Page 1 of 1

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

Posted: Thu Jan 02, 2025 1:25 pm
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!...

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

Posted: Thu Jan 02, 2025 2:12 pm
by robot256
Do you have Space Age set as a dependency in your mod?

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

Posted: Thu Jan 02, 2025 3:46 pm
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...

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

Posted: Thu Jan 02, 2025 5:21 pm
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.