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

How to add a vision file (filter) to your map

broken avatar :(
Created 2 months ago
by Klaudeh
0 Members and 1 Guest are viewing this topic.
133 views
broken avatar :(
×
broken avatar :(
Location: veValencia, Carabobo
Date Registered: 30 January 2021
Last active: 2 days ago
Posts
29
Respect
Forum Rank
Legless Crawler
Primary Group
Member
My Contact & Social Links
More
×
Klaudeh's Groups
Klaudeh's Contact & Social LinksKlaudehKlaudeh Klaudeh
This is a small tutorial on how to make vision files and add a script to change them dynamically with triggers. This helps to make each area of your map unique with different filters, you map can go from this:
 

 
To this:
 

 
It might not look like too much, but you can make areas look more bright and colorful or the total opposite, making them dark and greedy, to add that extra layer of visualization, so let's begin:
 
1. First off all we need to know exactly what we want in our vision files, to achieve this run your map after compiling it and open the console, there we can use the following commands:
 
r_filmUseTweaks = Defaults to 0 (can be changed between 0 to 1), overrides the actual vision file with default values.
 
r_filmTweakEnable = Defaults to 0 (can be changed between 0 to 1), enable the tweaks you can manually do (you need this and r_filmUseTweaks to see changes in real time).
 
r_filmTweakBrightness = Defaults to 0 (can be changed between -1 to 1), changes the Brightness of the filter.
 
r_filmTweakContrast = Defaults to 1.4 (can be changed between 0 to 4), changes the contrast of the filter.
 
r_filmTweakDarkTint = Defaults to 0.7 0.85 1 (any of these values can be change between 0 to 2. Admits decimal values), changes the dark tint of the filter which influences the tone of the dark colors. The values correspond to the RGB values of the filter, being 0.7 = Red, 0.85 = Green, 1= Blue.
 
r_filmTweakSaturation = Defaults to 0.2 (can be changed between 0 to 1), changes the saturation of colors, so high values make things look grayscale.
 
r_filmTweakInvert = Defaults to 0 (can be changed between 0 to 1. It doesn't admit decimal values), invert all the colors of the filter, making it look like negative
 
r_filmTweakLightTint = Defaults to 1.1 1.05 0.85 (can be change between 0 to 2. Admits decimal values), changes the light tint of the filter which influences more vivid colors and overall illumination of the map, follows the same excheme as darktint.
 


Also we can modify the glowing effect (known as bloom) so light sources and light reflection can be bright or less bright, these are all the values we can modify for the glow effect:
 
r_glow = Defaults to 1 (can be changed between 0 to 1), enables and disables the glow effect.
 
r_glow_allowed = Defaults to 1 (can be changed between 0 to 1), same as r_glow.
 
r_glowUseTweaks = Defaults to 0 (can be changed between 0 to 1), overrides the actual glow values with default ones
 
r_glowTweakEnable = Defaults to 0 (can be changed between 0 to 1), enables the tweaks you can manually do to the glowing effect.
 
r_glowTweakBloomCutoff = Defaults to 0.5 (can be changed between 0 to 1), changes the distance when the bloom is cut off.
 
r_glowTweakBloomDesaturation = Defaults to 0 (can be changed between 0 to 1), changes the desaturation of the bloom effect, so it can go into grayscale instead of editing the actual filter.
 
r_glowTweakBloomIntensity = Defaults to 1 (can be changed between 0 to 20. Admits decimals), changes the intensity of the bloom effect
 
r_glowTweakRadius0 = Defaults to 5 (can be changed between 0 to 32. Admits decimals), changes the radius of how far the bloom effect travels.
 
​​​​​​r_glowTweakRayExpansion = Defaults to 0 (can be changed between 0 to 4. Admit decimals), this changes how far the sun rays travel when looking directly at the sun.
 
r_glowTweakRayIntensity = Defaults to 1 (can be changed between 0 to 20. Admit decimals), changes how intense the sun rays glow.
 


After we played a bit with all the different values we can tweak we might get a result that we enjoy, now we need to make a file and import it into our map with these values
 
2. Go to your waw directory and open the "raw>vision" and copy "zombie_factory.vision", change the name of the file to whatever name you want and open it. Once you open it you can see there's all the different values we manually modify inside our map, now add them to this file to save the values.
 
3. Once you're done with your vision file add this line to your map's mod.csv:
 
Code Snippet
gamescript
rawfile,vision/your_vision_file_name.vision

4. Now go to your mapname folder, go into "maps>createart" and open "mapname_art.gsc" and modify this line to add the name of your vision file:
 
Code Snippet
gamescript
level thread maps\_utility::set_all_players_visionset( "your_vision_file_name", 0.1 );

4.1 If you're using gympie's perks, open "_zombiemode_perks.gsc" and add your vision file to:
 
Code Snippet
gamescript
set_zombie_var( "vision_file", "your_vision_file_name" );


And we're done adding a custom vision file into our map.
 
(Optional) Now i'll show you a script to change them in real time, so you can have different vision files for unique areas or made indoors/outdoors filters :
 
1. Go to your map folder, inside "maps" open your "mapname.gsc", scroll to the bottom and add this (There's some commented code to debug your vision file triggers):
 
Code Snippet
gamescript
vision_watcher()
{
    flag_wait("all_players_connected");

    for(;;)
    {
        self waittill("trigger", player);

        if( player IsTouching(self) && is_player_valid(player))
        {
            //IPrintLn("player inside " + self.script_noteworthy);
            player VisionSetNaked(self.script_noteworthy, 1 );
            level.last_visionfile = self.script_noteworthy;
            //IPrintLn(level.last_visionfile);
            //IPrintLn("player vision set to: " + self.script_noteworthy);
        }
       
        wait 0.1;
    }
   
}
2. Add this after your maps/_zombiemode::main();
 
Code Snippet
gamescript
vision_trigg = getentarray("vision_trigg", "targetname");
    array_thread(vision_trigg, ::vision_watcher);

Note: All 2.x steps are only needed if you're using gympie's perks
 
2.1 Add this before maps\_zombiemode::main();
 
Code Snippet
gamescript
level.last_visionfile = "your_vision_file_name";
2.2 Open "gympie_perks.iwd" with winrar or 7zip and go to "maps" and open "_zombiemode_perks_functions" and change all instances of
 
Code Snippet
gamescript
self VisionSetNaked( level.zombie_vars[ "vision_file" ], 1 );
Into:
 
Code Snippet
gamescript
self VisionSetNaked( level.last_visionfile, 1 );

3. Now open radiant and add as many triggers multiple as you need with the following kvps:
 
targetname vision_trigg
script_noteworthy vision_file_name
 
You need to add your vision file name under the script_noteworthy value
 
And you're done, you should have now a custom vision file and a script to change them whenever a player touch the triggers. For any questions or errors just leave a comment ;)

 
Loading ...