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

[TUTORIAL] Mortar Strike

HOT
broken avatar :(
Created 8 years ago
by BluntStuffy
0 Members and 1 Guest are viewing this topic.
12,058 views
broken avatar :(
×
broken avatar :(
Location: nlApeldoorn
Date Registered: 17 December 2013
Last active: 1 year ago
Posts
1,187
Respect
1,404Add +1
Forum Rank
Zombie Colossus
Primary Group
Community 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.
Community 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 LinksBluntstuffy@BluntZombieBluntStuffyStuffyZombie
Just a fun script i came across a few days ago, have it laying around for ages but not going to use it myself prob so why not upload it?


Instructions included in the dl as well.


Add this to a .csv:
Code Snippet
Plaintext
// mortar strike
sound,mortar_strike,,,
weapon,sp/mortar_strike
material,hud_icon_m8_white_smoke
xmodel,projectile_us_smoke_grenade
xmodel,mortar_shell
fx,weapon/satchel/fx_explosion_satchel_generic
fx,blst_custom/streak_marker_smoke
fx,misc/fx_ui_airstrike_smk_green



Open _zombiemode, around line 60-70 you'll see similar line's. Add this one:

Code Snippet
Plaintext
	maps\_blst_mortar_strike::init();

   


( this might be a bit different in your version of _weapons, so pay attention! )
open _zombiemode_weapons, and look for this line inside the treasure_chest_give_weapon() function:
Code Snippet
Plaintext
	if( !( weapon_string == "fraggrenade" || weapon_string == "stielhandgranate" || weapon_string == "molotov" || weapon_string == "zombie_cymbal_monkey" ) )

Add this part to it:
Code Snippet
Plaintext
	|| weapon_string == "mortar_strike"
   
   
So it looks like:
Code Snippet
Plaintext
	if( !( weapon_string == "fraggrenade" || weapon_string == "stielhandgranate" || weapon_string == "molotov" || weapon_string == "zombie_cymbal_monkey" || weapon_string == "mortar_strike" ) )



Next a few lines down, you'll see this line:
Code Snippet
Plaintext
	if( weapon_string != "fraggrenade" && weapon_string != "stielhandgranate" && weapon_string != "molotov" && weapon_string != "zombie_cymbal_monkey" )
   
This time we're going to add:
Code Snippet
Plaintext
	&& weapon_string != "mortar_strike" 
   
So in the end it looks like:
Code Snippet
Plaintext
			if( weapon_string != "fraggrenade" && weapon_string != "stielhandgranate" && weapon_string != "molotov" && weapon_string != "zombie_cymbal_monkey" && weapon_string != "mortar_strike" )




Next look for the function treasure_chest_give_weapon(), and in there look for these lines:
Code Snippet
Plaintext
	self GiveWeapon( weapon_string, 0 );
self GiveMaxAmmo( weapon_string );
self SwitchToWeapon( weapon_string );
   
Right ABOVE those lines, paste in these new ones:
Code Snippet
Plaintext
	if( weapon_string == "mortar_strike" )
{
self thread maps\_blst_mortar_strike::player_give_mortar();
play_weapon_vo("zombie_cymbal_monkey");
return;
}
   



Dont forget to add the weapon 'mortar_strike" to both dlc3_code and _zombiemode_weapons, like you would with any other weapon.



If you want to give the players a mortar strike in another way then through the box, use this line of code ( using 'give' in the console will not work!! ):

   player thread maps\_blst_mortar_strike::player_give_mortar();



The Script:
Spoiler: click to open...
Code Snippet
Plaintext
#include maps\_utility;
#include common_scripts\utility;
#include maps\_zombiemode_utility;

////////////////////////////////////////////////
///// Mortar Strike:    /////
///// by: BluntStuffy    /////
///// Please give credit when used..       /////
////////////////////////////////////////////////

init()
{
// level thread test_mortar_strike(); // put this line back in to get a mortar strike 3 seconds after the game starts ( for testing )

level.mortar_drop_count = 35; // amount of mortars that will be launched

level.mortar_damages_other_players = false; // if other players can take damage from your mortar strike

level.player_mortar_radius = 250; // radius of effect of the mortars on the players
level.player_mortar_damage = 50; // max damage from a mortar, when a player is in the center of the radius

level.zombie_mortar_radius = 300; // radius of effect of the mortars on zombies
level.zombie_mortar_damage = 1200; // max damage from a mortar, when a zombie is in the center of the radius

    level._effect[ "marker_explode" ] = loadfx( "misc/fx_ui_airstrike_smk_green");
    level._effect[ "mortar_explosion" ] = loadfx( "weapon/satchel/fx_explosion_satchel_generic");
level._effect[ "mortar_trail" ] = loadfx( "weapon/grenade/fx_trail_rifle_grenade" );
precachemodel( "mortar_shell" );

}

test_mortar_strike()
{
wait 3;

player = get_players();
for( i=0 ;i<player.size ; i++ )
{
player[i] thread player_give_mortar();
}
}

player_give_mortar()
{
self giveweapon("mortar_strike");
self setactionslot(3,"weapon","mortar_strike");
self setweaponammostock("mortar_strike",1);
self thread player_marker_fired();
}

player_marker_fired()
{
self notify( "starting_mortar_watch" );
self endon( "starting_mortar_watch" );

while( 1 )
{
grenade = get_thrown_marker();
if( isdefined( grenade ) )
{
if( self maps\_laststand::player_is_in_laststand() )
{
grenade delete();
continue;
}
grenade hide();
model = spawn( "script_model", grenade.origin );
model SetModel( "projectile_us_smoke_grenade" );
model linkTo( grenade );
model.angles = grenade.angles;
velocitySq = 100000;
oldPos = grenade.origin;

while( velocitySq != 0 )
{
wait( 0.05 );
velocitySq = distanceSquared( grenade.origin, oldPos );
oldPos = grenade.origin;
}

model unlink();
model thread marker_model_cleanup( grenade );

level thread mortar_strike( grenade.origin, self );
}
wait 0.05;
}
}


get_thrown_marker()
{
self endon( "starting_mortar_watch" );

while( true )
{
self waittill( "grenade_fire", grenade, weapname );
if( weapname == "mortar_strike" )
{
return grenade;
}

wait 0.05;
}
}

marker_model_cleanup( grenade )
{
while( 1 )
{
if( !isDefined( grenade ) )
{
if( isDefined( self ) )
{
playfx( level._effect["marker_explode"], self.origin );
self delete();
}
break;
}
wait 0.05;
}
}

mortar_strike( origin, player )
{
mortar_count = level.mortar_drop_count;
mortar_impacts = [];
mortar = [];

for( i=0;i<mortar_count;i++ )
{
offset1 = randomintrange( -400, 401 );
offset2 = randomintrange( -400, 401 );
offset3 = origin+(0,0,75);

mortar_impacts[mortar_impacts.size] = (groundpos( origin+(offset1,offset2,offset3[2]) ) + (0,0,15) );
}

wait 3;
offset1 = randomintrange( 600, 701 );
offset2 = randomintrange( 600, 701 );

for( i=0;i<mortar_impacts.size;i++ )
{
mortar_angle = vectortoangles( mortar_impacts[i]+(offset1,offset2,2500) - mortar_impacts[i] );

mortar[i] = spawn( "script_model", mortar_impacts[i]+(offset1,offset2,2500) );
mortar[i] setmodel( "mortar_shell" );
mortar[i].angles = (mortar_angle-(90,0,90));

mortar[i] hide();
wait randomfloatrange( 0.10, 0.35 );
mortar[i] thread fire_mortar( mortar_impacts[i], player );
}
}

fire_mortar( impact_origin, player )
{
self show();

self.fx_tag = spawn( "script_model", self.origin );
self.fx_tag setmodel( "tag_origin" );
self.fx_tag.angles = self.angles;
self.fx_tag linkto( self );
playfxontag( level._effect["mortar_trail"], self.fx_tag, "tag_origin" );

self moveto( impact_origin, 0.8, 0.15, 0 );
playsoundatposition( "mortar_incoming", impact_origin );
wait 0.9;

self.fx_tag unlink();
self.fx_tag delete();

Earthquake( 0.6, 0.5, impact_origin, 450);
playfx( level._effect["mortar_explosion"], impact_origin );
playsoundatposition( "grenade_explode", impact_origin );

mortar_damage_players(impact_origin, player);
mortar_damage_zombies(impact_origin, player);
physicsexplosioncylinder( impact_origin, 400, 75, 1 );

self delete();
}

mortar_damage_players(impact_origin, player)
{
players = get_array_of_closest(impact_origin, get_players(), undefined, undefined, level.player_mortar_radius);

if( isdefined( players ) && players.size != 0 )
{
for(i=0;i<players.size;i++)
{
if( players[i] != player && !level.mortar_damages_other_players )
{
continue;
}

dist_mult = 1 - ( (distance( players[i].origin, impact_origin ))/level.player_mortar_radius );
damage = int( dist_mult*level.player_mortar_damage );
if( damage < 15 )
{
damage = 15;
}
RadiusDamage( players[i].origin, 10, damage, (damage-10) );
// iprintln( "player damage: "+damage );
}
}

}

mortar_damage_zombies(impact_origin, player)
{
zombs = get_array_of_closest(impact_origin, getaispeciesarray( "axis" ), undefined, undefined, level.zombie_mortar_radius);

if( isdefined( zombs ) && zombs.size != 0 )
{
for(i=0;i<zombs.size;i++)
{
dist_mult = 1 - ( (distance( zombs[i].origin, impact_origin ))/level.zombie_mortar_radius );
damage = int( dist_mult*level.zombie_mortar_damage );
if( damage < 75 )
{
damage = 75;
}

if( !zombs[i].gibbed && dist_mult > 0.3 )
{
refs = [];
refs[refs.size] = "guts";
refs[refs.size] = "right_arm";
refs[refs.size] = "left_arm";
refs[refs.size] = "right_leg";
refs[refs.size] = "left_leg";
refs[refs.size] = "no_legs";

zombs[i].a.gib_ref = animscripts\death::get_random( refs );
zombs[i] thread animscripts\death::do_gib();
}

zombs[i] dodamage( damage, self.origin, player );
// iprintln( "zombie damage: "+damage );
}
}
}
broken avatar :(
×
broken avatar :(
Location: usNew Jersey
Date Registered: 30 July 2013
Last active: 4 weeks ago
Posts
271
Respect
Forum Rank
Mr. Elemental
Primary Group
Community Mapper
My Groups
More
My Contact & Social Links
More
Personal Quote
fk
Signature
iPlay - Facts                               
Hex Tower - Facts
Andromeda - Facts
Octagonal Ascension - Facts
iPlay v2 - Facts
Eclipse - Facts
MW2 Rust - Facts
Gulag - Facts
Decagon - Facts
---------------------------------------------- BO3
Scrapyard - Facts
Rust 2.0 - Facts
Rust MP - Facts
Gulag Again ffs - Facts
Hex Tower - Facts
Octagon - Facts
Decagon - Facts
Cataclysm - Facts
Dome - Bland
×
Psh's Groups
Community Mapper Has released one or more maps to the UGX-Mods community which have been added to the UGX Map Manager.
Psh's Contact & Social LinksAskPshZombiesihaZzRaBieZI_haZzZ_RaBieZz
Dank :gusta:
broken avatar :(
×
broken avatar :(
Location: ph
Date Registered: 22 May 2016
Last active: 4 months ago
Posts
225
Respect
Forum Rank
Mr. Elemental
Primary Group
Member
Signature
×
KhelMho's Groups
KhelMho's Contact & Social Links
What the! Nice  :D
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
Good work +1. :)
broken avatar :(
×
broken avatar :(
Location: seDesert..
Date Registered: 22 May 2015
Last active: 4 years ago
Posts
29
Respect
Forum Rank
Legless Crawler
Primary Group
Donator ♥
My Groups
More
My Contact & Social Links
More
Personal Quote
The Samantha Project
×
Sebra's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Sebra's Contact & Social LinksMcfu34mcfu34Sebraa
Amazing :D
broken avatar :(
×
broken avatar :(
Location: usrhode island
Date Registered: 22 February 2014
Last active: 5 years ago
Posts
75
Respect
Forum Rank
Rotting Walker
Primary Group
Donator ♥
My Groups
More
My Contact & Social Links
More
Personal Quote
Brains
×
fiveseven hd'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
fiveseven hd's Contact & Social Linksjaminboggs76561198122502681FiveSevenHD
Sweet man !  I always appreciate when you release basically anything because all of your work is just amazing.  Thanks for putting this out there for everybody to enjoy. i know i will +1
broken avatar :(
×
broken avatar :(
Location: deDortmund
Date Registered: 20 December 2015
Last active: 5 months ago
Posts
307
Respect
Forum Rank
Perk Hacker
Primary Group
Community Scripter
My Groups
More
Personal Quote
Payback
Signature
Tears Of The Fallen | Join the project https://discord.gg/8gDNQRj
×
fanmagic's Groups
Community Scripter Has shown effort and knowledge in the area of scripting while being a part of the UGX-Mods community.
fanmagic's Contact & Social LinksTears Of The Fallen
Great, +1 ;)
broken avatar :(
×
broken avatar :(
Location: 00persia
Date Registered: 20 December 2012
Last active: 1 year ago
Posts
66
Respect
Forum Rank
Rotting Walker
Primary Group
Member
×
nikfar1's Groups
nikfar1's Contact & Social Links
You are perfect .thanks +1
broken avatar :(
×
broken avatar :(
Location: jp
Date Registered: 26 June 2016
Last active: 2 years ago
Posts
86
Respect
Forum Rank
Rotting Walker
Primary Group
Member
My Contact & Social Links
More
×
Conbini2017's Groups
Conbini2017's Contact & Social Linksdadakhrconbini2017
is cool!  ;)
broken avatar :(
×
broken avatar :(
Location: ph
Date Registered: 22 May 2016
Last active: 4 months ago
Posts
225
Respect
Forum Rank
Mr. Elemental
Primary Group
Member
×
KhelMho's Groups
KhelMho's Contact & Social Links
Need help? Where do i put this code?  :-\
Problems:
Powerup "Max ammo" is not working
in mortar  :(

Code Snippet
Plaintext
player thread maps\_blst_mortar_strike::player_give_mortar();
broken avatar :(
×
broken avatar :(
Location: nlApeldoorn
Date Registered: 17 December 2013
Last active: 1 year ago
Posts
1,187
Respect
1,404Add +1
Forum Rank
Zombie Colossus
Primary Group
Community Scripter Elite
My Groups
More
My Contact & Social Links
More
Personal Quote
It aint much, if it aint Dutch
×
BluntStuffy's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Community 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 LinksBluntstuffy@BluntZombieBluntStuffyStuffyZombie
Need help? Where do i put this code?  :-\
Problems:
Powerup "Max ammo" is not working

In _zombiemode_powerups in the max ammo function, wich is this one:

Code Snippet
Plaintext
full_ammo_powerup( drop_item )
{
players = get_players();

for (i = 0; i < players.size; i++)
{
primaryWeapons = players[i] GetWeaponsList();

for( x = 0; x < primaryWeapons.size; x++ )
{
players[i] GiveMaxAmmo( primaryWeapons[x] );
}
}
// array_thread (players, ::full_ammo_on_hud, drop_item);
level thread full_ammo_on_hud( drop_item );
}

Put it in like this:

Code Snippet
Plaintext
full_ammo_powerup( drop_item )
{
players = get_players();

for (i = 0; i < players.size; i++)
{
                players[i] thread maps\_blst_mortar_strike::player_give_mortar();          //   <---- Add Here!

primaryWeapons = players[i] GetWeaponsList();

for( x = 0; x < primaryWeapons.size; x++ )
{
players[i] GiveMaxAmmo( primaryWeapons[x] );
}
}
// array_thread (players, ::full_ammo_on_hud, drop_item);
level thread full_ammo_on_hud( drop_item );
}
broken avatar :(
×
broken avatar :(
Location: ph
Date Registered: 22 May 2016
Last active: 4 months ago
Posts
225
Respect
Forum Rank
Mr. Elemental
Primary Group
Member
×
KhelMho's Groups
KhelMho's Contact & Social Links
In _zombiemode_powerups in the max ammo function, wich is this one:

Code Snippet
Plaintext
full_ammo_powerup( drop_item )
{
players = get_players();

for (i = 0; i < players.size; i++)
{
primaryWeapons = players[i] GetWeaponsList();

for( x = 0; x < primaryWeapons.size; x++ )
{
players[i] GiveMaxAmmo( primaryWeapons[x] );
}
}
// array_thread (players, ::full_ammo_on_hud, drop_item);
level thread full_ammo_on_hud( drop_item );
}

Put it in like this:

Code Snippet
Plaintext
full_ammo_powerup( drop_item )
{
players = get_players();

for (i = 0; i < players.size; i++)
{
                players[i] thread maps\_blst_mortar_strike::player_give_mortar();          //   <---- Add Here!

primaryWeapons = players[i] GetWeaponsList();

for( x = 0; x < primaryWeapons.size; x++ )
{
players[i] GiveMaxAmmo( primaryWeapons[x] );
}
}
// array_thread (players, ::full_ammo_on_hud, drop_item);
level thread full_ammo_on_hud( drop_item );
}

Thanks BluntStuffy  :)

Spoiler: click to open...
:troll:
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 9 December 2015
Last active: 2 years ago
Posts
68
Respect
Forum Rank
Rotting Walker
Primary Group
Member
×
BrandynNew's Groups
BrandynNew's Contact & Social Links
Craziest thing I've seen all day man!!! Looks incredible!
broken avatar :(
×
broken avatar :(
Location: nl
Date Registered: 4 July 2016
Last active: 2 months ago
Posts
38
Respect
Forum Rank
Legless Crawler
Primary Group
Member
Personal Quote
Failing at life
Signature
PC still broken FeelsBadMan
×
robbie696's Groups
robbie696's Contact & Social Links
Hey,

The problem I am getting isn't only for this tutorial, but always when trying to follow tutorials since I started using UGX mod :S . When I edit a file, and close it, I get a popup asking if I want to change the filew in the archive. When I click yes, I get a new popup saying "access denied"

Could anyone help me with this?
broken avatar :(
×
broken avatar :(
The King of Zombies
Location: usLouisiana
Date Registered: 24 June 2013
Last active: 4 years ago
Posts
2,148
Respect
Forum Rank
King of the Zombies
Primary Group
Donator ♥
My Groups
More
My Contact & Social Links
More
Signature
Donate to me if you enjoy my work. https://www.paypal.me/thezombiekilla6
×
Dust's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Dust's Contact & Social LinksMrZ0mbiesFanaticdust103194MrZ0mbiesFanatic
Hey,

The problem I am getting isn't only for this tutorial, but always when trying to follow tutorials since I started using UGX mod :S . When I edit a file, and close it, I get a popup asking if I want to change the filew in the archive. When I click yes, I get a new popup saying "access denied"

Could anyone help me with this?

You need to drag the file out of the .IWD, edit it, then put it back in the IWD.

 
Loading ...