00:00
00:00
Newgrounds Background Image Theme

Djsjwks just joined the crew!

We need you on the team, too.

Support Newgrounds and get tons of perks for just $2.99!

Create a Free Account and then..

Become a Supporter!

Problem with the randomizing code?

462 Views | 5 Replies

Okay, so I'm practicing the basic functions of RPG actions.

I have an attack button which I have programmed an animation and I used a random code, but I'm not getting the results I want. I want a random number between 10 and 20, but I've been getting 50 and more removed from the counter. Any ideas?

Oh and here's my formula:

Problem with the randomizing code?

Response to Problem with the randomizing code? 2010-12-15 21:13:04


That will return a number between 10 and 21, so nothing's wrong there. It must be something to do with the way you've set up the events!


Self-published fiction: Mostly Lies

Response to Problem with the randomizing code? 2010-12-15 21:56:36


Hmm...maybe. I'll check it out and give an update.

Response to Problem with the randomizing code? 2010-12-15 22:07:25


Well it looks like that behavior had to be set up by itself, rather than grouped with the attack button. It's a wierd, wierd world.

Response to Problem with the randomizing code? 2010-12-15 22:12:22


At 12/15/10 10:07 PM, LosaruTaiyo wrote: Well it looks like that behavior had to be set up by itself, rather than grouped with the attack button. It's a wierd, wierd world.

Try and figure why it was being weird! That way you avoid making a similar mistake and you'll learn something about how the program works that you might be able to exploit. If you do find out let us know! :)


Self-published fiction: Mostly Lies

Response to Problem with the randomizing code? 2010-12-15 22:31:52


Well, I created a new sprite called "Pet" and did to its attack button the same that I did to my hero's, but I didn't get the same result and as I'm not a master coder (Jeez, I can't even understand the A values...lol) I doubt I can figure it out. My only theory is is that when I programmed the hero, the behaviors counted the click and the end of her animation as one attack and took off alot. I can't think of anything else. It seems to be going okay now so. *Shrugs*