LoginLogin
Nintendo shutting down 3DS + Wii U online services, see our post

Please Help Me Debug this RPG

Root / Programming Questions / [.]

ElzoBroCreated:
So, I just quick programed this VERY simple RPG but when I start it, the HP's just seem to go by themselves even when I put the players turn on a button system and worst of all the numbers seem to just be random. ignoring the variables and everything. I'm very basic at programing BASIC so please help me all you high level programers. hahah. Please and Thank You! \(^_^) I'll post the code in the next comment...

Code: CK2K343Y Please help me!

Hmm, had a look. Sorry to say but the way you structured the code in general is very strange. I think the biggest problem is you have the flow broken up over several parts with WAIT commands. You can't use buttons with WAIT commands because the program won't read the input. You would do best to just scrap that and start over with a structure more like this for inputs.
@PATTACK 
VSYNC 1
B=BUTTON(2)
IF B AND #A THEN GOTO @ATTACK
GOTO @PATTACK
Sorry, but if you want a better example I have a simple RPG I've made I could upload it.

Oh thanks! Also Please upload the example if you can!

I'll upload it now, oh and you can do the display update for HP at the top(inside) of that loop too. EDIT: Ok it's pretty simple, let me know if you don't understand a certain part. NDSJJ3E3

@PATTACK 
VSYNC 1
B=BUTTON(2)
IF B AND #A THEN GOTO @ATTACK
GOTO @PATTACK
.
Does that basically cause a loop that waits for a button input?

@PATTACK 
VSYNC 1
B=BUTTON(2)
IF B AND #A THEN GOTO @ATTACK
GOTO @PATTACK
.
Does that basically cause a loop that waits for a button input?
Yup, and it can be much longer too just so you know.
@PATTACK
'UPDATE DISPLAY HERE
VSYNC 1
B=BUTTON(2)
IF B AND #A THEN GOTO @ATTACK
IF B AND #B THEN GOTO @DEFEND
GOTO @PATTACK
@ATTACK
ATT=RND(9)+1 'Random attack 1-10 inclusive.
EHP=EHP-ATT
GOTO @PATTACK

Thanks a lot! I am independently trying to create a battle system and this little tidbit is going to help a metric f**k ton!

Here's 5k2kx3ry

Sorry wasn't sure you noticed my EDIT above. NDSJJ3E3

5K2KX3RY is my key for rpg I'm working on has pretty good battle system probably what looking for