Page 1 of 1

custom projectile action

Posted: Sun Mar 15, 2015 9:28 pm
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)

Re: custom projectile action

Posted: Mon Mar 16, 2015 5:20 pm
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.

Re: custom projectile action

Posted: Mon Mar 16, 2015 8:55 pm
by hangyas
Good trick, thanks