Announcement
Collapse
No announcement yet.
OB engine zoom
Collapse
X
-
dirty
OB engine zoom
How do you get the engine to change the field of view? I've tried various things like hooking SetupMain3DView, Push3DView, and RenderView. None worked; the SetupMain3DView hook worked, but the game crashed while calling the original Setupmain3DView. Any ideas?Tags: None
-
dirty
Nevermind, I got the SetupMain3DView hook to work with some inline assembly. Since its a class member function intercept and the 'this' pointer is passed in ECX I had to preserve it and call the original function from inline assembly.
-
Originally posted by dirtyHow do you get the engine to change the field of view? I've tried various things like hooking SetupMain3DView, Push3DView, and RenderView. None worked; the SetupMain3DView hook worked, but the game crashed while calling the original Setupmain3DView. Any ideas?
or just get baseplayer->mi_Fov
& play with that in some frame based function.
Comment
-
dirty
I tried CBasePlayer::SetFOV first which didn't work, its supposed to be called on the server. What i did was in my SetupMain3DView intercept I check a global var 'zoom' and if I'm supposed to be zoomed in then i change view.fov to whatever I need, that worked beautifully.
Now if I can just find out where dod source does its bullet spread. I'm pretty sure its not CShotManipulator::ApplySpread because i hooked it and it was never called, unless I did something wrong. I think they added their own mod specific function for bullet spread. I know when i fire a bullet random->RandomFloat(-5.0f, 5.0f); gets called 4 or 5 times in a row so that might help me locate the function.
Comment
-
dirty
OB bullet spread algorithm
I found the FX_FireBullets function in the new DOD, here's the assembly, pastebin - collaborative debugging tool.
It looks a lot different than the one in the SDK. Has anyone figured out the algorithm yet? those -0.5 and 0.5s are the arguments to RandomFloat, they are in a loop, they get called 4 times every time i checked with RandomFloat intercepted.
Comment
-
dirty
Comment