TheUnknownCod3r / BO4-Lucy-Menu

Updated Version of @G1llam 's BO4 Lucy Menu for PC.
19 stars 11 forks source link

FOV (Scale) #29

Closed Markopolo784 closed 8 months ago

Markopolo784 commented 11 months ago

Incredible work with this mod. Never thought it'd be possible considering how restrictive it is and the online only factor.

Not an issue, just a query! Is it possible to have an fovscale option? Never liked how close the weapons were! When I saw this was a possibility, was one of the first things I wanted to do haha. I did try replacing one the functions, specifically the HUDdisable with setClientFov(number) but was getting some errors but I was probably doing it incorrectly anyway. I believe this is normal fov anyway, correct?

Thanks again!

TheUnknownCod3r commented 10 months ago

Currently yes the menu runs on normal FOV, with no changes. IIRC you should just be able to do self setDvar("cg_fov", 160); and set it to 160, but you'd wanna save the value first, something like this should work I think,

SetFOV(value)
{
    self setDvar("cg_fov", value);
    self S("FOV Set To: "+value):
}

that should work I think, add it to an IntSlider option, with max value of 160, min value of 0, default of 30 or so

Markopolo784 commented 10 months ago

Thank you.

So I added that function and added it as an option into the menu, passing in the value of 160 but I got a crash. I put a semi colon rather than a colon above and also tried removing the second line saying the fov it's set to.

Maybe this was the wrong way of doing it. I say intSliderTest but putting the code within it also caused the same crash.

Would that be something I am doing wrong?

Thanks again.

(Context below)

Menu option I added: self addOpt("FOV", &SetFOV, 160);

Function: SetFOV(value) { self setDvar("cg_fov", value); self S("FOV Set To: "+value); }

If I remove the two lines within SetFOV, it does not crash. Is it a case that cg_fov cannot be accessed? Doubt it?

DoubleG17 commented 10 months ago

If anyone else is wondering how they can modify a dvar using this menu I have a solution. In functions.gsc in visual studio find the "HideGun" function and modify it to the dvar you want to change. In my case I changed the default dvar it was modifying (to hide the gun) to r_lodbiasrigid -1000 because at high FOVs the object culling is extremely noticable. This works for me without crashes. If I toggle on the "Hide gun" option in game my draw distance is increased and if I turn it off it goes back to normal.

image
TheUnknownCod3r commented 9 months ago

If anyone else is wondering how they can modify a dvar using this menu I have a solution. In functions.gsc in visual studio find the "HideGun" function and modify it to the dvar you want to change. In my case I changed the default dvar it was modifying (to hide the gun) to r_lodbiasrigid -1000 because at high FOVs the object culling is extremely noticable. This works for me without crashes. If I toggle on the "Hide gun" option in game my draw distance is increased and if I turn it off it goes back to normal. image

This is basically the description I provided anyway, lol. This is the normal way of setting an int dvar, and has been standard in Call of duty for years. the only thing different is the shorthand code for defining the bool, which is also way more popular lately.

Thank you.

So I added that function and added it as an option into the menu, passing in the value of 160 but I got a crash. I put a semi colon rather than a colon above and also tried removing the second line saying the fov it's set to.

Maybe this was the wrong way of doing it. I say intSliderTest but putting the code within it also caused the same crash.

Would that be something I am doing wrong?

Thanks again.

(Context below)

Menu option I added: self addOpt("FOV", &SetFOV, 160);

Function: SetFOV(value) { self setDvar("cg_fov", value); self S("FOV Set To: "+value); }

If I remove the two lines within SetFOV, it does not crash. Is it a case that cg_fov cannot be accessed? Doubt it?

The mistake I made was including the self part, which was my bad, I wrote that reply before I went to bed. It should just be SetDvar, as the other person pointed out. Apologies, Ive been occupied with other things, so didnt have time to look into this until now.

TheUnknownCod3r commented 8 months ago

If anyone else is wondering how they can modify a dvar using this menu I have a solution. In functions.gsc in visual studio find the "HideGun" function and modify it to the dvar you want to change. In my case I changed the default dvar it was modifying (to hide the gun) to r_lodbiasrigid -1000 because at high FOVs the object culling is extremely noticable. This works for me without crashes. If I toggle on the "Hide gun" option in game my draw distance is increased and if I turn it off it goes back to normal. image

So to close this and confirm what works, this is how you would do it.

add a Slider option as so below:

self addOptIncSlider("Set FOV To: ", &SetFOV, 0,0,300,5);

then in functions.gsc, create a function as follows:

SetFOV(Value)
{
    setDvar("cg_fov", Value);
    self iPrintLnBold("^4FOV Set To: ^1"+Value);
}