Scripts / Variable name for the quantity of ammo for each weapon

Author
Message
Housetroll
9
Years of Service
User Offline
Joined: 12th Jun 2015
Location:
Posted: 3rd Sep 2015 23:01
anyone know what the variable name for the quantity of ammo for each weapon is? I tried just trying to guess it and have had no luck. I made a script to store a bunch of things like weapons and cash but I can't find where the ammo count for each weapon is stored. Help anyone?
PM
smallg
Community Leader
19
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 3rd Sep 2015 23:33
it doesnt exist yet and as you cant get mouse feedback either you can't create it yourself (as you can't detect gun shots)
life\'s one big game

windows vista ultimate

i5 @3.3ghz, 4gb ram, geforce gtx460, directx 11
Housetroll
9
Years of Service
User Offline
Joined: 12th Jun 2015
Location:
Posted: 4th Sep 2015 01:33
Arrrgghhh!!!! Thanks, smallg. I guess I'll just give the player a small amount of each ammo to pick up so they have some to start the level. Thanks, again!
PM
AstrobloodKnight
9
Years of Service
User Offline
Joined: 3rd Aug 2015
Location:
Posted: 4th Sep 2015 10:26
well i kinda have and idea why not set up a shop script then give the player a small amount of money to start and have them buy ammo from a shop at the start using the AddPlayerAmmo(#) and place some ammo box under the map just an idea
PM
Housetroll
9
Years of Service
User Offline
Joined: 12th Jun 2015
Location:
Posted: 4th Sep 2015 18:21
Making a fantasy/melee weapon type game and I finally got a script made to save and load between levels - not going to be a whole lot of merchants in a dungeon or enemy keep.
PM
smallg
Community Leader
19
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 4th Sep 2015 19:41
yh do it left4dead style and set up a choice of weapons at the start but you're limited to only 1 or 2 maybe
life\'s one big game

windows vista ultimate

i5 @3.3ghz, 4gb ram, geforce gtx460, directx 11
Housetroll
9
Years of Service
User Offline
Joined: 12th Jun 2015
Location:
Posted: 4th Sep 2015 21:25 Edited at: 4th Sep 2015 21:29
I actually have it set to save up to 10 weapons - sword, dagger, halberd, crossbow, bow, mace, hatchet, flail, slingshot, and staff (staff doesn't show up in the HUD tho - not sure why unless they never created one (from fantasy pack)). Then it reloads all the weapons you have from the previous level into you using addweapon, plus the health, lives, a cash variable and a couple of more - works fine but you have to place a weapon of each type in the each level and change the script so that it recognizes the entity numbers of each weapon. I made them not spawn at start and it adds them back just fine. I put them out for anyone to use on the thread called Save/Load. Just change the load script to use the names of each weapon in your game and expand the list on both save and load scripts to account for all your weapons.
PM
AstrobloodKnight
9
Years of Service
User Offline
Joined: 3rd Aug 2015
Location:
Posted: 5th Sep 2015 19:12 Edited at: 5th Sep 2015 19:14
then why not set up a script like the one a provided and set it on a box when the play presses e on it then you could give them around ammo based on the id of the item also you could set it on a box and have it toggled and destroy itself after words
PM
Housetroll
9
Years of Service
User Offline
Joined: 12th Jun 2015
Location:
Posted: 5th Sep 2015 20:19 Edited at: 5th Sep 2015 20:21
Yeah, I was just thinking to have the ammo as not spawned then as the weapon is loaded it spawns the ammo and they'd be right on top of it so it'd load automatically along with weapon. Really a simple fix as long as you don't mind reloading their ammo to full or whatever you estimate they should have left. It'll work. If I could just count how many times they fire that specific weapon, I could just spawn that many to reload them to what they had at the end of the previous level.
PM

Login to post a reply

Server time is: 2024-12-22 05:26:03
Your offset time is: 2024-12-22 05:26:03