Sign in to follow this  
killbill88

gravity and speed settings

Recommended Posts

26 minutes ago, killbill88 said:

Hi everyone,

 

I'm  noob sorry, but how can i change speed and gravity in config file?

 

Thanks for ur help,

Kill3ill ;)

set g_gravity "800" //Gravity //Standard 800

set g_speed "190" // normal 180 or 190 I forget what normal speed is

Share this post


Link to post
Share on other sites
5 hours ago, killbill88 said:

Is it in config.cfg file? If yes, where to place the line?

 

Thanks,

 

kb

I place it near the end of the server,cfg file  but it can be placed any where in the file

try setting set g_gravity "550"  to see if it works for you - you should be able to jump high but die when you land

I have a gsx file that allows me to make a high jumping server and turn it off at will

I turn it on my setting script_number2 to 1 and turn it off by setting script_number2 to 0

set script_mumber2 1 // to turn on jumping

or set script_number2 0 //to turn off jumping

I use the set script_number2  instead of set g_gravity in my server.cfg

my gsx file is named _jump.gsx

and is called by _callbacksetup.gsx 

CodeCallback_StartGameType()
{
    // If the gametype has not beed started, run the startup
    if(!isDefined(level.gametypestarted) || !level.gametypestarted)
    {
        thread code\init::startGameType();
        [[level.callbackStartGameType]]();

        level.gametypestarted = true; // so we know that the gametype has been started up
thread maps\mp\gametypes\_jump::init();

this is whats inside _jump.gsx

init(){
            
        if(getdvarint("script_number2")==1)

setDvar("jump_height","600");            
setDvar("g_gravity","550");                        
setDvar("jump_slowdownEnable","0");                
setDvar("bg_fallDamageMaxHeight","1000");
setDvar("bg_fallDamageMinHeight","500");

if(getdvarint("script_number2")==0){
setDvar("g_gravity","800");
setDvar("jump_height","39");
setDvar("bg_fallDamageMaxHeight","300");
setDvar("jump_slowdownEnable","1");
setDvar("bg_fallDamageMinHeight","128");    
}

}

Edited by wkuzma

Share this post


Link to post
Share on other sites

thanks a lot , i ll have try and tell u:)

But if i only want to set one setting about gravity and speed do i need to make 2 dvars?Cause it seems to be setted in config.file but never found where. So what do you recommend you to me?

 

KB

 

Edited by killbill88

Share this post


Link to post
Share on other sites

does it work like this: 

init(){
                           
setDvar("g_gravity","550");                        

}

}

and for speed:

init(){
                           
setDvar("g_speed","220");                        

}

}

Share this post


Link to post
Share on other sites
10 hours ago, killbill88 said:

does it work like this: 

init(){
                           
setDvar("g_gravity","550");                        

}

}

and for speed:

init(){
                           
setDvar("g_speed","220");                        

}

}

no --  but this will work

init(){

setDvar("g_gravity","550"); 

setDvar("g_speed","220");

}

but you still have to call it from _callbacksetup.gsx

Edited by wkuzma

Share this post


Link to post
Share on other sites

Thanks for  your replies Wkuzma., but i still have issues about that. I created a gravity.gsx file and i filled it with ur dvar and setted my callbacksetup.gsx like this: 

//    Callback Setup
//    This script provides the hooks from code into script for the gametype callback functions.

//=============================================================================
// Code Callback functions

/*================
Called by code after the level's main script function has run.
================*/
CodeCallback_StartGameType()
{
    // If the gametype has not beed started, run the startup
    if(!isDefined(level.gametypestarted) || !level.gametypestarted)
    {
        [[level.callbackStartGameType]]();

        level.gametypestarted = true; // so we know that the gametype has been started up
        
        thread welcome::init(); // Initializes the welcome script.
        
        thread gravity::init(); //gravity and speed settings. 
    }
}

/*================
Called when a player begins connecting to the server.
Called again for every map change or tournement restart.

Return undefined if the client should be allowed, otherwise return
a string with the reason for denial.

 

Otherwise, the client will be sent the current gamestate
and will eventually get to ClientBegin.

firstTime will be qtrue the very first time a client connects
to the server machine, but qfalse on map changes and tournement
restarts.
================*/
CodeCallback_PlayerConnect()
{
    self endon("disconnect");
    [[level.callbackPlayerConnect]]();
}

===> Result: Speed and gravity are still the same :(. I think these two values are setted somewhere in COD4x New Experience  folder, but never found where?! 

 

Kb

Edited by killbill88

Share this post


Link to post
Share on other sites

I do not run the "cod4x ne" so I can not help on that.

where did you place your gravity.gsx file  since my thread looks for it in the

cod4x/main_shared/maps/mp/gametypes directory and is called by

thread maps\mp\gametypes\_jump::init(); in the callbacksetup.gsx

and your post is thread gravity::init(); //gravity and speed settings.

Edited by wkuzma

Share this post


Link to post
Share on other sites

My gravity.gsx file is  now in cod4x/main_shared/maps/mp/gametypes directory 

and my thread is in callbacksetup.gsx 

=>thread maps\mp\gametypes\gravity::init();

I did this error to put my gravity.gsx file in main_shared directory  and not in main_shared/maps/mp/gametypes directory .

Now it works fine , thanks a lot Wkuzma :)

 

KB :)

Edited by killbill88

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this