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:
Click here to join us on IRC (#charas on irc.freenode.net)!
Charas-Project
»
Game Creation
»
Requests
»
Tutorials
»
Variables for Beginners
« previous
next »
Print
Pages: [
1
]
Author
Topic: Variables for Beginners (Read 2728 times)
Tomi
*does mannerism*
Leader
Posts: 2,000
Variables for Beginners
«
on:
November 13, 2005, 11:43:21 PM »
Introduction
Variables are probably one of the most confusing things that beginners using RPG Maker encounter. Yet, once you harness their power, you can do almost anything!
What is a variable?
A variable is simply a thing that you can store a number in for any reason. You can do basic math operations, you can use them to make mini game, and to make custom systems.
Variable Commands
Here are the basics; what everything in the Variable Operations menu does.
Variables to Change: Selects the Variable or set of variables that you want to perform some action on.
--Single Variable: You only want to change one variable. Select it by clicking the … next to the box.
--Variable Range: You want to change a block of variables, a range of variables. Say you want to set variables 5-24 to a certain number. This is how you would do it.
--Variable Reference: You want to change a variable that is reference in another variable. For example, say variable 0001 = 4. So if you Variable reference Variable 0001, it will change variable 0004, the one referenced in Variable 0001.
Operation: Its like Math. You can add, subtract, multiply, divide, set equal, and modulus the variable that you set above. Its what you are doing to the “Variable to Change”
--Set Equal: Well, makes the “Variable to Change” equal to the “Operand”(as seen below)
--Add: Duh
--Subtract: Duh again. (Variable to Change minus Operand)
--Multiply: If you don’t understand this, you must have failed math.
--Divide: … (Variable to Change divided by Operand)
--Modulus: Now this gets a little trickier. Modulus is the function where it divides the variable by the specified number, then stores the remainder in the variable. Example 25 mod 10 = 5
Operand: The second part of the math equation. This can be a number of things. Each one is explained here.
--Number: A number specified by you.
--Value of Variable: The number (value) stored in the variable you choose. It’s basically like the Variable Reference in Variable to Change.
--Value Stored in Index: Hard to explain, but it works like this. Say you select Variable 0005, and the value of Variable 0005 = 2, then the variable it will reference is Variable 0002.
--Random Number Between [X] and [Y]: Generates a random Number between X and Y.
--Item: Select an Item, and whether you want to reference the Number of this Item possessed, or the number of this Item Equipped. So say the player has 10 Potions, and Potions is the Item you selected, then the operand will be 10.
--Hero: First choose one of your Heroes. Then choose a stat of theirs, such as their level, attack, etc. The Weapon/Shield/Etc. Number refers to the number next to the equipment name in the Items tab of the Database. It will use this number as the operand.
--Sprite: First choose the hero’s sprite, a vehicle’s sprite, or an event’s sprite. Then choose one of the following.
-----Map ID: The Number that each map starts out being named. The first map you make is Map0001, so if the sprite was on Map0001, it would use 1 as the operand.
-----X/Y-Coordinate: The sprite’s position on the map. X is Horizontal, Y is Vertical. You can find the X or Y coordinates by counting the squares from the left side (X) or top (Y) of the map, or you can see the coordinates at the bottom of the map editor (shown as X, Y). So if the sprite is on the coordinates 5,6 and you chose the X coordinate, then the operand would be 5.
-----Facing: A different number will be used as the operand depending on which way you face. Down=1, Left=2, Right=3, Up=4.
-----Screen Relative X/Y: Same as X/Y Coordinate, only instead of counting squares from the edge of the map, you count it from the edge of the screen when you are playing the game.
--Other: Just other various things that can be used as operands.
-----Money: The amount of Money held.
-----Timer 1/2 Seconds: The number of seconds left in timer 1/2.
-----Size of Party: The number of people in you party.
-----Number of Saves: Duh.
-----Number of Battles Fought: Duh.
-----Number of Victories: -_-'
-----Number of Defeats: …
-----Number of Escapes: *yawn*
-----Midi Ticks: The number (in milliseconds) that the current Midi has played, 0 if no Midi is playing (starts over when Midi repeats).
Conclusion
*Phew* So those are all the basics of Variable management. They are all very useful, depending on how you apply them (except for maybe Midi Ticks, never figured that out).
So that’s the basics of variables for you. This tutorial was directed to those with hardly any experience working with variables. You probably found the majority of this obvious if you have had any experience with RPG Maker, but you may have still learned something that you didn’t know before. Thank you for reading!
Logged
coasterkrazy
June 2005 - September 2008... January 2011?
Exemplar
Posts: 1,915
Hello...
(No subject)
«
Reply #1 on:
November 14, 2005, 12:09:05 AM »
Great tutorial, Tomi! I know plenty of people who should see this...
Logged
Tomi
*does mannerism*
Leader
Posts: 2,000
(No subject)
«
Reply #2 on:
November 14, 2005, 12:45:24 AM »
Thanks!
Logged
WarxePB
Action Sue
Royal
Posts: 3,601
What killed the dinosaurs?
(No subject)
«
Reply #3 on:
November 14, 2005, 12:45:42 AM »
Hmm, pretty much the same as Asakura's tutorial, minus the pictures. But well-explained and everything, so it's all good.
Logged
Blog:
The Gigaverse
Twitter:
Initial Chaos
Tomi
*does mannerism*
Leader
Posts: 2,000
(No subject)
«
Reply #4 on:
November 14, 2005, 12:46:41 AM »
Should I add some applications then?
Logged
WarxePB
Action Sue
Royal
Posts: 3,601
What killed the dinosaurs?
(No subject)
«
Reply #5 on:
November 14, 2005, 12:48:56 AM »
It's your tutorial, so do whatever you think will make it better.
Logged
Blog:
The Gigaverse
Twitter:
Initial Chaos
Print
Pages: [
1
]
« previous
next »
Charas-Project
»
Game Creation
»
Requests
»
Tutorials
»
Variables for Beginners