Is it possible to change the "holdtype" of C weapons?
5 replies, posted
As I understand a weapon's HoldType is part of the SWep base or something. For C-side weapons I'm guessing it's not as simple as just running a function (The "holdtypes" of the C-side weapons are generated in-house so I'm guessing it's not possible to change it.)
I'm going to go check the SWep base source ([url=http://glua.me/bin/?path=/gamemodes/base/entities/weapons/weapon_base/sh_anim.lua]found it[/url]) to see if there's anything I could use from that function or if Garry did it C-side.
[editline]12th August 2012[/editline]
So it seems SWeps animate it dynamically based on the HoldType. Okay.
Now to see where TranslateActivity is used so I can figure out how he plays the animations and if I can overwrite it.
[editline]12th August 2012[/editline]
Hm, well, it seems Garry didn't intend for anyone to try to hook into his source, seeing as how he spams local everywhere, and as such I can't get to it with fenv. I suppose this is a security feature but whatever.
Not too sure what I'm looking at. I would guess that all this code is for SWeps and for addon makers that need the functions otherwise, not for the C-side weapons specifically. I think my hypothesis was correct, all of that is managed in the weapon.
However...
That does not mean I can't stop the animation and force another one. I'm going to keep studying this code to see if I can get anything out of it. Expected answer is nothing but I'll try anyway.
[editline]12th August 2012[/editline]
Not sure if I can get it to work (or if I really WANT to do it anymore, it would be a huge project prolly) but it works fine for SWeps.
[editline]12th August 2012[/editline]
*the thing I'm working on
[editline]12th August 2012[/editline]
Meh, I'm sure I could get it working. It's just not going to happen right now.
Oh well, works for SWeps. That's fine with me.
[editline]12th August 2012[/editline]
[del]I like how no one posted here.[/del]
I thought the holdtype was in the weapon it self, not the base...
[QUOTE=wishbone;37203919]I thought the holdtype was in the weapon it self, not the base...[/QUOTE]
[QUOTE=Donkie;37204125]Yeah doesn't [url]http://maurits.tv/data/garrysmod/wiki/wiki.garrysmod.com/indexaeaf.html[/url] work?[/QUOTE]
I don't think you understand. Please read the title again.
C-side weapons, as in weapon point entities not made with the SWep base.
They do not have that function.
[editline]13th August 2012[/editline]
GARRY MAKE A SETHOLDTYPE FUNCTION FOR C WEAPONS
So, you want to change the hold type for client only? Because I still don't get what you exactly want.
[QUOTE=wishbone;37223252]So, you want to change the hold type for client only? Because I still don't get what you exactly want.[/QUOTE]
The non-Lua weapons. The standard HL2 pistol, the OSIPR, etc. The ones created by C++ files. They do not have "holdtype"s like the weapons based off of the Lua base do.
Sorry, you need to Log In to post a reply to this thread.