Zo Kath Ra wrote:Isaac wrote:**Is there a simpler way to send a delayed kill than to spawn a timer connected to a function that calls .monster:die() ?
There is
delayedCall(receiver, delay, msg, parameters)
receiver = ID of a script entity with a killMonster function
delay = can be zero
msg = function name, e.g. killMonster
parameter = the monster's ID
Example:
viewtopic.php?f=22&t=8182&start=10#p83174
Delayed Call has never worked for me in that, or any situation that requires a component. It does seem that a controller (or other) component does handle some calls/redirects to scripts, but
delayedCall(id, .01 , "die") to a monster object, always fails silently for me; it's the reason I asked.
petri wrote:...so you should always check isAlive() before calling die().
This is good to know. In my case, it is alive. It seems that any use of the variable (in this case named 'monster') causes the the [false?] detection for using a non-existant 'go' field. I have an onDie hook that if I checked/used monster.id in, it would halt at the previous damageTile function (that killed the monster), and give the [seemingly erroneous] error.
It's working with the work-around, but I don't know the reason for the error.