Team Spartan Cookies & Milk Forums
Function request - Printable Version

+- Team Spartan Cookies & Milk Forums (https://teamscm.co.uk)
+-- Forum: Garry's Mod (https://teamscm.co.uk/forum-4.html)
+--- Forum: Starfall (https://teamscm.co.uk/forum-7.html)
+--- Thread: Function request (/thread-1284.html)



Function request - Yuri6037 - 25-08-2015

Helo all,

I just want to know why there is no Player:GetAmmoCount function by the way you can disable CHudAmmo and CHudSecondaryAmmo ?
Can we get an access to that function ? I don't see any reason to not have access to this function, the function just gives you ammo count for ammo type, the function does not change any variable on the player.

Thanks by advanced,
Yuri.


RE: Function request - Red The Blue Color - 26-08-2015

Pretty sure there is ammo functions I tried it awhile back on a Starfall Hud most of the weapons always gave nil and some worked really strange


RE: Function request - Yuri6037 - 26-08-2015

There are indeed ammo functions, but only for current clips contents (clip1/clip2) however many weapons are not using any clips they use instead direct weapon ammo decrease on the player's ammo. And the gmod hud renders those weapons which are not using any clips, the Player:GetAmmoCount to display restent ammo.


RE: Function request - Person8880 - 26-08-2015

Why are you asking as if I am intentionally not binding it?

There are hundreds of methods for players, entities etc. Binding them all is a time consuming process (mostly because of the bad root design of Starfall which is not easily changed now everyone's invested in it), so the reason it's not bound is simply because it's one of loads of methods.

Also, Starfall HUDs have the "hudshoulddraw" hook to allow you to hide default HUD elements. Works exactly like the GLua hook, just with a lower cased hook name.


RE: Function request - Yuri6037 - 26-08-2015

(26-08-2015, 05:42 PM)Person8880 Wrote: Why are you asking as if I am intentionally not binding it?

There are hundreds of methods for players, entities etc. Binding them all is a time consuming process (mostly because of the bad root design of Starfall which is not easily changed now everyone's invested in it), so the reason it's not bound is simply because it's one of loads of methods.

Also, Starfall HUDs have the "hudshoulddraw" hook to allow you to hide default HUD elements. Works exactly like the GLua hook, just with a lower cased hook name.

Yes but by the fact you can disable weapon info render, you should be able to GetAmmoCount too. Can't you make it just client side ? So sever wouldn't be overloaded.
Please, I don't ask any other functions, just asking this one just because I'd like to recreate completely the tscm/GMod hud.


RE: Function request - LocInt - 26-08-2015

"So the reason it's not bound is simply because it's one of loads of methods."

Yuri just give up. Person won't make server more laggy just because you ask it.


RE: Function request - Yuri6037 - 26-08-2015

If he makes it client side only / only for huds, then it will not be laggy...

And I don want to give up because I like this server and I want it to become the best sbep server.

Allow users to recreate/modify completely their huds is a realy good idea. But if they want to display weapon restent ammo, not just considering me, but every other Starfall developpers or future Starfall developpers, they will be stuck at the same point as me because of just one function...

I know we can already make so much using Starfall, this would just allow you to remake completely your hud. Think of people who don't like GMod's hud and want their own !

Another example can be IntelliHUD, the hud I'm trying to develop, a few players already likes it and wants it finished !



I can't change anyone's mind, but I can always try to explain. After the decision is up to you Person.


RE: Function request - Yuri6037 - 27-08-2015

Oh I just noticed you added the function in the last ChangeLog. Thank you so much my hud will be so much better now !


I suppose I need to wait until server reboot ? Because for the moment the Starfall Editor now shows the method in blue (that's good) but when the script is interpreted it crashes with "attempt to call method getAmmoCount (a nil value)".

The server just crashed and rebooted itself so no probems, now the functions works as expected, thanks again !