• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

[Trigger] Army Supply System

Status
Not open for further replies.
Level 2
Joined
May 21, 2016
Messages
5
Hello there! Currently working on a map based in the Napoleonic era called "Age of Napoleon" basically an 8 player RTS map similar to Napoleon Total War.

Anywho as Napoleon was famously defeated after overextending his supply lines deep into Russia and losing his army on the ensuing retreat, I figured a supply system of some sort would be a nice touch.

I've been trying to modify this system I found in the resources:
Hunger System 1.1 GUI bar version

However I'm having trouble "Decreasing Hunger" without using items. I'd much rather Armies have to move from City to City to gain "supplies" through an aura of some sort.

Any help great appreciated! And of course credits will be give in-game if
 
Level 39
Joined
Feb 27, 2007
Messages
5,017
You can hack apart the "Descrease Hunger" trigger into your open periodic check to feed units if they're under the effect of an aura:
  • Events
    • Time - Every 1.00 seconds of game-time
  • Conditions
  • Actions
    • For each (Integer HU2) from 1 to HU_Times, do (Actions)
      • Loop - Actions
        • If (all conditions are true) then do (actions) else (actions)
          • If - Conditions
            • (HU_Unit[HU2] has buff YOUR_AURA) equal to true
          • Then - Actions
            • -------- You might need to change some of these values, idk how the system works --------
            • Set HU_Value[HU2] = (HU_Value[HU2] + (Random real number between HU_DescreaseFrom[HU3] and HU_DescreaseTo[HU3]))
            • Unit - Set life of (HU_Unit[HU2]) to ((Life of (HU_Unit[HU2])) + (Random real number between HU_HealFrom[HU3] and HU_HealTo[HU3]))
          • Else - Actions
 
Status
Not open for further replies.
Top