• 🏆 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!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

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: 44
Status
Not open for further replies.
Top