CYCLE_SPEED_LIMIT
CYCLE_SPEED_LIMIT_DECAY
Once the players bike speed is >= CYCLE_SPEED_LIMIT the acceleration is altered by CYCLE_SPEED_LIMIT_DECAY
Ive set the default value for CYCLE_SPEED_LIMIT 99999 so that it will not effect the game play if the commands are not in the server configs
For testing I set CYCLE_SPEED_LIMIT 100 and CYCLE_SPEED_LIMIT_DECAY -1 , this made the game play normally as long as I kept my speed below the limit but once I had exceeded it my bike accelerated wildly causing it to crash and explode which is exactly what I was trying to achieve, no more speeders in my server !
I just tested it on some friends with lan and got many WTF?'s / LOL's and on the whole everyone enjoyed it once they had got used to it
The code is based on the cycle_speed_decay_above stuff thats already in there, I wasnt sure what the nConfItemVersionWatcher::Group_Bumpy was all about so I copied it as is into my new variables and it seems to work but let me know if it needs changing
so heres my mods that I added to gCycleMovement.cpp
variables
Code: Select all
// galaxy invader add speed limit variable
REAL sg_speedCycleLimit = 99999;
static nSettingItemWatched<REAL> c_sl("CYCLE_SPEED_LIMIT",
sg_speedCycleLimit,
nConfItemVersionWatcher::Group_Bumpy,
8);
// galaxy invader add speed limit acceleration factor
REAL sg_speedCycleLimitDecay = -1;
static nSettingItemWatched<REAL> c_sld("CYCLE_SPEED_LIMIT_DECAY",
sg_speedCycleLimitDecay,
nConfItemVersionWatcher::Group_Bumpy,
8);
Code: Select all
REAL baseSpeed = sg_speedCycle * SpeedMultiplier();
if ( verletSpeed_ <= ( sg_correctAccelerationScaling.Supported() ? baseSpeed : sg_speedCycle ) )
acceleration+=( baseSpeed - verletSpeed_) * sg_speedCycleDecayBelow;
else
acceleration+=( baseSpeed - verletSpeed_) * sg_speedCycleDecayAbove;
// galaxy invader top speed limit changes
if ( verletSpeed_ >= sg_speedCycleLimit )
acceleration+=( baseSpeed - verletSpeed_) * sg_speedCycleLimitDecay;
Thanks