add a way to detect projectile origin on hit

Place to ask discuss and request the modding support of Factorio. Don't request mods here.
thankedsphere2
Manual Inserter
Manual Inserter
Posts: 2
Joined: Sun Jul 05, 2026 1:15 pm
Contact:

add a way to detect projectile origin on hit

Post by thankedsphere2 »

TL;DR make projectiles store a value from their spawn that can be compared against their future states.


currently you cannot detect where a projectile came from, how long it travelled, or how long it exists. this is bad if you want to do things with this data, such as projectiles that lose or gain damage with distance


to change this, i recommend giving projectiles an age, spawn_tick, or spawn_position variable, maybe optionally added in the data phase.



a workaround is currently to compare the projectile's position to the shooter's position. this works perfectly for turrets, but is innacurate for characters.
Post Reply

Return to “Modding interface requests”