HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

the math in wc3

09-14-2003, 03:19 AM#1
Crimsongg137
ok i dont under stand the math thing in wc3.. for example if i wanted to have an income of 10 then i make a unit then that will make the income to 4.(lets say) then lets say i have a stroage vault that will hold the income amout say the limite is 15 and i have 20 income it will stay at 15 until another 1 is made to increse the income.. understand?? or no..
09-14-2003, 03:29 AM#2
Thunder-Hunter
so ur saying 1 vault = +15 gold space? I know its possible.. Let me mess with the editor and see what I get.
09-14-2003, 03:43 AM#3
Crimsongg137
sure thing"
ok but say if i add a buildin (barrack) lets say that gives me +2 income for each a player owns...
09-14-2003, 04:14 AM#4
Raptor--
i think what you want to do is have 'maxgold' as a variable that is increased/decreased whenver stuff is built/destroyed, and have whenever income is collected, do and if statement and if 'current gold' is greater than 'maxgold' then set gold to maxgold
09-14-2003, 04:29 AM#5
Pesmerga
Check out a sheeptag map, theres a trigger that counts all money farms and gives them +1 gold every 5 seconds or so.
09-14-2003, 05:13 AM#6
Norbo
ResDepotMax is an integer variable (array if wanted).
NumOfBuilding1 is an integer variable (array if wanted).
Income is an integer variable (array if wanted).
Code:
ResDepotMax = (Number of units in (units owned by player X of type ResDepot)) x 70

NumOfBuilding1 = (Number of units in (units owned by player X of type Building1))

Income = (NumOfBuilding1 x 2) + (any other money variables)

if(ResDepotMax < Income)
    Income = ResDepotMax
else
    nothing

Add Income to player X current gold


That's not in jass or anything.. but there ya go..

I know exactly what you are trying to do. Mwahhaa.

You'd put that on a periodic event or something, probably.
09-14-2003, 02:00 PM#7
Crimsongg137
ok thanx norbs