Charas-Project
Game Creation => Requests => Tutorials => Topic started by: zuhane1 on May 16, 2007, 07:43:21 AM
-
Hey everyone! I'm currently working on a game where you can dodge attacks mid-battle. For it to work, a number flashes up and you have 2 seconds to press it. If you press the correct button, you dodge the attack, this way you can beat anyone through skill, and the higher levels are just a bonus. All the key input processing works fine and everything but I have to call a common event into battle. The only problem is that after the event has been fulfilled the battle stops instead of the common event stopping. Please could someone help? Thanks.
-
Are you using the default battle system?
-
Yep. It's just a normal battle that calls a common event. It works but the battle ends. It even damages me after battle or says I dodged it depending whether I do it right.
EDIT:... Doesn't anyone know what I'm on about?
-
Im pickin up what your putting down. But I dont know how to do it up. Battle events are not my forte.
But heres a kick for your problem.
-
God, I hate battle events. They're evil! >:
-
If there us a switch that activates the common event, turn the switch off after the event performs it's duties.
Other than that, you'll need to be more clearer.
-
Right, here's the script:
An enemies attack is a skill that activates the switch: ENEMYATK
This is the battle event:
If ENEMYATK is on:
Call common event: Dodge
Here is the common event:
Mes: Dodge by pressing 1432!
Timer 1 operation set: 5 seconds
Timer 1 operation start
Input number 4 digits [0001: Dodge]
-------------
Branch if timer is 5 second or more
Show battle animation: hit
mes: you didn't manage to dodge the attack
simulated enemy attack: 50 damage
-------------
Branch if variable [0001: Dodge = 1432]
play sound: tada!
you dodged the attack!
--v--v--v--v--
Else handler:
Show battle animation: hit
mes: wrong number!
simulated enemy attack: 50 damage
that was my coding, i tried doing it so a switch activates it and then turns it off, that doesnt work. This is a rough sketch, the real version will be much better and not use RTP crap. Thanks in advance!
:D :D
-
5 seconds? 0_o
Nothing to do with the coding, but I'd only give them 1 second at most. You're making it too easy and each attack will take too long.
-
Yeah, it's just a rough RTP mess-about. Once I get it working I'm gonna mess with it more.
-
A:
Branch if timer is 5 second or more
Show battle animation: hit
mes: you didn't manage to dodge the attack
simulated enemy attack: 50 damage
B:
Branch if variable [0001: Dodge = 1432]
play sound: tada!
you dodged the attack!
C:
Else handler:
Show battle animation: hit
mes: wrong number!
simulated enemy attack: 50 damage
I may see a problem.
Part A could be the same as part C in the same aspect that if you were to not enter any numbers at all, the end result is the same as pressing the incorrect number. My suggestion would be to get rid of part A and leave in parts B and C with no message, as a message would get annoying everytime you got hit.
-
Sorry I don't quite understand. Can we clarify aswell, I aren't actually going to put all this crap, this is a test using RTP and a crap looking battle system. Once I get it working then i will change the sounds, bad guys, messages and everything! I sitll don't understand what I'm doing wrong though.
-
Originally posted by Dragoon de Sol
A:
Branch if timer is 5 second or more
Show battle animation: hit
mes: you didn't manage to dodge the attack
simulated enemy attack: 50 damage
B:
Branch if variable [0001: Dodge = 1432]
play sound: tada!
you dodged the attack!
C:
Else handler:
Show battle animation: hit
mes: wrong number!
simulated enemy attack: 50 damage
I may see a problem.
Part A could be the same as part C in the same aspect that if you were to not enter any numbers at all, the end result is the same as pressing the incorrect number. My suggestion would be to get rid of part A and leave in parts B and C with no message, as a message would get annoying everytime you got hit.
What I meant is that the coding under Letter A could be the same as the coding under letter C, because the end result is you getting hit. All honesty, hitting the wrong nuber would be like not pushing a number at all, which is the case of the coding under lettter A. So basically, you're saying:
If five seconds is up, I get hit.
If I hit the correct combo, I dodge,
but if not, I get it.
Here's what you can do.
The coding under letter A, you make a conditional branch with an else handle. In the else handle, put the coding under letters B and C, B being a condition branch with C in it's else handler. So basically:
If timer 5 Greater than or Equal to
>Show Animation: Hit
>Message: You were unable to dodge in time
>Enemy Attack: 50
Else
>If Varible [XXXX:Dodge] = 1432
>> Play Sound: Success
>> Message: You dodged the attack
>Else
>>Show Animation: Hit
>>Message: Wrong Code Input
>>Enemy Attack: 50
-
Right, I think I get it now, I'll have a look. Cheers!
-
Right, I think I get it now, I'll have a look. Cheers!
-
Sorry for all the overlapping posts, it keeps posting everything twice. Yeah, I tried your method, it doesn't work :(