• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.
  • The Hive's 22nd Icon Contest: Creep Abilities is now concluded, time to vote for your favourite set of icons! Click here to vote!
  • ✅ The POLL for Hive's Texturing Contest #34 is OPEN! Vote for the TOP 3 SKINS! 🔗Click here to cast your vote!
  • ✅ The POLL for Hive's Techtree Contest #20 is OPEN! Vote for the TOP 3 FACTIONS! 🔗Click here to cast your vote!

Upkeep

Status
Not open for further replies.
Level 18
Joined
Mar 21, 2011
Messages
1,622
hi,
i want to customize my upkeep. now what i want to do is change the actual food used via trigger.
at first i thought about just creating a unit for the triggering player with foodcost 1 for each action, but there are 8 players and it could get laggy if there are too much units on map.
then i thought about directly changing the food cost of a unit (current food cost + 1), but i didnt found it in trigger editor.
is there any solution?
ty
 
i dont think it is possible with trigger changeing the unit food cost :/ or atleast i dont got any action for it, i got action for check unit food cost is enable or no or what is the unit food cost but not for change it

JASS:
SetUnitUseFood      takes unit whichUnit, boolean useFood returns nothing
constant native GetUnitFoodUsed     takes unit whichUnit returns integer
constant native GetUnitFoodMade     takes unit whichUnit returns integer
constant native GetFoodUsed         takes integer unitId returns integer
constant native GetFoodMade         takes integer unitId returns integer
 
If this could help you more:

Change the icon in the Interface of the food to your choice
Be sure that all units appearing in your map have 0 food cost [hard work if your map isn't recently made]

you can change all the text appearing when pointing on the food in the game interface

Finally triggers:
This is an example of a trigger which shows the amount of units rescued over the amount of units that need to be rescued

  • Initialization
    • Events
      • Time - Elapsed game time is 0.00 seconds
    • Conditions
    • Actions
      • Unit Group - Pick every unit in (Units of type Rescue unit) and do (Actions)
        • Loop - Actions
          • Unit - Make (Picked unit) Rescuable by Player Group - Player 1 (Red)
      • Player - Set Player 1 (Red) Food cap to 10
      • -------- Player 1 needs to rescue 10 units --------
      • Player - Set Player 1 (Red) Food used to 0
      • -------- Player 1 have not rescued any unit yet (0) --------
  • Rescue
    • Events
      • Unit - A unit Is rescued
    • Conditions
    • Actions
      • Player - Set Player 1 (Red) Food used to ((Player 1 (Red) Food used) + 1)
      • Game - Display to (All players) the text: (((Name of Player 1 (Red)) + has rescued ) + ((((String((Player 1 (Red) Food used))) + /) + (String((Player 1 (Red) Food cap)))) + units))
 
Status
Not open for further replies.
Back
Top