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

Status
Not open for further replies.
This a system or a trigger?
Just wondering.
If it a trigger, how do i make guns use ammo?
Not including multiboard.
Like items.
Something like:
Events
(dunno what events are)
conditions
[Triggering Unit] has item of type ((Glock)) AND [Triggering Unit] has item of type ((9mm Clip))
Actions
(dont know)
___
Something like that.
 
Download one of the 65464321 ammo systems already created

.. and learn to use your own head! there are 15 movement systems relased to public so what? I Made 2 new ones! there's 100 inventory systems around web! So what? I Made 2 new ones! There are few creep follow systems around web! SO What? I Made myself a new one! And anyway, since bag4 is better inv system i will use it and credit man who made it when i finish map! I wont post "How do i make inventory system?"
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,258
The only trouble I have ever encountered in an ammo saystem was canceling that attack but if I wanted I could always find a way.
You basicly have to run the trigger everytime a unit attacks and if the unit has no ammo it cancels the attack by issuing another order of some kind and if it does have enough ammo it deducts ammo by 1.

Its that simple. . .
 
Level 3
Joined
May 28, 2005
Messages
47
Code:
Event:
Unit Attacks (or whatever)

Code:
Condition:
Unit is unit-type of Rifleunit
And (multiple functions)
Unit is carrying ammopack
Ammo(this is a variable) Greater than or equal to 1

Code:
Actions:
Set Ammo=Ammo-1
Play unit's attack animation
Attack selected unit

I just made this up at the moment. It might not work out. >.<
Spacing is weird when using /
Code:
 Idk why..
 
Level 2
Joined
Apr 17, 2005
Messages
27
I asked the same question, and I figured it out, I used mana for clip size and gold for spare mags, so I still have lumber available, and that way I can adjust clip sized quickly and easily, if you want type of ammo to change, use arrays to save the ammount of ammo for gun X when you change to gun Y and have it change back. This is kind of what the trigger looks like.
Events -
A unit is attacked
Conditions -
NONE
If mana of (attacking unit) in less than or equal to 0
then
Pause attacking unit
(make a reload, set mana to max, set gold to Gold of (owner of (attacking unit))-1
unpause attacking unit unit
Else-
set mana of attacking unit to (mana of (attacking unit)) -1


This is generally what it should look like, but not exaclty, its not difficult to make ur own, it just takes some logic.

Hope this helps!
 
Status
Not open for further replies.
Top