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

Scripting perks into pre-existing maps

HOT
broken avatar :(
Created 7 years ago
by jiggy22
0 Members and 1 Guest are viewing this topic.
12,054 views
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 30 December 2016
Last active: 1 year ago
Posts
229
Respect
Forum Rank
Mr. Elemental
Primary Group
Member
My Contact & Social Links
More
×
jiggy22's Groups
jiggy22's Contact & Social Linksarchdukesquidlyllljiggy22
Thanks again for the help, that finally worked! :) How would I add weapon exceptions to this function? We don't want the Wunderwaffe completely refilling its ammo with one shot!
broken avatar :(
×
broken avatar :(
Location: aupotato
Date Registered: 27 September 2013
Last active: 3 years ago
Posts
588
Respect
Forum Rank
Zombie Enslaver
Primary Group
Community Scripter
My Groups
More
My Contact & Social Links
More
Signature
respect the dead

donates greatly appreciated :) paypal.me/F3ARxReaper666
discord server:
https://discord.gg/tsGHW99
×
death_reaper0's Groups
Community Mapper Has released one or more maps to the UGX-Mods community which have been added to the UGX Map Manager.
Community Scripter Has shown effort and knowledge in the area of scripting while being a part of the UGX-Mods community.
Code Snippet
Plaintext
ammomatic_init()
{
flag_wait( "all_players_connected" );
players = get_players();
for ( i = 0; i < players.size; i++ )
players[i] ammomatic();
}

ammomatic()
{
while(1)
{
self waittill("zom_kill");
if(self hasperk("specialty_specialgrenade"))
{
weapon = self GetCurrentWeapon();
if(weapon != "tesla_gun" && weapon != "tesla_gun_upgraded" )
{
current = self GetWeaponAmmoStock( weapon );
self SetWeaponAmmoStock( weapon, current + 1 );
}
}
}
}
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 30 December 2016
Last active: 1 year ago
Posts
229
Respect
Forum Rank
Mr. Elemental
Primary Group
Member
My Contact & Social Links
More
×
jiggy22's Groups
jiggy22's Contact & Social Linksarchdukesquidlyllljiggy22
Thanks again for the help! :)
So I think there's just one final thing I have to do before this can all be brought to a close. You said before that it's possible to spawn the entity that allows the jingles and stings for the new perks to play. What would be the best way to do this? Thanks again for all of your help with this, I couldn't have done any of this without it!
broken avatar :(
×
broken avatar :(
Location: aupotato
Date Registered: 27 September 2013
Last active: 3 years ago
Posts
588
Respect
Forum Rank
Zombie Enslaver
Primary Group
Community Scripter
My Groups
More
My Contact & Social Links
More
×
death_reaper0's Groups
Community Mapper Has released one or more maps to the UGX-Mods community which have been added to the UGX Map Manager.
Community Scripter Has shown effort and knowledge in the area of scripting while being a part of the UGX-Mods community.
this is untested but hopefully it works

ok, replace the place_perk script with this new one

Code Snippet
Plaintext

place_perk( machine_origin,  machine_angles, model, targetname, specialty, script_string, script_sound)
{
perk = Spawn( "script_model", machine_origin );
perk.angles = machine_angles;
perk setModel( model );
perk.targetname = targetname;

perk_trigger = Spawn( "trigger_radius", machine_origin + (0 , 0, 50), 0, 60, 50 );
perk_trigger.targetname = "zombie_vending";
perk_trigger.target = targetname;
perk_trigger.script_noteworthy = specialty;

spawnCollision("collision_geo_64x64x128", "collider", machine_origin+(0, 0, 50), machine_angles);
if(isdefined(script_string) && isdefined(script_sound))
{
struct = SpawnStruct();
struct.origin = machine_origin+(0,0,40);
struct.script_string = script_string;
struct.targetname = "perksacola";
struct.script_sound = script_sound;
}
}


then the part used to set where they are, eg:
Code Snippet
Plaintext
	level thread place_perk( (-84.8484, 540.435, 58.125),  (0, 0, 90), "zombie_vending_mulekick", "vending_mule_kick", "specialty_extraammo");


should now have 2 more parts to it (p.s. this will only need to be done for ones your adding the jingle to, if the perk doesnt have a jingle you can skip this for that perk)
Code Snippet
Plaintext
	level thread place_perk( (-84.8484, 540.435, 58.125),  (0, 0, 90), "zombie_vending_mulekick", "vending_mule_kick", "specialty_extraammo", script_string, script_sound);


now you will have to go into the perk prefab to get the kvps, the first new one ( script_string ) is found on a pink square thing on the perk perk prefab, about halfway up the machine or so, should have kvps similar to this:



the first bit will need to be what the script_string says, this perk is doubletap as an example, and has "tap_perk" for this,

second one is the kvp script_sound, in the example it is "mx_doubletap_jingle"

so if using these in that example it would look like

Code Snippet
Plaintext
level thread place_perk( (-84.8484, 540.435, 58.125),  (0, 0, 90), "zombie_vending_mulekick", "vending_mule_kick", "specialty_extraammo",  "tap_perk", "mx_doubletap_jingle");

broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 30 December 2016
Last active: 1 year ago
Posts
229
Respect
Forum Rank
Mr. Elemental
Primary Group
Member
My Contact & Social Links
More
×
jiggy22's Groups
jiggy22's Contact & Social Linksarchdukesquidlyllljiggy22
Thanks once again for the help. I wasn't able to get it to work, but that's most likely because my perk sounds are in the wrong wav format, I'll have to try it again soon.

One last thing before I mark this topic as solved. I was wondering if it was possible to modify the functions of Stamin-Up so that it gives the buyer unlimited sprint, as opposed to just an increased sprint duration. Would that be do-able? Thanks again!
broken avatar :(
×
broken avatar :(
Location: aupotato
Date Registered: 27 September 2013
Last active: 3 years ago
Posts
588
Respect
Forum Rank
Zombie Enslaver
Primary Group
Community Scripter
My Groups
More
My Contact & Social Links
More
×
death_reaper0's Groups
Community Mapper Has released one or more maps to the UGX-Mods community which have been added to the UGX Map Manager.
Community Scripter Has shown effort and knowledge in the area of scripting while being a part of the UGX-Mods community.
dont know if unlimited is possible, but just setting it really high should do fine, not likely a player will be sprinting forever to reach the limit

 
Loading ...