fast_replaceable_group Question

Place to get help with not working mods / modding interface.
Post Reply
TheSAguy
Smart Inserter
Smart Inserter
Posts: 1449
Joined: Mon Jan 13, 2014 6:17 pm
Contact:

fast_replaceable_group Question

Post 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.

User avatar
DaveMcW
Smart Inserter
Smart Inserter
Posts: 3700
Joined: Tue May 13, 2014 11:06 am
Contact:

Re: fast_replaceable_group Question

Post by DaveMcW »

Mark the mod as an optional dependency so you always go last and win. :P

Or you could try talking with the other mod author to find a solution. :idea:

TheSAguy
Smart Inserter
Smart Inserter
Posts: 1449
Joined: Mon Jan 13, 2014 6:17 pm
Contact:

Re: fast_replaceable_group Question

Post 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

Post Reply

Return to “Modding help”