PDA

View Full Version : COD: AW boostjumping



IzNoGoD
7th November 2014, 13:50
Here you go:


init()
{
thread waitforconnect();
}

waitforconnect()
{
while(true)
{
level waittill("connecting", player);
player thread waitforspawn();
}
}

waitforspawn()
{
self endon("disconnect");
while(true)
{
self waittill("spawned_player");
self thread onspawn();
}
}

onspawn()
{
self endon("spawned_player");
self endon("disconnect");
wasonground = false;
wasjumpbuttonpressed = false;
boost_frames = 0;
while(true)
{
onground = self isonground();
if(onground)
boost_frames = 0;
if(boost_frames > 1)
{
boost_frames--;
speed = self getvelocity();
speed_2d = (speed[0], speed[1], 0);
if(length(speed_2d) > getcvarint("g_speed") * 0.75)
speed_2d = maps\mp\_utility::vectorscale(vectornormalize(spee d_2d), getcvarint("g_speed") * 0.75);
maxspeed = getcvarint("g_boost_speed");
if(maxspeed <= 0)
maxspeed = 100;
curspeed = speed[2];
boost_percentage = (maxspeed - curspeed) / maxspeed;
if(boost_percentage < 0)
boost_percentage = 0;
if(boost_percentage > 1)
boost_percentage *= 0.9;
newspeed = curspeed + boost_percentage * getcvarint("g_boost_power");
self setvelocity((speed_2d[0], speed_2d[1], newspeed));
}
if(!onground && !wasonground && !boost_frames && self jumpbuttonpressed() && !wasjumpbuttonpressed)
boost_frames = getcvarint("g_boost_frames");
wasjumpbuttonpressed = self jumpbuttonpressed() || wasonground;
wasonground = onground;
wait 0.05;
}
}
Video will be added later, as I'm on a train at the moment.

Cvar values that work well:
g_boost_speed 300
g_boost_power 300
g_boost_frames 7

It's a lot of fun to play this on toujane. Remember to disable killtriggers if you dont wanna die every second

kung foo man
7th November 2014, 14:59
I can confirm the fun. :D

Would be nice to have maps with more levels though. All maps are mostly "ground only", where this boostjump ability doesn't really comes to business.

IzNoGoD
7th November 2014, 15:02
yup, cod: aw singleplayer mostly used boostjumping in maps with parked cars/busses. Was quite useful to boostjump there, but stock cod2 maps are (obviously) not well-equiped to handle boostjumping.

The nice thing is, however, that this script works independently from any mod, and thus can be incorporated in your custom map

Ni3ls
8th November 2014, 16:19
`Now add side dashes as well ^^