• 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] Shooting System

Status
Not open for further replies.
Level 3
Joined
Oct 4, 2007
Messages
27
Hi guys,
I need a Special System for my Suriver Map:
I want a System like in Resident Evil;Where you have Weapons and Amornitions and if you shoot you loose it.


Thx :infl_thumbs_up:

Sry but i dont know how to write :)
 
Level 4
Joined
Dec 16, 2007
Messages
134
First of all let us say the Ammo is your lumber. Therefore you ill change the Icon of the Lumber into an Icon of whatever Ammo you like by importing things.You can change the Icon of Lumber in the Advanced and then Game Interface...

And then after that you should put this things on your Trigger Editor (F4):

  • Untitled Trigger 003
    • Events
      • Unit - A unit Is attacked
    • Conditions
    • Actions
      • Player - Add -1 to (Owner of (Attacking unit)) Current lumber
This trigger is to Subtract/Deduct 1 lumber/ammo from the owner of attacking unit.

  • Untitled Trigger 006
    • Events
      • Unit - A unit Is attacked
    • Conditions
      • ((Owner of (Attacking unit)) Current lumber) Equal to 0
    • Actions
      • Unit - Order (Attacking unit) to Stop
This trigger will stop the attacking unit if its owner has no Lumber/Ammo.

Hope it Works to you.:infl_thumbs_up:
 
Level 20
Joined
Oct 21, 2006
Messages
3,230
But that trigger has a problem.


You lose one lumber even if your unit only begins to play the attack animation.

So if you press Stop always when you're going to attack, you don't make any damage if attack animation stops and
the lumber is lost always when the attack animation begins.
 
Level 3
Joined
Oct 4, 2007
Messages
27
Hmm thx but i need a trigger for many weapons e.z. and so i cant do this with this simple trigger and there are many bugs too like Super-Sheep said.

I need something in Resident Evil Style :?
 
Level 3
Joined
Oct 4, 2007
Messages
27
Hmm i dont know which you played but i mean Ammunation that is like an item and is only variable for some Weapons...
 
Level 29
Joined
Jul 29, 2007
Messages
5,174
It doesn't matter wether you use gold,lumber,items with charges,leaderboard, or whatever else you can come up with.

It will still take your ammo when you are starting to shoot because the event "A Unit is Attacked" refers to when the unit STARTS to attack.

If you want him to actualy attack you need a damage detection system.
 
Level 4
Joined
Dec 16, 2007
Messages
134
It doesn't matter wether you use gold,lumber,items with charges,leaderboard, or whatever else you can come up with.

It will still take your ammo when you are starting to shoot because the event "A Unit is Attacked" refers to when the unit STARTS to attack.

If you want him to actualy attack you need a damage detection system.

If he will do that trigger, I am sure that if the attack missed, the lumber/ammo of the owner of unit will not be deducted.
 
Level 6
Joined
Feb 12, 2008
Messages
207
If he will do that trigger, I am sure that if the attack missed, the lumber/ammo of the owner of unit will not be deducted.

ya, damage detection system will not deduct ammo if the shot doesnt hits...

i would recommend this (ill make it complete):

Gold = Ammo
Lumber = Magazines

  • Ammo System
    • Events
      • Unit - A unit Is attacked
    • Conditions
      • ((Owner of (Attacking unit)) controller) Equal to User
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Owner of (Attacking unit)) Current gold) Not equal to 0
        • Then - Actions
          • Player - Add -1 to (Owner of (Attacking unit)) Current gold
        • Else - Actions
          • Unit - Order (Attacking unit) to Stop
  • Reload System
    • Events
      • Player - Player 1 (Red)'s Current gold becomes Equal to 0.00
      • Player - Player 2 (Blue)'s Current gold becomes Equal to 0.00
      • Player - Player 3 (Teal)'s Current gold becomes Equal to 0.00
      • Player - Player 4 (Purple)'s Current gold becomes Equal to 0.00
      • Player - Player 5 (Yellow)'s Current gold becomes Equal to 0.00
      • Player - Player 6 (Orange)'s Current gold becomes Equal to 0.00
      • Player - Player 7 (Green)'s Current gold becomes Equal to 0.00
      • Player - Player 8 (Pink)'s Current gold becomes Equal to 0.00
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Triggering player) Current lumber) Not equal to 0
        • Then - Actions
          • Game - Display to (Player group((Triggering player))) the text: Reloading...
          • Wait 5.00 seconds
          • Player - Add -1 to (Triggering player) Current lumber
          • Player - Set (Owner of (Casting unit)) Current gold to 30
        • Else - Actions
          • Game - Display to (Player group((Triggering player))) the text: Out of ammo!
          • Wait until (((Triggering player) Current lumber) Greater than 0), checking every 0.50 seconds
          • Trigger - Run (This trigger) (checking conditions)
I think that will do the right job... (yes, if you attack and then stop, it will sustract a bullet... but what kind of fool will stop attacking when ordered to attack? also... 1 bullet sustracted wont be so bad)

if you need the trigger for a skill named "reload" like in Resident Evil... that reloads a new magazine.. then you will need to use this trigger:

  • ReloadSkill System
    • Events
      • Unit - A unit Finishes casting an ability
    • Conditions
      • (Ability being cast) Equal to Reload
    • Actions
      • Trigger - Run Reload System (checking conditions)
remember to use "SET current gold to 30" so you never get more than 30 rounds in the magazine...
 
Last edited:
Status
Not open for further replies.
Top