Help - Search - Members - Calendar
Full Version: how do i create a gauge
RPG RPG Revolution Forums > Game Engines > RPG Maker 2000 / 2003
andreasaspenberg
variables is just too limited. creating a gauge by using variables would require up to 100 variables per character. that is just too much to keep track of due to my damaged memory. i can barely keep track of a few variables.
Zinx10
IT is dependent of how complex the gauge is...a few variables can be perfectly fine! Btw...it isn't good to recreate a thread that was locked not too long ago.
Kread-EX
I'll let it go, for now.
Kazesui
You're still the one who's limited, not the variables. How do you manage to need 100 variables for 1 gauge?
A single variable per gauge should be enough. Storing a value in a variable and then adding or subtracting from it to decide how filled the gauge should be.
download and open this project in your editor

The example shows how to create a very simple gauge with one variable and a couple of events. The events are commented, so it should be understandable, but feel free to ask if it's still unclear as long as you don't ask how to solve it without using variables.

Om du fremdeles mener at du ikke kan bruke variabler for å løse dette, så kan du egentlig bare gi opp. Det er ikke uten grunn at forrige topic ble låst for at du var vrang angående det med variabler. Det er så enkelt som at enten så lærer du deg å bruke variabler, eller så får du bare finne deg i at du ikke kommer til å greie å lage noe sånt.
andreasaspenberg
i understand norwegian but many people dont. therefore if anybody want to speak norwegian with me they should do it through personal messages. how do i create a gauge that increase based on steps, then depletes once it have gone above a certain value.
Kazesui
Since the gauge in the demonstration decreased by subtraction, it would be obvious to think that it will increase by addition.
You could use a conditional branch checking for a switch "increase".
If increase is on, you will add to the gauge, to make it increase.
if increase is off (i.e. the condition "else" handler), you will subtract from gauge.

After you've performed the addition, you have another branch check if the value is at it's maximum. If yes, then turn the switch "increase" off.
Likewise, after the subtraction you'd check if the gauge is empty (i.e. if gauge = 0), and turn the switch "increase" on if it is.
andreasaspenberg
sounds interesting. please explain further. i still need more information in order to create a working gauge. i really want to finish the gameplay in my game soon but it wont work without the gauge.
Jparker1984
wow, i never ever talk bad about anyone but really, how dumb is this guy. if some one can understand switches they can understand variables. I am sorry dude, but you seriously need to stop using RPG Maker if you cant do the very basics aspects of the program.
andreasaspenberg
i did manage to create several different gauges. 1 that fills with kills and 1 that fills by using keys. i still cant fully figure out how to fill it with steps. i still dont have the graphics for them though.
Holder
QUOTE (Jparker1984 @ Jun 27 2011, 01:52 PM) *
wow, i never ever talk bad about anyone but really, how dumb is this guy. if some one can understand switches they can understand variables. I am sorry dude, but you seriously need to stop using RPG Maker if you cant do the very basics aspects of the program.

You never talk bad about anyone... try to keep it that way.
Everyone has their own skill levels and learning curve, this topic is for help and support, not telling them to stop using the program.
Vanit
Checking to see if the hero has taken a step is surprisingly easy!

You'll need 5 variables:
Hero X - Holds the Hero's current X coordinate
Hero Y - Holds the Hero's current Y coordinate
Last X - Holds the Hero's previous X coordinate
Last Y - Holds the Hero's previous Y coordinate
Steps - Amount of steps taken

The idea is that when we detect that Hero X/Y and Last X/Y have different values, it means the character would've moved one space! Then all you need is a parallel process enabled by a switch that does the following:

CODE
Last X = Hero X
Last Y = Hero Y
Hero X = Hero's Current X Coordinate
Hero Y = Hero's Current Y Coordinate
IF Hero X is not equal to Last X
    Steps + 1
Else
    IF Hero Y is not equal to Last Y
          Steps + 1
    End IF
End IF
IF Steps greater than 100
    Steps = 100
End IF


And you can replace 100 with whatever the maximum amount of steps is (that is if you want a maximum, if not you'll need to adjust your code to cap the gauge out at a maximum or weird stuff will happen).
andreasaspenberg
when the gauge reaches maximum it falls back to 0. dont worry, i know how to set it back to 0. though each character gets their own gauges. it doesnt exactly help that people call me stupid though or dumb.
Jparker1984
I am sorry, a bit un called for, I just didn't get how you couldn't figure it out by the way people were explaining it.
Kread-EX
In addition to what Holder said, Jparker1984, andreasaspenberg finally overcame his aversion for variables and is learning how to use them. It may be difficult for him but he is trying now.

Don't insult people like that.
andreasaspenberg
i should be able to manage the rest of the script on my own. i still dont have a design for it though. the best would be a gauge that exist a single image that fill with color. i have seen it in a game but i dont have the slightest idea how to create that kind of effect.
Zinx10
Wait...create what kind of effect?
andreasaspenberg
the effect of a gauge filling up without using pictures for the entire process.(just for the gauge itself.)
Vanit
The only way you can do it with a single picture is if you conceal the unused part of the gauge by having it offscreen or underneath another picture. Personally I prefer the slightly more tedious method of having a picture for each state of the gauge and then using the picpointerpatch to easily animate them, and the benefit of doing it this way is that you don't need to hide the guage behind anything (which can look clunky depending on how your do it.
kayden997
Arg! Does no one look in the tutorial section anymore?
Or even payed a visit to the search button?
I took well over 2 hours creating a very easy-to-understand tutorial for variables
http://www.rpgrevolution.com/forums/index....showtopic=50943

If you still do not understand it, I suggest you look at the tutorial.
andreasaspenberg
the gauge i saw was completely shown at all times. that proves that it is possible. i just dont know how. please dont get angry at me. i just want to set up a visible gauge.
Vanit
Put this in a event thats a parallel process:


Using the below gauge of 50x10 pixels. Get this working and then you can adjust the gauge to how you want it later.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2013 Invision Power Services, Inc.