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
»
RPG Maker Programming
»
Timer gauge- help me!
« previous
next »
Print
Pages: [
1
]
Author
Topic: Timer gauge- help me! (Read 2332 times)
zuhane1
Member
Associate
Posts: 210
Male, Tall, 16, UK, Brown hair, Tom.
Timer gauge- help me!
«
on:
October 14, 2007, 11:57:53 AM »
Hello folks! I want to have a gauge on my game with an arrow moving. You have to press spacebar and get it as close to the middle as you can to determine your power (Like the spiral cut on FFX). How the hell do I do this? I have good knowledge of variables and key input processing, so just fire away! Cheers!
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:
October 15, 2007, 06:56:35 PM »
There are a LOT of ways to do something like this.
I'd do it like this...
Note: [arrowx] and [arrowy] are variables.
Display gauge at 10, 10 (or whatever possition you want).
Set [arrowx] = 10 (or the starting x possition of your gauge)
set [arrowy] = 10 (or the y possition of your gauge)
label 1
Show picture arrow at [arrowx], [arrowy]
add 1 to [arrowx]
wait 0.0 seconds (or .1)
Conditional Branch (if [arrowx] = possition of right end of gauge)
- label 2
- Show picture arrow at [arrowx], [arrowy]
- subtract 1 from [arrowx]
- wait 0.0 seconds
- Conditional Branch (if [arrowx] = position of left end of gauge)
--jump to label 1
- else
-- jump to label 2
Else (from the first conditional branch
- jump to label 1
That'll get your arrow moving.
Make a seperate event for when you press the spacebar key to record the possition of [arrowx]. Do what you want with [arrowx] then.
I forgot to add in how you would stop the arrow from moving after you hit the key, if you need help with that, let me know and I'll add it in.
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:
October 15, 2007, 09:11:06 PM »
I really don't understand what that means. Maybe a print screen would make more sense. I've just made a really good-looking gauge and have a ticker which moves left and right underneath it. I now need some way of making him him jump when I press spacebar. Could you please try to rephrase it maybe using a printscreen?
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 #3 on:
October 15, 2007, 10:49:42 PM »
Heres an example, I don't have any pics called gauge or arrow, but pretend fly2 is gauge and fly4 is arrow.
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 #4 on:
October 16, 2007, 08:02:49 AM »
Right, it's running smoothly up to now although it moves a bit slow. Not to worry though, I've just decreased the size of the hit mark to make it harder. It works fine and everything but how do I now program it so that when I press spacebar an event happens? 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.
DragonBlaze
A Wild DB Appeared!
Royal
Posts: 3,329
(No subject)
«
Reply #5 on:
October 16, 2007, 03:01:14 PM »
You can make it move faster by adding or subtracting 2 instead of 1.
Ok, what you do is make a second page, and have it triggered by a switch called [gauge off]. Leave this page blank.
Make a separate parallel process event, have a key input process to check to see if the decision key is pressed, then make a fork for if the key is pressed. When the key is pressed, turn [gauge off] ON. This will stop your gauge from moving.
You then need to find what x value would be the center of the gauge. Lets say you're going from 10 to 20, 15 would be in the center.
Still in the decision key conditional branch, add some variable commands and conditional branches that looks like this:
[arrowx] - 15 (or whatever the center would be).
if [arrowx] is less than 0
-- [arrowx] * -1
What this did was it found the value, lets say arrow x was on 11, it subtracted 15 from 11, leaving you with -4. Since we're only looking for the distance between the center and the spot you hit, we want to get rid of the negitive value (distances can never be negitive), so we multiply it by -1 to make it positive. So, if you land it right on the middle, you got a 0, if you have it one unit to the left or right, you get a 1, if you have it 5 units to the left or right, you get a 5.
I suggest that if you want to have a bonus with this, you can do it like this. (this is still in the decision key conditional branch)
set [bonus] = (a value such as 5).
[bonus] - [arrowx].
Ok, what the above does is subtract [arrowx] from [bonus]. Remeber if the arrow was in the center [arrowx] would be 0. Thus you would get the maximum bonus since 5 - 0 = 5. Where if the arrow landed farthest away from the center, the value would be 5 (in my example), and 5 - 5 = 0, thus you wouldn't get any bonus. The closer you get to the center, the higher the bonus.
This is how the code should look.
key input process (decision key)
if [key] = 5
-turn [gauge off] ON
-[arrowx] - 15 (or whatever the center would be).
-if [arrowx] is less than 0
-- [arrowx] * -1
-set [bonus] = (a value such as 5).
-[bonus] - [arrowx].
(you'll also want to erase the gauge and arrow picture, plus probably add sound effects and such, but i have no idea how you're using this system, so its up to you to do that.)
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 #6 on:
October 17, 2007, 03:45:39 PM »
Right, I'm actually having it similar to that system but not the same. The gauge is simply to jump over gaps. I don't need the gauge in battle as it wouldn't work. Here's my scripting for the parallel process which doesn't seem to be working. It's to make him jump over a gap. If you just tell me what I'm doing wrong. Thanks!
EDIT: BTW, the conditional branch has been changed to Arrow X, I noticed that little mistake. But it's still not working!
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 #7 on:
October 17, 2007, 06:34:01 PM »
Give me a screen of the other event that actually shows the time gauge and arrow. That way I can see how the two interact and find the problem that way.
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
Print
Pages: [
1
]
« previous
next »
Charas-Project
»
Game Creation
»
Requests
»
RPG Maker Programming
»
Timer gauge- help me!