Home
Help
Search
Calendar
Login
Register
Please
login
or
register
.
1 Hour
1 Day
1 Week
1 Month
Forever
Login with username, password and session length
News:
New forum theme up and running!
Charas-Project
»
Game Creation
»
Requests
»
Tutorials
»
My variable CBS, I can't use timers.
« previous
next »
Print
Pages: [
1
]
Author
Topic: My variable CBS, I can't use timers. (Read 2718 times)
zuhane1
Member
Associate
Posts: 210
Male, Tall, 16, UK, Brown hair, Tom.
My variable CBS, I can't use timers.
«
on:
June 14, 2007, 01:18:55 PM »
Right, since my default battle system Paper-Mario-styled-battle didn't work at all, I'm working on a new idea. The battle are using character sets on a map, an auto-start event will control the whole battle. The idea is that a number flashes up and you have about a second to press it, if you press it, you attack, if you don't press the right number or leave it too late, then you don't attack.
The same goes for dodging, press the correct number in time and dodge an enemy attack. This is all working fine (obviously I haven't finished the coding. But there is one problem, I am terrible with timers. What timer coding could I put in and where to make you not attack if the time runs out? Please help! If this works we will have a game like Paper Mario and I will unleash a demo and you can all copy the coding and have nice Paper-Marioey type games!
Here's the first half of my coding:
[img=http://img2.freeimagehosting.net/uploads/th.f1510b0f07.jpg]
Logged
Nether-
A game featuring more extras and minigames than anything. Endorse in hours of fun without even doing the storyline. A game with so many features it's just not right.
DragonBlaze
A Wild DB Appeared!
Royal
Posts: 3,329
(No subject)
«
Reply #1 on:
June 14, 2007, 05:10:53 PM »
Ok first off though, instead of making that an autostart event on he map, make it a 'call triggered' common event. And on the map, just call that common event. This way if you decided to change your battle system later, you won't have to recode every battle, just edit the one code in the common events.
I don't recomend using timers, make a second 'parallel process' event, (again, i'd put it in the common events). Make it triggered by a switch.
Make it look something like this.
Turn [switch - timer] ON
wait 1.0 seconds
Turn [switch- timer] OFF
So basically all this event does is turn a swtich on for one second and then back off.
Now in your other event, make a variable command that makes a random number between 1 and 9. Set it equal to a variable called [random]. Place a label [1] here, After that, make a key input process, and check the box for numbers and uncheck every other box. Lets call the variable in the key input process [input].
Make a conditional branch for if [input] is equal to [random] (also make an else case for this one to display a miss message or something if you miss, and turn a switch [pressed key] ON.
Inside the regualar part of your conditional branch, make another branch for if [switch - timer] is ON. And in THAT conidtinal branch make your attack.
After everything so far, make another conditinal branch for if [pressed key] is OFF. In that branch, make another for if [switch timer] is ON. And in that conditional branch make a wait 0.0 second command and then jump to label 1.
After that conditional branch, turn the switch [pressed key] OFF.
So in the end, it should look like this.
************************
Variable options [random] = random number between 1 and 9
Label 1
Key input process [input]
IF [input] = [random]
- IF [switch - timer] is ON
-- {attack code}
- End
Else
- Turn [pressed key] ON
End
If [pressed key] is OFF
- If [switch - timer] is ON
-- wait 0.0 seconds
-- Jump to label 1
-end
end
Turn switch [pressed key] OFF
******************
Logged
Hell Yeah! Just recovered all my old rm2k/3 games from my 10 year old, broken laptop hard drive that had been formatted and had a new OS installed on it. Oh, and I did all of this from my phone. WIN
zuhane1
Member
Associate
Posts: 210
Male, Tall, 16, UK, Brown hair, Tom.
(No subject)
«
Reply #2 on:
June 15, 2007, 11:51:31 AM »
You are a genius. I'm gonna give this a shot and come back to you if I'm still having trouble, thanks.
Logged
Nether-
A game featuring more extras and minigames than anything. Endorse in hours of fun without even doing the storyline. A game with so many features it's just not right.
zuhane1
Member
Associate
Posts: 210
Male, Tall, 16, UK, Brown hair, Tom.
(No subject)
«
Reply #3 on:
June 16, 2007, 10:50:46 AM »
Right, I think I've copied it okay but it's still not working. Please help! Just click the attachment.
Logged
Nether-
A game featuring more extras and minigames than anything. Endorse in hours of fun without even doing the storyline. A game with so many features it's just not right.
DragonBlaze
A Wild DB Appeared!
Royal
Posts: 3,329
(No subject)
«
Reply #4 on:
June 17, 2007, 03:44:52 AM »
Exactly how isn't it working? Cuz the problem I see with it right now is that you turn the switch 'timer on' on after the loop, so that switch will always be on and thus it's not gonna wait a second, its gonna be held up in that loop forever until a key is pressed.
Anyway, instead of having that switch on, turn a differant swtich on that turns the parallel process event on that handles the
Turn [switch - timer] ON
wait 1.0 seconds
Turn [switch- timer] OFF
stuff.
If thats not wrong with it, i'll test it through and see whats up.
Logged
Hell Yeah! Just recovered all my old rm2k/3 games from my 10 year old, broken laptop hard drive that had been formatted and had a new OS installed on it. Oh, and I did all of this from my phone. WIN
zuhane1
Member
Associate
Posts: 210
Male, Tall, 16, UK, Brown hair, Tom.
(No subject)
«
Reply #5 on:
June 18, 2007, 09:55:13 AM »
I've tried so many things, but I don't think I'm good enough so I'm giving up on it. Thanks anyway.
Logged
Nether-
A game featuring more extras and minigames than anything. Endorse in hours of fun without even doing the storyline. A game with so many features it's just not right.
Print
Pages: [
1
]
« previous
next »
Charas-Project
»
Game Creation
»
Requests
»
Tutorials
»
My variable CBS, I can't use timers.