ID:138860
 
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?
You have to indent the things you want to spawn off under spawn(). That's all the help I'm offering for your Naruto rip.
In response to Robertbanks2
its not a rip its a side scroller like Naruto showdown or Naruto vs or naruto ninja moo moo.
In response to Robertbanks2
Robertbanks2 wrote:
You have to indent the things you want to spawn off under spawn(). That's all the help I'm offering for your Naruto rip.

Thanks for trying, but I already tried that. I didn't want to make the post huge.

Also it's not a rip, because it isn't a copy off any byond game in existence. It's code is actually completely original. And by that, I mean completely original. You don't believe me? Well take a look at this proof:

PhotobucketPhotobucketPhotobucketPhotobucket

And there's even a YouTube video I made about it!

http://www.youtube.com/watch?v=xJCYSLZ0QWA

With a download link to play yourself (of course it's the multiplayer version, so you would have to host it to actually fight against players.)

http://www.mediafire.com/?ua23xe74rjh75nr


Just to get something straight here: Just because I like naruto and I'm not a byond member, does not mean it's automatically a rip. I hate rips, I really do. It's my mission to get more real developers in byond that actually create original code, and actually do stuff from scratch like I do.

I may have been a stupid fucking retard when I was 12, but that was 3 fucking years ago. What BYOND really needs is to learn that 12 years old is a big difference from 15 years old (my birthday is this saturday, which is when I turn 15 officially)

So cut the "you're ripping" shit, it won't work. Just give up on trying to prove that naruto games are rips no matter what, because this game is going to be the first non-ripped naruto game on byond. Just remember that, asshole.

Now am I going to get real help, or just some prick telling me stuff to piss me off?
In response to Narutorox123456
Narutorox123456 wrote:
Robertbanks2 wrote:
You have to indent the things you want to spawn off under spawn(). That's all the help I'm offering for your Naruto rip.

Thanks for trying, but I already tried that. I didn't want to make the post huge.

The issue is that you're using spawn() improperly, it has to come BEFORE the infinite loop proc, not after, otherwise you will never even get to the spawn().

Also it's not a rip, because it isn't a copy off any byond game in existence. It's code is actually completely original. And by that, I mean completely original. You don't believe me? Well take a look at this proof:

Images and videos aren't proof of anything. I could pick up a Naruto source and doll it up with a new GUI and some different icons and according to a screenshot, it would be a new game.

Just to get something straight here: Just because I like naruto and I'm not a byond member, does not mean it's automatically a rip. I hate rips, I really do. It's my mission to get more real developers in byond that actually create original code, and actually do stuff from scratch like I do.

A rather large portion of your favorite games list appears to be rips.

I may have been a stupid fucking retard when I was 12, but that was 3 fucking years ago. What BYOND really needs is to learn that 12 years old is a big difference from 15 years old (my birthday is this saturday, which is when I turn 15 officially)

Age is irrelevant. I'm sure there are plenty of rippers over the age of 16.

So cut the "you're ripping" shit, it won't work. Just give up on trying to prove that naruto games are rips no matter what, because this game is going to be the first non-ripped naruto game on byond. Just remember that, asshole.

No, actually, I'm pretty sure the first Naruto game on BYOND was the first non-ripped Naruto game.

Now am I going to get real help, or just some prick telling me stuff to piss me off?

I already explained what was wrong, you're not using spawn() properly.
In response to Robertbanks2
Robertbanks2 wrote:
Narutorox123456 wrote:
Robertbanks2 wrote:
You have to indent the things you want to spawn off under spawn(). That's all the help I'm offering for your Naruto rip.

Thanks for trying, but I already tried that. I didn't want to make the post huge.

The issue is that you're using spawn() improperly, it has to come BEFORE the infinite loop proc, not after, otherwise you will never even get to the spawn().

Ok, I'll try that

Also it's not a rip, because it isn't a copy off any byond game in existence. It's code is actually completely original. And by that, I mean completely original. You don't believe me? Well take a look at this proof:

Images and videos aren't proof of anything. I could pick up a Naruto source and doll it up with a new GUI and some different icons and according to a screenshot, it would be a new game.

What do you, want me to post the code here now? I bet another person would just rip it. Besides, how many games have you seen the code I provided in the first post? This stuff is original, because it uses my method of simple coding. Since I was 13, I experimented with the code, and found new ways of doing things, which led to my method of simplified DM, which is the type of coding I used. Hell, there's even a combo system in the damn game! You call that a rip?

Just to get something straight here: Just because I like naruto and I'm not a byond member, does not mean it's automatically a rip. I hate rips, I really do. It's my mission to get more real developers in byond that actually create original code, and actually do stuff from scratch like I do.

A rather large portion of your favorite games list appears to be rips.

Those games were games I used to play. I just don't update my Byond username frequently. I'm too busy coding over 3 games from scratch at the same time and school.

I may have been a stupid fucking retard when I was 12, but that was 3 fucking years ago. What BYOND really needs is to learn that 12 years old is a big difference from 15 years old (my birthday is this saturday, which is when I turn 15 officially)

Age is irrelevant. I'm sure there are plenty of rippers over the age of 16.

Yes, but the difference between us, is that I've been on byond longer than them, and long enough to learn about rips.

So cut the "you're ripping" shit, it won't work. Just give up on trying to prove that naruto games are rips no matter what, because this game is going to be the first non-ripped naruto game on byond. Just remember that, asshole.

No, actually, I'm pretty sure the first Naruto game on BYOND was the first non-ripped Naruto game.

I meant other than the first. Obviously the first would be a non-rip, but every other game has at least some code from another byond game, but this one is completely from scratch.

Now am I going to get real help, or just some prick telling me stuff to piss me off?

I already explained what was wrong, you're not using spawn() properly.

You hadn't explained it, you just said "I'll give a hint to it, but that's all for your rip".

Now let's drop the rip subject, because I hate rips, which is a fact. I express this to all of my friends on byond majorly, as they can probably tell. I don't join games for naruto commonly, because they are all the same gameplay. Log train, spam verbs on users, very little to none macros.

So now onto the real subject. I will try to do that now, and I will say the results.

Edit: It works, thanks for helping, but I don't appreciate being told a game is a rip, when I put months of effort into creating it from scratch. The only unoriginal content would be the player icons, which weren't even from a byond game, it was from a DS game called Naruto Shippuden: Shinobi Rumble.

Just because a guy who has a name expressing he likes naruto made a byond game doesn't mean that he's a ripper. If you think that is true, then you can kindly leave byond right now, before I call on the admins.
In response to Narutorox123456
That happens to look exactly like a certain someone's project from a year ago. He never released it but I tested it with him and the similarities are just endless.
Hi there. You want to use the spawn() function

You don't want this:
foo() // assume this proc calls sleep(10) somewhere, which sleeps the game for 1 second.
bar() // this will get called after foo() has been completed, which would be in 1 second


You want this:
spawn() // spawn() allows the next code after this code block to execute before waiting for this code to finish executing
foo()
bar()



Both procs will execute at the same time. Optionally, you can add an integer parameter to spawn() to give it a delay much like sleep(), but it will still allow the next code to run.
In response to ExPixel
ExPixel wrote:
That happens to look exactly like a certain someone's project from a year ago. He never released it but I tested it with him and the similarities are just endless.

Really? He must have used the same tactic as me, or you are just trying to be a smartass. Tell me the name of this project as well as the username and what year it was started and ended. I'm pretty sure if there was such a project, I would not have known about it, seeing how it was never released.