• 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.

Ammo System

Status
Not open for further replies.
You can use a custom Attack abilit. Go to your unit, scroll to Combat - Attack 1 - Show UI -> False. Then, go to Combat - Acquisiton range and set it to 0.
Then, triggers:
  • Trigger
  • Events
    • Unit - A unit is attacked
  • Conditions
    • (Current gold of (Owner of (Attacking unit)) Equal to 0
  • Actions
    • Unit - Order (Attacking unit) to Stop
    • Game - Display to (Player Group (Owner of (Attacking unit))) the text "Not enough ammo."
  • Trigger
  • Events
    • Map Initialization
  • Conditions
  • Actions
    • Custom script: set bj_wantDestroyGroup = true
    • Unit Group - Pick every unit in (Units in (Playable Map Area)) and do (Actions)
      • Loop - Actions
        • Trigger - Add to Trigger3 <gen> the event (Unit - (Picked unit) takes damage)
  • Trigger2
  • Events
    • Unit - A unit enters (Playable Map Area)
  • Conditions
  • Actions
    • Trigger - Add to Trigger3 <gen> the event (Unit - (Triggering unit) takes damage)
  • Trigger3
  • Events
  • Conditions
    • (Current gold of (Owner of (Damage source)) Not Equal to 0
  • Actions
    • Player - Add -1 to (Owner of (Damage source)) Current gold
 
Last edited:
Ok, in your Trigger2 trigger, under the Unit Group, you placed (Triggering unit), when it should be (Picked unit). My bad on something. I told you to hide the Attack ability, because I initially thought of an alternative solution, then scratched that, but forgot to delete that UI I suggested. Here:
 

Attachments

  • Alien - Extinction.w3x
    363.3 KB · Views: 47
Status
Not open for further replies.
Top