PoLlama Forums  

Go Back   PoLlama Forums > WarCraft > Tutorials

Reply
 
LinkBack Thread Tools Rate Thread
Old 07-09-2007   #1
 
MrApples's Avatar
 
Join Date: Sep 2006
Location: Your Mom
Posts: 2,241
MrApples has a spectacular aura about
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 Menu


You’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
Basics
Now 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]
MrApples is offline   Reply With Quote
Old 07-22-2007   #2
 
MrApples's Avatar
 
Join Date: Sep 2006
Location: Your Mom
Posts: 2,241
MrApples has a spectacular aura about
Re: Variables For Beginners

Fixed the pictures.
MrApples is offline   Reply With Quote
Old 07-31-2007   #3
 
Join Date: May 2007
Posts: 75
Ukitake is an unknown quantity at this point
Re: Variables For Beginners

this tutorial is a nice introduction to variables, thanks.
Ukitake is offline   Reply With Quote
Old 02-08-2008   #4
 
graal's Avatar
 
Join Date: Feb 2008
Posts: 87
graal is on a distinguished road
Re: Variables For Beginners

Sorry, but I can't see the screen shots, only those awful "X"s

graal is offline   Reply With Quote
Old 03-18-2008
Rick3
This message has been deleted by Mr. Zero.
Old 3 Days Ago   #5
 
Halakbalakbalak's Avatar
 
Join Date: Jun 2007
Posts: 1,634
Halakbalakbalak will become famous soon enough
Re: Variables For Beginners

I think you need to upload them to photobucket mate.

Current Projects
[Only registered and activated users can see links. ]
Halted Projects
Conflict Rising 2.0(A much better balanced, much better made version of the original.)
Barbarus Incursio
Halakbalakbalak is offline   Reply With Quote
Old 3 Days Ago   #6
 
Anman's Avatar
 
Join Date: Nov 2008
Posts: 94
Anman is a jewel in the roughAnman is a jewel in the rough
Re: Variables For Beginners

I find it lulzy that Mr PHP Pro did a tut on something like this.


Contact Me
[Only registered and activated users can see links. ] - [Only registered and activated users can see links. ]


Anman is online now   Reply With Quote
Reply

Tags
None

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may post replies
You may post attachments
You may edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On
Trackbacks are Off
Pingbacks are Off
Refbacks are On


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


All times are GMT -5. The time now is 07:18 PM.

A friend of Wc3Happy
Powered by vBulletin® Version 3.7.1
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165