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)
 
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.
 
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
 
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.
  • V-SNES V-SNES:
    Happy Friday!
    +1
  • The Helper The Helper:
    News portal has been retired. Main page of site goes to Headline News forum now
  • The Helper The Helper:
    I am working on getting access to the old news portal under a different URL for those that would rather use that for news before we get a different news view.
  • Ghan Ghan:
    Easily done
    +1
  • The Helper The Helper:
    https://www.thehelper.net/pages/news/ is a link to the old news portal - i will integrate it into the interface somewhere when i figure it out
  • Ghan Ghan:
    Need to try something
  • Ghan Ghan:
    Hopefully this won't cause problems.
  • Ghan Ghan:
    Hmm
  • Ghan Ghan:
    I have converted the Headline News forum to an Article type forum. It will now show the top 20 threads with more detail of each thread.
  • Ghan Ghan:
    See how we like that.
  • The Helper The Helper:
    I do not see a way to go past the 1st page of posts on the forum though
  • The Helper The Helper:
    It is OK though for the main page to open up on the forum in the view it was before. As long as the portal has its own URL so it can be viewed that way I do want to try it as a regular forum view for a while
  • Ghan Ghan:
    Yeah I'm not sure what the deal is with the pagination.
  • Ghan Ghan:
    It SHOULD be there so I think it might just be an artifact of having an older style.
  • Ghan Ghan:
    I switched it to a "Standard" article forum. This will show the thread list like normal, but the threads themselves will have the first post set up above the rest of the "comments"
  • The Helper The Helper:
    I don't really get that article forum but I think it is because I have never really seen it used on a multi post thread
  • Ghan Ghan:
    RpNation makes more use of it right now as an example: https://www.rpnation.com/news/
  • The Helper The Helper:
  • The Helper The Helper:
    What do you think Tom?
  • tom_mai78101 tom_mai78101:
    I will have to get used to this.
  • tom_mai78101 tom_mai78101:
    The latest news feed looks good

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top