offset and offset_deviation in create_entity and create_asteroid_chunk

Things that we aren't going to implement
gogogadgetdisco
Manual Inserter
Manual Inserter
Posts: 2
Joined: Thu Feb 20, 2025 3:59 am
Contact:

offset and offset_deviation in create_entity and create_asteroid_chunk

Post by gogogadgetdisco »

The noise in velocity and position of the resulting downsized asteroids when asteroids are destroyed appear to be accomplished by the offset and offset_deviation keys inside the dying_trigger_effects of the entity-type asteroids (used on both the create-entity and create-asteroid-chunk type effects).

So far as I can tell from the docs, neither Surface's create_entity() or SpacePlatform's create_asteroid_chunks() appear to take this as input, would it be possible to expose these on both methods?

My use case is spawning additional asteroid entities/chunks prior to asteroid destruction, and without this I think I'm restricted to noiseless/inorganic feeling methods to set the position and velocity for the new objects?

(Apologies if this duplicates another request, is documented somewhere I missed, or is a dumb ask that can be done another way, this is my first tiny mod to orient myself in the code)
posila
Factorio Staff
Factorio Staff
Posts: 5442
Joined: Thu Jun 11, 2015 1:35 pm
Contact:

Re: offset and offset_deviation in create_entity and create_asteroid_chunk

Post by posila »

gogogadgetdisco wrote: Thu Feb 20, 2025 4:20 amI'm restricted to noiseless/inorganic feeling methods to set the position and velocity for the new objects?
I don't understand what do you mean by this, or rather why do you think offset and offset_deviation makes things organic in a way that you can't do by setting position and velocity yourself? Trigger just uses uniform random generator to generate random offset. How would that be different from calling math.random in Lua on your side?
gogogadgetdisco
Manual Inserter
Manual Inserter
Posts: 2
Joined: Thu Feb 20, 2025 3:59 am
Contact:

Re: offset and offset_deviation in create_entity and create_asteroid_chunk

Post by gogogadgetdisco »

You know, having trawled through a bunch of mod code and not having ran into any math.Random calls made me assume the determinism requirements prohibited random values BUT IT TURNS OUT I WAS A FOOL.

Thank you very much!

Edit: Ah, and now I see the line about it being reimplemented for determinism in the auxiliary docs! Sorry for wasting your time my friend.
posila
Factorio Staff
Factorio Staff
Posts: 5442
Joined: Thu Jun 11, 2015 1:35 pm
Contact:

Re: offset and offset_deviation in create_entity and create_asteroid_chunk

Post by posila »

No time wasted, I was just confused by the request and wanted to understand :)
Post Reply

Return to “Won't implement”