5,391
edits
(comparing by index, duh) |
(yay) |
||
Line 54: | Line 54: | ||
dmsg("No index match!") | dmsg("No index match!") | ||
} | } | ||
or this, in TCTF HQ: | |||
func void striker_spawn(string ai_name) | |||
{ | |||
var int index = d_getindex(ai_name); | |||
var int index1 = d_getindex(garage_striker_01); | |||
var int index2 = d_getindex(garage_striker_02); | |||
if(index eq index1) | |||
dmsg("Striker_01 has been spawned!") | |||
if(index eq index2) | |||
dmsg("Striker_02 has been spawned!") | |||
} | |||
func void striker_die(string ai_name) | |||
{ | |||
var int index = d_getindex(ai_name); | |||
var int index1 = d_getindex(garage_striker_01); | |||
var int index2 = d_getindex(garage_striker_02); | |||
if(index eq index1) | |||
dmsg("Striker_01 has died!") | |||
if(index eq index2) | |||
dmsg("Striker_02 has died!") | |||
} | |||
func void spawnStriker1(void) | |||
{ | |||
chr_wait_animtype 0 punch | |||
ai2_spawn garage_striker_01 force | |||
sleep 60 | |||
fork spawnStriker1 | |||
} | |||
func void spawnStriker2(void) | |||
{ | |||
chr_wait_animtype 0 kick | |||
ai2_spawn garage_striker_02 force | |||
sleep 60 | |||
fork spawnStriker2 | |||
} | |||
func void main(void) | |||
{ | |||
fork spawnStriker1 | |||
fork spawnStriker2 | |||
} | |||
The same thing works just fine for a trigger volume, e.g., at the Airport: | |||
func void fire_damage(string ai_name) | |||
{ | |||
var int index = d_getindex(ai_name); | |||
var int index0 = d_getindex(char_0); | |||
var int index1 = d_getindex(LoadingBay_Thug_1); | |||
var int index2 = d_getindex(LoadingBay_Thug_2); | |||
if(index eq index0) | |||
dmsg "Konoko is burning!" | |||
if(index eq index1) | |||
dmsg "Thug 1 is burning!" | |||
if(index eq index2) | |||
dmsg "Thug 2 is burning!" | |||
} | |||
func void main(void) | |||
{ | |||
ai2_spawn LoadingBay_Thug_1 | |||
ai2_spawn LoadingBay_Thug_2 | |||
chr_location 0 134 -105 1029 | |||
} | |||
OK, then, problem solved, moving on. --[[User:Geyser|geyser]] ([[User talk:Geyser|talk]]) 12:39, 19 May 2020 (CEST) |