PDA

View Full Version : AI - NPC with limited life time


krapno
06.10.2005, 13:51
Hi,

i am looking for AI in order to implement for some NPC a limited "time of life", i mean when that NPC is spawned (manually or not) the NPC will automatically disappear (or die) after a precised time...

Any idea is welcome, i dunno if it is possible :)

hamidouch
06.10.2005, 14:14
use toma teleport AI
and make it teleport to a dead land place

Sauron
06.10.2005, 14:15
[php:1:a60f5d472a]
class name : (null)
handler 13 // CREATED
variable_begin
"myself"
"_choiceN"
"_code"
"_from_choice"
variable_end

shift_sp 1
push_const 1
push_const 19000 // time in ms
func_call 28 // func[AddTimerEx]
shift_sp -2
shift_sp -1
handler_end

handler 12 // TIMER_FIRED_EX
variable_begin
"timer_id"
"myself"
"_choiceN"
"_code"
"_from_choice"
variable_end

push_event // timer_id
push_const 176
add
fetch_i
push_const 1
equal
branch_false L2
L1
shift_sp 1
func_call 175 // func[Despawn]
shift_sp -1
L2
handler_end

class_end
[/php:1:a60f5d472a]

krapno
06.10.2005, 16:30
tx a lot Sauron, i am going to test it soon :)