custom projectile action

Place to get help with not working mods / modding interface.
User avatar
hangyas
Manual Inserter
Manual Inserter
Posts: 3
Joined: Fri Mar 13, 2015 8:32 am
Contact:

custom projectile action

Post by hangyas »

Hi

I try to make a rocket with special effect (or it should remove an entity wich isn't on the map at impact), but I can't find out how to call a function when the rocket hits it's target. I tried use onentitydied, but it doesn't called becaouse projectiles don't have health (I guess)
Rseding91
Factorio Staff
Factorio Staff
Posts: 14856
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: custom projectile action

Post by Rseding91 »

hangyas wrote:Hi

I try to make a rocket with special effect (or it should remove an entity wich isn't on the map at impact), but I can't find out how to call a function when the rocket hits it's target. I tried use onentitydied, but it doesn't called becaouse projectiles don't have health (I guess)
You'd want to use the "createentity" trigger with the "trigger_createdentity" property set to true then watch for the event in "ontriggercreatedentity".

You can see an example of it in use in my Explosive Termites mod.
If you want to get ahold of me I'm almost always on Discord.
User avatar
hangyas
Manual Inserter
Manual Inserter
Posts: 3
Joined: Fri Mar 13, 2015 8:32 am
Contact:

Re: custom projectile action

Post by hangyas »

Good trick, thanks
Post Reply

Return to “Modding help”