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

[Trigger] ammo system

Status
Not open for further replies.
Level 6
Joined
Apr 30, 2008
Messages
153
ok so i think i started off good
  • leaderboard setup
    • Events
      • Time - Elapsed game time is 0.00 seconds
    • Conditions
    • Actions
      • Leaderboard - Create a leaderboard for (All players) titled Ammo
      • Leaderboard - Add Player 1 (Red) to (Last created leaderboard) with label ammo and value lives
      • Leaderboard - Change the color of all labels for (Last created leaderboard) to (0.00%, 100.00%, 0.00%) with 0.00% transparency
      • Leaderboard - Show (Last created leaderboard)
  • ammo lost
    • Events
      • Unit - A unit Is attacked
    • Conditions
      • ((Attacking unit) is A Hero) Equal to True
    • Actions
      • Set lives = (lives - 1)
      • Leaderboard - Change the value for Player 1 (Red) in (Last created leaderboard) to lives
      • Trigger - Run defet <gen> (checking conditions)
  • out of ammo
    • Events
    • Conditions
      • ammo Less than or equal to 0
    • Actions
but i do not know how to make it so that after ammo reches zero you cant atack anymore is there such a trigger to do so if so what?
 
Level 24
Joined
May 9, 2007
Messages
3,563
Or,

  • Ammo
    • Events
      • Unit - A unit Is attacked
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Mana of (Attacking unit)) Greater than 0.00
        • Then - Actions
          • Unit - Set mana of (Attacking unit) to (((Mana of (Attacking unit)) - 1.00) + 0.00)
        • Else - Actions
          • Unit - Order (Attacking unit) to Stop
This uses mana as ammo.

Alternitavley you could use Custom Value as well and have an ability show that.
 
Ok its ready... i think.

Ill post the map as well.

The one problem with this system is that the triggers affect all units, so if you are using units other than the gunners it could be difficult.

  • Ammocounter
    • Events
      • Time - Every 0.01 seconds of game time
    • Conditions
    • Actions
      • Player - Set (Owner of Attacker) Food cap to (Charges remaining in (Item carried by Attacker of type Chaingun Ammo Clip))
      • Player - Set (Owner of Attacker) Food used to (Charges remaining in (Item carried by Attacker of type Chaingun Bullets))
  • Ammodrain
    • Events
      • Unit - A unit Is attacked
    • Conditions
    • Actions
      • Set Attacker = (Attacking unit)
      • Item - Set charges remaining in (Item carried by Attacker of type Chaingun Bullets) to ((Charges remaining in (Item carried by Attacker of type Chaingun Bullets)) - 1)
  • Ammozero
    • Events
      • Time - Every 0.01 seconds of game time
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Charges remaining in (Item carried by Attacker of type Chaingun Bullets)) Equal to 0
        • Then - Actions
          • Item - Remove (Item carried by Attacker of type Chaingun Bullets)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Charges remaining in (Item carried by Attacker of type Chaingun Ammo Clip)) Greater than 0
            • Then - Actions
              • Item - Set charges remaining in (Item carried by Attacker of type Chaingun Ammo Clip) to ((Charges remaining in (Item carried by Attacker of type Chaingun Ammo Clip)) - 1)
              • Hero - Create Chaingun Bullets and give it to Attacker
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Charges remaining in (Item carried by Attacker of type Chaingun Ammo Clip)) Equal to 0
                • Then - Actions
                  • Item - Remove (Item carried by Attacker of type Chaingun Ammo Clip)
                • Else - Actions
            • Else - Actions
        • Else - Actions
  • Ammozeroattack
    • Events
      • Unit - A unit Is attacked
    • Conditions
      • ((Attacking unit) has an item of type Chaingun Ammo Clip) Equal to False
      • ((Attacking unit) has an item of type Chaingun Bullets) Equal to False
    • Actions
      • Unit - Order (Attacking unit) to Stop
I am sure it works but there might be a few bugs.
 

Attachments

  • ammunitionsystemV1.2.w3x
    19.4 KB · Views: 36
Last edited:
Status
Not open for further replies.
Top