Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Newcomers DBPro Corner / RPG Battle System Button Help

Author
Message
Fneep
19
Years of Service
User Offline
Joined: 3rd Sep 2005
Location: In my house
Posted: 15th Oct 2005 09:04
Hi!
Im making an RPG Battle system were you customize your stats at the start, and customize your face. Then you battle an opponent. Note that it is the same opponent each time.
Anyway, I have a bug in the code. First you roll your stats. Then you further customize them by adding-subtracting points.
Here is the code:



I run it. After which I click "Next" after rolling the stats and it just ends instead of going to customizestats:

Whats up?

Sven B
19
Years of Service
User Offline
Joined: 5th Jan 2005
Location: Belgium
Posted: 15th Oct 2005 13:51
When using goto/gosub, you may not put the : behing it.

so
goto mainmenu:

should be
goto mainmenu

I have quickly done this for you:



Immunity and Annihalation makes Immunihalation...
Fneep
19
Years of Service
User Offline
Joined: 3rd Sep 2005
Location: In my house
Posted: 16th Oct 2005 01:12
Unfortunately, it is still not working.

I checked my code and it seemed I had more then one label for customizestats.

I changed them. And it still ends when I want it to go to customizestats.

Grog Grueslayer
Valued Member
19
Years of Service
User Offline
Joined: 30th May 2005
Playing: Green Hell
Posted: 16th Oct 2005 05:36 Edited at: 16th Oct 2005 05:47
It's because of this line in customizestats:


When you enter that do/loop your mouse is already pushing down on "next" so it goes to faceselection instantly. You can add a timer like this before the loop:


And this for the line that goes too fast:


You can get rid of all the goto's (it's a bad idea to use goto) and use select/case (this requires not "goto" but "gosub") When you use "gosub" and the code gets to "return" it goes back to the line it came from (just after the gosub):


And use this function for rolling of the stats (use it like "strength=RollStat()" ):


You don't want stats at zero. And try to get rid of all goto's and use gosub. Hope this helps.
Fneep
19
Years of Service
User Offline
Joined: 3rd Sep 2005
Location: In my house
Posted: 16th Oct 2005 12:26
~Grog Grueslayer:
You are so totally awesome! Thanx heaps!

Grog Grueslayer
Valued Member
19
Years of Service
User Offline
Joined: 30th May 2005
Playing: Green Hell
Posted: 17th Oct 2005 00:17
Quote: "You are so totally awesome! Thanx heaps!"


Thanks and np.

Login to post a reply

Server time is: 2024-11-27 14:31:05
Your offset time is: 2024-11-27 14:31:05