Page 1 of 1

Changing effect etc. of entities in dependent mod

Posted: Tue Mar 10, 2020 10:26 am
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.

Re: Changing effect etc. of entities in dependent mod

Posted: Tue Mar 10, 2020 10:54 am
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.

Re: Changing effect etc. of entities in dependent mod

Posted: Tue Mar 10, 2020 11:04 am
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!