HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Food Production Variation

08-14-2008, 08:16 AM#1
Archi
We meet again, community!

I have a small question to ask. Is it possible to control how much food a farm (for instance) produces using triggers only?

Any answer would be much appreciated :)
That is if it relates to my question :P

Thanks in advance!
08-14-2008, 09:50 AM#2
Pyrogasm
No.

Well, yes, but it would involve the farms not actually granting any food and instead having dummy units which provide 1 food each that you can give to the players in the proper quantities to make it seem as though the food given by a farm is dynamic in some way, shape, or form.
08-14-2008, 10:09 AM#3
Alexander244
You are able to control the food resource by triggers:
Collapse JASS:
native SetPlayerState takes player whichPlayer, playerstate whichPlayerState, integer value returns nothing
constant native GetPlayerState takes player whichPlayer, playerstate whichPlayerState returns integer

PLAYER_STATE_RESOURCE_FOOD_CAP
PLAYER_STATE_RESOURCE_FOOD_USED
08-14-2008, 10:16 AM#4
Captain Griffen
Alexander is right.

Yet you cannot alter how much food it shows as produced on the UI, unless you have multiple units.
08-14-2008, 10:16 AM#5
Pyrogasm
Really?
I didn't know that XD

Edit: Referring to Alexander, not Griffen
08-14-2008, 11:51 AM#6
rulerofiron99
If there is a small variation and you absolutely need the farm to show how much food is produced, make a copy of the unit for each different value, and use triggers to replace. Looks better than triggering food amounts, but adds up in terms of map size and load time.
08-14-2008, 12:21 PM#7
Archi
At this time, I'm using the replace unit trigger.
Quote:
Originally Posted by Alexander244
You are able to control the food resource by triggers:
JASS, huh? Any chance it might be possible with regular GUI?
08-14-2008, 12:32 PM#8
Tide-Arc Ephemera
It is. As far as I know, under the same Gold/Wood giving and taking command, food is also listed.
08-14-2008, 12:37 PM#9
Archi
Quote:
Originally Posted by Tide-Arc Ephemera
It is. As far as I know, under the same Gold/Wood giving and taking command, food is also listed.
Which Gold/Wood giving and taking command are you refering to?

The:
Trigger:
Player - Set Player 1 (Red) Current gold to 750
08-14-2008, 12:40 PM#10
Tide-Arc Ephemera
Yeah. That one and the other one that adds instead of sets.
08-14-2008, 12:41 PM#11
Fledermaus
Yes, pull the "Current gold" menu down and you should find 3 things referring to food: Food used, Food cap and Food max.