Ammo System?

Kyzer

New Member
Reaction score
0
Hey, I've looked all over and cant find this system, which i'm fairly sure exists SOMEWHERE. Same one used in the map "I AM LEGEND" where, you pick up a weapon, say a SMG, that starts with 25 ammo (charges). Ammo is stored in Lumber, and every time you attack a charge from your weapon goes away, when it reaches 0, it reloads it to its full charge (25) and takes away 25 lumber. Does anyone know of a system using this?

P.S. (In I am legend, actually USING the weapon changes the hero to one with different attack/attack speed/type etc., which then uses the weapon's ammo depending on what hero it is)
 

LostFlip

New Member
Reaction score
0
Have you tried looking for it in HiveWorkshop.com? i think i saw one there, but not exactly like the one on i am legend.
 

onejube

New Member
Reaction score
1
I...

I had the same problem as you, what I've done is made an ability which costs 1 mana every use and the ability gives the unit 8 mana (8 Bullets). The unit has no mana regen and to reload you can either use a trigger

Trigger:
  • Events
    • Unit - Paladin 0001 <gen>'s mana becomes Less than 1.00
    • Conditions
    • Actions
      • Wait 5.00 seconds
      • -------- Reload --------
      • Unit - Set mana of (Triggering unit) to 100.00%



or have an item to replenish mana
 

TheAbyss

New Member
Reaction score
2
You could also do it with variables. One way would be to store every single different gun in the game to an item array and then store their ammo amounts to an integer array, but that problably would cause a bit of lag, and wouldn't work if you can buy guns (well, there would be a maximum to how many guns can be in the game at once).

So, the much easier way would be to make it so that every unit that can use a gun is set to a unit OR player array (this would work best if each player only has one gunner) and then make a variable array to match that (Variable[1] is Unit/Player[1]'s ammo, etc.) and then whenever the unit drops their gun, you would set the item's custom value to it's leftover ammo, and then set the variable to custom value of a gun when you pick it up.

All this trouble is because I'm not sure if you can set an item's custom value when it's being held, if you CAN do that, then you could just always set the custom value to the ammo left in the gun.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top