Coding Ironsights Created 6 years ago2017-07-26 05:21:13 UTC by abbadon abbadon

Created 6 years ago2017-07-26 05:21:13 UTC by abbadon abbadon

Posted 6 years ago2017-07-26 05:21:13 UTC Post #336386
Hi. I am working again on a new mod, it is far simpler than ZWC, and this time it´s full original. ;) It will be done with GoldSource, no Xash between, probably EHL from Solokiller :). It will have very few new code, mostly for enemies and, of course the weapons, the rest of the development will be Mapping. Don´t have a name yet, but the first scratch book has the name "ROWEN" on its pages...

After seeing some tutorials using scripts for this feature, I want to know if someone of you can point me to a good tutorial about how to code ironsights for HL (Goldsource) Weapons. The modelling part will not be a problem as I can learn how it is done through decompiling an existing "ironsighted" model. I found a tutorial form Jorg40 (coder for a Natural Selection Bot) at ValveDeveloper but it is for HL2 (Crazy stuff there) so I am sure it won´t work for standard GoldSource.

Thanks in anticipation.
Posted 6 years ago2017-07-26 05:31:19 UTC Post #336389
There aren't really any "set" way to do it though, you can go about it a couple different ways; shifting the viewmodel origin to a pre-defined value, using animations to toggle (and give the effect of moving your gun by yourself), there's a few other ways you can do it as well.

Also, you'd be surprised how mow code from HL2 can be ported and shoved into GoldSource.
Posted 6 years ago2017-07-26 11:42:44 UTC Post #336403
Mmmm, could it be done with the crossbow as a basecode?, what I don´t know since it been almost two years that I don´t play HL, is that if the zoom (right mouse/alternate fire) is a toggle key or not. :/
you'd be surprised how mow code from HL2 can be ported and shoved into GoldSource.
Oh, I must pay more attention, maybe I can exract some useful info from that tutorial (and others) :crowbar:
Posted 6 years ago2017-07-27 06:02:46 UTC Post #336438
Crossbow zoom is a toggle, just FYI
monster_urby monster_urbyGoldsourcerer
Posted 6 years ago2017-07-27 10:16:10 UTC Post #336444
Urby isn't a programmer but he's pointing you in the right direction.
Posted 6 years ago2017-07-27 11:53:40 UTC Post #336449
Thanks!, as I could see, I have to make the "from hip to face" animation, call it with "send weapon animation" in the "secondary" attack function, and let the rest work as normal, I mean the primary attack, of course, right?. :)

As the Mod will have the halo weapons-switching method for weapon carrying so you can have only 2 at a time (1 primary, 1 secondary) and I have planned to add only a very few of them, probably 2 melee (will be present always), 2 types of pistols, 1 type of SMG, 1 type of SG and 1 type of grenade, the coding part for this will be very quick as all of them are based on pre existing code. :)
You must be logged in to post a response.