• 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] Reloading and ammo system

Status
Not open for further replies.
Level 13
Joined
Sep 24, 2007
Messages
1,023
i was wondering if anyone nos where i could find a good ammo system or if you could help me make one if you dont no what im talking aobut ill explain
i want it so that you can equit guns and you need ammo in the gun for it too be able to shoot and once the in the gun runs out if you click on the gun in ur iventory and you have ammo in ur iventory it puts ammo in the gun
 
Level 13
Joined
Sep 24, 2007
Messages
1,023
whats mpi and mui i tihnk the board displaying the ammo would be a nice touch the gun would probly be
Gun Type Ammo used
Pistol Pistol ammo
Sniper rifle ammo
Semiautorifle rifle ammo
fullautorifle rifle ammo
machinegun machinegunammo
flame thrower nappalm cylinders
 
Level 29
Joined
Jul 29, 2007
Messages
5,174
Then I guess you don't have... lol.

JNGP (Jass New Gen Pack) is a hacked version of the normal WE (World Editor).
It allows you to use some new options in the overall use of the WE and it enchances Jass by allowing us to use vJass (which pretty much simulates OOP progamming languages) and some other usefull things.

If you do not use Jass its suggested. If you use Jass, its a must.
 
Level 29
Joined
Jul 29, 2007
Messages
5,174
This is an example of two ammo types.

Variables used:

AmmoTypeOne - Integer, arrayed, initial value 0
AmmoTypeTwo - Integer, arrayed, initial value 0
(you can put more then 0 if you want the players to start with ammo)

  • Ammunition
    • Events
      • Unit - A unit Uses an item
    • Conditions
      • Or - Any (Conditions) are true
        • Conditions
          • (Item-type of (Item being manipulated)) Ammo_Item_One
          • (Item-type of (Item being manipulated)) Equal to Ammo_Item_Two
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Item-type of (Item being manipulated)) Ammo_Item_One
        • Then - Actions
          • Set AmmoTypeOne[(Player number of (Owner of (Triggering unit)))] = (AmmoTypeOne[(Player number of (Owner of (Triggering unit)))] + (Charges remaining in (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)) Ammo_Item_Two
            • Then - Actions
              • Set AmmoTypeTwo[(Player number of (Owner of (Triggering unit)))] = (AmmoTypeTwo[(Player number of (Owner of (Triggering unit)))] + (Charges remaining in (Item being manipulated)))
            • Else - Actions

As you can see, you will need your ammo items to have a instant (no target) spell that will allow you to equip them.
You can also pretty easly set a maximum of bullets if you want.
 
Status
Not open for further replies.
Top