UGX-Mods Login

or login with an authentication provider below
Sign In with Google
Sign In with Twitter
Sign In with Discord
Sign In with Steam
Sign In with Facebook
Sign In with Twitch

Knee Slide (like CoD Ghosts/CoD Advanced Warfare)

HOT
broken avatar :(
Created 9 years ago
by espi_thekiller
0 Members and 1 Guest are viewing this topic.
13,557 views
broken avatar :(
×
broken avatar :(
Location: esAlbacete
Date Registered: 15 February 2014
Last active: 1 year ago
Posts
9
Respect
Forum Rank
Legless Crawler
Primary Group
Member
×
espi_thekiller's Contact & Social Links
This is my first tutorial in this page. This contribution has been entirely created by me  if you use this script give me credit.
First, open your mapname.gsc and before
Code Snippet
Plaintext
maps\_zombiemode::main();

Write:
Code Snippet
Plaintext
maps\_knee_slide::main();

Save and close the file.
Create a new GSC and within it put this:
Code Snippet
Plaintext
//================================================================================================//
// File Name  : Knee Slide (Movement Ghosts and AW)   //
// Author        : Espi_thekiller   //
// Notes          : call before zombiemode main   //
//        //
//================================================================================================//

#include maps\_utility;
#include common_scripts\utility;
#include maps\_zombiemode_utility;

main()
{
set_knee_slide_var( "ready_knee_time", 1.3 ); //TIME BETWEEN KNEE SLIDES
set_knee_slide_var( "knee_sliding_time", 1 ); //THE DURATION OF THE SLIDE
set_knee_slide_var( "knee_slide_force", 300 ); //THE FORCE WITH WHICH YOU SLIDE
thread add_weapons_main(); //DEFAULTS MOVE SPEED SCALE = 1
level thread on_player_connect();
}

add_weapons_main()
{
//Search \moveSpeedScale\ in your weapon file and copy the value
//EXAMPLE: add_weaps("zombie_colt", 1);

//add_weaps(<weap>, <movescale>);
add_weaps("zombie_sw_357", 0.9);
add_weaps("zombie_sw_357_upgraded", 0.9);
add_weaps("zombie_kar98k", 0.9);
add_weaps("zombie_kar98k_upgraded", 0.9);
add_weaps("zombie_m1carbine", 0.9);
add_weaps("zombie_m1carbine_upgraded", 0.9);
add_weaps("zombie_m1garand", 0.9);
add_weaps("zombie_m1garand_upgraded", 0.9);
add_weaps("zombie_gewehr43", 0.9);
add_weaps("zombie_gewehr43_upgraded", 0.9);
add_weaps("ptrs41_zombie", 0.75);
add_weaps("ptrs41_zombie_upgraded", 0.75);
add_weaps("m1garand_gl_zombie", 0.9);
add_weaps("m1garand_gl_zombie_upgraded", 0.9);
add_weaps("m2_flamethrower_zombie", 0.67);
add_weaps("m2_flamethrower_zombie_upgraded", 0.67);
add_weaps("zombie_30cal", 0.75);
add_weaps("zombie_30cal_upgraded", 0.75);
add_weaps("zombie_mg42", 0.75);
add_weaps("zombie_mg42_upgraded", 0.75);
add_weaps("panzerschrek_zombie", 0.75);
add_weaps("panzerschrek_zombie_upgraded", 0.75);
}

on_player_connect()
{
while(1)
{
level waittill( "connecting", player );
player thread ready_to_slide();
}
}

ready_to_slide()
{
flag_wait( "all_players_connected" );
self.is_sliding = false;
self.is_ready_to_slide = true;
while(1)
{
if(self IsSprinting() && self isonground())
self thread knee_slide();
wait 0.001;
}
}

knee_slide()
{
wait 0.1;
if(self getstance() == "crouch" && !self.is_sliding && self.is_ready_to_slide && self isonground())
{
self.is_sliding = true;
self.is_drinking = 1;
self setstance( "crouch" );
dvar = [];
dvar[0] = GetDvar("cg_gun_ofs_r");
dvar[1] = GetDvar("cg_gun_ofs_u");
dvar[2] = get_move_speed_scale(get_weap_index(self GetCurrentWeapon()));
self thread SetKneeSlideVars(dvar);
self AllowProne(false);
self AllowStand(false);
self AllowAds(false);
self AllowMelee(false);
self do_knee_slide(dvar,level._knee_slide_var["knee_slide_force"],level._knee_slide_var["knee_sliding_time"]);
self.is_drinking = undefined;
self AllowAds(true);
self AllowMelee(true);
self AllowProne(true);
self AllowStand(true);
}
}

do_knee_slide(dvar,force,time)
{
force = force*dvar[2];
angles = self GetPlayerAngles();
angles = (0,(angles[1]),0);
vec = AnglesToForward(angles);
i = 0;
self SetClientDvar("cg_gun_ofs_r",dvar[0]-5);
self SetClientDvar("cg_gun_ofs_u",dvar[1]+3);
time = time*0.18;
dist = 20;
while(i < time && self isonground() && dist > 5)
{
mo = self.origin;
i += 0.01;
wait 0.01;
self SetVelocity(vec * force);
dist = distance(mo, self.origin);
}
self end_knee_slide();
}

end_knee_slide()
{
self.is_sliding = false;
dvar = self GetKneeSlideVars();
self SetClientDvar("cg_gun_ofs_r",dvar[0]);
self SetClientDvar("cg_gun_ofs_u",dvar[1]);
self thread between_knee_slides();
self thread CleanKneeSlideVars();
}

between_knee_slides()
{
if(!self.is_sliding)
{
self.is_ready_to_slide = false;
if(level._knee_slide_var["ready_knee_time"] > 0)
wait level._knee_slide_var["ready_knee_time"];
self.is_ready_to_slide = true;
}
}

SetKneeSlideVars(dvar)
{
if(dvar.size > 1)
for(i=0;i<dvar.size;i++)
self.knee_slide_vars[i] = dvar[i];
else
self.knee_slide_vars[0] = dvar;
}

GetKneeSlideVars()
{
return self.knee_slide_vars;
}

CleanKneeSlideVars()
{
for(i=0;i<self.knee_slide_vars.size;i++)
if(IsDefined(self.knee_slide_vars[i]))
self.knee_slide_vars[i] = undefined;
}

get_weap_index(w)
{
for(i=0;i<level._knee_slide_weaps.size;i++)
if(level._knee_slide_weaps[i].weap == w)
return i;
return -1;
}

get_move_speed_scale(index)
{
if(index < 0)
return 1;
return level._knee_slide_weaps[index].movespeedscale;
}

set_knee_slide_var(var, value)
{
if(!IsDefined(level._knee_slide_var))
level._knee_slide_var = [];
level._knee_slide_var[var] = value;
}

add_weaps(weap, movespeedscale)
{
if(!IsDefined(level._knee_slide_weaps))
level._knee_slide_weaps = [];

struct = SpawnStruct();
struct.weap = weap;
struct.movespeedscale = movespeedscale;
level._knee_slide_weaps[level._knee_slide_weaps.size] = struct;
}

IsSprinting()
{
max_v = 280;
mas_v_vector = 110;
index = get_weap_index(self GetCurrentWeapon());
move_scale = get_move_speed_scale(index);
v = self getVelocity();
v1_c2 = abs(v[0])*abs(v[0]);
v2_c2 = abs(v[1])*abs(v[1]);
total_velocidad = sqrt(v1_c2 + v2_c2);
max_v12 = Int(max_v*move_scale);
if(total_velocidad >= max_v12)
{
mas_v_vector2 = Int(mas_v_vector*move_scale);
if(abs(v[0]) > mas_v_vector2 || abs(v[1]) > mas_v_vector2)
return true;
}
return false;
}

Save as:
Code Snippet
Plaintext
_knee_slide.gsc

I hope you like it. Any bug, comments section.
You can edit the weapons you want.
broken avatar :(
×
broken avatar :(
The Last of Us
Location: scotland
Date Registered: 28 September 2013
Last active: 12 days ago
Posts
1,463
Respect
Forum Rank
Zombie Colossus
Primary Group
UGX V.I.P.
My Groups
More
My Contact & Social Links
More
Personal Quote
ฏ๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎
Signature
×
smasher248's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
UGX V.I.P.
UGX V.I.P.
Community Mapper Has released one or more maps to the UGX-Mods community which have been added to the UGX Map Manager.
BO3 Modtools Alpha
BO3 Modtools Alpha
This user has access to the Black Ops 3 Modtools Alpha
smasher248's Contact & Social Linkssmasher248smasher248
this looks good, i will try this out and let you know how it goes
broken avatar :(
×
broken avatar :(
True Blue Elite
Location: auAustralia
Date Registered: 8 February 2015
Last active: 7 months ago
Posts
688
Respect
Forum Rank
Zombie Enslaver
Primary Group
Donator ♥
My Groups
More
My Contact & Social Links
More
Personal Quote
Still Kickin'
Signature


×
Andy Whelan's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Andy Whelan's Contact & Social LinksAndyWhelanAndyWhelan01AndyWhelan
Can we see a video? Just to see if it works :)
broken avatar :(
×
broken avatar :(
Location: esAlbacete
Date Registered: 15 February 2014
Last active: 1 year ago
Posts
9
Respect
Forum Rank
Legless Crawler
Primary Group
Member
×
espi_thekiller's Contact & Social Links
https://youtu.be/lCkVGif__b4

This is my first tutorial in this page. This contribution has been entirely created by me  if you use this script give me credit.
First, open your mapname.gsc and before
Code Snippet
Plaintext
maps\_zombiemode::main();

Write:
Code Snippet
Plaintext
maps\_knee_slide::main();

Save and close the file.
Create a new GSC and within it put this:
Code Snippet
Plaintext
//================================================================================================//
// File Name  : Knee Slide (Movement Ghosts and AW)   //
// Author        : Espi_thekiller   //
// Notes          : call before zombiemode main   //
//        //
//================================================================================================//

#include maps\_utility;
#include common_scripts\utility;
#include maps\_zombiemode_utility;

main()
{
set_knee_slide_var( "ready_knee_time", 1.3 ); //TIME BETWEEN KNEE SLIDES
set_knee_slide_var( "knee_sliding_time", 1 ); //THE DURATION OF THE SLIDE
set_knee_slide_var( "knee_slide_force", 300 ); //THE FORCE WITH WHICH YOU SLIDE
thread add_weapons_main(); //DEFAULTS MOVE SPEED SCALE = 1
level thread on_player_connect();
}

add_weapons_main()
{
//Search \moveSpeedScale\ in your weapon file and copy the value
//EXAMPLE: add_weaps("zombie_colt", 1);

//add_weaps(<weap>, <movescale>);
add_weaps("zombie_sw_357", 0.9);
add_weaps("zombie_sw_357_upgraded", 0.9);
add_weaps("zombie_kar98k", 0.9);
add_weaps("zombie_kar98k_upgraded", 0.9);
add_weaps("zombie_m1carbine", 0.9);
add_weaps("zombie_m1carbine_upgraded", 0.9);
add_weaps("zombie_m1garand", 0.9);
add_weaps("zombie_m1garand_upgraded", 0.9);
add_weaps("zombie_gewehr43", 0.9);
add_weaps("zombie_gewehr43_upgraded", 0.9);
add_weaps("ptrs41_zombie", 0.75);
add_weaps("ptrs41_zombie_upgraded", 0.75);
add_weaps("m1garand_gl_zombie", 0.9);
add_weaps("m1garand_gl_zombie_upgraded", 0.9);
add_weaps("m2_flamethrower_zombie", 0.67);
add_weaps("m2_flamethrower_zombie_upgraded", 0.67);
add_weaps("zombie_30cal", 0.75);
add_weaps("zombie_30cal_upgraded", 0.75);
add_weaps("zombie_mg42", 0.75);
add_weaps("zombie_mg42_upgraded", 0.75);
add_weaps("panzerschrek_zombie", 0.75);
add_weaps("panzerschrek_zombie_upgraded", 0.75);
}

on_player_connect()
{
while(1)
{
level waittill( "connecting", player );
player thread ready_to_slide();
}
}

ready_to_slide()
{
flag_wait( "all_players_connected" );
self.is_sliding = false;
self.is_ready_to_slide = true;
while(1)
{
if(self IsSprinting() && self isonground())
self thread knee_slide();
wait 0.001;
}
}

knee_slide()
{
wait 0.1;
if(self getstance() == "crouch" && !self.is_sliding && self.is_ready_to_slide && self isonground())
{
self.is_sliding = true;
self.is_drinking = 1;
self setstance( "crouch" );
dvar = [];
dvar[0] = GetDvar("cg_gun_ofs_r");
dvar[1] = GetDvar("cg_gun_ofs_u");
dvar[2] = get_move_speed_scale(get_weap_index(self GetCurrentWeapon()));
self thread SetKneeSlideVars(dvar);
self AllowProne(false);
self AllowStand(false);
self AllowAds(false);
self AllowMelee(false);
self do_knee_slide(dvar,level._knee_slide_var["knee_slide_force"],level._knee_slide_var["knee_sliding_time"]);
self.is_drinking = undefined;
self AllowAds(true);
self AllowMelee(true);
self AllowProne(true);
self AllowStand(true);
}
}

do_knee_slide(dvar,force,time)
{
force = force*dvar[2];
angles = self GetPlayerAngles();
angles = (0,(angles[1]),0);
vec = AnglesToForward(angles);
i = 0;
self SetClientDvar("cg_gun_ofs_r",dvar[0]-5);
self SetClientDvar("cg_gun_ofs_u",dvar[1]+3);
time = time*0.18;
dist = 20;
while(i < time && self isonground() && dist > 5)
{
mo = self.origin;
i += 0.01;
wait 0.01;
self SetVelocity(vec * force);
dist = distance(mo, self.origin);
}
self end_knee_slide();
}

end_knee_slide()
{
self.is_sliding = false;
dvar = self GetKneeSlideVars();
self SetClientDvar("cg_gun_ofs_r",dvar[0]);
self SetClientDvar("cg_gun_ofs_u",dvar[1]);
self thread between_knee_slides();
self thread CleanKneeSlideVars();
}

between_knee_slides()
{
if(!self.is_sliding)
{
self.is_ready_to_slide = false;
if(level._knee_slide_var["ready_knee_time"] > 0)
wait level._knee_slide_var["ready_knee_time"];
self.is_ready_to_slide = true;
}
}

SetKneeSlideVars(dvar)
{
if(dvar.size > 1)
for(i=0;i<dvar.size;i++)
self.knee_slide_vars[i] = dvar[i];
else
self.knee_slide_vars[0] = dvar;
}

GetKneeSlideVars()
{
return self.knee_slide_vars;
}

CleanKneeSlideVars()
{
for(i=0;i<self.knee_slide_vars.size;i++)
if(IsDefined(self.knee_slide_vars[i]))
self.knee_slide_vars[i] = undefined;
}

get_weap_index(w)
{
for(i=0;i<level._knee_slide_weaps.size;i++)
if(level._knee_slide_weaps[i].weap == w)
return i;
return -1;
}

get_move_speed_scale(index)
{
if(index < 0)
return 1;
return level._knee_slide_weaps[index].movespeedscale;
}

set_knee_slide_var(var, value)
{
if(!IsDefined(level._knee_slide_var))
level._knee_slide_var = [];
level._knee_slide_var[var] = value;
}

add_weaps(weap, movespeedscale)
{
if(!IsDefined(level._knee_slide_weaps))
level._knee_slide_weaps = [];

struct = SpawnStruct();
struct.weap = weap;
struct.movespeedscale = movespeedscale;
level._knee_slide_weaps[level._knee_slide_weaps.size] = struct;
}

IsSprinting()
{
max_v = 280;
mas_v_vector = 110;
index = get_weap_index(self GetCurrentWeapon());
move_scale = get_move_speed_scale(index);
v = self getVelocity();
v1_c2 = abs(v[0])*abs(v[0]);
v2_c2 = abs(v[1])*abs(v[1]);
total_velocidad = sqrt(v1_c2 + v2_c2);
max_v12 = Int(max_v*move_scale);
if(total_velocidad >= max_v12)
{
mas_v_vector2 = Int(mas_v_vector*move_scale);
if(abs(v[0]) > mas_v_vector2 || abs(v[1]) > mas_v_vector2)
return true;
}
return false;
}

Save as:
Code Snippet
Plaintext
_knee_slide.gsc

I hope you like it. Any bug, comments section.
You can edit the weapons you want.
broken avatar :(
×
broken avatar :(
Location: gbMilton Keynes
Date Registered: 17 January 2014
Last active: 4 years ago
Posts
6,877
Respect
1,004Add +1
Forum Rank
Immortal
Primary Group
Community Scripter
My Groups
More
My Contact & Social Links
More
Signature
If you want scripts / features made for you, then contact me by PM or email / skype etc
it will cost you tho so if you have no intention of reciprocating don't even waste my time ;)
×
Harry Bo21's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Community Scripter Has shown effort and knowledge in the area of scripting while being a part of the UGX-Mods community.
Harry Bo21's Contact & Social Links[email protected]HarryBo21HarryBo000
is this second post, something you want us to overwrite the first post with? Is it a update?
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 21 April 2013
Last active: 8 years ago
Posts
49
Respect
Forum Rank
Legless Crawler
Primary Group
Member
My Contact & Social Links
More
×
Nice job! The slide is my favorite move. Are you thinking about trying to tackle the viewmodel anims as well? It's definitely possible if you're up for the challenge, I think my version turned out pretty good...check out my YT channel. Keep up the great work.
broken avatar :(
×
broken avatar :(
Location: 00
Date Registered: 20 June 2014
Last active: 9 days ago
Posts
768
Respect
Forum Rank
The Decider
Primary Group
Member
Personal Quote
Behold the power of Mirror Force
Signature
The greatest failure is not to try and fail, but is to fail without trying.
×
Ramiabdh's Groups
Ramiabdh's Contact & Social Links
is this second post, something you want us to overwrite the first post with? Is it a update?

There's this video he posted:

https://youtu.be/lCkVGif__b4
broken avatar :(
×
broken avatar :(
Location: esAlbacete
Date Registered: 15 February 2014
Last active: 1 year ago
Posts
9
Respect
Forum Rank
Legless Crawler
Primary Group
Member
×
espi_thekiller's Contact & Social Links
Nice job! The slide is my favorite move. Are you thinking about trying to tackle the viewmodel anims as well? It's definitely possible if you're up for the challenge, I think my version turned out pretty good...check out my YT channel. Keep up the great work.
Your version is better that mine, how can i make the anims like yours?
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 21 April 2013
Last active: 8 years ago
Posts
49
Respect
Forum Rank
Legless Crawler
Primary Group
Member
My Contact & Social Links
More
×
Your version is better that mine, how can i make the anims like yours?
Your version is good too, the extra boost you get from sliding can help keep you alive. I used the M9A1 slide anims from ghosts (was a pain in the ass porting it to waw, had to reanimate the left gun). After you get some viewmodel slide anims, you just need to add them to an additional weapon file...utilizing the pullout, idle, and putaway anim slots. The worldmodel anims are a different story, but once you get used to playeranimtypes you can just use the crouch anim like I did (the slide anim from ghosts and aw looks so much better lol).
broken avatar :(
×
broken avatar :(
Location: gbMilton Keynes
Date Registered: 17 January 2014
Last active: 4 years ago
Posts
6,877
Respect
1,004Add +1
Forum Rank
Immortal
Primary Group
Community Scripter
My Groups
More
My Contact & Social Links
More
×
Harry Bo21's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Community Scripter Has shown effort and knowledge in the area of scripting while being a part of the UGX-Mods community.
Harry Bo21's Contact & Social Links[email protected]HarryBo21HarryBo000
Your version is good too, the extra boost you get from sliding can help keep you alive. I used the M9A1 slide anims from ghosts (was a pain in the ass porting it to waw, had to reanimate the left gun). After you get some viewmodel slide anims, you just need to add them to an additional weapon file...utilizing the pullout, idle, and putaway anim slots. The worldmodel anims are a different story, but once you get used to playeranimtypes you can just use the crouch anim like I did (the slide anim from ghosts and aw looks so much better lol).
can utilize putaway/pullout - empty for these things too sometimes. I did that with the shield
broken avatar :(
  • steviewonder87
  • Deleted Member
×
broken avatar :(
steviewonder87
This user is deleted :(
Can you upload a video of this so people can see it in action?
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 14 September 2013
Last active: 4 years ago
Posts
1,895
Respect
Forum Rank
Zombie Destroyer
Primary Group
Community Scripter
My Groups
More
My Contact & Social Links
More
Personal Quote
BE ORIGINAL
Signature
×
MakeCents's Groups
Community Mapper Has released one or more maps to the UGX-Mods community which have been added to the UGX Map Manager.
Community Scripter Has shown effort and knowledge in the area of scripting while being a part of the UGX-Mods community.
BO3 Modtools Alpha
BO3 Modtools Alpha
This user has access to the Black Ops 3 Modtools Alpha
Can you upload a video of this so people can see it in action?

http://youtu.be/lCkVGif__b4

He did, just didn't place it well.
broken avatar :(
×
broken avatar :(
Location: de
Date Registered: 18 October 2013
Last active: 12 days ago
Posts
652
Respect
Forum Rank
Zombie Enslaver
Primary Group
Donator ♥
My Groups
More
×
InFInIX's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Oil Rig Beta Access
Oil Rig Beta Access
InFInIX's Contact & Social Links
Looks good are you able to shot while sliding?
broken avatar :(
×
broken avatar :(
Location: esAlbacete
Date Registered: 15 February 2014
Last active: 1 year ago
Posts
9
Respect
Forum Rank
Legless Crawler
Primary Group
Member
×
espi_thekiller's Contact & Social Links
Looks good are you able to shot while sliding?
Yes but you can't ads and buy perks, weapons, ..
broken avatar :(
×
broken avatar :(
Location: gbNewport
Date Registered: 2 November 2014
Last active: 2 years ago
Posts
1,265
Respect
Forum Rank
Zombie Colossus
Primary Group
Member
My Contact & Social Links
More
Personal Quote
Embrace the Darkness
×
Tim Smith's Groups
Tim Smith's Contact & Social Linkstimsmith90THEREALBaDBoY17TimSmithMy clan Website
so sick dude but as i recall ghosts did it very smoothly and so as AW , anyway it's still better than nothing .

good job man +1 for you .

 
Loading ...