FROZEN BATTLE SYSTEM GLITCH
Posts
Pages:
1
Okay, I have a short time to work on my Zelda game on a friend's RMXP, so I tried out my new battle system code. Every time Link comes into contact with an enemy, it freezes the game! I don't have long to work on this, so if anybody can help me, PLEASE respond. Anyway, My code is simple.
First, a common event...
Then enemy event coding. This is just an example. There are three event pages.
Page 1:Parallel Process:
Page 2:Event Touch:If Self Switch A is on...
Page 3:Parallel Process:If Self Switch B is on...
I'm sure that whatever it is is obvious and I'm overlooking it, but I can't fix it no matter what I do! Please help.
First, a common event...
@>Button Input Processing:
@>Conditional Branch: Variable ==16
@>Control Switches: = ON
@>Set Move Route: Player (Ignore if can't move)
: :$>Change Speed:6
: :$>Change Freq:6
: :$>SE '064-Swing03', 80, 130
: :$>1 Step Forward
: :$>Change Speed:4
: :$>Change Freq:4
@>Wait for Move's Completion
@>Control Switches: = OFF
@>Control Variables: = 0
@>
:Branch End
@>
@>Conditional Branch: Variable ==16
@>Control Switches: = ON
@>Set Move Route: Player (Ignore if can't move)
: :$>Change Speed:6
: :$>Change Freq:6
: :$>SE '064-Swing03', 80, 130
: :$>1 Step Forward
: :$>Change Speed:4
: :$>Change Freq:4
@>Wait for Move's Completion
@>Control Switches: = OFF
@>Control Variables: = 0
@>
:Branch End
@>
Then enemy event coding. This is just an example. There are three event pages.
Page 1:Parallel Process:
@>Control Variables: = 10
@>Control Self Switch: A = ON
@>
@>Control Self Switch: A = ON
@>
Page 2:Event Touch:If Self Switch A is on...
@>Label 1
@>Conditional Branch: Switch == ON
@> Show Animation: This Event,
@> Set Move Route: This Event (Ignore if can't move)
: :$>1 Step Back
@> Control Variables: -= 1
@>
: Else
@> Show Animation: Player,
@> Set Move Route: Player(Ignore if can't move)
: :$>1 Step Back
@> Change HP: Entire Party, -1
@>
: Branch End
@>Conditional Branch: Variable ==0
@> Control Self Switch: B = ON
: Else
@> Jump to Label: 1
@>Conditional Branch: Switch == ON
@> Show Animation: This Event,
@> Set Move Route: This Event (Ignore if can't move)
: :$>1 Step Back
@> Control Variables: -= 1
@>
: Else
@> Show Animation: Player,
@> Set Move Route: Player(Ignore if can't move)
: :$>1 Step Back
@> Change HP: Entire Party, -1
@>
: Branch End
@>Conditional Branch: Variable ==0
@> Control Self Switch: B = ON
: Else
@> Jump to Label: 1
Page 3:Parallel Process:If Self Switch B is on...
@>Show Animation: This Event,
@>Erase Event
@>
@>Erase Event
@>
I'm sure that whatever it is is obvious and I'm overlooking it, but I can't fix it no matter what I do! Please help.
two things I'd look at. First the order of the pages. It does make a difference even if you have preconditions.
Second, I bet it's in the Page 2:Event Touch. You have a loop there so that's probably where it's hanging up. Try setting the <=0. Also, to trouble shoot these things, I try putting in Messages here and there. Try putting one that says "\v 0016" (the Enemy1HP's value) above where you have Jump to Label: 1...if you keep getting that message over and over, then you know that the loop is what is freezing the game.
I bet it's the fact that you can't swing when the mob hits you. Is it a Parallel Process?
Second, I bet it's in the Page 2:Event Touch. You have a loop there so that's probably where it's hanging up. Try setting the <=0. Also, to trouble shoot these things, I try putting in Messages here and there. Try putting one that says "\v 0016" (the Enemy1HP's value) above where you have Jump to Label: 1...if you keep getting that message over and over, then you know that the loop is what is freezing the game.
I bet it's the fact that you can't swing when the mob hits you. Is it a Parallel Process?
I didn't even realize that a loop was being made that could glitch like that...
I'll give it a shot!
And by the way, yes it is a parallel process. The common event for Link's attack, that is. Only the part labeled "event touch" is not parallel.
I'll give it a shot!
And by the way, yes it is a parallel process. The common event for Link's attack, that is. Only the part labeled "event touch" is not parallel.
Okay, I tried it, and it didn't do anything, but.....
I placed the message at the part of the code where it changes the HP, and it would show up, then repeat the animation and message without allowing any movement... what the heck is up with that?
I placed the message at the part of the code where it changes the HP, and it would show up, then repeat the animation and message without allowing any movement... what the heck is up with that?
Actually, I think I see it. It's the loop you have. If the mob is dead, it sets B to ON, but if it doesn't die, it goes back to the top. You don't allow the process to end so the player can "move". Basically, you are reducing the players HP constantly. Remove the "else" condition at the end. If Enemy1HP == 0, then B is ON. Period...no Else.
Also, you might want to add an If PlayerHP == 0, then End Game. No Else.
Also, you might want to add an If PlayerHP == 0, then End Game. No Else.
I tried it, and it still doesn't work. I tried deleting the entire loop, but it still freezes. The error must be in another part of the code.
Okay, I got this part working. Aparently there was a second loop earlier on the same page...
Thanks, Melch!
Thanks, Melch!
NOW I have another... problem.
I am trying to add a spin attack into the game, and I can't seem to make it work right. I got the control and animation, but the enemies don't respond to it! I'll type the code here.
First, a common event...
Next is an event on the map, setting some variables.
Parallel Process:
Then enemy event coding. This is the same example. This attack uses one page, just before the "Enemy dead" page. I'll just type this page. It is quite long...
Parallel Process: When switch is on...
I am trying to add a spin attack into the game, and I can't seem to make it work right. I got the control and animation, but the enemies don't respond to it! I'll type the code here.
First, a common event...
@>Button Input Processing:
@>Conditional Branch: Variable ==17
@>Control Switches: = ON
@>Show Animation: Player,
@> Wait 10 frames
@>Control Switches: = OFF
@>
:Branch End
@>
@>Conditional Branch: Variable ==17
@>Control Switches: = ON
@>Show Animation: Player,
@> Wait 10 frames
@>Control Switches: = OFF
@>
:Branch End
@>
Next is an event on the map, setting some variables.
Parallel Process:
@>Control Variables: = ENEMY1's Screen X
@>Control Variables: = ENEMY1's Screen Y
@>Control Variables: = ENEMY1's Screen Y
Then enemy event coding. This is the same example. This attack uses one page, just before the "Enemy dead" page. I'll just type this page. It is quite long...
Parallel Process: When switch is on...
@>
@>Control Self Switch: A = OFF
@>Control Variables: = Player's Screen Y
@>Control Variables: = Player's Screen X
@>Control Variables: += 1
@>Conditional Branch: Variable == Variable
@>Conditional Branch: Variable == Variable
@> Show Animation: This Event,
@> Set Move Route: This Event (Ignore if can't move)
: :$>1 Step Back
@> Control Variables: -= 1
@>Control Switches: = OFF
@>Control Self Switch: A = ON
@>
: Else
@>
: Branch End
@>
: Else
@>Control Variables: = Player's Screen Y
@>Control Variables: = Player's Screen X
@>Control Variables: -= 1
@>Conditional Branch: Variable == Variable
@>Conditional Branch: Variable == Variable
@> Show Animation: This Event,
@> Set Move Route: This Event (Ignore if can't move)
: :$>1 Step Back
@> Control Variables: -= 1
@>Control Switches: = OFF
@>Control Self Switch: A = ON
@>
: Else
@>
: Branch End
@>
: Else
@>Control Variables: = Player's Screen Y
@>Control Variables: = Player's Screen X
@>Control Variables: += 1
@>Conditional Branch: Variable == Variable
@>Conditional Branch: Variable == Variable
@> Show Animation: This Event,
@> Set Move Route: This Event (Ignore if can't move)
: :$>1 Step Back
@> Control Variables: -= 1
@>Control Switches: = OFF
@>Control Self Switch: A = ON
@>
: Else
@>
: Branch End
@>
: Else
@>Control Variables: = Player's Screen Y
@>Control Variables: = Player's Screen X
@>Control Variables: -= 1
@>Conditional Branch: Variable == Variable
@>Conditional Branch: Variable == Variable
@> Show Animation: This Event,
@> Set Move Route: This Event (Ignore if can't move)
: :$>1 Step Back
@> Control Variables: -= 1
@>Control Switches: = OFF
@>Control Self Switch: A = ON
@>
: Else
@>
: Branch End
@>
: Else
@>
: Branch End
@>
: Branch End
@>
: Branch End
@>
: Branch End
@>Conditional Branch: Variable ==0
@> Control Self Switch: B = ON
@>
: Branch End
@>Control Self Switch: A = OFF
@>Control Variables: = Player's Screen Y
@>Control Variables: = Player's Screen X
@>Control Variables: += 1
@>Conditional Branch: Variable == Variable
@>Conditional Branch: Variable == Variable
@> Show Animation: This Event,
@> Set Move Route: This Event (Ignore if can't move)
: :$>1 Step Back
@> Control Variables: -= 1
@>Control Switches: = OFF
@>Control Self Switch: A = ON
@>
: Else
@>
: Branch End
@>
: Else
@>Control Variables: = Player's Screen Y
@>Control Variables: = Player's Screen X
@>Control Variables: -= 1
@>Conditional Branch: Variable == Variable
@>Conditional Branch: Variable == Variable
@> Show Animation: This Event,
@> Set Move Route: This Event (Ignore if can't move)
: :$>1 Step Back
@> Control Variables: -= 1
@>Control Switches: = OFF
@>Control Self Switch: A = ON
@>
: Else
@>
: Branch End
@>
: Else
@>Control Variables: = Player's Screen Y
@>Control Variables: = Player's Screen X
@>Control Variables: += 1
@>Conditional Branch: Variable == Variable
@>Conditional Branch: Variable == Variable
@> Show Animation: This Event,
@> Set Move Route: This Event (Ignore if can't move)
: :$>1 Step Back
@> Control Variables: -= 1
@>Control Switches: = OFF
@>Control Self Switch: A = ON
@>
: Else
@>
: Branch End
@>
: Else
@>Control Variables: = Player's Screen Y
@>Control Variables: = Player's Screen X
@>Control Variables: -= 1
@>Conditional Branch: Variable == Variable
@>Conditional Branch: Variable == Variable
@> Show Animation: This Event,
@> Set Move Route: This Event (Ignore if can't move)
: :$>1 Step Back
@> Control Variables: -= 1
@>Control Switches: = OFF
@>Control Self Switch: A = ON
@>
: Else
@>
: Branch End
@>
: Else
@>
: Branch End
@>
: Branch End
@>
: Branch End
@>
: Branch End
@>Conditional Branch: Variable ==0
@> Control Self Switch: B = ON
@>
: Branch End
For anybody still checking this to see if they can help, I made a few changes. I removed all the blank else handlers, and replaced the Self Switch B section with a "erase event" command. Also, I tried using messages to troubleshoot, and they only appeared after the first conditional branch for each spot. Anyway, now all it does is make the enemy do many hits all at once! PLEASE, if ANYBODY can tell me how to fix this, TELL ME!!!!!!!!
By the way, sorry for the quadruple post....
By the way, sorry for the quadruple post....
First of all, learn how to freakin use Ruby. That shit above is atrocious. There's a REASON they put RGSS into RMXP.
The reason I haven't been using Ruby is because I try to learn it, but the program won't even execute the simplest of commands. I ask people on other forums, and even the creator of the script is unsure of why it doesn't work. I've been forced to rely on common events.
Also, please don't insult that code. It took forever just to figure out how to get that far.
Also, please don't insult that code. It took forever just to figure out how to get that far.
author=Quiversee link=topic=370.msg4796#msg4796 date=1194392597
NOW I have another... problem.
I am trying to add a spin attack into the game, and I can't seem to make it work right. I got the control and animation, but the enemies don't respond to it! I'll type the code here.
First, a common event...@>Button Input Processing:
@>Conditional Branch: Variable ==17
@>Control Switches: = ON
@>Show Animation: Player,
@> Wait 10 frames
@>Control Switches: = OFF
@>
:Branch End
@>
Next is an event on the map, setting some variables.
Parallel Process:@>Control Variables: = ENEMY1's Screen X
@>Control Variables: = ENEMY1's Screen Y
Then enemy event coding. This is the same example. This attack uses one page, just before the "Enemy dead" page. I'll just type this page. It is quite long...
Parallel Process: When switch is on...@>
@>Control Self Switch: A = OFF
@>Control Variables: = Player's Screen Y
@>Control Variables: = Player's Screen X
@>Control Variables: += 1
@>Conditional Branch: Variable == Variable
@>Conditional Branch: Variable == Variable
@> Show Animation: This Event,
@> Set Move Route: This Event (Ignore if can't move)
: :$>1 Step Back
@> Control Variables: -= 1
@>Control Switches: = OFF
@>Control Self Switch: A = ON
@>
: Else
@>
: Branch End
@>
: Else
@>Control Variables: = Player's Screen Y
@>Control Variables: = Player's Screen X
@>Control Variables: -= 1
@>Conditional Branch: Variable == Variable
@>Conditional Branch: Variable == Variable
@> Show Animation: This Event,
@> Set Move Route: This Event (Ignore if can't move)
: :$>1 Step Back
@> Control Variables: -= 1
@>Control Switches: = OFF
@>Control Self Switch: A = ON
@>
: Else
@>
: Branch End
@>
: Else
@>Control Variables: = Player's Screen Y
@>Control Variables: = Player's Screen X
@>Control Variables: += 1
@>Conditional Branch: Variable == Variable
@>Conditional Branch: Variable == Variable
@> Show Animation: This Event,
@> Set Move Route: This Event (Ignore if can't move)
: :$>1 Step Back
@> Control Variables: -= 1
@>Control Switches: = OFF
@>Control Self Switch: A = ON
@>
: Else
@>
: Branch End
@>
: Else
@>Control Variables: = Player's Screen Y
@>Control Variables: = Player's Screen X
@>Control Variables: -= 1
@>Conditional Branch: Variable == Variable
@>Conditional Branch: Variable == Variable
@> Show Animation: This Event,
@> Set Move Route: This Event (Ignore if can't move)
: :$>1 Step Back
@> Control Variables: -= 1
@>Control Switches: = OFF
@>Control Self Switch: A = ON
@>
: Else
@>
: Branch End
@>
: Else
@>
: Branch End
@>
: Branch End
@>
: Branch End
@>
: Branch End
@>Conditional Branch: Variable ==0
@> Control Self Switch: B = ON
@>
: Branch End
Heh, looks like 90% of my coding in rm2k3.
author=harmonic link=topic=370.msg5157#msg5157 date=1195256172
Heh, looks like 90% of my coding in rm2k3.
?????????
Wasn't sure if you meant that like it is actually similar to rm2k3 coding, or if it really is just a jumbled mess. Not to criticize any work you may have done. :)
ah well.
I'm going to just have to try to fix my scripting glitch, and see if I can work with that. Either that, or try to fix this myself.
Sorry if my last code made no sense. In truth, I can't see where it is messing up. :( ???
ah well.
I'm going to just have to try to fix my scripting glitch, and see if I can work with that. Either that, or try to fix this myself.
Sorry if my last code made no sense. In truth, I can't see where it is messing up. :( ???
It looks a lot like rm2k3 coding.
But then again, rm2k3 coding is like trying to disassemble a bomb with sheet of tissue paper and a tuft of grass. (unnecessarily convoluted to achieve simple things)
But then again, rm2k3 coding is like trying to disassemble a bomb with sheet of tissue paper and a tuft of grass. (unnecessarily convoluted to achieve simple things)
That's what I feel like I'm trying to deal with. It shouldn't be so hard to make a simple code where you spin and all adjacent enemies get hurt.
BTW, I found a new scripting tut that is ACTUALLY WORKING!!! Hopefuly this means I will be able to replace this mess with RGSS soon.
But just in case I can't, if anyone knows how to fix this, thanks.
BTW, I found a new scripting tut that is ACTUALLY WORKING!!! Hopefuly this means I will be able to replace this mess with RGSS soon.
But just in case I can't, if anyone knows how to fix this, thanks.
Pages:
1
















