Page 1 of 1
fast_replaceable_group Question
Posted: Wed Mar 20, 2019 4:27 pm
by TheSAguy
Hi,
Currently Rail does not have a "fast_replaceable_group"
So I'm adding one as fast_replaceable_group = "rail"
My question is, what if another mod also want's adds a Fast Replace group, and it's not the same as mine.
Then whatever mod goes last will override the group.
Is there a way to prevent this?
Thanks.
Re: fast_replaceable_group Question
Posted: Wed Mar 20, 2019 4:37 pm
by DaveMcW
Mark the mod as an optional dependency so you always go last and win.
Or you could try talking with the other mod author to find a solution.

Re: fast_replaceable_group Question
Posted: Wed Mar 20, 2019 4:49 pm
by TheSAguy
Pass the problem on.
Love it!
Well, I'm adding this code, will solve 50% of the issues
Code: Select all
---- Rail Replacement Group settings
if data.raw["straight-rail"]["straight-rail"].fast_replaceable_group then
data.raw["straight-rail"]["bi-straight-rail-wood"].fast_replaceable_group = data.raw["straight-rail"]["straight-rail"].fast_replaceable_group
else
data.raw["straight-rail"]["straight-rail"].fast_replaceable_group = "rail"
data.raw["straight-rail"]["bi-straight-rail-wood"].fast_replaceable_group = "rail"
end
if data.raw["curved-rail"]["curved-rail"].fast_replaceable_group then
data.raw["curved-rail"]["bi-curved-rail-wood"].fast_replaceable_group = data.raw["curved-rail"]["curved-rail"].fast_replaceable_group
else
data.raw["curved-rail"]["curved-rail"].fast_replaceable_group = "rail"
data.raw["curved-rail"]["bi-curved-rail-wood"].fast_replaceable_group = "rail"
end