UGX-Mods Login

or login with an authentication provider below
Sign In with Google
Sign In with Twitter
Sign In with Discord
Sign In with Steam
Sign In with Facebook
Sign In with Twitch

[TUT] Maintain FOV in ADS

broken avatar :(
Created 8 years ago
by Scobalula
0 Members and 1 Guest are viewing this topic.
5,481 views
broken avatar :(
×
broken avatar :(
OnionmanVere Bo21
Location: ieu dnt wnt 2 no
Date Registered: 27 September 2013
Last active: 1 year ago
Posts
1,864
Respect
Forum Rank
Zombie Destroyer
Primary Group
Community Mapper
My Groups
More
Personal Quote
ok
Signature
Aye mate you don't know me so y don't you shut tf up ok buddy :)

×
Scobalula's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Box Mappers Elite
Box Mappers Elite
Community Mapper Has released one or more maps to the UGX-Mods community which have been added to the UGX Map Manager.
Community Scripter Has shown effort and knowledge in the area of scripting while being a part of the UGX-Mods community.
Scobalula's Contact & Social Links
I took inspiration from UGX Mod for this, it will essentially maintain the FOV when aiming, so if you're FOV is set to 65, when you aim, it will still be 65, instead of 45 or whatever weaponfile has it set to. Note: I take the assumption you have ADS FOV is set accordingly, if it's set higher than current FOV, this won't work.

As always, I recommend downloading something like Notepad++ and enabling Syntax Highlighting (Wiki has tut for this), click here to download it.

Go to root\mods\modname\clientscripts and open mapname.csc, if it doesn't exist make one, and go to root\raw\clientscripts, and copy it from here to the folder in mod.

Once here, got to the bottom of the csc, and add this:

Code Snippet
Plaintext
fov_maintain_watch()
{
self endon( "disconnect" );
while(true)
{
if(getdvar("cg_scoba_fov_maintain") == "1")
setClientDvar("cg_fovmin", getdvar("cg_fov"));
else
setClientDvar("cg_fovmin", 10);
wait 0.5;
}
}

The go up in the same csc and find this:

Code Snippet
Plaintext
println("*** Client : zombie running...or is it chasing? Muhahahaha");

and under it add:

Code Snippet
Plaintext
players = getlocalplayers();
for(i=0;i<players.size;i++)
      players[i] thread fov_maintain_watch();

Next go to root\raw\ui and copy the file "options_game_pc.menu" to root\mods\modname\ui (create this folder if it doesn't exist).

Open this, and locate the following section:

Code Snippet
Plaintext
CHOICE_DVARFLOATLIST( 22, "@MENU_ENABLE_CONSOLE", monkeytoy, { "@MENU_YES" 0 "@MENU_NO" 1 }, ; )

Under it add this:

Code Snippet
Plaintext
CHOICE_DVARFLOATLIST( 27, "Maintain FOV in ADS", cg_scoba_fov_maintain, { "@MENU_YES" 1 "@MENU_NO" 0 }, ; ) 

In mod.csv add this line:

Code Snippet
Plaintext
menufile,ui\options_game_pc.menu

Tick the csc if it isn't ticked, the menu file need not be ticked. And that should be it.

You can use in conjunction with this, just make sure to change the 27 above to 28 or something, this will move it up or down:

http://ugx-mods.com/forum/index.php/topic,6870.0.html

Credits:

UGXMod - Inspiration.
alauranc9 - csc information.

Note: If you have this enabled ingame, and decide to lower your FOV through a slider or similar, the effect won't be seen while paused, the fov will set once you leave the menu, this same effect is not seen when increasing the field of view.

Last Edit: May 16, 2016, 11:27:23 am by Scobalula
broken avatar :(
×
broken avatar :(
Location: usCali(fornia)
Date Registered: 21 December 2013
Last active: 4 years ago
Posts
418
Respect
Forum Rank
Perk Hacker
Primary Group
Member
My Contact & Social Links
More
Signature
The sound of God is the screech of tires, lights and magnets, bolts and wires. Strayed from the road, this very one, still to come. The sound of tires is the sound of God, the electric version.
×
mrpeanut188's Groups
mrpeanut188's Contact & Social Linksmrpeanut1881337p34nutmrpeanut188
Sweet, was planning on implementing this into my own map. Saves everyone with the same idea some time.
broken avatar :(
×
broken avatar :(
[UGX] Documentation Writer & Programmer
Location: usLos Angeles, CA
Date Registered: 23 August 2013
Last active: 6 months ago
Posts
1,322
Respect
Forum Rank
Zombie Colossus
Primary Group
UGX Team Member
My Groups
More
My Contact & Social Links
More
Personal Quote
(ง º ω º )ง u wont sum m8y?
Signature
Do not take life too seriously. You will never get out of it alive.
×
DidUknowiPwn's Groups
UGX Team Member
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Community Scripter Elite Has shown excellence and experience in the area of custom scripting in the UGX-Mods community.
BO3 Modtools Alpha
BO3 Modtools Alpha
This user has access to the Black Ops 3 Modtools Alpha
Not sure if getdvar in csc will work correctly.
Have you tested this in coop to make sure it applies to the player  with varying fov?
broken avatar :(
×
broken avatar :(
OnionmanVere Bo21
Location: ieu dnt wnt 2 no
Date Registered: 27 September 2013
Last active: 1 year ago
Posts
1,864
Respect
Forum Rank
Zombie Destroyer
Primary Group
Community Mapper
My Groups
More
Personal Quote
ok
×
Scobalula's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Box Mappers Elite
Box Mappers Elite
Community Mapper Has released one or more maps to the UGX-Mods community which have been added to the UGX Map Manager.
Community Scripter Has shown effort and knowledge in the area of scripting while being a part of the UGX-Mods community.
Scobalula's Contact & Social Links
Not sure if getdvar in csc will work correctly.
Have you tested this in coop to make sure it applies to the player  with varying fov?

I tried it with setting a dvar to true in gsc if they are prone and checking in csc, I assumed it would work with this somewhat, I'll give it a go though, just kinda hard to do co-op testing when the game decides to give me 500 random errors like "could not find zombiemode"...
broken avatar :(
×
broken avatar :(
Location: gbNewport
Date Registered: 2 November 2014
Last active: 2 years ago
Posts
1,265
Respect
Forum Rank
Zombie Colossus
Primary Group
Member
My Contact & Social Links
More
Personal Quote
Embrace the Darkness
×
Tim Smith's Groups
Tim Smith's Contact & Social Linkstimsmith90THEREALBaDBoY17TimSmithMy clan Website
Very nice scob. Was looking for ages for this. Thx.
broken avatar :(
×
broken avatar :(
OnionmanVere Bo21
Location: ieu dnt wnt 2 no
Date Registered: 27 September 2013
Last active: 1 year ago
Posts
1,864
Respect
Forum Rank
Zombie Destroyer
Primary Group
Community Mapper
My Groups
More
Personal Quote
ok
×
Scobalula's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Box Mappers Elite
Box Mappers Elite
Community Mapper Has released one or more maps to the UGX-Mods community which have been added to the UGX Map Manager.
Community Scripter Has shown effort and knowledge in the area of scripting while being a part of the UGX-Mods community.
Scobalula's Contact & Social Links
Not sure if getdvar in csc will work correctly.
Have you tested this in coop to make sure it applies to the player  with varying fov?

Seems to be working:

http://i.imgur.com/AZm52A6.jpg

And tried messing with FOV, switching settings constantly, etc. and didn't run into any issue. Still though please report if you do have any issues at all in co-op. :P
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 27 October 2013
Last active: 5 months ago
Posts
354
Respect
Forum Rank
Perk Hacker
Primary Group
Donator ♥
My Groups
More
×
adfgdagasdf2's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
adfgdagasdf2's Contact & Social Links
Or, you know, "cg_fovmin #"

EDIT: Just saw that in your code. My bad.
Last Edit: April 13, 2016, 09:38:31 pm by PSNtoonjuice
broken avatar :(
×
broken avatar :(
Location: gbNewport
Date Registered: 2 November 2014
Last active: 2 years ago
Posts
1,265
Respect
Forum Rank
Zombie Colossus
Primary Group
Member
My Contact & Social Links
More
Personal Quote
Embrace the Darkness
×
Tim Smith's Groups
Tim Smith's Contact & Social Linkstimsmith90THEREALBaDBoY17TimSmithMy clan Website
Sadly. sometimes it works sometimes it doesn't. Using both of your tuts. This and the fov slider. So i lunch map, put the slider to the full right "95 fov". Click yes on the ads thingy. Go to the map and try to ads it keeps getting back to the gun's fov ads that's has been set in weapon file. Ok restart, everything is working perfectly. Dafaq ? 
broken avatar :(
×
broken avatar :(
OnionmanVere Bo21
Location: ieu dnt wnt 2 no
Date Registered: 27 September 2013
Last active: 1 year ago
Posts
1,864
Respect
Forum Rank
Zombie Destroyer
Primary Group
Community Mapper
My Groups
More
Personal Quote
ok
×
Scobalula's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Box Mappers Elite
Box Mappers Elite
Community Mapper Has released one or more maps to the UGX-Mods community which have been added to the UGX Map Manager.
Community Scripter Has shown effort and knowledge in the area of scripting while being a part of the UGX-Mods community.
Scobalula's Contact & Social Links
Sadly. sometimes it works sometimes it doesn't. Using both of your tuts. This and the fov slider. So i lunch map, put the slider to the full right "95 fov". Click yes on the ads thingy. Go to the map and try to ads it keeps getting back to the gun's fov ads that's has been set in weapon file. Ok restart, everything is working perfectly. Dafaq ?

Just to point out I have tested many times, across different maps, with different configs, etc. and didn't run into any issues, Co-Op is the only thing I haven't tested fully, only once.

If you run into any issues on Solo, it's probably on your end. :P

Double Post Merge: April 16, 2016, 12:47:17 pm
Sadly. sometimes it works sometimes it doesn't. Using both of your tuts. This and the fov slider. So i lunch map, put the slider to the full right "95 fov". Click yes on the ads thingy. Go to the map and try to ads it keeps getting back to the gun's fov ads that's has been set in weapon file. Ok restart, everything is working perfectly. Dafaq ?

Actually if it happens again, type cg_fov into console and take note of the value.

EDIT: And cg_fovmin, they should be be the same if it's enabled, that's how it works, it sets the min fov to the same as the fov, overriding the fov set in weaponfile.
Last Edit: April 16, 2016, 02:47:51 pm by Scobalula
broken avatar :(
×
broken avatar :(
Location: scotland
Date Registered: 2 September 2013
Last active: 3 days ago
Posts
379
Respect
Forum Rank
Perk Hacker
Primary Group
Community Mapper
My Groups
More
My Contact & Social Links
More
Personal Quote
Ping998
Signature
"My maps might not be the best looking, or the most hyped, but I still release them in hopes that they can make others somewhat happy"

- Ping
×
Ping998's Groups
Community Mapper Has released one or more maps to the UGX-Mods community which have been added to the UGX Map Manager.
Ping998's Contact & Social LinksPing998Ping998ZPing998CreepersAreAwesome
This isn't working. When I try to play my map it says that the variable "players" is not initialised. I've followed the tutorial through and through but I can't do anything about it?
broken avatar :(
×
broken avatar :(
OnionmanVere Bo21
Location: ieu dnt wnt 2 no
Date Registered: 27 September 2013
Last active: 1 year ago
Posts
1,864
Respect
Forum Rank
Zombie Destroyer
Primary Group
Community Mapper
My Groups
More
Personal Quote
ok
×
Scobalula's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Box Mappers Elite
Box Mappers Elite
Community Mapper Has released one or more maps to the UGX-Mods community which have been added to the UGX Map Manager.
Community Scripter Has shown effort and knowledge in the area of scripting while being a part of the UGX-Mods community.
Scobalula's Contact & Social Links
This isn't working. When I try to play my map it says that the variable "players" is not initialised. I've followed the tutorial through and through but I can't do anything about it?

You probably didn't copy the second part correctly, you can see it is initialized above.

If you're 100% sure you did it correctly send me your mapname.csc from clientscripts.

I've edited tutorial too, meant to do it a while back but changed to getlocalplayers with suggestion by alauranc.


 
Loading ...