Welcome, Guest. Please login or register. Did you miss your activation email?

* TUTORIAL SECTION RULES

This section is for SMOD TUTORIALS & GUIDES ONLY.
You may create a new topic in the appropriate area to share your tutorial. If you post anything off-topic here you will be temp-banned. This is so we don't hassle the moderators too much, they are volunteers.

If you need help with a tutorial, post a reply in its thread . Do not start a new topic for help here!

Author Topic: [Tutorial] How to set up and fine tune ironsights and viewmodels  (Read 10953 times)

0 Members and 1 Guest are viewing this topic.

Offline Xamp

  • *
  • +2% chance to make useful post
  • Xamp has no influence.
[Tutorial] How to set up and fine tune ironsights and viewmodels
« on: December 12, 2012, 08:00:22 PM »
I haven't seen a tutorial in writing form (don't worry Counter Life, i haven't forgotten your video tutorial) for how to set up ironsights correctly, so i'll give it a try.

Note: For this tutorial you will need the "ironsight_cfg" wich should come with SMOD, just saying this in case you already know you don't have that.

What you will find here:

1. General knowledge and how to start
2. "ironsight_cfg" and you
3. Changing viewmodel (with "ironsight_cfg")
4. Setting up ironsights and fine tuning


1. General knowledge and how to start.

Okay, so first off, choose a gun you want to set up the viewmodel and ironsights for.



I'll go with the SMOD: Tacticals default FiveseveN.
Let's say your ironsights and viewmodel are effd up, so now we will reset them to original in the script, that means we go from this:



To this:



Pretty easy stuff i know.
Now your gun will use the default CS: S origins.

Alright, here comes the funny part, we NEED to set up the default viewmodel, aka. the hipfire origin FIRST since the ironsight will be based on how this viewmodel is set.
For this we will use the script luckily coming together with SMOD (as far as i know), the "ironsite_cfg".
To use it we just have to open the console and type in "exec ironsite_cfg".
Now your console should show you this:



2. "ironsight_cfg" and you.

Okay, so this part is for when you have enabled the script.

As i said, enable "ironsight_cfg" with typing "exec ironsight_cfg" in the console or disable it with "exec ironsight_cfg_off".

Ingame you should be able to move the guns origin with the numpad.

8 for up slightly, 2 for down slightly, 4 for left, 6 for right, 7 for left slightly, 9 for right slightly, 1 to move yaw to the left, 3 to move yaw to the right, - to move the gun away, + to move the gun towards you,* (should look like an x on most keybords) to move the pitch up, "," (under 3) to move the pitch down, also we have the two keys on the left of the num button, picture up for rotation to the right and picture down for rotation to the left. After you are done press 5 to see the coordinates for the position you choose for the viewmodel or ironsight.

What you will notice is that on the upper left and in the console, there are showen what values are changed to what number, nothing you have to care about right now (But it will be very usefull for later).

You might have to try around a bit but you should get the hang of it soon.

3. Changing viewmodel (with "ironsight_cfg")

After you know how to controll the script, have some fun and move the gun around until you have the position that you like.
For example i moved it in the middle and a bit further away from me.
For the viewmodel you shouln't need fine tuning, but it can be used here too, just so you know (more on fine tuning in chapter 4).
Now if you are finished you have to press 5 on the numpad to have the ironsight script show you the coordinates for this viewmodel position.
They should look something like this:



As you can see, there are value names on the left and the values we need on the right (example: Right "viewmodel_r" = "2.710000").
If you look in your script you should see those value names with values too, just that all of them are set to 0.
Now copy the values from the console and use them to replace those in the script under the categorie "Adjust", if a value isn't in the script and has a value of 0 or -0 in the console you can skip these, but if they are in the script but have a value of 0 in the console and you have something else then 0 in the script, replace.
(example: instead of "right"    "0", we will have "right"    "2.710000" or instead of "right"    "0.12345", we will have "right"    "0.00000")
After you are finished your script should look like this:



If you are sure you did everything right, test it ingame by saving the weapon script, turning off "ironsight_cfg" by using "ironsight_cfg_off" and reloading the map (try "reload" in the console).



New viewmodel looks good? Okay, lets carry on!

4. Setting up ironsights and fine tuning

First things first, reenable your best friend "ironsight_cfg".
Now, do it just the way you did it with the viewmodel, but this time try lining up the ironsights, the hl2 default crosshair should help you a lot.
And do NOT right click to enable ingame ironsights in "ironsights_cfg", use the hip-fire mode.
Don't worry if you don't manage to line em' up perfectly, just try to get the ironsights lined up roughly.

If you think "close enough, but still not right", you need fine tuning!
Now you might ask me what fine tuning is. Well, simple: The "ironsight_cfg" won't be able to do work on small levels, here comes the console in play and what i call "fine tuning".
Let's say your ironsights are too far on the right of the default hl2 crosshair and you need to move them to the left. Move the gun to the left and the console will show you what values are in play and to what number they are changed, for example: currently we have Yaw "viewmodel_y" = 0.00000 *move to the right* "viewmodel_y" = 0.20000, that means "0.20000" will be addet to "viewmodel_y" if we move the gun to the right, this also means that "0.20000" will be taken away from "viewmodel_y" if we move the gun to the left.

Now if you want to fine tune, change the value manualy with the console.
For example, we need to move the yaw just half of what is normal for the "ironsight_cfg" to the left.
Currently yaw is set to "0.20000", and the yaws normal move level should be from "0.00000" to "0.20000" so we type in the console "viewmodel_y 0.30000" (the value we should have if we add the half of what is normal), and the guns origin should already move without you having to close the menu.
Or do you need it even finer?
Instead of adding 0.20000, try adding 0.04000.
Play around with this tactic an set up the ironsights correctly.



If they are set up correctly, press 5 on your numpad to have the console show you the coordinates for this position, now replace the coordinates in your script under "IronSight" (wich should still all be on 0) with the fresh ones you got from the console.
Now your script should look something like this:



After you are done with that, safe the script, disable "ironsight_cfg" with "ironsight_cfg_off" and reload the map (try "reload" in the console).

Now everything should work, Good job!

If you still have questions, have problems with the tutorial or just want to say something on-topic, don't hold back on writing a reply to this post or sending me a privat message.
Also i hope the pictures helped at least a little bit.

Note: Mods, if possible, please correct grammatical mistakes in this tutorial, i tried to keep them to a minimum, but i'm sure there are still a few of them here, after you are done, remove this note. Thank you :3


On wall duty again

Offline Counter-Life™

  • *
  • *
  • +17% chance to make useful post
  • Counter-Life™ is a rising star!Counter-Life™ is a rising star!Counter-Life™ is a rising star!Counter-Life™ is a rising star!Counter-Life™ is a rising star!Counter-Life™ is a rising star!
    • Youtube Channel
Re: [Tutorial] How to set up and fine tune ironsights and viewmodels
« Reply #1 on: December 12, 2012, 10:15:28 PM »
Great looking tutorial, will be useful guys who are new at SMOD.

Offline Xamp

  • *
  • +2% chance to make useful post
  • Xamp has no influence.
Re: [Tutorial] How to set up and fine tune ironsights and viewmodels
« Reply #2 on: December 13, 2012, 07:01:55 AM »
Exactly, this tutorial was made for beginners, pros don't hate ^^


On wall duty again

Offline Pepsifan04

  • *
  • *
  • +12% chance to make useful post
  • Pepsifan04 might someday be someone...Pepsifan04 might someday be someone...Pepsifan04 might someday be someone...Pepsifan04 might someday be someone...
    • Smod: CryLife
Re: [Tutorial] How to set up and fine tune ironsights and viewmodels
« Reply #3 on: December 13, 2012, 11:51:44 AM »
Very nice! it's easy to understand and not spammed with pictures and screenshots.
Great job! 
DROP DATABASE bsnooch

Offline Dez

  • *
  • +1% chance to make useful post
  • Dez has no influence.
Re: [Tutorial] How to set up and fine tune ironsights and viewmodels
« Reply #4 on: December 14, 2012, 12:21:05 AM »
I don't appear to actually HAVE an ironsight_cfg

Well I got one, but it doesn't appear to be working correctly. The settings and coords I making in the cfg do not match the ones put in game? Like, it looks perfect with the ironsights_cfg on, but when I put it into the code and restart the game, it's all messed up.
« Last Edit: December 14, 2012, 02:49:33 AM by Dez »

Offline Xamp

  • *
  • +2% chance to make useful post
  • Xamp has no influence.
Re: [Tutorial] How to set up and fine tune ironsights and viewmodels
« Reply #5 on: December 14, 2012, 10:34:01 AM »
In this case 2 things could be made wrong:

1. You have to set up the hip-fire origin FIRST, then save, restart/change the map to get the game to use the new values from the script, and only then set up the ironsights, if you didn't change the hip-fire origin, you only have to set up the ironsights, other then that,...

2. ...did you go into ironsights mode to set up the ironsights? If yes, don't do that, set up the ironsights from the hip-fire mode, or else the coordinates will be wrong.

If that didn't help, you have to give me more details on what exactly you did while setting up the ironsights.


On wall duty again

Offline Pepsifan04

  • *
  • *
  • +12% chance to make useful post
  • Pepsifan04 might someday be someone...Pepsifan04 might someday be someone...Pepsifan04 might someday be someone...Pepsifan04 might someday be someone...
    • Smod: CryLife
Re: [Tutorial] How to set up and fine tune ironsights and viewmodels
« Reply #6 on: December 14, 2012, 11:12:28 AM »

2. ...did you go into ironsights mode to set up the ironsights? If yes, don't do that,
What's wrong with that? I'm doing this all the time and it work's perfectly:P srly
DROP DATABASE bsnooch

Offline Xamp

  • *
  • +2% chance to make useful post
  • Xamp has no influence.
Re: [Tutorial] How to set up and fine tune ironsights and viewmodels
« Reply #7 on: December 14, 2012, 12:48:53 PM »
I don't know how the hell that works for you but if i try this, i can guarrente you 100%ly that the ironsights will be screwed after that.


On wall duty again

Offline Counter-Life™

  • *
  • *
  • +17% chance to make useful post
  • Counter-Life™ is a rising star!Counter-Life™ is a rising star!Counter-Life™ is a rising star!Counter-Life™ is a rising star!Counter-Life™ is a rising star!Counter-Life™ is a rising star!
    • Youtube Channel
Re: [Tutorial] How to set up and fine tune ironsights and viewmodels
« Reply #8 on: December 14, 2012, 04:56:30 PM »
I don't know how the hell that works for you but if i try this, i can guarrente you 100%ly that the ironsights will be screwed after that.

Not if he had every value at 0 in is ironsihgt settings ;)

Offline Xamp

  • *
  • +2% chance to make useful post
  • Xamp has no influence.
Re: [Tutorial] How to set up and fine tune ironsights and viewmodels
« Reply #9 on: December 14, 2012, 05:28:15 PM »
Not if he had every value at 0 in is ironsihgt settings ;)

Ahh yes, in this case it would work.


On wall duty again

Offline Dez

  • *
  • +1% chance to make useful post
  • Dez has no influence.
Re: [Tutorial] How to set up and fine tune ironsights and viewmodels
« Reply #10 on: December 14, 2012, 09:35:09 PM »
Thanks for the help. I kept trying to do the viewmodel first, and then make the ironsights without exec ironsights_cfg_off after getting the viewmodel. Oops.

Offline Xamp

  • *
  • +2% chance to make useful post
  • Xamp has no influence.
Re: [Tutorial] How to set up and fine tune ironsights and viewmodels
« Reply #11 on: December 14, 2012, 09:42:02 PM »
Ohh well, looks like i could help someone after all, but you got it to work now right?


On wall duty again

Offline Dez

  • *
  • +1% chance to make useful post
  • Dez has no influence.
Re: [Tutorial] How to set up and fine tune ironsights and viewmodels
« Reply #12 on: December 14, 2012, 10:13:06 PM »
yes, thank you for the tutorial.

Offline Xamp

  • *
  • +2% chance to make useful post
  • Xamp has no influence.
Re: [Tutorial] How to set up and fine tune ironsights and viewmodels
« Reply #13 on: December 14, 2012, 10:40:15 PM »
No problem, feels good to help.


On wall duty again

Offline TheMann25

  • *
  • +4% chance to make useful post
  • TheMann25 has no influence.
Re: [Tutorial] How to set up and fine tune ironsights and viewmodels
« Reply #14 on: December 16, 2012, 11:44:12 AM »
Strangely I figured this out before I even saw this page.
This is a catchy signature.