![]() | |
| | #1 |
![]() Join Date: Sep 2006 Location: Your Mom
Posts: 2,241
![]() | Variables For Beginners Variables for Beginners The best thing to hit mapping since swiss cheese. Introduction In this tutorial you will learn how to make a variable, what they are, and how they work, yeah!What is a Variable? var•i•a•ble P Pronunciation Key (vâr - -b l, v r -)adj. 1. a. Likely to change or vary; subject to variation; changeable. b. Inconstant; fickle. 2. Biology. Tending to deviate, as from a normal or recognized type; aberrant. 3. Mathematics. Having no fixed quantitative value. Taken from www.dictionary.com What is a Variable in World Editor? A Variable is like empty space. Like a really small Floppy Disc or Flash Drive. You can store stuff in the Variable that you want to use for later in the game. Instead of actually storing stuff inside of the Variable though, it only points to what you saved. If you saved a Unit to a Variable, the actual Unit would still be in the game, but if you ever wanted to do anything to that unit, you could use the Variable. Making the Variable Time to Create a Variable! (Gasp!). First thing to do is enter the Variable MenuYou’re in the Variables Menu, Congratulations! Now you must make a New Variable (Be Careful!). Ok for your first Variable, let’s do something nice, like a Variable that tracks Kills! Steps -In the Variable Name Spot, type Kills -In the Variable Type Spot, select Integer (An integer is any full number, like 1, 2, and 3, but not 1.5 or 2.3). -Click Ok! You made your first Variable! Congratulations! It should look like this if you did it right. Using the Variable BasicsNow that you made your first variable, let’s put it into action shall we? Lets say you want to keep track of the Kills by Player 1 (Red), and Player 1 (Red) could check his kills whenever he wanted by typing kills. We would do this. Voila! It’s Easy, right?[/center] Using Arrays. Ok, now say you wanted to make it so not just Player 1 (Red) could use this, but every player could! Sounds hard huh? Actually it’s really easy. You have to make a thing called an Array Variable . Array Variables are like a whole bunch of Variables of the same type in one. They work by sorting them by a Number, such as Variable[1] would be a completely different variable then Variable[2], or Variable[3], and so on. These are meant to be used only when its necessary, yes you could put every Variable of the same type into one Array Variable and use numbers, but it would be slower on a very small scale then just using good ole' Single Variables. Now onto making the Kill Check Trigger work for every player. You must go back into the Variable Menu, then Edit the Kills Variable you just made, and check the Array Box near the bottom. That’s it, now your Variable is Array! Tip: Array Size is only for how many Variables of the array you would like to have the Default Value. But now in order to use the Kills Variable, you have to specify what number, like this. There! Now you have successfully used both Variables and Array Variables! Congratulations! [b]Please comment on how this tutorial can be improved, if you find anything that you find confusing, or may be confusing to others, please let me know![b] |
| | |
| | #2 |
![]() Join Date: Sep 2006 Location: Your Mom
Posts: 2,241
![]() | Re: Variables For Beginners Fixed the pictures. |
| | |
| | #3 |
![]() Join Date: May 2007
Posts: 75
![]() | Re: Variables For Beginners this tutorial is a nice introduction to variables, thanks. |
| | |
| | #4 |
![]() Join Date: Feb 2008
Posts: 87
![]() | Re: Variables For Beginners Sorry, but I can't see the screen shots, only those awful "X"s |
| | |
| | #5 |
![]() Join Date: Jun 2007
Posts: 1,634
![]() | Re: Variables For Beginners I think you need to upload them to photobucket mate. |
| | |
| | #6 |
![]() Join Date: Nov 2008
Posts: 94
![]() ![]() | Re: Variables For Beginners I find it lulzy that Mr PHP Pro did a tut on something like this. |
| | |
![]() |
| Tags |
| None |
| Thread Tools | |
| Rate This Thread | |
| |
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Dialogs | MrOrange | Tutorials | 10 | 08-26-2007 09:21 AM |
| Reducing Lag | MrApples | Submit a Tutorial [World Editor] | 1 | 07-09-2007 03:24 PM |
| Variables | GiL-GaLaD | World Editor Help | 12 | 06-17-2007 10:54 PM |
| [Tutorial] Reducing Lag | MrApples | World Editor Help | 5 | 04-27-2007 03:34 AM |