Register for free, and make this box disappear!

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


Welcome to the BF Forums; your source for the latest video game news, strategies, discussions, and resources. Join over 66,000 like-minded gamers 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. Whatever your game interest may be, you'll find information here where people realize that games are more than just poker online.


Have your questions answered. Share your thoughts about a topic. Take 2 minutes, Register Now!
BattleForums.com Blizzard Gaming Forums > Warcraft > Warcraft General > Warcraft Maps and Modifications

We're Half-Way There!! - BF Lotto: $50 Ebay or Amazon Gift Card - A Single Click is All It Takes...

Reply
 
Thread Tools Display Modes
Old 01-24-2005, 03:12 AM   #1 (permalink)
BattleForums Junior Member
 
MyNameIsMonky's Avatar
 
Join Date: Feb 2004
Location: No place
Age: 17
Posts: 137
Varibals

i dont get how they work....can somone please explain them to me? :halo
MyNameIsMonky is offline   Reply With Quote
Beitrag Sponsored Links

__________________
Ads suck! Take 2 minutes to register for your free account, and GET RID OF THESE ADS!
Old 01-24-2005, 06:04 AM   #2 (permalink)
BattleForums Addict
 
Darimus's Avatar
 
Join Date: Oct 2003
Posts: 681
It's "variables" first off...

They're data-types and are used for storing data that you might want to keep. Booleans are for true or false, integers are for numbers between 0 and 4294967295 (without decimals), "real"s are for numbers with decimals, such as 4.25, and 2.00.

For example, you might have it so that after 4 town halls are killed, the player wins... to do this, you would make an integer (number without a decimal point), and increment (increase) by 1 each time a town hall was killed... then you could use an If statement to check if it was 4, and declare victory.
Darimus is offline   Reply With Quote
Old 01-24-2005, 06:21 AM   #3 (permalink)
BattleForums Junior Member
 
MyNameIsMonky's Avatar
 
Join Date: Feb 2004
Location: No place
Age: 17
Posts: 137
o ok...what if i wanted 2? Town halls desroyed
MyNameIsMonky is offline   Reply With Quote
Old 01-24-2005, 06:35 AM   #4 (permalink)
BattleForums Addict
 
Darimus's Avatar
 
Join Date: Oct 2003
Posts: 681
You could do that in a multitude of ways... you could do an integer and check for 2, or you could set a boolean to true if a town hall is killed, or declare victory if it's already true when the town hall is destroyed
Darimus is offline   Reply With Quote
Old 01-24-2005, 07:21 AM   #5 (permalink)
BattleForums Junior Member
 
MyNameIsMonky's Avatar
 
Join Date: Feb 2004
Location: No place
Age: 17
Posts: 137
uhggg sorry i still dont understand :doh ...whats interger?or however u spell it
MyNameIsMonky is offline   Reply With Quote
Old 01-24-2005, 08:02 AM   #6 (permalink)
Aya Matsuura is awesome
 
x42bn6's Avatar
 
Join Date: Nov 2002
Location: Trieste, Friuli-Venezia Giulia
Age: 20
Posts: 15,282
Quote:
Originally Posted by MyNameIsMonky
uhggg sorry i still dont understand :doh ...whats interger?or however u spell it
Integers are numbers without decimal places, without the mantissa. So 1 would be an integer, and 1.00 a real number.

Use integers for, predictably, discrete data like 'number of sheep entered region' or 'number of heroes doing stupid things'. Use real numbers for things like 'Every 1.50 seconds kill target unit' or 'Remove 1.7HP from target hero every second he stays in the enemy base'.*
__________________
* IM IN UR WIKI RVRTING UR EDITS

x42bn6 is offline   Reply With Quote
Old 01-24-2005, 03:23 PM   #7 (permalink)
BattleForums Junior Member
 
MyNameIsMonky's Avatar
 
Join Date: Feb 2004
Location: No place
Age: 17
Posts: 137
ohhhhh......so its a # with out decmal...i see

ok i get it...can somone help me with a trigger two..like theres this
unit that dont come up to often i need it to not come up two often...like randomly spawn. not liek every 60 seconds can ne one help?

Last edited by MyNameIsMonky; 01-24-2005 at 05:52 PM.
MyNameIsMonky is offline   Reply With Quote
Old 01-24-2005, 06:18 PM   #8 (permalink)
BattleForums Addict
 
Darimus's Avatar
 
Join Date: Oct 2003
Posts: 681
It was hard to discern from your explanation what you meant, but I think you mean a unit that rarely, and randomly spawns. If so, you could do that using Math - Random Number (and choose 2 high numbers), and just have it spawn using a Timer or a perodic event. [Note: If you choose to do a random number, using a perodic event, the number will be randomly chosen at the start, but only once... If you choose a timer, you should remake the timer each time the unit is killed to have another random number]
Darimus is offline   Reply With Quote
Old 01-25-2005, 05:20 PM   #9 (permalink)
 
Chris's Avatar
 
Join Date: May 2003
Location: Temple Prime, Sarajevo
Age: 22
Posts: 16,127
Variables are variables really. They are used to store data on a computer for future use and have a temporary address on your physical memory. You assign types such as.

Integer, Boolean, Real (decimal numbers), a unit, unit group etc.

You then make a trigger to declare what they want to equal, eg.

Set X = (Player 1's Current Gold) will make X whatever player 1's gold is. However, you may need to put a event to keep the variable constantly updated.

Then there are arrays, which is a variable which stores multiple values into one and are called by an index. eg.

hi[7] = 1, 155, 24, 234, 123243, 56, 645, 93

However, note that there are 8 elements compared to the [7]. That's because 0 is an active index. If i call hi[0], I get 1. Why do you this?

Say in a Hero Line Wars map, you would want income[11] rather than making 12 seperate variables. Note that although 0 may be an active index, it may not be in Warcraft III editor.

Quote:
Originally Posted by MyNameisMonky
ok i get it...can somone help me with a trigger two..like theres this
unit that dont come up to often i need it to not come up two often...like randomly spawn. not liek every 60 seconds can ne one help
Make a random number as Dari said, but it needs to be re-chosen when the player who commanded that unit died. Set a range for the random number function and it should work properly.
__________________



One Vision. One Purpose.
Through leadership in Kane, we seek a new Tiberium future.
Our stealth and advanced weaponry will bring swift death to any who oppose us.
PEACE THRU POWER!


Warlock-Rauteus - Zy-el Necromancer - Level 143 of 10000

My Personal Blog Page - Updated every Friday
Join the Phantasy Star Online sensation - ChrisH36
Chris is online now   Reply With Quote
Old 01-25-2005, 11:28 PM   #10 (permalink)
BattleForums Addict
 
Darimus's Avatar
 
Join Date: Oct 2003
Posts: 681
Hellwolf_36, when you declare something like hi[7], it goes from 0 to 6, not 0 to 7... There's 7 variables when you declare it as 7, it just doesn't go up to 7 (Goes up to 6).
Darimus is offline   Reply With Quote
Old 01-26-2005, 04:39 AM   #11 (permalink)
 
Chris's Avatar
 
Join Date: May 2003
Location: Temple Prime, Sarajevo
Age: 22
Posts: 16,127
Ok, 0 is an active index like in C. I kinda got the two mixed up
__________________



One Vision. One Purpose.
Through leadership in Kane, we seek a new Tiberium future.
Our stealth and advanced weaponry will bring swift death to any who oppose us.
PEACE THRU POWER!


Warlock-Rauteus - Zy-el Necromancer - Level 143 of 10000

My Personal Blog Page - Updated every Friday
Join the Phantasy Star Online sensation - ChrisH36
Chris is online now   Reply With Quote
 
Reply

Get rid of all these ads! Take 30 seconds to register.

« Changing attack characteristics | auto cast? »

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 +1. The time now is 06:35 AM.



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