HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

how do you subtract food cap?

09-11-2004, 08:41 PM#1
nouse
Untitled Trigger 002
Events
Map initialization
Conditions
Actions
Player Group - Pick every player in (All players) and do (Player - Set (Picked player) Food cap to 65)


Untitled Trigger 003
Events
Time - Every 2.00 seconds of game time
Conditions
Actions
Player Group - Pick every player in (All allies of Player 11 (Dark Green)) and do (Player - Set (Picked player) Food cap to ((Player 11 (Dark Green) Food cap) - 1))


this is setting my food cap to 42949 on the first trigger execution and it remains at this number for later executions. if i do a trigger with the same syntax as 003 except changing the set to an add -1, the food cap remains unchanged.
09-12-2004, 01:44 AM#2
BuRnInSpartan
you could make a farm with -1 foot stats for the player...
09-12-2004, 02:18 AM#3
nouse
Quote:
Originally Posted by BuRnInSpartan
you could make a farm with -1 foot stats for the player...

and what, add that food value? won't let me add -1 as it is...
09-12-2004, 02:24 AM#4
BuRnInSpartan
what do you mean? if you mean object editor wont let you set -1 as the food cap bonus then do shift enter

well you're right you can't even shift enter
09-12-2004, 06:15 AM#5
JoSanchez55
Advanced-> Gameplay Constants-> Food Limit
09-12-2004, 12:20 PM#6
BuRnInSpartan
that's not gonna work b/c you can't reset the constants after they are set...
09-12-2004, 04:33 PM#7
nouse
Quote:
Originally Posted by JoSanchez55
Advanced-> Gameplay Constants-> Food Limit

ok... let me make this clear... don't think you guys are understanding me...

i want to change the FOOD CAP, as in food CAPACITY...

i think your talking about FOOD MAX...

i have a trigger that increments the food CAPacity just fine... but, i can't get it to decrement it...
09-12-2004, 04:37 PM#8
nouse
see... this will work fine:

Untitled Trigger 004
Events
Time - Every 2.00 seconds of game time
Conditions
Actions
Player - Add 1 to Player 1 (Red) Food cap


try it in a blank map for yourself....

i want to do the opposite of this...
09-12-2004, 04:46 PM#9
nouse
it works by doing it with a unit's mana value like this:

Untitled Trigger 006
Events
Time - Every 5.00 seconds of game time
Conditions
Actions
Unit - Set mana of Tester 0005 <gen> to ((Mana of Tester 0005 <gen>) - 1.00)


Untitled Trigger 005
Events
Time - Every 1.00 seconds of game time
Conditions
Actions
Player - Set Player 1 (Red) Food cap to (Integer((Mana of Tester 0005 <gen>)))


but, i think this is really tacky...
09-12-2004, 04:58 PM#10
nouse
nevermind... i see...

you have to convert the whole arithmetic to an integer, not just the static value your adding to the food cap integer (1.00)...

Untitled Trigger 007
Events
Time - Every 2.00 seconds of game time
Conditions
Actions
Player - Set Player 1 (Red) Food cap to (Integer(((Real((Player 1 (Red) Food cap))) - 1.00)))

this converts the food cap to a real... subtracts a real value of 1.00 from it... then converts it all to an integer... and sets the food cap as this...

still don't really understand why ............

here we go:

Untitled Trigger 009
Events
Time - Every 2.00 seconds of game time
Conditions
Actions
Player - Add (Integer(-1.00)) to Player 1 (Red) Food cap

this is yet another reason to not do anything programming related when you haven't slept in a few days... and to think.. i've been programming for 11 years...
09-13-2004, 12:18 AM#11
BuRnInSpartan
dude that's 100% spam... just edit your post