aStiffSausage Posted May 19, 2013 Share Posted May 19, 2013 So, I'm trying to make sniper have slightly better zoom options, and first thing I'd need is the normal Field of View that is used when player is on foot. I know I could check it while player is on foot and using opcode 0801, but it just doesn't seem right to me for some reason, is it wise to use it like I described? And, when setting new FoV while aiming sniper, opcode 0922 doesn't seem the best option to use as I'd need to use "restore_camera" after aiming, to skip the zoom-out. Any tips on those two? Link to comment Share on other sites More sharing options...
DK22Pac Posted May 19, 2013 Share Posted May 19, 2013 I have some code to control FOV (H - enable/disable, J,K - increase/decrease). {$CLEO}const VK_J = 74 VK_K = 75 VK_H = 72 FOV = [email protected] TIMERA = [email protected] TIMEINFO = 2000endTIMERA = TIMEINFOwhile true wait 0 // check if player enabled FOV mode if 0AB0: key_pressed VK_H then while 0AB0: key_pressed VK_H wait 0 end // enable FOV mode 0A8C: write_memory 0x6FF410 size 1 value 0xC3 virtual_protect 1 0ACD: show_text_highpriority "FOV mode enabled" time TIMEINFO 0A8D: FOV = read_memory 0x8D5038 size 4 virtual_protect 0 while true wait 0 // check if player disabled FOV mode if 0AB0: key_pressed VK_H then while 0AB0: key_pressed VK_H wait 0 end // disable FOV mode 0A8C: write_memory 0x6FF410 size 1 value 0x8B virtual_protect 1 0ACD: show_text_highpriority "FOV mode disabled" time TIMEINFO break end if 0AB0: key_pressed VK_J then FOV += 0.5 TIMERA = 0 0a8c: write_memory 0x8D5038 size 4 value FOV virtual_protect 0 else if 0AB0: key_pressed VK_K then FOV -= 0.5 TIMERA = 0 0a8c: write_memory 0x8D5038 size 4 value FOV virtual_protect 0 end end if TIMERA < TIMEINFO then 0AD1: show_formatted_text_highpriority "FOV: %.2f" time 100 FOV end end endend Link to comment Share on other sites More sharing options...
aStiffSausage Posted May 19, 2013 Author Share Posted May 19, 2013 Alright, thanks, but what does these two do? 0A8C: write_memory 0x6FF410 size 1 value 0xC3 virtual_protect 1 And 0A8C: write_memory 0x6FF410 size 1 value 0x8B virtual_protect 1 Link to comment Share on other sites More sharing options...
DK22Pac Posted May 19, 2013 Share Posted May 19, 2013 Blocking/unblocking CDraw::SetFOV function. Means game couldn't manipulate it (only you could). Link to comment Share on other sites More sharing options...
aStiffSausage Posted May 19, 2013 Author Share Posted May 19, 2013 Okay, got it, thanks! But next question(s): Using opcode 00E1 to check if player is pressing Zoom in/out key doesn't seem to work, ID's 5 and 7 should be for next weapon/zoom in and previous weapon/zoom out. None of those work. Changing ID's to 10 and 11, conversation yes/no, seems to work though. What's the problem, is SannyBuilder help wrong or is the problem with opcode itself? And, when using low FoV in first person, like when aiming with sniper rifle, isn't smooth. What I mean, when using, let's say, field of view of 7.0, makes the aiming hard as the camera "jumps", for example when you set mouse sensitivity to lowest, and try to move the camera really slowly, it jumps over, like the aiming is made with a grid. Can't explain further, if you don't understand I'll just make a video. EDIT: shows the second problem quite well. Link to comment Share on other sites More sharing options...
aStiffSausage Posted May 27, 2013 Author Share Posted May 27, 2013 Still searching for answers. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now