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

Trying to convert the BO1 thunder gun script to WaW

broken avatar :(
Created 11 years ago
by Harry Bo21
0 Members and 1 Guest are viewing this topic.
3,379 views
broken avatar :(
×
broken avatar :(
Location: gbMilton Keynes
Date Registered: 17 January 2014
Last active: 6 years ago
Posts
6,875
Respect
Forum Rank
Immortal
Primary Group
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.
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 LinksHarryBo000[email protected]HarryBo21
Ok, so i added any missing functions, and changed the only part that I couldnt track down the function for in the black ops files

Ive threaded it in mapname.gsc

Am I missing some thing?

Also im missing the FX, anyone feel like sharing? :) :) :)

Code Snippet
Plaintext
#include maps\_utility; 
#include common_scripts\utility;
#include maps\_zombiemode_utility;
#include maps\_zombiemode_net;
#using_animtree( "generic_human" );
init()
{
if( !maps\_zombiemode_weapons::is_weapon_included( "zombie_thundergun" ) )
{
return;
}

//level._effect["thundergun_viewmodel_power_cell1"] = loadfx("weapon/thunder_gun/fx_thundergun_power_cell_view1");
//level._effect["thundergun_viewmodel_power_cell2"] = loadfx("weapon/thunder_gun/fx_thundergun_power_cell_view2");
//level._effect["thundergun_viewmodel_power_cell3"] = loadfx("weapon/thunder_gun/fx_thundergun_power_cell_view3");
//level._effect["thundergun_viewmodel_steam"] = loadfx("weapon/thunder_gun/fx_thundergun_steam_view");
//level._effect["thundergun_viewmodel_power_cell1_upgraded"] = loadfx("weapon/thunder_gun/fx_thundergun_power_cell_view1");
//level._effect["thundergun_viewmodel_power_cell2_upgraded"] = loadfx("weapon/thunder_gun/fx_thundergun_power_cell_view2");
//level._effect["thundergun_viewmodel_power_cell3_upgraded"] = loadfx("weapon/thunder_gun/fx_thundergun_power_cell_view3");
//level._effect["thundergun_viewmodel_steam_upgraded"] = loadfx("weapon/thunder_gun/fx_thundergun_steam_view");
//level._effect["thundergun_knockdown_ground"] = loadfx( "weapon/thunder_gun/fx_thundergun_knockback_ground" );
//level._effect["thundergun_smoke_cloud"] = loadfx( "weapon/thunder_gun/fx_thundergun_smoke_cloud" );
set_zombie_var( "thundergun_cylinder_radius", 180 );
set_zombie_var( "thundergun_fling_range", 480 );
set_zombie_var( "thundergun_gib_range", 900 );
set_zombie_var( "thundergun_gib_damage", 75 );
set_zombie_var( "thundergun_knockdown_range", 1200 );
set_zombie_var( "thundergun_knockdown_damage", 15 );
level.thundergun_gib_refs = [];
level.thundergun_gib_refs[level.thundergun_gib_refs.size] = "guts";
level.thundergun_gib_refs[level.thundergun_gib_refs.size] = "right_arm";
level.thundergun_gib_refs[level.thundergun_gib_refs.size] = "left_arm";
level thread thundergun_on_player_connect();
}
thundergun_on_player_connect()
{
for( ;; )
{
level waittill( "connecting", player );
player thread wait_for_thundergun_fired();
}
}
wait_for_thundergun_fired()
{
self endon( "disconnect" );
self waittill( "spawned_player" );
for( ;; )
{
self waittill( "weapon_fired" );
currentweapon = self GetCurrentWeapon();
if( ( currentweapon == "zombie_thundergun" ) || ( currentweapon == "zombie_thundergun_upgraded" ) )
{
self thread thundergun_fired();
view_pos = self GetTagOrigin( "tag_flash" ) - self GetPlayerViewHeight();
view_angles = self GetTagAngles( "tag_flash" );
playfx( level._effect["thundergun_smoke_cloud"], view_pos, AnglesToForward( view_angles ), AnglesToUp( view_angles ) );
}
}
}
thundergun_network_choke()
{
level.thundergun_network_choke_count++;

if ( !(level.thundergun_network_choke_count % 10) )
{
wait_network_frame();
wait_network_frame();
wait_network_frame();
}
}
thundergun_fired()
{

PhysicsExplosionCylinder( self.origin, 600, 240, 1 );

if ( !IsDefined( level.thundergun_knockdown_enemies ) )
{
level.thundergun_knockdown_enemies = [];
level.thundergun_knockdown_gib = [];
level.thundergun_fling_enemies = [];
level.thundergun_fling_vecs = [];
}
self thundergun_get_enemies_in_range();

level.thundergun_network_choke_count = 0;
for ( i = 0; i < level.thundergun_fling_enemies.size; i++ )
{
thundergun_network_choke();
level.thundergun_fling_enemies[i] thread thundergun_fling_zombie( self, level.thundergun_fling_vecs[i], i );
}
for ( i = 0; i < level.thundergun_knockdown_enemies.size; i++ )
{
thundergun_network_choke();
level.thundergun_knockdown_enemies[i] thread thundergun_knockdown_zombie( self, level.thundergun_knockdown_gib[i] );
}
level.thundergun_knockdown_enemies = [];
level.thundergun_knockdown_gib = [];
level.thundergun_fling_enemies = [];
level.thundergun_fling_vecs = [];
}
thundergun_get_enemies_in_range()
{
//view_pos = self GetWeaponMuzzlePoint();
view_pos = self.origin + (0,0, 72/2 + 10);//72 = player height. plus 10 because your center is a little lower than your gun's muzzle
zombies = get_array_of_closest( view_pos, GetAiSpeciesArray( "axis", "all" ), undefined, undefined, level.zombie_vars["thundergun_knockdown_range"] );
if ( !isDefined( zombies ) )
{
return;
}
knockdown_range_squared = level.zombie_vars["thundergun_knockdown_range"] * level.zombie_vars["thundergun_knockdown_range"];
gib_range_squared = level.zombie_vars["thundergun_gib_range"] * level.zombie_vars["thundergun_gib_range"];
fling_range_squared = level.zombie_vars["thundergun_fling_range"] * level.zombie_vars["thundergun_fling_range"];
cylinder_radius_squared = level.zombie_vars["thundergun_cylinder_radius"] * level.zombie_vars["thundergun_cylinder_radius"];
forward_view_angles = anglesToForward(self getPlayerAngles()); //self GetWeaponForwardDir();
end_pos = view_pos + vector_scale( forward_view_angles, level.zombie_vars["thundergun_knockdown_range"] );
for ( i = 0; i < zombies.size; i++ )
{
if ( !IsDefined( zombies[i] ) || !IsAlive( zombies[i] ) )
{

continue;
}
test_origin = zombies[i] getcentroid();
test_range_squared = DistanceSquared( view_pos, test_origin );
if ( test_range_squared > knockdown_range_squared )
{
zombies[i] thundergun_debug_print( "range", (1, 0, 0) );
return;
}
normal = VectorNormalize( test_origin - view_pos );
dot = VectorDot( forward_view_angles, normal );
if ( 0 > dot )
{

zombies[i] thundergun_debug_print( "dot", (1, 0, 0) );
continue;
}

radial_origin = PointOnSegmentNearestToPoint( view_pos, end_pos, test_origin );
if ( DistanceSquared( test_origin, radial_origin ) > cylinder_radius_squared )
{

zombies[i] thundergun_debug_print( "cylinder", (1, 0, 0) );
continue;
}
if ( 0 == zombies[i] DamageConeTrace( view_pos, self ) )
{

zombies[i] thundergun_debug_print( "cone", (1, 0, 0) );
continue;
}
if ( test_range_squared < fling_range_squared )
{
level.thundergun_fling_enemies[level.thundergun_fling_enemies.size] = zombies[i];

dist_mult = (fling_range_squared - test_range_squared) / fling_range_squared;
fling_vec = VectorNormalize( test_origin - view_pos );

if ( 5000 < test_range_squared )
{
fling_vec = fling_vec + VectorNormalize( test_origin - radial_origin );
}
fling_vec = (fling_vec[0], fling_vec[1], abs( fling_vec[2] ));
fling_vec = vector_scale( fling_vec, 100 + 100 * dist_mult );
level.thundergun_fling_vecs[level.thundergun_fling_vecs.size] = fling_vec;
zombies[i] thread setup_thundergun_vox( self, true, false, false );
}
else if ( test_range_squared < gib_range_squared )
{
level.thundergun_knockdown_enemies[level.thundergun_knockdown_enemies.size] = zombies[i];
level.thundergun_knockdown_gib[level.thundergun_knockdown_gib.size] = true;
zombies[i] thread setup_thundergun_vox( self, false, true, false );
}
else
{
level.thundergun_knockdown_enemies[level.thundergun_knockdown_enemies.size] = zombies[i];
level.thundergun_knockdown_gib[level.thundergun_knockdown_gib.size] = false;
zombies[i] thread setup_thundergun_vox( self, false, false, true );
}
}
}
thundergun_debug_print( msg, color )
{
}
thundergun_fling_zombie( player, fling_vec, index )
{
if( !IsDefined( self ) || !IsAlive( self ) )
{

return;
}
if ( IsDefined( self.thundergun_fling_func ) )
{
self [[ self.thundergun_fling_func ]]( player );
return;
}

self DoDamage( self.health + 666, player.origin, player );
if ( self.health <= 0 )
{
points = 10;
if ( !index )
{
points = maps\_zombiemode_score::get_zombie_death_player_points();
}
else if ( 1 == index )
{
points = 30;
}
player maps\_zombiemode_score::player_add_points( "thundergun_fling", points );

self StartRagdoll();
self LaunchRagdoll( fling_vec );
self.thundergun_death = true;
}
}
thundergun_knockdown_zombie( player, gib )
{
self endon( "death" );
playsoundatposition ("vox_thundergun_forcehit", self.origin);
playsoundatposition ("wpn_thundergun_proj_impact", self.origin);
if( !IsDefined( self ) || !IsAlive( self ) )
{

return;
}
if ( IsDefined( self.thundergun_knockdown_func ) )
{
self [[ self.thundergun_knockdown_func ]]( player, gib );
}
else
{

self DoDamage( level.zombie_vars["thundergun_knockdown_damage"], player.origin, player );


}

if ( gib )
{
self.a.gib_ref = random( level.thundergun_gib_refs );
//self thread animscripts\zombie_death::do_gib();
}
self.thundergun_handle_pain_notetracks = ::handle_thundergun_pain_notetracks;
self DoDamage( level.zombie_vars["thundergun_knockdown_damage"], player.origin, player );
self playsound( "fly_thundergun_forcehit" );

}
handle_thundergun_pain_notetracks( note )
{
if ( note == "zombie_knockdown_ground_impact" )
{
playfx( level._effect["thundergun_knockdown_ground"], self.origin, AnglesToForward( self.angles ), AnglesToUp( self.angles ) );
self playsound( "fly_thundergun_forcehit" );
}
}
is_thundergun_damage()
{
return IsDefined( self.damageweapon ) && (self.damageweapon == "thundergun_zm" || self.damageweapon == "thundergun_upgraded_zm") && (self.damagemod != "MOD_GRENADE" && self.damagemod != "MOD_GRENADE_SPLASH");
}
enemy_killed_by_thundergun()
{
return ( IsDefined( self.thundergun_death ) && self.thundergun_death == true );
}
thundergun_sound_thread()
{
self endon( "disconnect" );
self waittill( "spawned_player" );
for( ;; )
{
result = self waittill_any_return( "grenade_fire", "death", "player_downed", "weapon_change", "grenade_pullback" );
if ( !IsDefined( result ) )
{
continue;
}
if( ( result == "weapon_change" || result == "grenade_fire" ) && self GetCurrentWeapon() == "thundergun_zm" )
{
self PlayLoopSound( "tesla_idle", 0.25 );
}
else
{
self notify ("weap_away");
self StopLoopSound(0.25);
}
}
}
setup_thundergun_vox( player, fling, gib, knockdown )
{
if( !IsDefined( self ) || !IsAlive( self ) )
{
return;
}

if( !fling && ( gib || knockdown ) )
{
if( 25 > RandomIntRange( 1, 100 ) )
{

}
}

if( fling )
{
if( 30 > RandomIntRange( 1, 100 ) )
{

//player maps\_zombiemode_audio::create_and_play_dialog( "kill", "thundergun" );
}
}


vector_scale(vec, scale)
{
vec = (vec * scale);
return vec;
}
broken avatar :(
×
broken avatar :(
Location: nlApeldoorn
Date Registered: 17 December 2013
Last active: 2 years ago
Posts
1,186
Respect
1,332Add +1
Forum Rank
Zombie Colossus
Primary Group
Scripter Elite
My Groups
More
My Contact & Social Links
More
Personal Quote
It aint much, if it aint Dutch
Signature
×
BluntStuffy's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Scripter Elite Has shown excellence and experience in the area of custom scripting in the UGX-Mods community.
Oil Rig Beta Access
Oil Rig Beta Access
BluntStuffy's Contact & Social LinksBluntStuffyBluntstuffy@BluntZombieStuffyZombie
Code Snippet
Plaintext
view_pos = self GetTagOrigin( "tag_flash" )

That doesn't work in WaW, you cant acces the gunmodel in .gsc as far as i know. You would have to come up with an alternative for that..
broken avatar :(
×
broken avatar :(
Senpai
Location: us
Date Registered: 28 September 2013
Last active: 10 months ago
Posts
602
Respect
Forum Rank
Zombie Enslaver
Primary Group
Box Mappers Elite
My Groups
More
My Contact & Social Links
More
×
arceus's Groups
Box Mappers Elite
Box Mappers Elite
arceus's Contact & Social LinksarceusNT
replace
Code Snippet
Plaintext
view_pos = self GetTagOrigin( "tag_flash" )

with
Code Snippet
Plaintext
view_pos = self.origin + (0,0,45);
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 14 September 2013
Last active: 6 years ago
Posts
1,895
Respect
Forum Rank
Zombie Destroyer
Primary Group
Scripter
My Groups
More
My Contact & Social Links
More
Personal Quote
BE ORIGINAL
Signature
×
MakeCents's Groups
Mapper Has released one or more maps to the UGX-Mods 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
Are you trying to do this?

thundergun with more lights

If so, I scripted the fx/lights on the csc side and copied the tesla fx and modified them for the thundergun. Still could use tweaking though, I just decided not to use it for now, so I stopped tweaking it. If this is it, just pm me and I will send you all the files and stuff later tonight.
Last Edit: January 02, 2015, 03:00:36 pm by MakeCents
broken avatar :(
×
broken avatar :(
Location: gbMilton Keynes
Date Registered: 17 January 2014
Last active: 6 years ago
Posts
6,875
Respect
Forum Rank
Immortal
Primary Group
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.
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 LinksHarryBo000[email protected]HarryBo21
Ive actually sorted the script, working great

Ive got the FX from CFG factory, the only thing its missing is the lights so ill look at that, thanks bro :)

 
Loading ...