Talk:Adding Ironsights: Difference between revisions
No edit summary |
No edit summary |
||
Line 23: | Line 23: | ||
:Did you update the flags to FCVAR_REPLICATED? Else set a breakpoint on the two returns in GetIronsightPositionOffset to see which one is executed, and why. --[[User:Z33ky|z33ky]] 06:02, 23 Sep 2008 (PDT) | :Did you update the flags to FCVAR_REPLICATED? Else set a breakpoint on the two returns in GetIronsightPositionOffset to see which one is executed, and why. --[[User:Z33ky|z33ky]] 06:02, 23 Sep 2008 (PDT) | ||
:so, does it work now? :S --[[User:Z33ky|z33ky]] 08:44, 27 Sep 2008 (PDT) | :so, does it work now? :S --[[User:Z33ky|z33ky]] 08:44, 27 Sep 2008 (PDT) | ||
== Doesnt work for me == | |||
This code doesnt work for me. when activated, when i move or turn my gun goes off in randomd irections and is usually off the screen. I dont get ironsights at all. | |||
=old code= | =old code= |
Revision as of 16:31, 30 October 2008
Renewed (fixed) Article
Fixed errors Code compiles now, ironsights and console-variables work (except for the bugs mentioned in the tutorial)
Sorry for the trouble I made by giving the variables a proper but sometimes wrong name without testing the actual code --z33ky 09:05, 22 Sep 2008 (PDT)
- Wiki talk paes are usually left the same, rather then removing them after a few messages :) --Craziestdan 12:50, 22 Sep 2008 (PDT)
- I wanted to clear the page because I renewed the article to a compilable level. So basicly the stuff already talked about is useless. --z33ky 13:13, 22 Sep 2008 (PDT)
not-working ConVars & bugs
Thanks z33ky for correcting the code. It still doesn't work for me though, I'm getting the same problems as Jlea. Except when I have viewmodel_adjust_enabled set to 0, the gun goes half into ironsight position but then immediately goes out again. --Johnmagicson 13:24, 22 Sep 2008 (PDT)
- It completly works for me and I have an exact copy of that code. Are you sure the variables are networked correctly? (I just added a little note there) --z33ky 15:56, 22 Sep 2008 (PDT)
Oh, sorry, I assumed it would've gone into the first network table, and that was what caused all my errors and all the problems I had in game. Now it works fine, thanks z33ky!
EDIT: The only thing that doesn't work for me now is using the console commands. In Jorg's version, I could tweak the ironsight co-ordinates to find the right ones to put in my scripts, but in this one the viewmodel_adjust commands do nothing, and turning on viewmodel_adjust_enabled just makes it so I can't aim in ironsights :S --Johnmagicson 22:39, 22 Sep 2008 (PDT)
- Did you update the flags to FCVAR_REPLICATED? Else set a breakpoint on the two returns in GetIronsightPositionOffset to see which one is executed, and why. --z33ky 06:02, 23 Sep 2008 (PDT)
- so, does it work now? :S --z33ky 08:44, 27 Sep 2008 (PDT)
Doesnt work for me
This code doesnt work for me. when activated, when i move or turn my gun goes off in randomd irections and is usually off the screen. I dont get ironsights at all.
old code
not compilable
Z33ky, i followed it and it come up with doezen's of errors :( Probably because my lack of C++ expert :( Could you possibly add line numbers to each section of code? Because some parts im unsure of, so i end up adding in the wrong parts and generate a million errors. Please, add line numbers for all parts :) --Craziestdan 08:46, 14 Sep 2008 (PDT)
- Could someone please add line numbers for this tutorial please?? --Craziestdan 17:32, 15 Sep 2008 (PDT)
- The reason I won't add lines is, that I don't want newbies to just copy&paste that code, but understand what they are doing. Also, the lines will be wrong if there is a code-update or you already modified one of the files. You should be able to do this with knowledge of C++ and basic Source-knowledge --z33ky
ConVars not working
- Hey z33ky, the tutorial works great and I'd like to thank you so much for putting this up. One problem is the console commands do not work ingame, they have no effect.--JLea 21:27, 19 Sep 2008 (PDT)
- You need to set viewmodel_adjust_enabled 1 and for that you need sv_cheats to be 1, too. --z33ky 01:28, 20 Sep 2008 (PDT)
EDIT: And you have to make viewmodel_adjust_fov to a ConCommand, changing the fov if viewmodel_adjust_enables is 1.
- I'm not that stupid :P. Even if sv_cheats are 1 and viewmodel_Adjust_Enabled is 1 it doesn't do anything. Acutally if adjust_enabled is set to 1, pressing the ironsights button has no effect even if I type new values in. --JLea 02:15, 21 Sep 2008 (PDT)
- I'm not sure what's the problem then - I guess you'll have to debug your way through. --z33ky 05:17, 21 Sep 2008 (PDT)
not compilable
The other tutorial was harder to follow, but it worked for me... This one just gave me tons and tons of errors. I have some knowledge in programming in C, and I have made a few mods for hl2 before. I'm pretty sure I followed every step correctly.
- The errors tell me there are undeclared identifiers for several variables, and when I look through your code, I can't find any part where you declare some of them, such as "m_bIsIronsighted"... Am I supposed to do some of the coding work myself? I thought this was just an easy copy and paste tutorial :(
EDIT: I also noticed there are some spelling errors, such as m_bIsIronsighted is spelled incorrectly as m_bIsIronighted and "position" is sometimes spelled as "positon"... correcting these spelling errors has reduced the amount of errors for me, i'm still looking through the code. I'm just curious, has anyone tested this and got the same results as the other tutorial?
EDIT: after correcting several spelling errors, i finally got it to compile... but in game when i toggle ironsights, it does nothing!.. I modified some of the code and I managed to get it to go in and out of ironsight aiming, but it can never stay! It just makes the gun go into ironsight position for a second and then immediately goes out. --Johnmagicson 22:09, 21 Sep 2008 (PDT)