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

[User Tutorial] Custom Gun-Dropping Powerups

broken avatar :(
Created 12 years ago
by ZMBS DON GOONY
0 Members and 1 Guest are viewing this topic.
6,911 views
broken avatar :(
×
broken avatar :(
Date Registered: 14 March 2012
Last active: 11 years ago
Posts
105
Respect
Forum Rank
Pack-a-Puncher
Primary Group
Community Scripter
My Groups
More
My Contact & Social Links
More
Personal Quote
i love zombies
×
ZMBS DON GOONY's Groups
Community Scripter Has shown effort and knowledge in the area of scripting while being a part of the UGX-Mods community.
ZMBS DON GOONY's Contact & Social LinksZMBS_DON_GOONY
this will teach how to make random guns spawn  throughout ye map like in Insanatorium and Oil spill


add this line in ye mapname .gsc

Code Snippet
Plaintext
maps\guns::main();

above

Code Snippet
Plaintext
maps\_zombiemode::main();

so it looks like this

Code Snippet
Plaintext
maps\guns::main();
maps\_zombiemode::main();

create a new.gsc or copy one of ye old ones and name it
" guns"

then add this code into it
Code Snippet
Plaintext
#include common_scripts\utility; 
#include maps\_utility;
#include maps\_zombiemode_utility;

main()
{
level.gun_spot = getentArray("free", "targetname");// u can edit the targetname if already using"free" in ye map
level._effect["powerup_on"] = loadfx( "misc/fx_zombie_powerup_on" );// u can edit the fx u want to play on the gun
thread gun_ammo();
/// dont touch these
currentweapon = self GetCurrentWeapon();
    ammoclip = WeaponClipSize( currentweapon );
    self SetWeaponAmmoClip( currentweapon, ammoclip );
}

gun_ammo()/// dont touch these
{
thread gun();
       
while(1)
{
level waittill("between_round_over");
level.gunmodel Delete();
gun();
}
}

gun()/// dont touch these
{
rand = RandomIntRange( 0, level.gun_spot.size);
randomgun = random_weapon();

gunmodelname = GetWeaponModel( randomgun );

for(i = 0; i < level.gun_spot.size; i++)
{
if(rand == i)
{
level.gunmodel = spawn( "script_model", level.gun_spot[i].origin +( 0, 0, -4 ) );
level.gunmodel.angles = level.gun_spot[i].angles +( 0, 180, 0 );


level.gunmodel setmodel( "tag_origin" );
playfxontag( level._effect["powerup_on2"], level.gunmodel, "tag_origin" );
level.gunmodel setmodel( gunmodelname );
thread got_ammo( gunmodelname );
}
}
}

got_ammo( gunmodelname )/// dont touch these
{
level endon("between_round_over");
level endon("ammo_taked");

player = get_Players();

while(1)
{
for(i = 0; i < player.size; i++)
{
if(player[i] IsTouching(level.gunmodel) )
{
thread free();
player[i] playsound("powerup_grabbed");
level.gunmodel Delete();
level notify("ammo_taked");
}
}
wait .2;
}
}

random_weapon()/// dont touch these
{

keys = GetArrayKeys( level.zombie_weapons );
return keys[RandomInt( keys.size )];
}

free()
{
level.free_weapon = [];/// u can add any guns in ye map and just replace them with the names of the guns below
level.free_weapon[0] = "zombie_gewehr43";
level.free_weapon[1] = "zombie_mp40";
level.free_weapon[2] = "zombie_stg44";
level.free_weapon[3] = "ptrs41_zombie";
level.free_weapon[4] = "zombie_doublebarrel_sawed_upgraded";
level.free_weapon[5] = "zombie_m1garand";
level.free_weapon[6] = "zombie_thompson";
level.free_weapon[7] = "zombie_fg42";
level.free_weapon[8] = "zombie_kar98k_upgraded";
level.free_weapon[9] = "zombie_sw_357_upgraded"; // rare weapon
level.free_weapon[10] = "zombie_mg42_upgraded"; // rare weapon

player = get_players();
for(i=0;i<player.size;i++)
{

player = player[i];
weapon = player getcurrentweapon();
weap = player GetWeaponsListPrimaries();
rand = randomintrange(1,1000);
for(i=0;i<weap.size;i++)
{
if(weap.size <= 2)
{
continue;
}
if(weap.size >=3)
{
player takeweapon(weapon);
}
}
if(rand == 1) // rare weapon 1
{
player giveweapon(level.free_weapon[9]);
player switchtoweapon(level.free_weapon[9]);
}
if(rand == 1000) //rare weapon 2
{
player giveweapon(level.free_weapon[10]);
player switchtoweapon(level.free_weapon[10]);
}
// normal weapons
if(rand >=3 && rand <=99)
{
player giveweapon(level.free_weapon[8]);
player switchtoweapon(level.free_weapon[8]);
}
if(rand >=900 && rand<=999)
{
player giveweapon(level.free_weapon[7]);
player switchtoweapon(level.free_weapon[7]);
}
if(rand >= 800 && rand <= 899)
{
player giveweapon(level.free_weapon[1]);
player switchtoweapon(level.free_weapon[1]);
}
if(rand >= 500 && rand <= 599) // a little hard
{
player giveweapon(level.free_weapon[6]);
player switchtoweapon(level.free_weapon[6]);
}
if(rand >= 100 && rand <= 199)
{
player giveweapon(level.free_weapon[5]);
player switchtoweapon(level.free_weapon[5]);
}
if(rand >= 300 && rand <= 399)
{
player giveweapon(level.free_weapon[4]);
player switchtoweapon(level.free_weapon[4]);
}
if(rand >=600 && rand <= 699 )
{
player giveweapon(level.free_weapon[3]);
player switchtoweapon(level.free_weapon[3]);
}
if(rand >=400 && rand <= 499)
{
player giveweapon(level.free_weapon[2]);
player switchtoweapon(level.free_weapon[2]);
}
if(rand >= 200 && rand <= 299)
{
player giveweapon(level.free_weapon[0]);
player switchtoweapon(level.free_weapon[0]);
}

}
}

ok put that gsc in ROOT/MODS/MAPNAME/MAPS
Then make sure its selected in mod builder

!! thats it for scripting easy right !!

you can have as many of these as u want in ye map In radiant add A script_ORIGIN anywhere in ye map whr u want the guns to appear and give it this kvp


Code Snippet
Plaintext
targetname
free


thats it  dance1 dance1 dance1 here are some pics





credit goes to
ME  dance1
MR.HANKEY  brainfood1
RAMPAGE_619  coffee1

TIP== THE GUN U SEE DOESN'T MEAN IT THE GUN U R GONNA GET  brainfood1

NOTE: you can edit this script to fit your map if u have NO knowlegde of scriptin and need help editing this just leave a post or if u have me on steam and skype u already should know i wont mind helping you coffee1
broken avatar :(
×
broken avatar :(
Location: usunited states
Date Registered: 19 August 2012
Last active: 2 years ago
Posts
215
Respect
Forum Rank
Mr. Elemental
Primary Group
Member
Personal Quote
Mapper
Signature
Maker of Contrivance
×
Psych's Groups
Psych's Contact & Social Links
This will make a fine edition to my map. Thanks! :D
broken avatar :(
×
broken avatar :(
☭ Soviet Commander ☭
Location: us
Date Registered: 13 August 2012
Last active: 8 years ago
Posts
2,790
Respect
Forum Rank
King of the Zombies
Primary Group
Community Daedra
My Groups
More
My Contact & Social Links
More
Signature
Let's keep this thread on topic from here on in. -DBZ

+1 to off-topic reply -DBZ

lmao. Too funny.

Goliath Script Placer: http://ugx-mods.com/forum/index.php/topic,11234.msg125257/topicseen.html#new

"...Christ, people. Learn C, instead of just stringing random characters
together until it compiles (with warnings)..."

-Linus Torvalds
×
daedra descent's Groups
Community Daedra
Community Daedra
daedra descent's Contact & Social LinksBlueSoviet
trying to use ZM emotes in UGX LOL

Quote
NOTE: you can edit this script to fit your map if u have NO knowlegde of scriptin and need help editing this just leave a post or if u have me on steam and skype u already should know i wont mind helping you coffee1

sure you will...
Last Edit: November 04, 2012, 07:46:10 pm by Daedra Descent
broken avatar :(
×
broken avatar :(
Location: usunited states
Date Registered: 19 August 2012
Last active: 2 years ago
Posts
215
Respect
Forum Rank
Mr. Elemental
Primary Group
Member
Personal Quote
Mapper
×
Psych's Groups
Psych's Contact & Social Links
Lol what?
Last Edit: November 04, 2012, 07:47:09 pm by Psych
broken avatar :(
×
broken avatar :(
Location: englandKent
Date Registered: 13 June 2013
Last active: 8 years ago
Posts
9
Respect
Forum Rank
Legless Crawler
Primary Group
Member
My Contact & Social Links
More
×
Gotbeats44's Groups
Gotbeats44's Contact & Social Linksevodjgotbeats44hotpropstv
found this really easy to follow and hopefully is working when I test it in a minute thanks bro

Post Merge: June 20, 2013, 05:05:39 pm
guns are showing up in game at random times but u can't pick them up and there not flashing or is that an extra mod?
Last Edit: June 20, 2013, 05:05:39 pm by Gotbeats44
broken avatar :(
×
broken avatar :(
Location: 00London
Date Registered: 18 June 2012
Last active: 4 years ago
Posts
7
Respect
Forum Rank
Legless Crawler
Primary Group
Member
My Contact & Social Links
More
FX doesn't seem to work on the custom drops + sometimes doesn't give you if you walk into it, but if you push f.
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.
do the guns just randomly show up?

how do i make it like an actual drop
Last Edit: April 29, 2014, 12:26:40 am by pashan
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_
Added everything correctly, double checked kvps, but nothings showing up in game. Help anyone?
Last Edit: August 05, 2014, 08:28:25 pm by Centric
broken avatar :(
×
broken avatar :(
Location: deFrankfurt
Date Registered: 16 June 2012
Last active: 1 year ago
Posts
83
Respect
Forum Rank
Rotting Walker
Primary Group
Member
Signature
×
holz's Groups
holz's Contact & Social Links
That gives a little chaotic funny Gameplay if you often use this weapons.  :D

 
Loading ...