Get rid fo this ad! Click here to register for your free account.

Welcome to the BF Forums! Register Now, It's Free!

Welcome to the BF Forums; your source for the latest and greatest video game news, strategies, discussions, and resources. Join over 60,000 like-minded gamers from around the world to chat about your interests in our community.

You are currently viewing the forums as a guest user, which limits your access to certain content, contests, downloads, and more. By joining our free community, you will be able to respond in discussions/articles, contact members privately (PM), participate in regular-scheduled contests, see less advertisements, and have access to many other features. Registration is quick, easy, and completely free.

Have your questions answered. Share your thoughts about a topic. Take 2 minutes, Register Now!
Register for free today, and these ads will disappear!
BattleForums.com Forums > Major Games > Warcraft > Warcraft Maps and Modifications

##Click Here## | BF Lotto: $50 Ebay or Amazon Gift Card - A Single Click is All It Takes...

Reply
 
Thread Tools Display Modes
Old 12-08-2006, 02:32 AM   #1 (permalink)
BattleForums Junior Member
 
Trigger Noob =]'s Avatar
 
Join Date: Dec 2006
Location: Behind you O_O
Posts: 36
What are variables?

What are variables?
And what are they for?
Can anyone tell me??? i really wanna know!:hbut
Trigger Noob =] is offline   Reply With Quote
Alt Heute
Advertising

Beitrag Sponsored Links

__________________
Ads suck! Take 2 minutes to register for your free account, and GET RID OF THESE ADS!
   
Old 12-08-2006, 01:19 PM   #2 (permalink)
Aya Matsuura is awesome
 
x42bn6's Avatar
 
Join Date: Nov 2002
Location: Trieste, Friuli-Venezia Giulia
Age: 20
Posts: 14,997
It is used to store values that can be used for multiple triggers or just for convenience.

Say, for example, you want to make the first unit that enters a region to patrol a region using multiple regions to guide it (Region 1 to Region 2 to Region 3 to Region 4 and back to Region 1, for example). However, there is no constant (like "Triggering Unit") that corresponds to "First unit that enters this region".

So what is the solution? A variable. You store the unit in a Unit variable and then order the variable to do things.

There are many other uses. You can store arrays of units so you can make your own AI, arrays of heroes to gangbang a castle, and so on.

The other use of variables is for convenience. If you have, for example, a mathematical constant that takes 5 minutes to create using the panels, you may as well put this constant as a variable and reference that every time you need it.*
__________________
* Hang on a second...

Diablo III has been announced!

Here's what you need to do: Register a new account and tell the world what you think of this game.

Tell the damned world. The world wants to know.
x42bn6 is offline   Reply With Quote
Old 12-09-2006, 05:47 PM   #3 (permalink)
BattleForums Junior Member
 
Trigger Noob =]'s Avatar
 
Join Date: Dec 2006
Location: Behind you O_O
Posts: 36
Ok........
Are there any other uses for variables?
Trigger Noob =] is offline   Reply With Quote
Old 12-09-2006, 09:48 PM   #4 (permalink)
Aya Matsuura is awesome
 
x42bn6's Avatar
 
Join Date: Nov 2002
Location: Trieste, Friuli-Venezia Giulia
Age: 20
Posts: 14,997
Plenty - I have probably missed tons of them.

User inputs are always useful, too.

Basically, if you think you want to store any bit of data, you should be using variables. You could do it by creating units (i.e. A Paladin in the top-right means a unit is dead) but this is essentially a variable, and much more convenient.*
__________________
* Hang on a second...

Diablo III has been announced!

Here's what you need to do: Register a new account and tell the world what you think of this game.

Tell the damned world. The world wants to know.
x42bn6 is offline   Reply With Quote
Old 12-10-2006, 10:00 AM   #5 (permalink)
BattleForums Senior Member
 
Dream_Walker's Avatar
 
Join Date: Feb 2005
Location: Arcanum
Age: 17
Posts: 1,909
It's kind of like variables from Algebra. They "store" things.

In case you were wondering, arrays are just more variables. Variable[0] can be different than Variable[1].
__________________
(\_/)
(O.o)
(> <) Bunnies rule the world. Paste him in your sig for world domination!
Married to §tar§oft
:heart Krobelus :heart

Quote:
Originally Posted by §tar§oft
don't make me smother your face in my thousand year old pussy
Quote:
Originally Posted by Trojan
Because Jenny is like an unfiltered bottle of water. You want it, but once you see whats on the bottom, you go ewww.
Thanks to Hellwolf_36 for my avatars .
Dream_Walker is offline   Reply With Quote
Old 02-28-2007, 03:47 AM   #6 (permalink)
[F-Zero Fanatic]
 
Chris's Avatar
 
Join Date: May 2003
Location: Phantom Road
Age: 22
Posts: 15,333
It opens a space of memory to allow the map to store information for later use. Can be data types like integers, floats, etc. To objects like units and buildings. To even things like timers and regions. Any object can be made an array.

But be warned. Do not overuse them, they will take up extra space on your file. Almost like importing icons or skins.
__________________


The Purpose of DTD is not to show off how good you are.
But to do an insane flying move and landing at 3000 km/h.
Hopefully, without crashing into something or flying off in the process.

Hellwolf_36@D2Maniacs
Jessica_McAllen - Zy-el Bowazon - Level 19 of 10000
Chris is online now   Reply With Quote
 
Reply

« u know the deal... i need help with a trigger... | Acquisition Range »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

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

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


All times are GMT -4. The time now is 12:01 AM.



Powered by vBulletin® Version 3.7.2 | Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0