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

[TUT] Adding custom ammo: Flame / Shock and Explosive

HOT
broken avatar :(
Created 10 years ago
by BluntStuffy
0 Members and 1 Guest are viewing this topic.
17,709 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
Question on the triggers in radiant. Are the triggers specific to ammo types or they just to buy ammo for the specific gun your holding. If the triggers are for specific ammo what are the kvp's for the 3 different types?

They work for the gun your holding, there's not a seperate trigger for each ammo-type.
broken avatar :(
×
broken avatar :(
Location: caCranbrook
Date Registered: 1 June 2013
Last active: 11 months ago
Posts
334
Respect
Forum Rank
Perk Hacker
Primary Group
Donator ♥
My Groups
More
My Contact & Social Links
More
Personal Quote
Zombies?
Signature
http://www.speedtest.net/result/3950067582.png

WaW - Nazi_zombie_candyland/Nazi_zombie_ascension2.0  90%-95% (Not completed)
WaW - Nazi_zombie_meth/Nazi_zombie_lamanai  100% (complete)
WaW - Nazi_zombie_killswitch 100% (complete)
WaW - Nazi_zombie_pax 100%  (complete + UGX 1.1 edition)
BO3 - zm_epping_woods 80%
×
iBarnett's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
iBarnett's Contact & Social LinksiBarnettiBarnettiBarnettCorey Barnett
Question on the triggers in radiant. Are the triggers specific to ammo types or they just to buy ammo for the specific gun your holding. If the triggers are for specific ammo what are the kvp's for the 3 different types?
So i'm also getting this error when trying to launch my map now
bad sentax: shock_ammo = maps\_blst_custom_ammo::blst_shock( self.damageweapon, mod );

that's word for word what you have . why is this not working??
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
So i'm also getting this error when trying to launch my map now
bad sentax: shock_ammo = maps\_blst_custom_ammo::blst_shock( self.damageweapon, mod );

that's word for word what you have . why is this not working??

Post the entire function with that line in it in a code-box, so i can have a look at it..
broken avatar :(
×
broken avatar :(
Location: caCranbrook
Date Registered: 1 June 2013
Last active: 11 months ago
Posts
334
Respect
Forum Rank
Perk Hacker
Primary Group
Donator ♥
My Groups
More
My Contact & Social Links
More
Personal Quote
Zombies?
×
iBarnett's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
iBarnett's Contact & Social LinksiBarnettiBarnettiBarnettCorey Barnett
So its in my _spawners.gsc

first section with that line of code
Code Snippet
Plaintext
zombie_damage( mod, hit_location, hit_origin, player )
shock_ammo = maps\_blst_custom_ammo::blst_shock( self.damageweapon, mod );
flame_ammo = maps\_blst_custom_ammo::blst_flame( self.damageweapon, mod );
explosive_ammo = maps\_blst_custom_ammo::blst_explosive( self.damageweapon, mod, self );

{
if( is_magic_bullet_shield_enabled( self ) )
{
return;
}

//ChrisP - 12/8 - no points for killing gassed zombies!
player.use_weapon_type = mod;
if(isDefined(self.marked_for_death))
{
return;
}

if( !IsDefined( player ) )
{
return;
}
if( shock_ammo )
{
shock_tag = maps\_blst_custom_ammo::hit_tag( hit_location );
if( isdefined( shock_tag ) )
{
network_safe_play_fx_on_tag( "shock_impact_fx", 3, level._effect["blst_shock_ammo"], self, shock_tag );
self playsound( "imp_tesla" );
}
}

if( flame_ammo )
{
if( !isdefined( self.flame_ammo_on_fire ) || isdefined( self.flame_ammo_on_fire ) && !self.flame_ammo_on_fire )
{
flame_tag = maps\_blst_custom_ammo::hit_tag( hit_location );
if( isdefined(flame_tag))
{
network_safe_play_fx_on_tag( "flame_impact_fx", 3, level._effect["character_fire_pain_sm"], self, flame_tag );
}
self thread maps\_blst_custom_ammo::blst_flame_ammo( player );
}
}

if( explosive_ammo )
{
expl_tag = maps\_blst_custom_ammo::hit_tag( hit_location );
if( isdefined( expl_tag))
{
network_safe_play_fx_on_tag( "expl_impact_fx", 3, level._effect["blst_expl_ammo"], self, expl_tag );
}
self maps\_blst_custom_ammo::blst_expl_ammo( hit_location );
}

if( self zombie_flame_damage( mod, player ) )
{
if( self zombie_give_flame_damage_points() )
{
player maps\_zombiemode_score::player_add_points( "damage", mod, hit_location, self enemy_is_dog() );
}
}
else if( self maps\_zombiemode_tesla::is_tesla_damage( mod ) )
{
self maps\_zombiemode_tesla::tesla_damage_init( hit_location, hit_origin, player );
return;
}
else
{
player maps\_zombiemode_score::player_add_points( "damage", mod, hit_location, self enemy_is_dog() );
}

if ( mod == "MOD_GRENADE" || mod == "MOD_GRENADE_SPLASH" )
{
if ( isdefined( player ) && isalive( player ) )
{
self DoDamage( level.round_number + randomintrange( 100, 500 ), self.origin, player);
}
else
{
self DoDamage( level.round_number + randomintrange( 100, 500 ), self.origin, undefined );
}
}
else if( mod == "MOD_PROJECTILE" || mod == "MOD_EXPLOSIVE" || mod == "MOD_PROJECTILE_SPLASH" || mod == "MOD_PROJECTILE_SPLASH")
{
if ( isdefined( player ) && isalive( player ) )
{
self DoDamage( level.round_number * randomintrange( 0, 100 ), self.origin, player);
}
else
{
self DoDamage( level.round_number * randomintrange( 0, 100 ), self.origin, undefined );
}
}
else if( mod == "MOD_ZOMBIE_BETTY" )
{
if ( isdefined( player ) && isalive( player ) )
{
self DoDamage( level.round_number * randomintrange( 100, 200 ), self.origin, player);
}
else
{
self DoDamage( level.round_number * randomintrange( 100, 200 ), self.origin, undefined );
}
}

//AUDIO Plays a sound when Crawlers are created
if( IsDefined( self.a.gib_ref ) && (self.a.gib_ref == "no_legs") && isalive( self ) )
{
if ( isdefined( player ) )
{
rand = randomintrange(0, 100);
if(rand < 10)
{
index = maps\_zombiemode_weapons::get_player_index(player);
plr = "plr_" + index + "_";
player thread create_and_play_dialog( plr, "vox_crawl_spawn", 0.25, "resp_cspawn" );
}
}
}
else if( IsDefined( self.a.gib_ref ) && ( (self.a.gib_ref == "right_arm") || (self.a.gib_ref == "left_arm") ) )
{
if( self.has_legs && isalive( self ) )
{
if ( isdefined( player ) )
{
rand = randomintrange(0, 100);
if(rand < 3)
{
index = maps\_zombiemode_weapons::get_player_index(player);
plr = "plr_" + index + "_";
player thread create_and_play_dialog( plr, "vox_shoot_limb", 0.25 );
}
}
}
}
self thread maps\_zombiemode_powerups::check_for_instakill( player );
}

second place it appears
Code Snippet
Plaintext
zombie_damage_ads( mod, hit_location, hit_origin, player )
shock_ammo = maps\_blst_custom_ammo::blst_shock( self.damageweapon, mod );
flame_ammo = maps\_blst_custom_ammo::blst_flame( self.damageweapon, mod );
explosive_ammo = maps\_blst_custom_ammo::blst_explosive( self.damageweapon, mod, self );

{
if( is_magic_bullet_shield_enabled( self ) )
{
return;
}

player.use_weapon_type = mod;
if( !IsDefined( player ) )
{
return;
}
if( shock_ammo )
{
shock_tag = maps\_blst_custom_ammo::hit_tag( hit_location );
if( isdefined( shock_tag ) )
{
network_safe_play_fx_on_tag( "shock_impact_fx", 3, level._effect["blst_shock_ammo"], self, shock_tag );
self playsound( "imp_tesla" );
}
}

if( flame_ammo )
{
if( !isdefined( self.flame_ammo_on_fire ) || isdefined( self.flame_ammo_on_fire ) && !self.flame_ammo_on_fire )
{
flame_tag = maps\_blst_custom_ammo::hit_tag( hit_location );
if( isdefined(flame_tag))
{
network_safe_play_fx_on_tag( "flame_impact_fx", 3, level._effect["character_fire_pain_sm"], self, flame_tag );
}
self thread maps\_blst_custom_ammo::blst_flame_ammo( player );
}
}

if( explosive_ammo )
{
expl_tag = maps\_blst_custom_ammo::hit_tag( hit_location );
if( isdefined( expl_tag))
{
network_safe_play_fx_on_tag( "expl_impact_fx", 3, level._effect["blst_expl_ammo"], self, expl_tag );
}
self maps\_blst_custom_ammo::blst_expl_ammo( hit_location );
}


if( self zombie_flame_damage( mod, player ) )
{
if( self zombie_give_flame_damage_points() )
{
player maps\_zombiemode_score::player_add_points( "damage_ads", mod, hit_location );
}
}
else if( self maps\_zombiemode_tesla::is_tesla_damage( mod ) )
{
self maps\_zombiemode_tesla::tesla_damage_init( hit_location, hit_origin, player );
return;
}
else
{
player maps\_zombiemode_score::player_add_points( "damage_ads", mod, hit_location );
}

self thread maps\_zombiemode_powerups::check_for_instakill( player );
}

zombie_give_flame_damage_points()
{
if( GetTime() > self.flame_damage_time )
{
self.flame_damage_time = GetTime() + level.zombie_vars["zombie_flame_dmg_point_delay"];
return true;
}

return false;
}

zombie_flame_damage( mod, player )
{
if( mod == "MOD_BURNED" )
{
self.moveplaybackrate = 0.8;

if( !IsDefined( self.is_on_fire ) || ( Isdefined( self.is_on_fire ) && !self.is_on_fire ) )
{
self thread damage_on_fire( player );
}

do_flame_death = true;
dist = 100 * 100;
ai = GetAiArray( "axis" );
for( i = 0; i < ai.size; i++ )
{
if( IsDefined( ai[i].is_on_fire ) && ai[i].is_on_fire )
{
if( DistanceSquared( ai[i].origin, self.origin ) < dist )
{
do_flame_death = false;
break;
}
}
}

if( do_flame_death )
{
self thread animscripts\death::flame_death_fx();
}

return true;
}

return false;
}


hope that helps
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
cange this:

Code Snippet
Plaintext
zombie_damage( mod, hit_location, hit_origin, player )
shock_ammo = maps\_blst_custom_ammo::blst_shock( self.damageweapon, mod );
flame_ammo = maps\_blst_custom_ammo::blst_flame( self.damageweapon, mod );
explosive_ammo = maps\_blst_custom_ammo::blst_explosive( self.damageweapon, mod, self );

{

into this:

Code Snippet
Plaintext
zombie_damage( mod, hit_location, hit_origin, player )
{
shock_ammo = maps\_blst_custom_ammo::blst_shock( self.damageweapon, mod );
flame_ammo = maps\_blst_custom_ammo::blst_flame( self.damageweapon, mod );
explosive_ammo = maps\_blst_custom_ammo::blst_explosive( self.damageweapon, mod, self );


And do the same for the other function
broken avatar :(
×
broken avatar :(
Location: caCranbrook
Date Registered: 1 June 2013
Last active: 11 months ago
Posts
334
Respect
Forum Rank
Perk Hacker
Primary Group
Donator ♥
My Groups
More
My Contact & Social Links
More
Personal Quote
Zombies?
×
iBarnett's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
iBarnett's Contact & Social LinksiBarnettiBarnettiBarnettCorey Barnett
cange this:

Code Snippet
Plaintext
zombie_damage( mod, hit_location, hit_origin, player )
shock_ammo = maps\_blst_custom_ammo::blst_shock( self.damageweapon, mod );
flame_ammo = maps\_blst_custom_ammo::blst_flame( self.damageweapon, mod );
explosive_ammo = maps\_blst_custom_ammo::blst_explosive( self.damageweapon, mod, self );

{

into this:

Code Snippet
Plaintext
zombie_damage( mod, hit_location, hit_origin, player )
{
shock_ammo = maps\_blst_custom_ammo::blst_shock( self.damageweapon, mod );
flame_ammo = maps\_blst_custom_ammo::blst_flame( self.damageweapon, mod );
explosive_ammo = maps\_blst_custom_ammo::blst_explosive( self.damageweapon, mod, self );


And do the same for the other function
get rid if that { at the end as well?

Double Post Merge: September 27, 2014, 07:26:46 pm
get rid if that { at the end as well?
because it now gives me
error bad sentax {

Double Post Merge: September 27, 2014, 07:32:15 pm
get rid if that { at the end as well?

Double Post Merge: September 27, 2014, 07:26:46 pm
because it now gives me
error bad sentax {
Ok so it was that last { that was causing the bad sentax

Everything works now map launches. THANKS!! glad you took the time to help me through it! +1
Last Edit: September 27, 2014, 07:32:15 pm by iBarnett
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
Yes, NOT like this:

Code Snippet
Plaintext
zombie_damage( mod, hit_location, hit_origin, player )
{
shock_ammo = maps\_blst_custom_ammo::blst_shock( self.damageweapon, mod );
flame_ammo = maps\_blst_custom_ammo::blst_flame( self.damageweapon, mod );
explosive_ammo = maps\_blst_custom_ammo::blst_explosive( self.damageweapon, mod, self );

{



but like this:

Code Snippet
Plaintext
zombie_damage( mod, hit_location, hit_origin, player )
{
shock_ammo = maps\_blst_custom_ammo::blst_shock( self.damageweapon, mod );
flame_ammo = maps\_blst_custom_ammo::blst_flame( self.damageweapon, mod );
explosive_ammo = maps\_blst_custom_ammo::blst_explosive( self.damageweapon, mod, self );

broken avatar :(
×
broken avatar :(
Location: caCranbrook
Date Registered: 1 June 2013
Last active: 11 months ago
Posts
334
Respect
Forum Rank
Perk Hacker
Primary Group
Donator ♥
My Groups
More
My Contact & Social Links
More
Personal Quote
Zombies?
×
iBarnett's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
iBarnett's Contact & Social LinksiBarnettiBarnettiBarnettCorey Barnett
Ya super glad i came across this script you posted. I was having troubles with adding blops weapons but not being able to buy wall ammo. but i figured a neat way to add this in to make it all work out.
thanks again.

Double Post Merge: September 27, 2014, 09:39:43 pm
just thought i'd post a pic of a cool little machine for buying the custom ammo.

thanks again for the scripts Blunt!! will give credit when map is released.
Last Edit: September 27, 2014, 09:39:43 pm by iBarnett
broken avatar :(
×
broken avatar :(
Location: usNC
Date Registered: 19 August 2014
Last active: 7 years ago
Posts
104
Respect
Forum Rank
Pack-a-Puncher
Primary Group
Donator ♥
My Groups
More
My Contact & Social Links
More
Personal Quote
OMTGaming
×
OfficialMT22's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
OfficialMT22's Contact & Social LinksOMTGamingOfficialMT22OfficialMT22GamingOMTGaming
Question on the triggers in radiant. Are the triggers specific to ammo types or they just to buy ammo for the specific gun your holding. If the triggers are for specific ammo what are the kvp's for the 3 different types?

the way i got the different ammo triggers to work... Atleast i think they worked is " I split the ammos up in the _custom_ammo_buy.gsc and made different files for each ammo." I have attached some demo files for you to play with, but make sure you have backup of your original files and dont forget to add this line to your nazi_zombie_{MAP_NAME}.gsc

UNDER
Code Snippet
Plaintext
	/*--------------------
ZOMBIE MODE
----------------------*/
ADD
Code Snippet
Plaintext
	thread maps\_custom_ammo_fire_buy::main();
thread maps\_custom_ammo_shock_buy::main();

dont forget to change the triggers in your map to the names in the files posted
Code Snippet
Plaintext
	trig = getentarray("fire_ammo","target");
Last Edit: October 01, 2014, 06:40:32 pm by OfficialMT22

 
Loading ...