Why do scripts that work normally with entities on Navius ​​not see entities on other planets?

Place to get help with not working mods / modding interface.
Keysivi
Fast Inserter
Fast Inserter
Posts: 109
Joined: Mon Feb 07, 2022 5:29 pm
Contact:

Why do scripts that work normally with entities on Navius ​​not see entities on other planets?

Post by Keysivi »

I once again encounter the fact that standard scripts do not see entities on other planets except Navius. And with an almost identical error

For example, such a script:

Code: Select all

data.raw.item["small-stomper-pentapod"].loot = {{count_max = 25, count_min = 5, item = "spoilage", probability = 1}}
Error:

Code: Select all

The following mods failed to load: __Poisonous_barbed_spikes__/data-updates.lua:44: attempt to index field 'small-stomper-pentapod' (a nil value)
Or another script:

Code: Select all

data.raw.resource["tungsten-ore"].minable.results = 
{
	{ type="item", name = data.raw.resource["tungsten-ore"].minable.result, amount = 1 },
	{ type="item", name = "breed", amount = 2 }
}
Error:

Code: Select all

The following mods failed to load: __hardcorio__/prototype/breed.lua:47: attempt to index field 'tungsten-ore' (a nil value)
Please help me figure out this error!...
robot256
Smart Inserter
Smart Inserter
Posts: 1063
Joined: Sun Mar 17, 2019 1:52 am
Contact:

Re: Why do scripts that work normally with entities on Navius ​​not see entities on other planets?

Post by robot256 »

Do you have Space Age set as a dependency in your mod?
Keysivi
Fast Inserter
Fast Inserter
Posts: 109
Joined: Mon Feb 07, 2022 5:29 pm
Contact:

Re: Why do scripts that work normally with entities on Navius ​​not see entities on other planets?

Post by Keysivi »

robot256 wrote: Thu Jan 02, 2025 2:12 pm Do you have Space Age set as a dependency in your mod?
Thanks for the advice! Strange... I always thought that the Space Age would load first and therefore it is not necessary to write a dependency on it... It is enough to write a condition...

Now I will know...
robot256
Smart Inserter
Smart Inserter
Posts: 1063
Joined: Sun Mar 17, 2019 1:52 am
Contact:

Re: Why do scripts that work normally with entities on Navius ​​not see entities on other planets?

Post by robot256 »

Even if that were true, you still need to include the dependency in your mod so that players don't install it without Space Age at all and get the same error.
Post Reply

Return to “Modding help”