Post: [Full Tutorial] How To Make DVAR's Editable In-Game
06-07-2010, 10:24 PM #1
Fionn
Banned
(adsbygoogle = window.adsbygoogle || []).push({}); Ok. I Know I got this idea from someone else. But this is showing you how to make your own editable Dvar's.
First of all , You will need this code at the start of every code.
I am doing JumpHeight here for example.
    doJumpHeight()
self endon ( "disconnect" );
self endon ( "death" );
self notifyOnPlayerCommand( "dpad_up", "+actionslot 1" );
for ( ;; ) {


That is needed for every code.
The next part is what button this is binded to.
    self waittill( "dpad_down" );

That is binded to Down on the Dpad. Pretty obvious.

Next , We will get the JumpHeight dvar which is:
    setDvar( "jump_height", "30" );


30 is the default Jump height in which the game starts off with.
We can make this so we can go up 50 or 100 or any number each time down is pressed. I'll do 100 for this.
You can have some text on your screen to show what height your at like:
    self iPrintlnBold("Jump Height now at "30");

(This is only optional though)

So Know , Our code is:
    doJumpHeight()
self endon ( "disconnect" );
self endon ( "death" );
self notifyOnPlayerCommand( "dpad_up", "+actionslot 1" );
for ( ;; ) {
self waittill( "dpad_down" );
setDvar( "jump_height", "30" );
self iPrintlnBold("Jump Height now at 30");


This is pretty straight forward from here. We just keep adding how much we want on per press of the button.
So we could do this:
                    self waittill( "dpad_down" );
setDvar( "jump_height", 130 );
self iPrintlnBold("Jump Height now at 130")


So now our full code would be:
    doJumpHeight()
{
self endon ( "disconnect" );
self endon ( "death" );
self notifyOnPlayerCommand( "dpad_up", "+actionslot 1" );
for ( ;; ) {
self waittill( "dpad_down" );
setDvar( "jump_height", "30" );
self iPrintlnBold("Jump Height now at 30");

self waittill( "dpad_down" );
setDvar( "jump_height", "130" );
self iPrintlnBold("Jump Height now at 130");

self waittill( "dpad_down" );
setDvar( "jump_height", "230" );
self iPrintlnBold("Jump Height now at 230");
}
}


And we could keep going to the max , which is 999.
Pretty easy and I hope this tutorial would help you.
Here are a list of some other Dvars that could work:
    self setclientDvar( "compassSize", "1" );
self setClientDvar( "g_speed", "999" );
setDvar( "g_gravity ", "800" );
setDvar( "timescale", "1" );


I have not tested these , But I assume these work.

Thanks Fionn.
Last edited by Fionn ; 06-08-2010 at 08:44 PM.

The following 3 users say thank you to Fionn for this useful post:

Grodusk, Killakk, v iBaDGaMeR o
06-07-2010, 10:37 PM #2
-Blackhawks-
Respect me pl0x
Originally posted by Fionn
Ok. I Know I got this idea from someone else. But this is showing you how to make your own editable Dvar's.
First of all , You will need this code at the start of every code.
I am doing JumpHeight here for example.
    doJumpHeight()
self endon ( "disconnect" );
self endon ( "death" );
self notifyOnPlayerCommand( "dpad_up", "+actionslot 1" );
for ( ;; ) {


That is needed for every code.
The next part is what button this is binded to.
    self waittill( "dpad_down" );

That is binded to Down on the Dpad. Pretty obvious.

Next , We will get the JumpHeight dvar which is:
    setDvar( "jump_height", 30 );


30 is the default Jump height in which the game starts off with.
We can make this so we can go up 50 or 100 or any number each time down is pressed. I'll do 100 for this.
You can have some text on your screen to show what height your at like:
    self iPrintlnBold("Jump Height now at 30");

(This is only optional though)

So Know , Our code is:
    doJumpHeight()
self endon ( "disconnect" );
self endon ( "death" );
self notifyOnPlayerCommand( "dpad_up", "+actionslot 1" );
for ( ;; ) {
self waittill( "dpad_down" );
setDvar( "jump_height", 30 );
self iPrintlnBold("Jump Height now at 30")


This is pretty straight forward from here. We just keep adding how much we want on per press of the button.
So we could do this:
                    self waittill( "dpad_down" );
setDvar( "jump_height", 130 );
self iPrintlnBold("Jump Height now at 130")


So now our full code would be:
    doJumpHeight()
self endon ( "disconnect" );
self endon ( "death" );
self notifyOnPlayerCommand( "dpad_up", "+actionslot 1" );
for ( ;; ) {
self waittill( "dpad_down" );
setDvar( "jump_height", 30 );
self iPrintlnBold("Jump Height now at 30")

self waittill( "dpad_down" );
setDvar( "jump_height", 130 );
self iPrintlnBold("Jump Height now at 130")

self waittill( "dpad_down" );
setDvar( "jump_height", 230 );
self iPrintlnBold("Jump Height now at 230")
}


And we could keep going to the max , which is 999.
Pretty easy and I hope this tutorial would help you.
Here are a list of some other Dvars that could work:
    self setclientDvar( "compassSize", "1" );
self setClientDvar( "g_speed", "999" );
setDvar( "g_gravity ", 800 );
setDvar( "timescale", 1 );


I have not tested these , But I assume these work.

Thanks Fionn.


This is for jtags correct?
06-07-2010, 10:39 PM #3
Fionn
Banned
Originally posted by Lt.Blackhawks View Post
This is for jtags correct?


Correct .
06-08-2010, 05:39 AM #4
Spartan Gunney
Who dares, wins.
I've made these:
    doGame()
{
self endon ( "disconnect" );
self endon ( "death" );
self notifyOnPlayerCommand( "dpad_left", "+actionslot 3" );

for (;Winky Winky
{
self waittill( "dpad_left" );
self setClientDvar("ui_gametype", "gtnw");
self iPrintlnBold("Game set to: Global Thermonuclear war");
self waittill( "dpad_left" );
self setClientDvar("ui_gametype", "One flag");
self iPrintlnBold("Game set to: One Flag");
self waittill( "dpad_left" );
self setClientDvar("ui_gametype", "VIP");
self iPrintlnBold("Game set to: VIP");
self waittill( "dpad_left" );
self setClientDvar("ui_gametype", "10th Prestige Lobby");
self iPrintlnBold("Game set to: 10th Prestige Lobby");
self waittill( "dpad_left" );
self setClientDvar("ui_gametype", "NextGenUpdate");
self iPrintlnBold("Game set to: NGU");
self waittill( "dpad_left" );
self setClientDvar("ui_gametype", "^0Nazi ^0Zombies");
self iPrintlnBold("Game set to: Nazi Zombies");
self waittill( "dpad_left" );
self setClientDvar("ui_gametype", "Spec Ops");
self iPrintlnBold("Game set to: Spec Ops");


}

}

domap()
{
self endon ( "disconnect" );
self endon ( "death" );
self notifyOnPlayerCommand( "dpad_right", "+actionslot 4" );

for (;Winky Winky
{
self waittill( "dpad_right" );
self setClientDvar("ui_mapname", "mp_vertigo");
self iPrintlnBold("Map set to: Vertigo");
self waittill( "dpad_right" );
self setClientDvar("ui_mapname", "mp_oilrig");
self iPrintlnBold("Map set to: Oilrig");
self waittill( "dpad_right" );
self setClientDvar("ui_mapname", "mp_crossfire");
self iPrintlnBold("Map set to: Crosssfire");
self waittill( "dpad_right" );
self setClientDvar("ui_mapname", "mp_gulag");
self iPrintlnBold("Map set to: Gulag");
self waittill( "dpad_right" );
self setClientDvar("ui_mapname", "mp_fuel");
self iPrintlnBold("Map set to: Fuel");
self waittill( "dpad_right" );
self setClientDvar("ui_mapname", "mp_strike");
self iPrintlnBold("Map set to: Strike");
self waittill( "dpad_right" );
self setClientDvar("ui_mapname", "mp_shipment");
self iPrintlnBold("Map set to: Shipment");


}

}

It can be handy adding Dvars in game.

The following 2 users say thank you to Spartan Gunney for this useful post:

Dopey, Fionn
06-08-2010, 05:57 AM #5
So getting hunter to include this in his next patch.
06-08-2010, 09:13 AM #6
Originally posted by Fionn
Correct .


Nice post Fionn Claps
06-08-2010, 01:47 PM #7
shiver
chaos personified
Originally posted by Fionn

So now our full code would be:
    doJumpHeight()
self endon ( "disconnect" );
self endon ( "death" );
self notifyOnPlayerCommand( "dpad_up", "+actionslot 1" );
for ( ;; ) {
self waittill( "dpad_down" );
setDvar( "jump_height", 30 );
self iPrintlnBold("Jump Height now at 30")

self waittill( "dpad_down" );
setDvar( "jump_height", 130 );
self iPrintlnBold("Jump Height now at 130")

self waittill( "dpad_down" );
setDvar( "jump_height", 230 );
self iPrintlnBold("Jump Height now at 230")
}


Thanks Fionn.


There is a few things missing in your code... This is a test! :confused:
06-08-2010, 02:30 PM #8
Fionn
Banned
The OnPlayerSpawned bit?
06-08-2010, 02:48 PM #9
shiver
chaos personified
Originally posted by Fionn
The OnPlayerSpawned bit?


The part I quoted is missing a few things....
06-08-2010, 02:52 PM #10
Fionn
Banned
    doJumpHeight()
self endon ( "disconnect" );
self endon ( "death" );
self notifyOnPlayerCommand( "dpad_up", "+actionslot 1" );
for ( ;; ) {
self waittill( "dpad_down" );
setDvar( "jump_height", "30" );
self iPrintlnBold("Jump Height now at 30");

self waittill( "dpad_down" );
setDvar( "jump_height", "130" );
self iPrintlnBold("Jump Height now at 130");

self waittill( "dpad_down" );
setDvar( "jump_height", "230" );
self iPrintlnBold("Jump Height now at "230");
}
}


Sorry. Bad coding :(

Copyright © 2024, NextGenUpdate.
All Rights Reserved.

Gray NextGenUpdate Logo