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,713 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
Ah that was it i forgot to change the ammoname and clipname. Also you know a good place to start to script the different prices?

Kind of depends, do you want to just buy the alt-ammo at the wall-weapon trigger? ->go back to the stock function of the ammo_give() ) and you prob need to modify the last part of the weapon_spawn_think() function to check for an alt-weapon and adjust the price in there.

You could also make new triggers on different locations that only provide the players with alt-ammo. In that case just start a small script from scratch..

Lemme know if you need help with the actual scripting..

broken avatar :(
×
broken avatar :(
UM Member, Mapper and 3d Modeler
Location: ca
Date Registered: 8 February 2014
Last active: 3 years ago
Posts
835
Respect
Forum Rank
The Decider
Primary Group
Community Mapper
My Groups
More
My Contact & Social Links
More
Personal Quote
Port Arthur
Signature
×
pashan's Groups
Community Mapper Has released one or more maps to the UGX-Mods community which have been added to the UGX Map Manager.
could you make another tut on how to make it a power drop. like when after the player picks it up the gun which they are holding becomes fire/shock/explosive for a limited time?
broken avatar :(
×
broken avatar :(
Location: mxGuanajuato
Date Registered: 5 May 2013
Last active: 6 days ago
Posts
225
Respect
Forum Rank
Mr. Elemental
Primary Group
Member
My Contact & Social Links
More
Personal Quote
If you do not take risks, you can not create a fut
×
shippuden1592's Groups
No, NaviLlicious is right. I decided not to make it do any extra damage in the script. Just set the damage for the weapon in the weapon file, and that's the damage to gun does.. No increase in the script.. (it has that effect the entire game anyway)


That's cool brother, thanks for everything.

Greetings!!
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
Kind of depends, do you want to just buy the alt-ammo at the wall-weapon trigger? ->go back to the stock function of the ammo_give() ) and you prob need to modify the last part of the weapon_spawn_think() function to check for an alt-weapon and adjust the price in there.

You could also make new triggers on different locations that only provide the players with alt-ammo. In that case just start a small script from scratch..

Lemme know if you need help with the actual scripting..

So I been trying ever since my last post to get this working. I did a separate trigger that will control all of the elemental ammo buys. It works up to a degree, when i press f to buy elemental ammo without a elemental ammo it says "You cannot buy Elemental Ammo for this Weapon". then when i actually have a elemental weapon it does nothing when i press f. you mind taking a look? This is my first real attempt at scripting something like this, so some stuff may be weird.

Code Snippet
Plaintext
#include maps\_utility; 
#include common_scripts\utility;
#include maps\_zombiemode_utility;
init()
{
thread elemental_trigger();
}
elemental_trigger()
{
trig = getent("elemental_ammo","targetname");
trig setcursorhint("HINT_NOICON");
trig sethintstring("Press and Hold &&1 to buy Elemental Ammo [Cost:2000]");
trig waittill("trigger",player);
player thread check_for_elemental_weapon();
}
check_for_elemental_weapon()
{
player = undefined;
weapon = undefined();
altweapon =  WeaponAltWeaponName( weapon ); // custom ammo buy
if( altweapon != "none" )
{   

altweapon =  WeaponAltWeaponName( weapon ); // custom ammo buy
if( altweapon != "none" )
{
player GivemaxAmmo( altweapon );
}
    if(player.score > 1999)
     {
player maps\_zombiemode_score::minus_to_player_score(2000);
player playsound( "cha_ching" );
trig = getent("elemental_ammo","targetname");
trig disable_trigger();
wait 1;
trig enable_trigger();

if( altweapon == "none")
{
self iprintlnbold("You cannot buy Elemental Ammo for this Weapon");
}
}
}
}
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 been trying ever since my last post to get this working. I did a separate trigger that will control all of the elemental ammo buys. It works up to a degree, when i press f to buy elemental ammo without a elemental ammo it says "You cannot buy Elemental Ammo for this Weapon". then when i actually have a elemental weapon it does nothing when i press f. you mind taking a look? This is my first real attempt at scripting something like this, so some stuff may be weird.

Np, i have a look a little later. Allready in the middle of something now..

could you make another tut on how to make it a power drop. like when after the player picks it up the gun which they are holding becomes fire/shock/explosive for a limited time?

I'll also have a look at this one, that will be sometime later this week though..
broken avatar :(
×
broken avatar :(
Location: england
Date Registered: 26 July 2013
Last active: 7 years ago
Posts
331
Respect
Forum Rank
Perk Hacker
Primary Group
Community Mapper
My Groups
More
My Contact & Social Links
More
Personal Quote
Action is the enemy of thought
Signature
×
tudark's Groups
Community Mapper Has released one or more maps to the UGX-Mods community which have been added to the UGX Map Manager.
tudark's Contact & Social Linkstudark71The Morgue
Hi Bluntstuffy , thanks for  the tutorials . The tutorials you've been putting out are great and its good to see somebody sharing the good stuff.
On this tutorial I have followed but have a few problems, hope you can help.  The explosive gun works with the effects but the zombie don't blow away.
The tesla kills them  and I hear the noise just no effects or the death.
fire works perfect.

I did follow tut , but was lost to find the death .gsc . the only one I found was in raw /animscripts.
I just copied that into my mod /mapname/maps and edited it as you said. thanks for any help in advance.

Post Merge: June 02, 2014, 06:53:40 pm
I meant fx`s
Last Edit: June 02, 2014, 06:53:40 pm by tudark
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
×
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
Hi Bluntstuffy , thanks for  the tutorials . The tutorials you've been putting out are great and its good to see somebody sharing the good stuff.
On this tutorial I have followed but have a few problems, hope you can help.  The explosive gun works with the effects but the zombie don't blow away.
The tesla kills them  and I hear the noise just no effects or the death.
fire works perfect.

I did follow tut , but was lost to find the death .gsc . the only one I found was in raw /animscripts.
I just copied that into my mod /mapname/maps and edited it as you said. thanks for any help in advance.

Post Merge: June 02, 2014, 06:53:40 pm
I meant fx`s

your suppose to copy the death.gsc into mapname/animscripts, so create a new folder in your mods folder and name it animscripts then paste that in there and edit it
broken avatar :(
×
broken avatar :(
Location: england
Date Registered: 26 July 2013
Last active: 7 years ago
Posts
331
Respect
Forum Rank
Perk Hacker
Primary Group
Community Mapper
My Groups
More
My Contact & Social Links
More
Personal Quote
Action is the enemy of thought
×
tudark's Groups
Community Mapper Has released one or more maps to the UGX-Mods community which have been added to the UGX Map Manager.
tudark's Contact & Social Linkstudark71The Morgue
Hey ,thanks very much for your help  will try later.
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
The first post is now updated with a new version of the script. You can now place triggers in radiant where the players buy their special ammo from. The players can only buy the special ammo at these triggers, and they can't buy normal ammo there..
You can change the price's for each ammo type now too.

I would recommend to the people that might have the first version to install this one (sorry for that..)
This is tested propperly by thezombiekilla6 (thanks for that!) and me, and it should work without any issue's..

Otherwise let me know  :)
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
FIXED every question i had .... THANKS FOR THIS

Double Post Merge: August 28, 2014, 04:51:14 pm
The first post is now updated with a new version of the script. You can now place triggers in radiant where the players buy their special ammo from. The players can only buy the special ammo at these triggers, and they can't buy normal ammo there..
You can change the price's for each ammo type now too.

I would recommend to the people that might have the first version to install this one (sorry for that..)
This is tested propperly by thezombiekilla6 (thanks for that!) and me, and it should work without any issue's..

Otherwise let me know  :)

anyway to script a hud icon for different types of ammo..... I tried but image wont show next to numbers... I also attached the images I personally would like to use for shock, flame, explosive

If you could do this before I can figure it out which will prob be never THAN THANKS!!!


EDIT: got the icon to show up on hud but it show up for everything and everygun
Last Edit: August 29, 2014, 06:27:17 pm by OfficialMT22
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
anyway to script a hud icon for different types of ammo..... I tried but image wont show next to numbers... I also attached the images I personally would like to use for shock, flame, explosive

If you could do this before I can figure it out which will prob be never THAN THANKS!!!

Here's what i put together for you, it's using a HUD element that will Always be on-screen when you wield a 'special-ammo weapon' and not fade away like the ammo counter does..

Open the _blst_custom_ammo.gsc and at the top, below the line:

Code Snippet
Plaintext
#include maps\_zombiemode_utility;

add this line:

Code Snippet
Plaintext
#include maps\_hud_util;



Now look for this line:

Code Snippet
Plaintext
	level.expl_ammo_sound = false;

And below that add:

Code Snippet
Plaintext
	PrecacheShader( "specialty_juggernaut_zombies" );
PrecacheShader( "specialty_fastreload_zombies" );
PrecacheShader( "specialty_doubletap_zombies" );



Next look fot the line:

Code Snippet
Plaintext
	players[i].alt_message_count = 0;

and below that one add:

Code Snippet
Plaintext
	players[i] thread alt_ammo_hud();	



Now go to the bottom of the file and add this new function:

Code Snippet
Plaintext
alt_ammo_hud()
{
self endon( "death" );
self endon( "disconnect" );

self.hud_set = "none";

while(1)
{
ammo_hud = undefined;
shader = undefined;
gun = self getcurrentweapon();

if(isdefined(level.shock_ammo[gun]))
{
ammo_hud = "shock";
shader = "specialty_juggernaut_zombies";
}

else if(isdefined(level.flame_ammo[gun]))
{
ammo_hud = "flame";
shader = "specialty_fastreload_zombies";
}

else if(isdefined(level.expl_ammo[gun]))
{
ammo_hud = "expl";
shader = "specialty_quickrevive_zombies";
}

else
{
ammo_hud = "none";
}

if( self.hud_set != ammo_hud )
{
self.hud_set = ammo_hud;

if( isdefined( self.custom_hud[ "ammo" ] ) )
{
self.custom_hud[ "ammo" ] destroy_hud();
self.custom_hud[ "ammo" ] = undefined;
}

self.ammo_hud = NewClientHudElem( self );
self.ammo_hud.foreground = true;
self.ammo_hud.sort = 1;
self.ammo_hud.hidewheninmenu = false;
self.ammo_hud.alignX = "right";
self.ammo_hud.alignY = "bottom";
self.ammo_hud.horzAlign = "right";
self.ammo_hud.vertAlign = "bottom";
self.ammo_hud.x = self.ammo_hud.x - 5;
self.ammo_hud.y = self.ammo_hud.y - 95;
self.ammo_hud.alpha = 1;
self.ammo_hud SetShader( shader, 45, 45 );

self.custom_hud[ "ammo" ] = self.ammo_hud;
}
wait 0.2;
}
}



NOTE: I'm using the perk-icons as place-holders here, replace the
"specialty_juggernaut_zombies"
"specialty_fastreload_zombies"
"specialty_doubletap_zombies"

with the name's of the shaders you want to use (there's 2 entry's of both!), also add the materials to your mod.csv like this:

Code Snippet
Plaintext
material,MATERIAL_NAME

You change the position of the shader by changing the numbers in these lines:

Code Snippet
Plaintext
	self.ammo_hud.x = self.ammo_hud.x - 5; 
self.ammo_hud.y = self.ammo_hud.y - 95;

And you can change the size of the shader by changing the numbers in this line:

Code Snippet
Plaintext
	self.ammo_hud SetShader( shader, 45, 45 );


That should be all.
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
thanks... when i add to my map ill let you know if it worked :D
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 2 April 2014
Last active: 2 years ago
Posts
481
Respect
Forum Rank
Perk Hacker
Primary Group
Donator ♥
My Groups
More
My Contact & Social Links
More
Personal Quote
If it's not perfect, you'll never see it.
Signature
Learn by doing, not copy and pasting.

Enjoy my 2015 contest map, a simple map with bo1-bo2 features
http://ugx-mods.com/forum/index.php?topic=14968.msg149200#
×
Centric's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Centric's Contact & Social Linkscentricccentric_
I've tried everything I could think of to make this work, but no matter what it doesn't. I'm trying to make a spas12 with flame but in game in still says "spas 12" and shoots normal rounds. Even the weapons you added to the script don't work. Could you put your scripts up for download so I could get this to work? I'm obviously doing something wrong.
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
I've tried everything I could think of to make this work, but no matter what it doesn't. I'm trying to make a spas12 with flame but in game in still says "spas 12" and shoots normal rounds. Even the weapons you added to the script don't work. Could you put your scripts up for download so I could get this to work? I'm obviously doing something wrong.

And you did put the scripts in your MOD folder, and selected them in the compile window when compiling your MOD?
Otherwise post the edited scripts in a code-box or PM me..
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?

 
Loading ...