I've been trying to do this for a while for my new game, Naruto Shippuden: Ultimate Ninja Storm 2 Byond for a new demo I was creating, so that it would be a one-player demo of Sage Naruto VS Pain. I made a NPCAI() proc as well as a UpdateHP() proc, however, if I execute NPCAI(), it uses while(src), so it won't execute UpdateHP(), and UpdateHP() has a loop in it, so it won't execute NPCAI(). So I used what I normally use, to execute both procs at the same time, spawn(1), however in this instance, it won't work!
turf clickable mouse_opacity = 2 icon = null layer = 1011 Start Click() if(usr.charselect==1) return usr << sound(null) usr << sound('YEAH!.wav') usr.frozen = 0 sleep(30) usr.charselect = 0 usr.loc = locate(19,8,2) sleep(1) usr.icon = null usr << sound('battle.wav') sleep(10) usr << sound('55 The Beast Set Loose.ogg') usr << sound(null) usr << sound('90 White-Hot Battle at the Summit.ogg') usr << sound(null) usr << sound('28 HWHAR.ogg') usr << sound(null) usr << sound('Story Sequence.ogg') usr << sound(null) usr.frozen = 0 usr.loggedin=1 usr.charselect = 0 usr.HP = 90 usr.Chakra = 90 usr.icon = 'Naruto.dmi' usr.icon_state = "" usr.dir = EAST usr.naruto = 1 usr.naruto3 = 0 usr.pain = 0 usr.loc = locate(48,40,1) usr.air=0 step(usr,EAST) usr.icon_state = "" usr.PlayMusic() for(var/mob/M in view(usr)) if(M.name == "Pain") M.NPCAI() spawn(1) usr.UpdateHP()
|
I get no errors, however it won't execute UpdateHP() when doing something like this. However, when I do something like this:
turf clickable mouse_opacity = 2 icon = null layer = 1011 Start Click() if(usr.charselect==1) return usr << sound(null) usr << sound('YEAH!.wav') usr.frozen = 0 sleep(30) usr.charselect = 0 usr.loc = locate(19,8,2) sleep(1) usr.icon = null usr << sound('battle.wav') sleep(10) usr << sound('55 The Beast Set Loose.ogg') usr << sound(null) usr << sound('90 White-Hot Battle at the Summit.ogg') usr << sound(null) usr << sound('28 HWHAR.ogg') usr << sound(null) usr << sound('Story Sequence.ogg') usr << sound(null) usr.frozen = 0 usr.loggedin=1 usr.charselect = 0 usr.HP = 90 usr.Chakra = 90 usr.icon = 'Naruto.dmi' usr.icon_state = "" usr.dir = EAST usr.naruto = 1 usr.naruto3 = 0 usr.pain = 0 usr.loc = locate(48,40,1) usr.air=0 step(usr,EAST) usr.icon_state = "" usr.PlayMusic() usr.UpdateHP() spawn(1) for(var/mob/M in view(usr)) if(M.name == "Pain") M.NPCAI()
|
It won't execute NPCAI!
I've also tried doing:
turf clickable mouse_opacity = 2 icon = null layer = 1011 Start Click() if(usr.charselect==1) return usr << sound(null) usr << sound('YEAH!.wav') usr.frozen = 0 sleep(30) usr.charselect = 0 usr.loc = locate(19,8,2) sleep(1) usr.icon = null usr << sound('battle.wav') sleep(10) usr << sound('55 The Beast Set Loose.ogg') usr << sound(null) usr << sound('90 White-Hot Battle at the Summit.ogg') usr << sound(null) usr << sound('28 HWHAR.ogg') usr << sound(null) usr << sound('Story Sequence.ogg') usr << sound(null) usr.frozen = 0 usr.loggedin=1 usr.charselect = 0 usr.HP = 90 usr.Chakra = 90 usr.icon = 'Naruto.dmi' usr.icon_state = "" usr.dir = EAST usr.naruto = 1 usr.naruto3 = 0 usr.pain = 0 usr.loc = locate(48,40,1) usr.air=0 step(usr,EAST) usr.icon_state = "" usr.PlayMusic() for(var/mob/M in view(usr)) if(M.name == "Pain") M.NPCAI() spawn(1) usr.UpdateHP()
|
Which gives an error saying "invalid expression" on spawn(1)
How would I be able to execute NPCAI() and UpdateHP() procs at the same time?