8,230
edits
(this really is what it stands for, ungainly though it is, so we might as well be consistent with our own article title) |
Paradox-01 (talk | contribs) (code pieces: follow me (events / player orders)) |
||
Line 120: | Line 120: | ||
==Code pieces== | ==Code pieces== | ||
===Character setup=== | |||
# an old but useful character setup function by geyser | # an old but useful character setup function by geyser | ||
func '''SpawnNameFlagHealthReset'''(string n, int f, int h, int r){ | func '''SpawnNameFlagHealthReset'''(string n, int f, int h, int r){ | ||
Line 136: | Line 136: | ||
SpawnNameFlagHealthReset A_S1 24 | SpawnNameFlagHealthReset A_S1 24 | ||
} | } | ||
===Follow me=== | |||
var bool follow_me = 1; | |||
### begin of the journey | |||
func follow_me_TV | |||
{ | |||
fork follow | |||
} | |||
func follow | |||
{ | |||
if (follow_me eq 1) | |||
{ | |||
ai2_spawn charname | |||
chr_lock_active charname | |||
ai2_followme charname | |||
ai2_setmovementmode charname run | |||
sleep 180 | |||
fork follow | |||
} | |||
} | |||
### events | |||
func dont_follow_me_TV_enter | |||
{ | |||
follow_me = 0 | |||
} | |||
func dont_follow_me_TV_extit | |||
{ | |||
follow_me = 1 | |||
fork follow | |||
} | |||
### player orders | |||
func main | |||
{ | |||
# ... | |||
fork do_follow_me | |||
fork dont_follow_me | |||
} | |||
func do_follow_me | |||
{ | |||
chr_wait_animation 0 ORDERbk_fw_kick | |||
follow_me = 1 | |||
follow | |||
# for the case he/she is passive right now | |||
ai2_passive charname 0 | |||
# sleep until anim finished | |||
sleep 60 | |||
fork do_follow_me | |||
} | |||
func dont_follow_me | |||
{ | |||
chr_wait_animation 0 ORDERbk_fw_punch | |||
follow_me = 0 | |||
ai2_idle charname | |||
# sleep until anim finished | |||
sleep 60 | |||
fork dont_follow_me | |||
} | |||
[[Category:Bungie scripting language docs]] | [[Category:Bungie scripting language docs]] |
edits