Skip to content
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Donate
Collapse

Plutonium

  1. Home
  2. BO2 Modding Support & Discussion
  3. Using r_xxxx dvars through a GSC file?

Using r_xxxx dvars through a GSC file?

Scheduled Pinned Locked Moved BO2 Modding Support & Discussion
7 Posts 4 Posters 643 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • Ultimatemanundefined Offline
    Ultimatemanundefined Offline
    Ultimateman
    wrote on last edited by
    #1

    Hi!
    I was wondering if it's possible to have dvars such as r_skyTransition loaded through a gsc file?
    I can change them through a console once in the map but I would like them to be loaded through a gsc file so I wouldn't have to change the values everytime I hop on in the map.
    I already have tried loading them in via gsc but either I'm fucking up with something or then it's not possible..
    Any advice / answers are much appreciated.
    Thanks!

    TheHiddenHourundefined 1 Reply Last reply
    0
    • TheHiddenHourundefined Offline
      TheHiddenHourundefined Offline
      TheHiddenHour Contributor
      replied to Ultimateman on last edited by
      #2

      @Dev-Ultimateman Can you show the code you've already tried? You'd generally do something like setDvar("r_skyTransition", "1"); in init().

      Ultimatemanundefined 1 Reply Last reply
      0
      • Sorexundefined Offline
        Sorexundefined Offline
        Sorex Contributor
        wrote on last edited by
        #3

        @Dev-Ultimateman On console you mean in game console?

        Ultimatemanundefined 1 Reply Last reply
        0
        • Ultimatemanundefined Offline
          Ultimatemanundefined Offline
          Ultimateman
          replied to TheHiddenHour on last edited by
          #4

          TheHiddenHour code goes as follows in the _clientids.gsc:
          #include maps/mp/gametypes/_hud_util;
          #include maps/mp/_utility;
          #include common_scripts/utility;
          #include maps/mp/zombies/_zm_utility;
          #include maps/mp/gametypes_zm/_hud_util;
          #include maps/mp/gametypes_zm/_hud_message;
          #include maps/mp/zombies/_zm_weapons;
          #include maps/mp/zombies/_zm_net;

          init()
          {
          //level.clientid = 0;
          level.player_out_of_playable_area_monitor = 0; //This doesn't disable deathbarriers yet but needs to be "initialized" here.
          level.inital_spawn = true;
          level thread onplayerconnect();
          init_flags();
          setDvar( "sv_cheats", 1 );
          setDvar( "developer", 2 );
          setDvar( "developer_script", 1 );
          setDvar( "zombie_cheat", 1 );
          setDvar( "sv_clientside", 1 );
          setDvar( "r_skyTransition", 0 );

          level.devcheater = 1;
          

          }

          onplayerconnect() //checked matches cerberus output
          {
          for ( ;; )
          {
          level.player_out_of_playable_area_monitor = 0; // if this is placed somewhere else, deathbarriers will start working again. //Ultimateman August 2020.
          level.devcheater = 1;
          level waittill( "connecting", player );
          //player.clientid = level.clientid;
          //level.clientid++;
          player thread onplayerSpawned();
          player thread enable_ufo_mod();
          }
          }

          onplayerSpawned()
          {
          self endon ( "disconnect" );
          level endon ( "game_ended" );
          self.initial_spawn = true;

          Text = createfontstring("objective", 1.0);
          Text setPoint("CENTER", "CENTER", -370, -200);
          Text setText("^2Unpatched Alpha Build ^21.5\n^7Developed by Ultimateman\n^2Black Ops 2");
          Text.alpha = 0.7;
          
          for( ;; )
          {
          	self waittill( "spawned_player" );
              
          
          	if ( level.inital_spawn )
          	{
          		level.inital_spawn = false;
          
          		level thread post_all_players_spawned();
          	}
          
          	if ( self.inital_spawn )
          	{
          		self.inital_spawn = false;
          
          		//----------------Developement stuff-------------//
          		//---------------Ultimateman Changes-------------//
          
          		self.score = 50000; //---DeV
          		self.ignoreme = 1; //---DeV
          		//self enableInvulnerability(); //---DeV
          		//self giveWeapon( "blundersplat_upgraded_zm");  //---DeV ||MOTD
          		//self giveMaxAmmo( "blundersplat_upgraded_zm"); //---DeV ||MOTD
          		self giveWeapon( "ray_gun_zm" ); //---Online / Dev ||ALL MAPS
          		self giveMaxAmmo( "ray_gun_zm" ); //---Online / Dev ||ALL MAPS
          		maps/mp/zombies/_zm_perks::give_perk( "specialty_armorvest", 0 ); //---Dev / Online
          
          		
          
                  wait 4;
                  self thread showConnectMessage();
          		
          
          		//---------------------------------------//
          		//---REMOVING THE HUD FROM THIS POINT---//
          		//--------------------------------------//
          		//---HUD_VISIBLE, 0 ONLY REMOVES HUD---//
          		//------SV_CHEATS 1 IN THE INIT-------//
          		//---CG_CROSSHAIR 0 IN THE CONSOLE---//
          		wait 12; 
          		players = getplayers();
          		i = 0;
          		while ( i < players.size )
              	{
                  	players[ i ] setclientuivisibilityFlag( "hud_visible", 1 ); //Set to 0 when recording
          			players[ i ] setclientuivisibilityFlag( "hud_crosshair", 0 );
          			players[ i ] setclientuivisibilityFlag( "hud_obituaries", 0 );
          			players[ i ] setclientuivisibilityFlag( "hud_showobjicons", 0 );
                  	if ( i > players.size )
                  		{
                      		players[ i ] setclientuivisibilityFlag( "hud_visible", 1 );
          					players[ i ] setclientuivisibilityFlag( "weapon_hud_visible", 1 );
                  		}
                		i++;
              	}
          		player thread spawn_if_round_one();     
          
          		//player thread visual_changes_highrise();
          	}
          }
          

          }

          post_all_players_spawned()
          {
          //flag_wait( "start_zombie_round_logic" );

          wait 0.05;
          
          level.local_doors_stay_open = 1;
          
          level.power_local_doors_globally = 1;
          

          }

          debugCredits()
          {
          for (;;)
          {
          self iPrintLn( "^6BO2 ^7Zombies Debug ^2Build ^7v.^61.5" );
          wait 2;
          self iPrintLn( "^6Developed ^7by ^2Ultimateman" );
          }
          }

          DeathBarriersCantTouchMe()
          {
          while( isDefined (level.player_out_of_playable_area_monitor) )
          {
          level.player_out_of_playable_area_monitor = 0;
          }
          }

          showConnectMessage()
          {
          self endon( "disconnect" );
          self iprintln("^7Hello:^6 " + self.name);
          wait 1.5;
          self iPrintLn("^6Welcome to the alpha build of unpatched maps! ^7:)");
          wait 4.0;
          self iPrintLn( "This patch ^2supports:" );
          wait 2.0;
          self iPrintLn( "OG Trample Steam ^2Glitches^7||" );
          wait 2.0;
          self iPrintLn( "Disabled ^2Deathbarriers^7||" );
          wait 3.0;
          self iPrintLn( "Unpatched Collision ^2Fixes^7||" );
          wait 1.0;
          self iPrintLn( "Unpatched Zombie ^2Pile Ups^7||" );
          wait 1.0;
          self iPrintLn( "^5More ^7Stuff ^5Coming ^7Soon^2||" );
          wait 1.0;
          }

          online_joining_and_given_score() //get thenwhen into game
          {
          wait 5;
          if ( self.sessionstate == "spectator" && level.round_number <= 15 )
          {
          self [ level.spawnplayer ];
          if ( level.script != "zm_tomb" || level.script != "zm_prison" || !is_classic() )
          {
          thread maps\mp\zombies_zm::refresh_player_navcard_hud();
          }
          if ( level.round_number < 5 )
          {
          self.score = 2500;
          }
          else if ( level.round_number < 10 )
          {
          self.score = 5000;
          }
          else if ( level.round_number < 13 )
          {
          self.score = 7500;
          }
          else if ( level.round_number >=15 )
          {
          self.score = 9500;
          }

          }
          else if ( self.sessionstate == "spectator" && level.round_number >= 15 )
          {
          	self.score = 10000;
          }
          

          }

          init_flags()
          {
          flag_init( "spawn_zombies", 1 );//set to 0 when recording tuts
          flag_init( "hud_visible", 0 );
          }

          spawn_if_round_one() //force spawn player
          {
          wait 5; //waits for blackscreen to load
          if ( self.sessionstate == "spectator" && level.round_number == 1 )
          {
          self [ level.spawnplayer ];
          if ( level.script != "zm_tomb" || level.script != "zm_prison" || !is_classic() )
          {
          thread maps\mp\zombies_zm::refresh_player_navcard_hud();
          }
          }
          }

          doUFOMode()
          {
          self endon("EndUFOMode");
          self.Fly = 0;
          UFO = spawn("script_model",self.origin);
          for(;;)
          {
          if(self FragButtonPressed())
          {
          self setclientuivisibilityflag( "hud_visible", 0 );
          self disableweapons();
          self playerLinkTo(UFO);
          self.Fly = 1;
          }
          else
          {
          self setclientuivisibilityflag( "hud_visible", 0 );
          self unlink();
          self enableweapons();
          self.Fly = 0;
          }
          if(self.Fly == 1)
          {
          Fly = self.origin + vector_scale( anglesToForward( self getPlayerAngles(), 10)); //speed

                  UFO moveTo(Fly, .1); //from point a TO b		
              }
              wait .001;
          }
          

          }
          enable_ufo_mod(){
          ufo_state = false;
          for(;;)
          {
          if(self actionslotonebuttonpressed() && self adsbuttonpressed() && !ufo_state)
          {
          self iprintln("UFO Mode ^2ON");
          ufo_state = true;
          self thread doUFOMode();
          }
          else if(ufo_state && self actionslotonebuttonpressed() && self adsbuttonpressed())
          {
          self iprintln("UFO Mode ^1OFF");
          ufo_state = false;
          self notify("EndUFOMode");
          }
          wait .001;
          }

          }

          vector_scale(vec, scale)
          {
          vec = (vec[0] * scale, vec[1] * scale, vec[2] * scale);
          return vec;
          }

          setclientdvars( dvar_name, value )
          {
          dvar = (dvar_name[0] * value, dvar_name[1] * value, dvar_name[2] * value);
          return dvar_name;
          }
          /*
          visual_changes_highrise()
          {
          setDvar ( "r_skyTransition", 0 );
          setDvar ( "r_skyColorTemp", 25000 );
          setDvar ( "r_skyRotation", 4 );
          setDvar ( "r_sky_intensity_angle0", 39 );
          setDvar ( "r_sky_intensity_angle1", 39 );
          setDvar ( "r_blur", 0.6 );
          setDvar ( "r_alphamap", 128 );
          setDvar ( "r_colormap", 2 );
          setDvar ( "r_bloomHiQuality", 1 );
          setDvar ( "r_dof_tweak", 1 );
          setDvar ( "r_dof_farblur", 2 );
          setDvar ( "r_dof_nearblur", 6 );
          setDvar ( "r_dof_viewmodelend", 5 );
          setDvar ( "r_dofHDR", 2 );
          setDvar ( "r_lightTweakSunLight", 30 );
          setDvar ( "r_dof_nearstart", 15 );
          setDvar ( "r_lightTweakSunDirection", -36, -142, 0 );
          setDvar ( "r_enablePlayerShadow", 1 );
          setDvar ( "r_lodbiasrigid", -1000 );
          setDvar ( "r_lodbiasskinned", -1000 );
          }
          */

          1 Reply Last reply
          0
          • Ultimatemanundefined Offline
            Ultimatemanundefined Offline
            Ultimateman
            replied to Sorex on last edited by
            #5

            Sorex I can change the values in "in game console" but can't get them to work through gsc

            JezuzLizardundefined 1 Reply Last reply
            0
            • Sorexundefined Offline
              Sorexundefined Offline
              Sorex Contributor
              wrote on last edited by
              #6

              @Dev-Ultimateman beacuse is a client dvar, on server side you need to change client dvar and not common dvar

              1 Reply Last reply
              0
              • JezuzLizardundefined Offline
                JezuzLizardundefined Offline
                JezuzLizard Plutonium Staff
                replied to Ultimateman on last edited by
                #7

                @Dev-Ultimateman Its not possible to set dvars on clients from gsc in T6. Clientside dvars need to be set by the client themselves or thru certain internal gsc functions created specifically for setting those dvars.

                1 Reply Last reply
                0

                • Login

                • Don't have an account? Register

                • Login or register to search.
                • First post
                  Last post
                0
                • Recent
                • Tags
                • Popular
                • Users
                • Groups
                • Donate