| 08-14-2008, 08:16 AM | #1 |
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 |
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 |
You are able to control the food resource by triggers: 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 |
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 |
Really? I didn't know that XD Edit: Referring to Alexander, not Griffen |
| 08-14-2008, 11:51 AM | #6 |
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 | |
At this time, I'm using the replace unit trigger. Quote:
![]() |
| 08-14-2008, 12:32 PM | #8 |
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 | |
Quote:
The: Trigger: Player - Set Player 1 (Red) Current gold to 750 |
| 08-14-2008, 12:40 PM | #10 |
Yeah. That one and the other one that adds instead of sets. |
| 08-14-2008, 12:41 PM | #11 |
Yes, pull the "Current gold" menu down and you should find 3 things referring to food: Food used, Food cap and Food max. |
