[Tutorial] Code choose to Remove Grass

Results 1 to 2 of 2
  1. #1
    My Status --> LukasCCB is offline
    MemberRank
    Apr 2013 Join Date
    CracolandiaLocation
    1,190Posts

    [Tutorial] Code choose to Remove Grass

    this function allows the player to remove the grass from the map just for him.
    he can do this using the options in the options, I made a tutorial on how to do this.
    or he does it going in the folder.

    C:\Users\LukasCCB\Documents\Arktos\WarZ\gameSettings.ini
    changing the value



    r_allow_render_grass 0
    0 = Disable - Hide Grass
    1 = Active - Show Grass


    Sorry my english.


    WarZ.sln


    Vars.h
    Search
    Code:
    REG_VAR( r_show_grass_texture_scale    , 1.f        , 0 );

    Add
    Code:
    REG_VAR( r_allow_render_grass        , true        , VF_SAVE ); // Remove grass

    RenderDeffered.cpp
    Search
    Code:
    } enableDisableShaderLoading; ( void )enableDisableShaderLoading;

    Add
    Code:
        LoadGrassShaders(true); // Remove this line and change
    
    
        //LoadGrassShaders(true); // New func for Remove Grass
        if(r_allow_render_grass->GetBool())
        {
          LoadGrassShaders(false);
        }
        else
        {
            LoadGrassShaders(true);
        }

    LevelEditor.cpp
    Search
    Code:
    SetLoadingProgress( LoadProgress += GROUPS_PROGRESS );

    Add || Replace line below for this
    Code:
        {
            LoadGrassLib();
            //////////
            if(r_allow_render_grass->GetBool()) // Remove Grass
            {
                g_pGrassMap->Load( r3dGameLevel::GetHomeDir() );
            }
            //////////
    
    
            //r3dOutToLog( "g_pGrassMap->Load...\n" ); // Remove Grass
            //g_pGrassMap->Load( r3dGameLevel::GetHomeDir() ); // Remove Grass

    FrontEndWarZ.cpp
    Search || this should be repeated 2 times
    Code:
    int old_vsync = r_vsync_enabled->GetInt();
        r_vsync_enabled            ->SetInt((int)args[22].GetNumber()-1);

    Add
    Code:
    int old_grass = r_allow_render_grass->GetInt(); // Remove Grass
        r_allow_render_grass ->SetInt((int)args[23].GetNumber()-1); // Remove Grass

    and change this line like
    Code:
        if(old_fullscreen!=r_fullscreen->GetInt() || old_vsync!=r_vsync_enabled->GetInt() || old_grass != r_allow_render_grass->GetInt() )

    HUDPause.cpp
    Search
    Code:
    var[29].SetNumber( r_vsync_enabled->GetInt()+1);

    Add
    Code:
    var[30].SetNumber( r_allow_render_grass->GetInt()+1); // Remove Grass

    repeat all this in 2 places.

    I will post Increase fps, if the haters do what you have to do :D
    Last edited by LukasCCB; 22-03-16 at 08:51 PM.


  2. #2
    Account Upgraded | Title Enabled! GetRektBambi is offline
    MemberRank
    Oct 2015 Join Date
    268Posts

    Re: [Tutorial] Code choose to Remove Grass

    Depending what source you have,
    if like mine it's original untouched: make sure you remove all the if not defined to final tags. Otherwise it will not make a blind bit of difference in client.

    keep your eyes peeled for #ifndef FINAL and #endif, all which apply to the above changes only.



Advertisement