Zelaron Gaming Forum

Zelaron Gaming Forum (http://zelaron.com/forum/index.php)
-   RPGMaker (http://zelaron.com/forum/forumdisplay.php?f=188)
-   -   Variables? (http://zelaron.com/forum/showthread.php?t=30269)

HungryforLint 2004-06-18 05:11 PM

Variables?
 
Well... Ive done alot with my game.. and ive noticed I've never used ANY variables.... I can't really grasp the concepts of Variables.. and i don't really know how to use em.... I know its kidna stupid but can someone break down to me how to use variables.... maybe a like a variable tutorial... something that a noob can understand :) THANKS!
-Alex

BlueCube 2004-06-18 07:45 PM

Variables are placeholders for numbers. That's it. If you can handle the ON/OFF values of a switch, you can handle a variable. Anything you can do with a number, you can do with a variable. Math, counting, comparison, whatever you want.

You can use \v[####] to put the value of a variable within a text message. For example, you can do something like this:

<>Set variable [0001] to the however much money you have
<>Show message: "You have \v[0001] gold"

Again, absolutely nothing to it.

HungryforLint 2004-06-19 12:09 AM

Oh ic.... i understand how it holds numbers like gold... but i dont understand how you used it in the Blacksmith demo...

BlueCube 2004-06-19 12:12 PM

That's actually not to hard to figure out once you understand the coding.

It's basically like this:

Start Place:

Get Sword
Set Upgrade Level to 1
Move to Shop

---

Shop:

Ask to upgrade. If you don't want to, the event ends.

<>If you're at upgrade level 1:
...<>Ask to upgrade to level 2 - if yes, Change Sword to level 2 and remove old level 1 sword, then set Upgrade Level to 2
....<>End event

<>If you're at upgrade level 2:
...<>Ask to upgrade to level 3 - if yes, Change Sword to level 3 and remove old level 2 sword, then set Upgrade Level to 3
...<>End event

<>If you're at upgrade level 3:
...<>Ask to upgrade to level 4 - if yes, Change Sword to level 4 and remove old level 3 sword, then set Upgrade Level to 4
...<>End event

<>If you're at upgrade level 4:
...<>Explain that you can't upgrade any more
...<>End event

----------------

And this repeats for each character, basically. I actually could simplify the coding more by adding more variables, now that I think about it.

The idea of the variables in the Upgrade Demo (not actually a Blacksmith Demo, that's a separate one) is to keep track of what upgrade level each character's weapons are. There's also the pot of gold variable which transfers money into your inventory, but that's rather easy to see.

ograx 2004-06-19 01:37 PM

I just thought I'd add a little tip that helped me with variables.
Variables in rpg maker are exactly the same as real variables(Algebra)


All times are GMT -6. The time now is 10:04 AM.

Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
This site is best seen with your eyes open.