- Joined
- Nov 26, 2007
- Messages
- 1,964
Ok so i've got this ammo clipish system in my map. It uses this bullet system which I kinda made which works fine but the clip system doesnt.
No ammo is depleted from the user, I'm not even sure if reloading works because no ammo is removed so...
Anyway, this is a long list of triggers so bare with me:
Shotguntrue and Battlerifletrue are Boolean arrays.
Items is an Item var (Duh) and Item charges is an integer.
This trigger is supposed to change the unit and equip him with the gun. I use the boolean for the other triggers.
The booleans here are used because I want the hero to only be able to reload the gun if he is actually using it. Here I used the Item vars (Shotgun and Battlerifle) that I set earlier.
What this does is that, if you are equipped a gun and drop it you are replaced with a weaponless marine. I think this one should be working..
Ya thats pretty much it... This is my first time trying to make a system like this and I just winged it and guessed how it was made putting together this piece of larf.
Equipping the gun works fine, drop/aquire detection seems to work. But charges or ammo doesnt deplete from the gun when fired.
So any ideas? I hope someone bothers to read through all of this mess... (Ya i'm a messy triggerer)
No ammo is depleted from the user, I'm not even sure if reloading works because no ammo is removed so...
Anyway, this is a long list of triggers so bare with me:
-
Equpping
-
Events
-
Unit - A unit Starts the effect of an ability
-
-
Conditions
-
Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
(Ability being cast) Equal to Battlerifle
-
Battlerifletrue[(Player number of (Owner of (Hero manipulating item)))] Equal to False
-
-
Then - Actions
-
Set Shotguntrue[(Player number of (Owner of (Hero manipulating item)))] = False
-
Set Battlerifletrue[(Player number of (Owner of (Hero manipulating item)))] = True
-
Sound - Play Reload <gen> at 100.00% volume, attached to (Hero manipulating item)
-
Set Items[1] = (Item carried by (Casting unit) in slot 1)
-
Set Itemcharge[1] = (Charges remaining in (Item carried by (Casting unit) in slot 1))
-
Set Items[2] = (Item carried by (Casting unit) in slot 2)
-
Set Itemcharge[2] = (Charges remaining in (Item carried by (Casting unit) in slot 2))
-
Set Items[3] = (Item carried by (Casting unit) in slot 3)
-
Set Itemcharge[3] = (Charges remaining in (Item carried by (Casting unit) in slot 3))
-
Set Items[4] = (Item carried by (Casting unit) in slot 4)
-
Set Itemcharge[4] = (Charges remaining in (Item carried by (Casting unit) in slot 4))
-
Set Items[5] = (Item carried by (Casting unit) in slot 5)
-
Set Itemcharge[5] = (Charges remaining in (Item carried by (Casting unit) in slot 5))
-
Set Items[6] = (Item carried by (Casting unit) in slot 6)
-
Set Itemcharge[6] = (Charges remaining in (Item carried by (Casting unit) in slot 6))
-
Unit - Replace (Casting unit) with a Battle Rifle using The old unit's relative life and mana
-
For each (Integer A) from 1 to 6, do (Hero - Give Items[(Integer A)] to (Last replaced unit))
-
For each (Integer A) from 1 to 6, do (Item - Set charges remaining in (Item carried by (Last replaced unit) in slot (Integer A)) to Itemcharge[(Integer A)])
-
Unit - Set (Last replaced unit) acquisition range to 0.00
-
Selection - Select (Last replaced unit) for (Owner of (Last replaced unit))
-
Set Playermarine[(Player number of (Owner of (Last replaced unit)))] = (Last replaced unit)
-
-
Else - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
(Ability being cast) Equal to Shotgun
-
Shotguntrue[(Player number of (Owner of (Hero manipulating item)))] Equal to False
-
-
Then - Actions
-
Set Shotguntrue[(Player number of (Owner of (Hero manipulating item)))] = True
-
Set Battlerifletrue[(Player number of (Owner of (Hero manipulating item)))] = False
-
Sound - Play Reload <gen> at 100.00% volume, attached to (Hero manipulating item)
-
Unit - Replace (Casting unit) with a Shotgun using The old unit's relative life and mana
-
Set Items[1] = (Item carried by (Casting unit) in slot 1)
-
Set Itemcharge[1] = (Charges remaining in (Item carried by (Casting unit) in slot 1))
-
Set Items[2] = (Item carried by (Casting unit) in slot 2)
-
Set Itemcharge[2] = (Charges remaining in (Item carried by (Casting unit) in slot 2))
-
Set Items[3] = (Item carried by (Casting unit) in slot 3)
-
Set Itemcharge[3] = (Charges remaining in (Item carried by (Casting unit) in slot 3))
-
Set Items[4] = (Item carried by (Casting unit) in slot 4)
-
Set Itemcharge[4] = (Charges remaining in (Item carried by (Casting unit) in slot 4))
-
Set Items[5] = (Item carried by (Casting unit) in slot 5)
-
Set Itemcharge[5] = (Charges remaining in (Item carried by (Casting unit) in slot 5))
-
Set Items[6] = (Item carried by (Casting unit) in slot 6)
-
Set Itemcharge[6] = (Charges remaining in (Item carried by (Casting unit) in slot 6))
-
Unit - Set (Last replaced unit) acquisition range to 0.00
-
For each (Integer A) from 1 to 6, do (Hero - Give Items[(Integer A)] to (Last replaced unit))
-
For each (Integer A) from 1 to 6, do (Item - Set charges remaining in (Item carried by (Last replaced unit) in slot (Integer A)) to Itemcharge[(Integer A)])
-
Selection - Select (Last replaced unit) for (Owner of (Last replaced unit))
-
Set Playermarine[(Player number of (Owner of (Last replaced unit)))] = (Last replaced unit)
-
-
Else - Actions
-
Do nothing
-
-
-
-
-
-
Shotguntrue and Battlerifletrue are Boolean arrays.
Items is an Item var (Duh) and Item charges is an integer.
This trigger is supposed to change the unit and equip him with the gun. I use the boolean for the other triggers.
-
Aquire
-
Events
-
Unit - A unit Acquires an item
-
-
Conditions
-
Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
(Item-type of (Item being manipulated)) Equal to Battlerifle
-
-
Then - Actions
-
Set HasItemBRIN[(Player number of (Owner of (Hero manipulating item)))] = (HasItemBRIN[(Player number of (Owner of (Hero manipulating item)))] + 1)
-
Set Battlerifle[(Player number of (Owner of (Hero manipulating item)))] = (Item being manipulated)
-
-
Else - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
(Item-type of (Item being manipulated)) Equal to Shotgun
-
-
Then - Actions
-
Set HasItemShottyIN[(Player number of (Owner of (Hero manipulating item)))] = (HasItemShottyIN[(Player number of (Owner of (Hero manipulating item)))] + 1)
-
Set Shotgun[(Player number of (Owner of (Hero manipulating item)))] = (Item being manipulated)
-
-
Else - Actions
-
Do nothing
-
-
-
-
-
-
-
Reloading
-
Events
-
Unit - A unit Uses an item
-
-
Conditions
-
Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
(Item-type of (Item being manipulated)) Equal to Shotgun Shells
-
-
Then - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
Shotguntrue[(Player number of (Owner of (Hero manipulating item)))] Equal to True
-
(Charges remaining in (Item being manipulated)) Greater than 0
-
-
Then - Actions
-
Item - Set charges remaining in Shotgun[(Player number of (Owner of (Hero manipulating item)))] to ((Charges remaining in (Item carried by (Hero manipulating item) of type Shotgun)) + 1)
-
Sound - Play Reload <gen> at 100.00% volume, attached to (Hero manipulating item)
-
Sound - Destroy (Last played sound)
-
-
Else - Actions
-
Do nothing
-
-
-
-
Else - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
(Item-type of (Item being manipulated)) Equal to Rifle clip
-
-
Then - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
Battlerifletrue[(Player number of (Owner of (Hero manipulating item)))] Equal to True
-
(Charges remaining in (Item being manipulated)) Greater than 0
-
-
Then - Actions
-
Item - Set charges remaining in Battlerifle[(Player number of (Owner of (Hero manipulating item)))] to 30
-
Sound - Play Reload <gen> at 100.00% volume, attached to (Hero manipulating item)
-
Sound - Destroy (Last played sound)
-
-
Else - Actions
-
Do nothing
-
-
-
-
Else - Actions
-
Do nothing
-
-
-
-
-
-
The booleans here are used because I want the hero to only be able to reload the gun if he is actually using it. Here I used the Item vars (Shotgun and Battlerifle) that I set earlier.
-
No Multiple Weapons
-
Events
-
Unit - A unit Acquires an item
-
-
Conditions
-
Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
HasItemBRIN[(Player number of (Owner of (Hero manipulating item)))] Equal to 2
-
(Item-type of (Item being manipulated)) Equal to Battlerifle
-
-
Then - Actions
-
Unit - Order (Hero manipulating item) to drop (Item being manipulated) at (Position of (Hero manipulating item))
-
-
Else - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
HasItemShottyIN[(Player number of (Owner of (Hero manipulating item)))] Equal to 2
-
(Item-type of (Item being manipulated)) Equal to Shotgun
-
-
Then - Actions
-
Unit - Order (Hero manipulating item) to drop (Item being manipulated) at (Position of (Hero manipulating item))
-
-
Else - Actions
-
Do nothing
-
-
-
-
-
-
-
Dropping gun
-
Events
-
Unit - A unit Loses an item
-
-
Conditions
-
Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
And - All (Conditions) are true
-
Conditions
-
(Unit-type of (Hero manipulating item)) Equal to Battle Rifle
-
(Item-type of (Item being manipulated)) Equal to Battlerifle
-
-
-
-
Then - Actions
-
Set HasItemBRIN[(Player number of (Owner of (Hero manipulating item)))] = (HasItemBRIN[(Player number of (Owner of (Hero manipulating item)))] - 1)
-
Set Battlerifletrue[(Player number of (Owner of (Hero manipulating item)))] = False
-
Set Items[1] = (Item carried by (Casting unit) in slot 1)
-
Set Itemcharge[1] = (Charges remaining in (Item carried by (Casting unit) in slot 1))
-
Set Items[2] = (Item carried by (Casting unit) in slot 2)
-
Set Itemcharge[2] = (Charges remaining in (Item carried by (Casting unit) in slot 2))
-
Set Items[3] = (Item carried by (Casting unit) in slot 3)
-
Set Itemcharge[3] = (Charges remaining in (Item carried by (Casting unit) in slot 3))
-
Set Items[4] = (Item carried by (Casting unit) in slot 4)
-
Set Itemcharge[4] = (Charges remaining in (Item carried by (Casting unit) in slot 4))
-
Set Items[5] = (Item carried by (Casting unit) in slot 5)
-
Set Itemcharge[5] = (Charges remaining in (Item carried by (Casting unit) in slot 5))
-
Set Items[6] = (Item carried by (Casting unit) in slot 6)
-
Set Itemcharge[6] = (Charges remaining in (Item carried by (Casting unit) in slot 6))
-
Unit - Replace (Hero manipulating item) with a Weaponless using The old unit's relative life and mana
-
For each (Integer A) from 1 to 6, do (Hero - Give Items[(Integer A)] to (Last replaced unit))
-
For each (Integer A) from 1 to 6, do (Item - Set charges remaining in (Item carried by (Last replaced unit) in slot (Integer A)) to Itemcharge[(Integer A)])
-
Unit - Set Playermarine[(Player number of (Owner of (Last replaced unit)))] acquisition range to 1.00
-
Set Playermarine[(Player number of (Owner of (Last replaced unit)))] = (Last replaced unit)
-
-
Else - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
And - All (Conditions) are true
-
Conditions
-
(Unit-type of (Hero manipulating item)) Equal to Shotgun
-
(Item-type of (Item being manipulated)) Equal to Shotgun
-
-
-
-
Then - Actions
-
Set HasItemShottyIN[(Player number of (Owner of (Hero manipulating item)))] = (HasItemShottyIN[(Player number of (Owner of (Hero manipulating item)))] - 1)
-
Set Shotguntrue[(Player number of (Owner of (Hero manipulating item)))] = False
-
Unit - Replace (Hero manipulating item) with a Weaponless using The old unit's relative life and mana
-
Set Items[1] = (Item carried by (Casting unit) in slot 1)
-
Set Itemcharge[1] = (Charges remaining in (Item carried by (Casting unit) in slot 1))
-
Set Items[2] = (Item carried by (Casting unit) in slot 2)
-
Set Itemcharge[2] = (Charges remaining in (Item carried by (Casting unit) in slot 2))
-
Set Items[3] = (Item carried by (Casting unit) in slot 3)
-
Set Itemcharge[3] = (Charges remaining in (Item carried by (Casting unit) in slot 3))
-
Set Items[4] = (Item carried by (Casting unit) in slot 4)
-
Set Itemcharge[4] = (Charges remaining in (Item carried by (Casting unit) in slot 4))
-
Set Items[5] = (Item carried by (Casting unit) in slot 5)
-
Set Itemcharge[5] = (Charges remaining in (Item carried by (Casting unit) in slot 5))
-
Set Items[6] = (Item carried by (Casting unit) in slot 6)
-
Set Itemcharge[6] = (Charges remaining in (Item carried by (Casting unit) in slot 6))
-
Unit - Set Playermarine[(Player number of (Owner of (Last replaced unit)))] acquisition range to 1.00
-
For each (Integer A) from 1 to 6, do (Hero - Give Items[(Integer A)] to (Last replaced unit))
-
For each (Integer A) from 1 to 6, do (Item - Set charges remaining in (Item carried by (Last replaced unit) in slot (Integer A)) to Itemcharge[(Integer A)])
-
Set Playermarine[(Player number of (Owner of (Last replaced unit)))] = (Last replaced unit)
-
-
Else - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
(Item-type of (Item being manipulated)) Equal to Battlerifle
-
-
Then - Actions
-
Set HasItemBRIN[(Player number of (Owner of (Hero manipulating item)))] = (HasItemBRIN[(Player number of (Owner of (Hero manipulating item)))] - 1)
-
-
Else - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
(Item-type of (Item being manipulated)) Equal to Shotgun
-
-
Then - Actions
-
Set HasItemShottyIN[(Player number of (Owner of (Hero manipulating item)))] = (HasItemShottyIN[(Player number of (Owner of (Hero manipulating item)))] - 1)
-
-
Else - Actions
-
Do nothing
-
-
-
-
-
-
-
-
-
-
What this does is that, if you are equipped a gun and drop it you are replaced with a weaponless marine. I think this one should be working..
-
No Ammo
-
Events
-
Unit - A unit Is issued an order targeting an object
-
-
Conditions
-
Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
(Issued order) Equal to (Order(attack))
-
(Unit-type of (Attacking unit)) Equal to Shotgun
-
-
Then - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
(Charges remaining in Shotgun[(Player number of (Owner of (Hero manipulating item)))]) Equal to 0
-
-
Then - Actions
-
Unit - Order (Ordered unit) to Stop
-
Sound - Play No_ammo__u <gen> at 100.00% volume, attached to (Attacking unit)
-
Floating Text - Create floating text that reads Reload! above (Ordered unit) with Z offset 5.00, using font size 9.00, color (100.00%, 0.00%, 0.00%), and 10.00% transparency
-
Floating Text - Show (Last created floating text) for (All players matching ((Owner of (Ordered unit)) Equal to (Matching player)))
-
Floating Text - Change (Last created floating text): Disable permanence
-
Floating Text - Change the lifespan of (Last created floating text) to 0.50 seconds
-
-
Else - Actions
-
Item - Set charges remaining in Shotgun[(Player number of (Owner of (Ordered unit)))] to ((Charges remaining in Shotgun[(Player number of (Owner of (Ordered unit)))]) - 1)
-
Sound - Play shotgun <gen> at 100.00% volume, attached to (Attacking unit)
-
Sound - Destroy (Last played sound)
-
-
-
-
Else - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
(Issued order) Equal to (Order(attack))
-
(Unit-type of (Attacking unit)) Equal to Battle Rifle
-
-
Then - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
(Charges remaining in Battlerifle[(Player number of (Owner of (Hero manipulating item)))]) Equal to 0
-
-
Then - Actions
-
Unit - Order (Ordered unit) to Stop
-
Sound - Play No_ammo__u <gen> at 100.00% volume, attached to (Attacking unit)
-
Floating Text - Create floating text that reads Reload! above (Ordered unit) with Z offset 5.00, using font size 9.00, color (100.00%, 0.00%, 0.00%), and 10.00% transparency
-
Floating Text - Show (Last created floating text) for (All players matching ((Owner of (Ordered unit)) Equal to (Matching player)))
-
Floating Text - Change (Last created floating text): Disable permanence
-
Floating Text - Change the lifespan of (Last created floating text) to 0.50 seconds
-
-
Else - Actions
-
Item - Set charges remaining in Battlerifle[(Player number of (Owner of (Ordered unit)))] to ((Charges remaining in Battlerifle[(Player number of (Owner of (Ordered unit)))]) - 3)
-
Sound - Play Dual <gen> at 100.00% volume, attached to (Attacking unit)
-
Sound - Destroy (Last played sound)
-
-
-
-
Else - Actions
-
Do nothing
-
-
-
-
-
-
Ya thats pretty much it... This is my first time trying to make a system like this and I just winged it and guessed how it was made putting together this piece of larf.
Equipping the gun works fine, drop/aquire detection seems to work. But charges or ammo doesnt deplete from the gun when fired.
So any ideas? I hope someone bothers to read through all of this mess... (Ya i'm a messy triggerer)