Changing effect etc. of entities in dependent mod

Place to get help with not working mods / modding interface.
Pietras
Manual Inserter
Manual Inserter
Posts: 2
Joined: Sun Mar 10, 2019 9:46 am
Contact:

Changing effect etc. of entities in dependent mod

Post by Pietras »

Hi,

So I have a bunch of mods, but would like to tweak them a bit.

What I did I created a simple mod with dependencies on the mods I want to tweak.

Example: one mod adds higher tiers of modules. I want to tweak their effects, for example, make bonuses the same as vanilla, but make penalties a bit smaller, to justify the cost.

I already know how to refer to base files:

Code: Select all

data.raw.module["speed-module-3"].effect = {...}
for example.

However, how do I refer to the modules being added by one of the dependent mods? The mod adds for example "productivity-module-4".

If i try to refer to it as above

Code: Select all

data.raw.module["productivity-module-4"].effect = {...}
then upon loading I get an error, that this line return "nil", eg. this entity does not exist.

Any tips?

Thanks in advance.
User avatar
Deadlock989
Smart Inserter
Smart Inserter
Posts: 2529
Joined: Fri Nov 06, 2015 7:41 pm

Re: Changing effect etc. of entities in dependent mod

Post by Deadlock989 »

The obvious one is to check that its name really is productivity-module-4.

The next thing I'd check is the part of the data lifecycle it's being defined in the depended-on mod - is it at the data, data-updates or data-final-fixes stage? If your depended-on mod is doing it in data-updates then you can't modify it any earlier than data-updates yourself because it won't exist yet, ditto data-final-fixes.
Pietras
Manual Inserter
Manual Inserter
Posts: 2
Joined: Sun Mar 10, 2019 9:46 am
Contact:

Re: Changing effect etc. of entities in dependent mod

Post by Pietras »

That's it.

The referenced mod added the entity in data-updates stage.

For future reference: solution is to set the dependent mod to load files in same or later stage as well.

Thank you!
Post Reply

Return to “Modding help”