Charas-Project

  • Home
  • Help
  • Search
  • Calendar
  • Login
  • Register
*
Please login or register.

Login with username, password and session length
 

News:

New forum theme up and running!



  • Charas-Project »
  • Game Creation »
  • Requests »
  • RPG Maker Programming »
  • Variables
« previous next »
  • Print
Pages: [1]

Author Topic: Variables  (Read 3204 times)

Offline SqareMan

  • Initiate
  • *
  • Posts: 40
Variables
« on: September 20, 2009, 03:46:10 AM »
I need a good tutorial on variables please!
Logged

Offline Prpl_Mage

  • Administrator
  • Sage
  • *
  • Posts: 7,645
  • The Administrator Mage
    • Check out our itch website
Re: Variables
« Reply #1 on: September 20, 2009, 07:29:12 AM »
Variables are expressions.

A conditional branch and event precondition have the option to check if the expression is true.
You can set a value to an expression, decrease it, increase it, set it equal to or give it a random value between something and something.

In a conditional branch:
You chose that you want to check a varaible - an expression
You enter the expression the maker should check. i.e: "If varaible 1 is equal to 5"
If the variable "Variable 1" have the value of 5 - the expression is true and the "true" fork of the conditional branch will play.

In a precondition:
Say that you have a mercenary who offers his services. He wants buckles if you want him to fight with you.
The merc event have 3 pages.
1: A page with nothing.
2: A page with the precondition that "variable 2" is larger than or equal to 3000.
3: A page with the precodition that the switch "merc in party" is ON.

Now, the first page is just when you speaks to him. He'll tell you that he want nothing to do with you unless you pay up.
The second page however will only exist if the precondition is true. In this case. If the varaible 2 is large than or equal to 3000.
If you have 3000 or more buckles - the event will play. Otherwise it won't.
(PS: You can make this easier by placing a conditional branch in the first page with the same check. This was just so you understand it.)


So - to sum it up. Variables are much more flexible than switches.
Switches are either On or Off. Yes or No. True or False. there are two options. Nothing more.
Variables on the other hand ranges from -9999999 to 99999999. So you can check if you have a certain amount of items. use them as health bars, use it as a pedometer. The list goes on. Programming with c++ as such depends on variables after all.
Logged
Cool RPGM Project!
Sprite till you die

Oh my god, this was ...10 years ago...

Offline SqareMan

  • Initiate
  • *
  • Posts: 40
Re: Variables
« Reply #2 on: September 20, 2009, 11:21:05 PM »
Thanks :), but what are buckles?
Logged

Offline MissingName

  • Here you go. Juicy Fruit. Happy?
  • Exemplar
  • *
  • Posts: 1,919
  • The scotch is well hidden. So scram.
Re: Variables
« Reply #3 on: September 20, 2009, 11:44:51 PM »
He's just saying if you have x number of ___________, then the variable will trigger a different event.  Buckles were an example item.

I think.
Logged
<sig></sig>

Offline Obvious Sock Account

  • I liek what I see
  • Associate
  • *
  • Posts: 211
Re: Variables
« Reply #4 on: September 20, 2009, 11:47:40 PM »
I figured buckles would be currency.

That is what most mercenaries' services are purchased with.
Logged
To the Halls of the Fallen the mighty march.
Their achievements cheat both death and eternity.
Lives filled with honour and deaths filled with glory,
In songs and in poems their heroism lives on.

Offline fruckert

  • Star-Star-Star-Star
  • Sage
  • *
  • Posts: 8,148
  • Not intended for public consumption
Re: Variables
« Reply #5 on: September 20, 2009, 11:50:13 PM »
I figured belt buckles, but that'd be ridiculous.
Logged
Quote
Ellie: I had a slice of ham in my hand. I was going to drop it, so I slapped it hard. It attached itself to the wall

Offline Obvious Sock Account

  • I liek what I see
  • Associate
  • *
  • Posts: 211
Re: Variables
« Reply #6 on: September 20, 2009, 11:54:31 PM »
Maybe Purple had a utopian setting in mind.  Can't imagine there would be too much work for a mercenary in a paradise.  To the point that they can't even afford belt buckles.
Logged
To the Halls of the Fallen the mighty march.
Their achievements cheat both death and eternity.
Lives filled with honour and deaths filled with glory,
In songs and in poems their heroism lives on.

  • Print
Pages: [1]
« previous next »
  • Charas-Project »
  • Game Creation »
  • Requests »
  • RPG Maker Programming »
  • Variables
 

  • SMF 2.0.10 | SMF © 2015, Simple Machines
  • XHTML
  • 2O11
  • RSS
  • WAP2
  • Simple Machines Forum