UGX-Mods

Call of Duty 5: World at War => Tutorial Desk => Scripting => Topic started by: Scobalula on May 28, 2015, 04:25:54 pm

Title: [Tutorial] Add FOV Changer/Slider
Post by: Scobalula on May 28, 2015, 04:25:54 pm
Before we start I recommend downloading Notepad++, click here (http://notepad-plus-plus.org) to download it.

In this tutorial I will be explaining how to add a FOV Changer/Slider.

I looked around the forums and didn't see a tutorial for this, so after I figured it out myself I decided to show other mappers how to do it. There are 2 Tutorials here, one for a simple changer, and the other for a slider. Both work perfect without cheats enabled, both can also be enabled at the same time, and changing one of them will change the other, so they don't conflict.



For the Changer:

This is simply a button that has set values (like changing Console from On or Off), go to root/raw/ui and locate the file "options_game_pc.menu".

Back up this file to somewhere else as we will be editing it.

Right click on the file and click "Edit with Notepad++", I recommend associating .menu files with Notepad++.

In this file around line 61 you'll see this:

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

Put under this:

Code Snippet
Plaintext
// FOV Changer
CHOICE_DVARFLOATLIST( 27, "Put what you want here as this is what the option will show up as, i.e. Change FOV", cg_fov, { "Normal" 65 "Medium" 75 "High" 90 }, ; )

You can change the quoted part above where I said "Put what you want" to what you want, this is what it will show up as in game, like where you see "Enable Console" in the options.

For the parts where you see "Normal", "Medium" and "High", there are what the options will say, like when you enable console it will say "Yes" or "No", as for the numbers beside them, these are the FOV values, so 65 is FOV of 65, equivelent to using command "cg_fov 65", you can add more here and change the values to your liking.

Now once you can save the file, you don't need to compile map for this, just Build Mod, once you get into game it will look like this:

(http://i.gyazo.com/789b220f34acdf7f20225f19c6b24d56.png)

For the Slider

Folloe the above for copying and opening the file.

For the Slider, look for this on line 61 (or around there):

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

Under it, add this:

Code Snippet
Plaintext
// FOV Slider
CHOICE_DVARSLIDER( 28, "Put what you want here", cg_fov, 65, 65, 90, ; )

Once again, Put what you want where it says that, as this is what it show up as in the menu, like "Enable Console".

You'll notice 3 Values, the first one is the default value, I leave this at 65 because that's WaW's default, but you change it to maybe 70 or higher if you want.

The second value is the lowest value the slider will go, so if you slide the slider furthest to the left, the FOV will be at 65.

The third is the highest value the slider will go, so if we slide it furthest to the right, the FOV will be at 90.

This is how it looks in-game:


(http://i.gyazo.com/fbcf2ce0de2b42b384b035b1e480ec32.gif)

Last but not least, in Mod Builder tab in Launcher, for your Mod, add this to the mod.csv:

Code Snippet
Plaintext
menufile,ui/options_game_pc.menu


Hope this helped you. :)
Title: Re: [Tutorial] Add FOV Changer/Slider
Post by: Tim Smith on May 28, 2015, 05:13:55 pm
Damn man thx for the script and the lesson :)

will use in my map just after i fix it still don't know how :\
Title: Re: [Tutorial] Add FOV Changer/Slider
Post by: Scobalula on May 28, 2015, 06:22:49 pm
Damn man thx for the script and the lesson :)

will use in my map just after i fix it still don't know how :\

Glad it works for you, hope you get your error solved. :(
Title: Re: [Tutorial] Add FOV Changer/Slider
Post by: alex-125 on June 01, 2015, 03:30:29 pm
Nice script bro ! ;)
Title: Re: [Tutorial] Add FOV Changer/Slider
Post by: EmpGeneral on November 17, 2016, 08:13:10 pm
It isn't working for me,I added the line in mod.csv,checked if mod.csv was selected in the iwd list,everything is fine.Any ideas what I may did wrong?