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

[Script] Updated BO1/BO2 style easter egg reward

HOT
broken avatar :(
Created 12 years ago
by Ege115
0 Members and 1 Guest are viewing this topic.
17,278 views
broken avatar :(
×
broken avatar :(
Location: se
Date Registered: 30 July 2013
Last active: 2 years ago
Posts
517
Respect
Forum Rank
Zombie Enslaver
Primary Group
Scripter
My Groups
More
My Contact & Social Links
More
×
Ege115's Groups
Scripter Has shown effort and knowledge in the area of scripting while being a part of the UGX-Mods community.
Ege115's Contact & Social LinksEge115
Hello there UGX members, I want to share a script. If you are making or will make an easter egg in your map and you want to give the players a reward, then you maybe want to give the player all perks?
Just like treyarch did in a couple of maps where you get all perks as a reward after completing an EE.

To impliment this in your map, follow these steps.

1. Copy and paste this in a new fresh .GSC file, and name the file,
Code Snippet
Plaintext
give_players_perks
Code Snippet
Plaintext
#include common_scripts\utility;
#include maps\_utility;
#include maps\_zombiemode_utility;

main()
{
thread give_player_perks();
}

give_player_perks()
{
players = get_players();
for( i = 0; i < players.size; i++ )
{
players[i] thread give_all_perks();
players[i] thread remove_revive_solo();
}
}

give_all_perks()
{
flag_wait("all_players_connected");

wait .3;

perks = [];
perks[0] = "specialty_armorvest"; //Juggernog
perks[1] = "specialty_rof"; //Double tap
perks[2] = "specialty_fastreload";//speed cola
perks[3] = "specialty_detectexplosive";//PHD flopper
perks[4] = "specialty_bulletaccuracy";//deadshot
perks[5] = "specialty_extraammo";//mule kick
perks[6] = "specialty_longersprint";// staminup
//perks[7] = "speciality_whatever_perk";// IF YOU HAVE MORE PERKS YOU WANT TO ADD, THEN CHANGE "speciality_whatever_perk" TO THE STRING NAME OF THE PERK YOU WILL ADD. THEN CONTINUE LIKE THAT WHEN ADDING MORE PERKS. AND CHANGE THE NUMBER AT EVERY PERK YOU ADD LIKE. "perks[number]"

while(1)
{
for(p=0;p<perks.size;p++)
{
if(!self HasPerk(perks[p]))
{
self thread jugg_fix();

self setperk(perks[p]);

self thread maps\_zombiemode_perks::perk_hud_create( perks[p] );
self thread maps\_zombiemode_perks::perk_think( perks[p] );
}
if(level.intermission == true)
break;
wait .3;
}
if(level.intermission == true)
break;
}
}

jugg_fix()
{
while(1)
{
if(self HasPerk("specialty_armorvest") && !self maps\_laststand::player_is_in_laststand() && self.being_revived == false)
{
self.maxhealth = level.zombie_vars["zombie_perk_juggernaut_health"];
self.health = level.zombie_vars["zombie_perk_juggernaut_health"];
break;
}
wait .1;
}
}

remove_revive_solo()
{
if(!self HasPerk("specialty_quickrevive"))
{
self SetPerk("specialty_quickrevive");
self maps\_zombiemode_perks::perk_hud_create( "specialty_quickrevive" );
self thread maps\_zombiemode_perks::perk_think( "specialty_quickrevive" );
}

while(1)
{
//iprintln("waittill is active");
self waittill_any( "fake_death", "death", "player_downed" );

if(self.size == 1 && self HasPerk("specialty_quickrevive"))
{
self UnSetPerk("specialty_quickrevive");
self thread maps\_zombiemode_perks::perk_hud_destroy( "specialty_quickrevive" );
// iprintln("removed revive on solo");
}
else if(self.size != 1 && !self HasPerk("specialty_quickrevive"))
{
self SetPerk("specialty_quickrevive");
self maps\_zombiemode_perks::perk_hud_create( "specialty_quickrevive" );
self thread maps\_zombiemode_perks::perk_think( "specialty_quickrevive" );
// iprintln("Give back revive in coop");
}
}
}
So yea, call it in whatever script you want that will give the players the perks.
But I don't suggest calling it in mapname.gsc in the main function, because then you will get all perks at the start of the game. ;)

3. Open launcher and go to the mod builder and check the script in the IWD list.

4. Build your mod.

This script supports Black ops 1 perks so if you have and will add like Black ops 2 perks, then just add it them in the script at where I commented.

Enjoy!

If you have any problems or you discover any bugs, let me know!

Credits:
PROxFTW for testing this script.
JR-Imagine for giving me suggestions on how to make this script better.
Last Edit: August 22, 2014, 09:56:19 pm by Ege115
broken avatar :(
×
broken avatar :(
The King of Zombies
Location: usLouisiana
Date Registered: 24 June 2013
Last active: 6 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 Linksdust103194MrZ0mbiesFanaticMrZ0mbiesFanatic
Will the players have all the perks all the time even if they go down with this? Also How could I make it so if their playing solo, it will get rid of quick revive if they go down but keep the rest.
broken avatar :(
×
broken avatar :(
Location: se
Date Registered: 30 July 2013
Last active: 2 years ago
Posts
517
Respect
Forum Rank
Zombie Enslaver
Primary Group
Scripter
My Groups
More
My Contact & Social Links
More
×
Ege115's Groups
Scripter Has shown effort and knowledge in the area of scripting while being a part of the UGX-Mods community.
Ege115's Contact & Social LinksEge115
Will the players have all the perks all the time even if they go down with this? Also How could I make it so if their playing solo, it will get rid of quick revive if they go down but keep the rest.
I didn't impliment that because I thought it maybe would be too OP in custom maps. But if you want it like that, I might be able to improve this later on the way you want.

Anyone else who want it like that?

Okey, script is now updated the way you wanted it zombiekilla. :)
Last Edit: June 25, 2014, 01:16:46 pm by Ege115
broken avatar :(
×
broken avatar :(
Location: se
Date Registered: 27 December 2013
Last active: 8 years ago
Posts
64
Respect
Forum Rank
Rotting Walker
Primary Group
Member
×
thebromonkey's Groups
thebromonkey's Contact & Social Links
Sorry for being a noob, but how do you call it into a script? :)
broken avatar :(
×
broken avatar :(
Location: usYork, SC
Date Registered: 15 March 2014
Last active: 7 years ago
Posts
214
Respect
Forum Rank
Mr. Elemental
Primary Group
Scripter
My Groups
More
My Contact & Social Links
More
Personal Quote
WaW Scriptor
Signature
WaW Scriptor
×
PROxFTW's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Scripter Has shown effort and knowledge in the area of scripting while being a part of the UGX-Mods community.
PROxFTW's Contact & Social LinksPROxFTWPROxFTWPROxFTWPROxFTW
Sorry for being a noob, but how do you call it into a script? :)
Calling a function via script:
1) Find the location of which you want to place the function. Seeing as this is a give all perks code. It would be recommended to use for an easter egg however doesn't matter. * Make sure the location you want to place it is in a function then being right outside the function *
2) Calling it - Simply it is threading the function.
Post this code in the location you found above. Due to the fact you have to name the file change FileName to whatever your file name is.
thread maps\FileName::main();
* If you don't understand this there are a few tutorials for WaW to help learn scripting *
http://ugx-mods.com/wiki/index.php?title=Scripting_Guide
broken avatar :(
×
broken avatar :(
Location: usMissouri
Date Registered: 6 August 2013
Last active: 10 months ago
Posts
513
Respect
Forum Rank
Zombie Enslaver
Primary Group
Member
My Contact & Social Links
More
Signature
Projects:
Unnamed Project: 5%
Mutliple Downloadable Items for Mappers: (Released after map releases)
×
GerardS0406's Groups
GerardS0406's Contact & Social LinksGerardS0406GerardS0406Gerard0406MrGerard0406
It's actually pretty easy calling in a script! Just look up the tutorial as Pro said above if you don't know how to...
Last Edit: August 01, 2014, 04:21:31 pm by GerardS0406
broken avatar :(
×
broken avatar :(
Location: se
Date Registered: 27 December 2013
Last active: 8 years ago
Posts
64
Respect
Forum Rank
Rotting Walker
Primary Group
Member
×
thebromonkey's Groups
thebromonkey's Contact & Social Links
ok thanks will try :)
broken avatar :(
×
broken avatar :(
Location: usMissouri
Date Registered: 6 August 2013
Last active: 10 months ago
Posts
513
Respect
Forum Rank
Zombie Enslaver
Primary Group
Member
My Contact & Social Links
More
×
GerardS0406's Groups
GerardS0406's Contact & Social LinksGerardS0406GerardS0406Gerard0406MrGerard0406
The only bug I find is that the black ops perk shaders are not showing... I only see the waw perks... any help?
broken avatar :(
×
broken avatar :(
Location: usYork, SC
Date Registered: 15 March 2014
Last active: 7 years ago
Posts
214
Respect
Forum Rank
Mr. Elemental
Primary Group
Scripter
My Groups
More
My Contact & Social Links
More
Personal Quote
WaW Scriptor
×
PROxFTW's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Scripter Has shown effort and knowledge in the area of scripting while being a part of the UGX-Mods community.
PROxFTW's Contact & Social LinksPROxFTWPROxFTWPROxFTWPROxFTW
The only bug I find is that the black ops perk shaders are not showing... I only see the waw perks... any help?
Are you using Bam's BO Perks? I don't think Bam has the shaders listed in _zombiemode_perks.gsc causing the shaders to not be seen. However you should still have the perk.
broken avatar :(
×
broken avatar :(
Location: usMissouri
Date Registered: 6 August 2013
Last active: 10 months ago
Posts
513
Respect
Forum Rank
Zombie Enslaver
Primary Group
Member
My Contact & Social Links
More
×
GerardS0406's Groups
GerardS0406's Contact & Social LinksGerardS0406GerardS0406Gerard0406MrGerard0406
yea i do get the perk but the shader does not show
broken avatar :(
×
broken avatar :(
Location: se
Date Registered: 30 July 2013
Last active: 2 years ago
Posts
517
Respect
Forum Rank
Zombie Enslaver
Primary Group
Scripter
My Groups
More
My Contact & Social Links
More
×
Ege115's Groups
Scripter Has shown effort and knowledge in the area of scripting while being a part of the UGX-Mods community.
Ege115's Contact & Social LinksEge115
I just tested the script again, and it works just fine.

Yea, I think PROxFTW is right, I think Bam included the shaders in a file called, _zombiemode_perks_black_ops.gsc
and not _zombiemode_perks.gsc
broken avatar :(
×
broken avatar :(
Location: usMissouri
Date Registered: 6 August 2013
Last active: 10 months ago
Posts
513
Respect
Forum Rank
Zombie Enslaver
Primary Group
Member
My Contact & Social Links
More
×
GerardS0406's Groups
GerardS0406's Contact & Social LinksGerardS0406GerardS0406Gerard0406MrGerard0406
I know it works just the shaders don't show up but it's fine...
broken avatar :(
×
broken avatar :(
Location: usYork, SC
Date Registered: 15 March 2014
Last active: 7 years ago
Posts
214
Respect
Forum Rank
Mr. Elemental
Primary Group
Scripter
My Groups
More
My Contact & Social Links
More
Personal Quote
WaW Scriptor
×
PROxFTW's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Scripter Has shown effort and knowledge in the area of scripting while being a part of the UGX-Mods community.
PROxFTW's Contact & Social LinksPROxFTWPROxFTWPROxFTWPROxFTW
I know it works just the shaders don't show up but it's fine...
This should help if you are using Bam's BO Perks Mod. If it still doesn't show that means you just need to update the name of the shader or the specialty_Whatever.
In _zombiemode_perks.gsc find
Code Snippet
Plaintext
perk_hud_create( perk )
{
// Code
}
and replace it with.
Code Snippet
Plaintext
perk_hud_create( perk )
{
if ( !IsDefined( self.perk_hud ) )
{
self.perk_hud = [];
}

/#
if ( GetDVarInt( "zombie_cheat" ) >= 5 )
{
if ( IsDefined( self.perk_hud[ perk ] ) )
{
return;
}
}
#/


shader = "";

switch( perk )
{
case "specialty_armorvest":
shader = "specialty_juggernaut_zombies";
break;

case "specialty_quickrevive":
shader = "specialty_quickrevive_zombies";
break;

case "specialty_fastreload":
shader = "specialty_fastreload_zombies";
break;

case "specialty_rof":
shader = "specialty_doubletap_zombies";
break;

// BO Perks
case "specialty_detectexplosive": // PHD
shader = "vending_phd_shader";
break;

case "specialty_longersprint": // Stamin-Up
shader = "vending_staminup_shader";
break;

case "specialty_extraammo": // Mule Kick
shader = "vending_mule_kick_shader";
break;

case "specialty_bulletaccuracy": // Deadshot
shader = "vending_deadshot_shader";
break;

default:
shader = "";
break;
}

hud = create_simple_hud( self );
hud.foreground = true;
hud.sort = 1;
hud.hidewheninmenu = false;
hud.alignX = "left";
hud.alignY = "bottom";
hud.horzAlign = "left";
hud.vertAlign = "bottom";
hud.x = self.perk_hud.size * 30;
hud.y = hud.y - 70;
hud.alpha = 1;
hud SetShader( shader, 24, 24 );

self.perk_hud[ perk ] = hud;
}
broken avatar :(
×
broken avatar :(
Location: usMissouri
Date Registered: 6 August 2013
Last active: 10 months ago
Posts
513
Respect
Forum Rank
Zombie Enslaver
Primary Group
Member
My Contact & Social Links
More
×
GerardS0406's Groups
GerardS0406's Contact & Social LinksGerardS0406GerardS0406Gerard0406MrGerard0406
Thanks That Worked!
broken avatar :(
×
broken avatar :(
Location: deFrankfurt
Date Registered: 16 June 2012
Last active: 3 years ago
Posts
83
Respect
Forum Rank
Rotting Walker
Primary Group
Member
Signature
×
holz's Groups
holz's Contact & Social Links
Bug Report:
You loose only Quick Revive in first dead, and at second you get all Perks back.
Same like in the Map Lake Michigan.

But thx good work i search for a while for such an Tutorial.

Code Snippet
Plaintext
Electric Cherry:
specialty_boost
shader = "cherry_vending_zombies";

Vultaire AID:
specialty_ordinance
shader = "vulture_vending_zombies_0";

Vutaire works too but without the green light around the shader.
Last Edit: August 20, 2014, 08:19:05 am by holz

 
Loading ...