Scripts / ammo from an entity

Author
Message
MChapman
9
Years of Service
User Offline
Joined: 19th May 2015
Location: USA
Posted: 21st Aug 2016 21:02
What I have is the supply entity from the "box" catagory, this object when i press e should give me 50 ammo for all guns. Now i tried a few things from the global.lua but to no prevail so i searched and got this thread
https://forum.game-guru.com/thread/212281
is this still the only way of doing this? I wasn't sure if (with the recent updates) this was still the only method of doing this.
Markchapman10 is my Skype let's have some dev talk.
smallg
Community Leader
19
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 21st Aug 2016 23:26
yep, that's still the only way.
lua guide for GG
https://steamcommunity.com/sharedfiles/filedetails/?id=398177770
windows 10
i5 @4ghz, 8gb ram, AMD R9 200 series , directx 11
MChapman
9
Years of Service
User Offline
Joined: 19th May 2015
Location: USA
Posted: 22nd Aug 2016 03:38
with all the weapon checks i had assumed they were new since the question had been asked last year. With all the weapon checks and variables you think someone could make a way of checking if you had the gun then you could simulate the entity some how.
Markchapman10 is my Skype let's have some dev talk.
pepesilvia
8
Years of Service
User Offline
Joined: 8th Jul 2016
Location:
Posted: 22nd Aug 2016 13:05
You mean like this? Here I put my "search for ammo" boxes that I'm using scattered around in my maps, and I just used this to add x50 ammo to all weapons: SetWeaponPoolAmmo ( index, pool ammo quantity ) -- Sets the weapon data directly, index is 1 through 10 (from the global file, and grenades are 10 I think)

That way there's no need to place the ammo entity somewhere on the map to spawn it via ActivateIfUsed(e) or AddPlayerAmmo(e)

PM
smallg
Community Leader
19
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 22nd Aug 2016 14:43
hadnt seen that, i last tried with g_PlayerGunAmmoCount = 0 and g_PlayerGunClipCount = 0 and those didn't work so not sure when those new commands got added, thanks pepesilvia for correcting me

so to answer the original question
-- Weapon stats
g_WeaponSlotGot = {}
g_WeaponSlotPref = {}
g_WeaponAmmo = {}
g_WeaponClipAmmo = {}
g_WeaponPoolAmmo = {}

sounds exactly like what you're after
lua guide for GG
https://steamcommunity.com/sharedfiles/filedetails/?id=398177770
windows 10
i5 @4ghz, 8gb ram, AMD R9 200 series , directx 11
MChapman
9
Years of Service
User Offline
Joined: 19th May 2015
Location: USA
Posted: 23rd Aug 2016 02:00 Edited at: 23rd Aug 2016 02:12
those were the variables i was looking at, ill play with them again and see what i can do, here is what I was working with before. I have changed the script quite a bit to try different things. I assumed weapon pool was ammo as a whole? but then i checked to see if weapon slot ( what i assumed was the players slot buttons 1 - 10) my script was blank i had already set it up to do somethign else lol.... sorry... I'll put it in anyways...If i get off work tommorow at a decent hour ill fill in the if g_KeyPressedE.




Markchapman10 is my Skype let's have some dev talk.
pepesilvia
8
Years of Service
User Offline
Joined: 8th Jul 2016
Location:
Posted: 24th Aug 2016 07:38
Sorry for the late response

@smallg: It's the man himself I learned a lot from your scripts thanks for all the great work! Yeah I ran into the same issue thinking gunclip should be the total amount allocated, so out of curiosity I decided to try the ammo pool (which I saw in the gunspec files) and it worked. The slot index didn't make sense to me either with 4 being pistol ammo pool, but then again I guess they assigned all the medieval weapon projectiles to the first 3. Just my personal preference and opinion, but I would have made them the last 3, with modern weapons being first. The new commands looks like they were added with 1.13 I believe, and I actually didn't notice them until I watched one of those GG videos on youtube.
PM
MChapman
9
Years of Service
User Offline
Joined: 19th May 2015
Location: USA
Posted: 26th Aug 2016 05:39 Edited at: 26th Aug 2016 06:04
So if I have some store bought guns what would the index be? cause I have the first set of modern weapons and .... So I need a variable index so no matter what gun I have using this will give the player 50 ammo for all the weapons ( obtained ). So what I'm going to is find out where the weapon index is.\, probably in the weapon fpe? and then go from there. Hopefully this little bit of info will give me what I'm looking for.

Edit: No luck finding the weapon id? in the fpe it just says that it is ammo. did you trial and error to get find the indexs? lol, if thats true I'm sorry you had to do it that way.
Markchapman10 is my Skype let's have some dev talk.
Belidos
3D Media Maker
9
Years of Service
User Offline
Joined: 23rd Nov 2015
Playing: The Game
Posted: 26th Aug 2016 06:09 Edited at: 26th Aug 2016 08:39
It will be in the weapons gunspec fle, they're located somewhere in the files/gamecore folder

i5, NV960 2GB, 16GB memory, 2x 2TB Hybrid, Win10.
i3 , Intel integrated graphics, 6GB memory, 512GB Generic SATAIII Win8.1.
Intel Celeron (duel Core), Radeon integrated graphics, 4GB memory, 180gB Generic SATAII, WinVista.
Q6600, Intel integrated graphics, 8GB memory, 512GB Generic SATAII, Win7.
MChapman
9
Years of Service
User Offline
Joined: 19th May 2015
Location: USA
Posted: 26th Aug 2016 06:21
lol, I was in the process of trying all the index's and trying to get ammo from my supply drop.
Markchapman10 is my Skype let's have some dev talk.
pepesilvia
8
Years of Service
User Offline
Joined: 8th Jul 2016
Location:
Posted: 26th Aug 2016 07:40
[quote= did you trial and error to get find the indexs? lol, if thats true I'm sorry you had to do it that way.]

LOL yeah I had loads of fun figuring it out, but actually didn't take as long as I expected to log them all down. It really doesn't matter what guns you get, as all that matters is what ammo pool that gun is assigned to. In the gunspec file, for example, I could change both my pistol and the default 1911 to collect crossbow arrows if I wanted to. The index number references the ammo pool type(not the weapon), so if I was to write this: SetWeaponPoolAmmo ( 4, 28 ) -- then it would would instantly add 28 ammo from the pistol ammo pool to share with all guns that are currently assigned to this pool through the gunspec file
PM

Login to post a reply

Server time is: 2025-01-05 06:47:55
Your offset time is: 2025-01-05 06:47:55