I've been looking all over for an example of some code for ironsights but can't seem to find one, can anybody help me out?
I suppose if you want to do it without a custom base you could play with fov and angles, but I've not really played with ironsights.
TTT has an iron sight system. There's also a Garry's Mod 12 released CS_WEAPON_BASE ( I think it actually came with the game ).
I'd personally recommend writing your own from scratch though, all the ones that are released rely on calculating whether or not it's being raised or lowered, and that can be glitched causing jumpy motion.
A lot of them rely on bobscale and swayscale which jumps around quite a bit ( unless recently fixed ). And, it's hard to add new animations to those such as sprinting lower and run, against wall lower, aim down sights, low ready, at ease, etc.
If you can find me a link to that base, and if it needs to be converted I'll do it. But as said they all suffer that design flaw which is why I'd say write your own. I've been considering my weapon base for a while, which resolves this issue; but I have so much custom stuff in it that I'd need to write a base for normal non-inventorized game-modes.
[QUOTE=Acecool;41611586]TTT has an iron sight system. There's also a Garry's Mod 12 released CS_WEAPON_BASE ( I think it actually came with the game ).
I'd personally recommend writing your own from scratch though, all the ones that are released rely on calculating whether or not it's being raised or lowered, and that can be glitched causing jumpy motion.
A lot of them rely on bobscale and swayscale which jumps around quite a bit ( unless recently fixed ). And, it's hard to add new animations to those such as sprinting lower and run, against wall lower, aim down sights, low ready, at ease, etc.
If you can find me a link to that base, and if it needs to be converted I'll do it. But as said they all suffer that design flaw which is why I'd say write your own. I've been considering my weapon base for a while, which resolves this issue; but I have so much custom stuff in it that I'd need to write a base for normal non-inventorized game-modes.[/QUOTE]
Well there lies the problem, writing my own. I have no idea where to start with writing my own
You'd modify this function:
function SWEP:GetViewModelPosition( pos, ang )
Basically, make it move to the ironsight position that you set up, over time. That's the function you'd want to look at in TTT, and the Garry's Mod CS_weapon_base to learn what to do.
Sorry, you need to Log In to post a reply to this thread.