Yes i'm back again with another question :)
I've been trying to add a scope to a desert eagle, but keep getting errors. The first few were mistakes i made, now i'm getting this crash error at the synchronizing screen:
Expression : fatal error Function : CInifile::r_string File : D:\xray-svn\xrCore\Xr_ini.cpp Line : 351 Description : Arguments : Can't find variable scope_y in [wpn_desert_eagle_m1]
No matter what number i use i keep getting this error. The line currently reads scope_y = 5. i've changed it to 10 and 50 and -20 and a bunch of other numbers to see if it would work.
Is it possible to put a scope on a pistol? I've been reading different forums and haven't seen a mod yet or a post on how, if we can.
If the model doesn't use the scope, then you can't add it to the weapon. That's the same with the Dragunov SVD, which can't be added a silencer because the model isn't build for that. (gamedata\meshes\weapons\desert_eagle\wpn_desert_eagle.ogf)
So until someone redo the desert eagle model and add the scope, you won't be able to add a scope to it, no matter how much variable you alter!
I think that's how it works, but if someone can give a better explanation...:p
I think a scope MIGHT be possible even without the model change, if you can manage to code the necessary parts properly.
I will look into it, since I need to try to give my unique VLA a scope anyways. One thing to keep in mind, though: Like SacriPan says, there's no model support. Assuming you can get it to work, it'll look fairly silly to have a zoom feature on a weapon that obviously lacks the attachment for it.
Alright, got it to work, first without a scope and second with the VLA's scope since it has support for it. As for your issue, ONLY use these lines: scope_status = 1 zoom_enabled = true scope_zoom_factor = 30 scope_texture = wpn\wpn_crosshair zoom_hide_crosshair = true
That will give you a working zoom, should apply to any weapon but I only tested it with a pistol (Fort, specifically) and a VLA. Also, I recommend you leave the zoom factor as it is since it's been my experience that pistols don't have very strong scopes. Turns out that zoom_factor is actually an FOV setting, too, which means lower = more zoom. Odd, because I was expecting the opposite given the variable name. Oh well.
Ramblings aside, the only thing this doesn't do is make it look like the gun has a scope equipped. When you zoom in it'll view through a scope, I used the SVD Sniper scope texture for that. Going back to what Sacri said again, you probably won't get the scope model to show up.
Lastly, chances are you're getting the error with scope_y because it may be a variable that does not exist in the Desert Eagle pistol's data. This is really weird since I would have expected that all the weapons would be consistent and have the same applicable variables but not using scope_y and scope_x seems to allow zoom to work. The comment attached notes that those two control the location of the scope's bitmap in the inventory screen, proportional to the gun.
Unless someone knows anything else, I think we're stuck with scope texture only and no model to supplement it. I'm cool with that, though. :P
Last edit: I just realized that you didn't specifically ask for zoom help but only for help with the scope, so if you already have zoom working then just ignore me. O_o
I already thought of what you said but I think he wanted the zoom working AND the scope model attached to the Desert Eagle. At least, that's what I understood from his post.
And without the right model, I think you can't have it. That's what I understand since I tried with the SVD from vanilla and the one from AMK Arsenal. The model has been remade so now I can put a silencer on it. The model file contains the model, the animation for it, the locations of the textures and all the attachments that fit on it (that would be silencer, scope and grenade launcher), because they're actually part of the model, so they can appear attached to the weapon in the first person view.
Yeah, I realized that after my post. My fault for not reading it more carefully. :P
I didn't make it!
Sorry I didn't see this post before I put mine up same question. I am using the H&K. I have the accuracy and damage set to the new limits but now I need the scope to finish it off.
Well, like we said before, if you want the model of the scope attached to your pistol, it's impossible unless you edit the model file with the appropriate software. If you just want the zoom feature, do like Remi said.