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
»
Can someone refresh my mind on switches & varaibles?
« previous
next »
Print
Pages: [
1
]
Author
Topic: Can someone refresh my mind on switches & varaibles? (Read 1757 times)
evmaster
Member
Associate
Posts: 231
Can someone refresh my mind on switches & varaibles?
«
on:
February 03, 2010, 06:41:16 PM »
Been awhile since I messed with rpg maker 2003. I think variables were just for message options but I forgot how switches work. And whats the common event for in the main options?
Logged
Prpl_Mage
Administrator
Sage
Posts: 7,644
The Administrator Mage
Re: Can someone refresh my mind on switches & varaibles?
«
Reply #1 on:
February 04, 2010, 11:33:52 PM »
Well, allow me to give you a hand.
Variables are basically the names of anything that can store a value.
The variables are the most used functions in the programming world, C++, Java or RPGm.
Say you want the player to know how many battles they've fought? Set a variable equal to the value of the amount of battles fought.
Want to make a synthesis shop? Make a conditional branch check how many "Iron Ore" the player is carrying.
Want to store the number pressed?
Want to store the stats?
Want to count how many times a certain party member died?
Want to store how many times you talked to the person who frankly told you not yo speak to him?
Variables handles all values and can sharply reduce complicated conditional branches and checks with only switches.
Say you want to remember what party member you decided to help out during the mutant siege? Have a variable called "partnersaved@mutant" and then give it the value 1 for Hanz, 2 for Franz, 3 for Danz and 4 for Bob.
This way you don't need the four switches: "Hanz saved @mutant","Franz saved @mutant","Danz saved @mutant" and "Bob saved @mutant" you simply have one single variable.
--------------------
And then we'll talk a bit more about them switches. Basically... A switch is a variable check.
The switch is either ON or OFF which on most other programming languages are simply called "0 or 1".
Everything you do with switches - you can do with variables as well.
THAT's what I'd like to say. But let's hear me out shall ya'?
The rpgm(2k3) likes it's switches, for example skills, items, battle commands, monster preconditions and trigger for common events.
So for example. Let's say you opened the chest your fiancé asked you not to open. You turn the switch [wifedisobeyed] ON.(ps, all names are optional by the maker)
If you killed the mailmain: [Mailmankilled] ON
if you use your Armageddon spell : [mankind destroyed] ON
I think you catch my drift.
Basically, the switches is either on or off. And the maker cna check the switches when it wants to. For exampel if you should be able to see a certain scene again. Or if you is allowed back into the town you were exiled from and so on. It's easy to remember and will probably help your programming a lot.
----------
And then we end with the final question: "Whats the common event for in the main options?"
Well... The common events could also be called "global events". In other words - it doesn't matter if you're on the map "Beaver city main" or "Beaver city bar" or even "Half-tracked undersea aeroplane". The common events are global and are not limited to a certain map like the events you place.
If you have events that happen often like the the custom change class systems or such - you'll probably want to make them common events.
Also, I think the common events even work in battle.
And i hope that helped you to refresh your memory.
Logged
Cool RPGM Project!
Sprite till you die
Oh my god, this was ...10 years ago...
Print
Pages: [
1
]
« previous
next »
Charas-Project
»
Game Creation
»
Requests
»
RPG Maker Programming
»
Can someone refresh my mind on switches & varaibles?