UGX-Mods

Call of Duty 5: World at War => Tutorial Desk => Scripting => Topic started by: death_reaper0 on October 03, 2016, 08:59:44 am

Title: REVELATIONS HAT/MASK
Post by: death_reaper0 on October 03, 2016, 08:59:44 am
this is a small tutorial for a revelations styled mask/hat for waw, keep in mind this is just an example, however it is fully functional and should work in your map. this one is just from a testing one ive made that will require 150 total kills (among all players, not just a single player) and will give 40% damage reduction, this is i think 2 extra hits with jugg and posibly one without (i use a 3 hit without jugg system so i haven't checked)

anyway
first you need to go into radiant and find the "hat" you wish to use, this needs to be a "char_..." model that is some kind of hat or helmet, for this example im going to use "char_usa_marine_wet_helm1" so if yours is different you will need to change that whenever that shows up during this tutorial.

create a script model with the model you wish to use (right click 2d view in radiant > script > model)

now make a trigger use (right click 2d view in radiant > trigger > trigger_use) and press N on the keyboard to bring up the KVP's, make the key: "targetname" and value: "helmet1" (without the ")

with the trigger still selected, select the helmet you chose and press W to link them, there should be a red line connecting them now. place wherever you want it to be, save and we're done in radiant

heres an example of how it should look
(https://www.ugx-mods.com/forum/proxy.php?request=http%3A%2F%2Fi.imgur.com%2FEePJiGY.jpg&hash=428e21d5e85816a3e48103eacef7e23fd64dd298)


now open up your mapname.gsc and place
Code Snippet
Plaintext
	level thread hat_ee();
under
Code Snippet
Plaintext
	level thread DLC3_threadCalls2();

then at the bottom of the file place this
Code Snippet
Plaintext
mask_kills_tracker()
{
while(1)
{
self waittill("zom_kill");
level notify ("got_a_mask_kill");
//iprintlnbold("got a kill");
}
}

hat_ee()
{
flag_wait( "all_players_connected" );
helmet1 = GetEnt( "helmet1", "targetname" );
helmet1_ta = GetEnt( helmet1.target, "targetname" );
helmet1_ta hide();
helmet1 SetCursorHint( "HINT_NOICON" );
helmet1 UseTriggerRequireLookAt();
kills = 150; //kills required, feel free to edit
players = get_players();
for (i = 0; i < players.size; i++)
players[i] thread mask_kills_tracker();
while(kills > 0)
{
level waittill("got_a_mask_kill");
kills -=1;
}
players = get_players();
for (i = 0; i < players.size; i++)
players[i] playsound("laugh_child"); //play a sound to notify upon completion
helmet1_ta show();
helmet1 SetHintString( "Hold &&1 To Take" ); //the trigger will say this
while(1)
{
helmet1 waittill( "trigger", user );
if (isdefined(user.hatModel))
user detach( user.hatModel, "" );
user.hatModel = "char_usa_marine_wet_helm1"; //this is the helmet model, should match the one in radiant
user attach(user.hatModel);
user iprintlnbold("+40 Percent Resistance To All Damage"); //says this when picked up
}
}

now we go into your _zombiemode.gsc and find the
Code Snippet
Plaintext
player_damage_override
function
in that find
Code Snippet
Plaintext
	finalDamage = iDamage;
and under it place
Code Snippet
Plaintext
 
if(isdefined(self.hatModel) && self.hatModel == "char_usa_marine_wet_helm1")
finalDamage = int(finalDamage*0.6);
remember to change the helmet if you changed it before!

before
(https://www.ugx-mods.com/forum/proxy.php?request=http%3A%2F%2Fi.imgur.com%2FslzxB7h.jpg&hash=e24cb25aaa76be09d5d0811b142aa5002842683c)
after
(https://www.ugx-mods.com/forum/proxy.php?request=http%3A%2F%2Fi.imgur.com%2F1XtyQmD.jpg&hash=20d03d24ba7b294fee3aaeb911ce7c1eaffd61d6)
other players should see it too


that should be everything, no need to precache or load the model in mod.csv since its a scriptmodel

as i said before this was my test one, for full quests you will have to script things youself

please credit if used
Title: Re: REVELATIONS HAT/MASK
Post by: ALIA999 on October 03, 2016, 02:41:07 pm
you are the best dude im making a map his name is daemons mine i wont some help with secripting coues idont every thing with scripting i just want some help with some things


Double Post Merge: October 03, 2016, 04:55:18 pm
you are the best dude im making a map his name is daemons mine i want some help with secripting coues idont know every thing with scripting i just want some help with some things
Title: Re: REVELATIONS HAT/MASK
Post by: death_reaper0 on October 03, 2016, 05:11:08 pm
you are the best dude im making a map his name is daemons mine i wont some help with secripting coues idont every thing with scripting i just want some help with some things


Double Post Merge: October 03, 2016, 04:55:18 pm
between my personal life and modding i dont really have much time to help single people, if you need help with stuff you should make a post here http://ugx-mods.com/forum/index.php/board,11.0.html (http://ugx-mods.com/forum/index.php/board,11.0.html)
theres lots of people around that most likely can help, just keep in mind it could take a bit for someone to respond
Title: Re: REVELATIONS HAT/MASK
Post by: ALIA999 on October 03, 2016, 07:12:47 pm
thanks dude
Title: Re: REVELATIONS HAT/MASK
Post by: IamTIMMEHHH on October 10, 2016, 08:22:28 am
Is this with the new ugx standalone???
Title: Re: REVELATIONS HAT/MASK
Post by: IamTIMMEHHH on October 24, 2016, 05:58:48 pm
Can you maybe do a tutorial on one of your custom perk Some ideas i would like in my map


Title: Re: REVELATIONS HAT/MASK
Post by: BrandynNew on October 26, 2016, 01:37:18 am
Thanks man!

If I didn't want to require any easter egg, would I edit your script:

Quote
mask_kills_tracker()
{
while(1)
{
self waittill("zom_kill");
level notify ("got_a_mask_kill");
//iprintlnbold("got a kill");
}
}

hat_ee()
{
flag_wait( "all_players_connected" );
helmet1 = GetEnt( "helmet1", "targetname" );
helmet1_ta = GetEnt( helmet1.target, "targetname" );
helmet1_ta hide();
helmet1 SetCursorHint( "HINT_NOICON" );
helmet1 UseTriggerRequireLookAt();
kills = 150;                                    //kills required, feel free to edit
players = get_players();
   for (i = 0; i < players.size; i++)
      players thread mask_kills_tracker();
while(kills > 0)
   {
   level waittill("got_a_mask_kill");
   kills -=1;
   }
players = get_players();
   for (i = 0; i < players.size; i++)
      players playsound("laugh_child");         //play a sound to notify upon completion
helmet1_ta show();
helmet1 SetHintString( "Hold &&1 To Take" );         //the trigger will say this
while(1)
   {
   helmet1 waittill( "trigger", user );
   if (isdefined(user.hatModel))
   user detach( user.hatModel, "" );
   user.hatModel = "char_usa_marine_wet_helm1";      //this is the helmet model, should match the one in radiant
   user attach(user.hatModel);
   user iprintlnbold("+40 Percent Resistance To All Damage");   //says this when picked up
   }
}

To something like:

Quote
helmet1 SetHintString( "Hold &&1 To Take" );         //the trigger will say this
while(1)
   {
   helmet1 waittill( "trigger", user );
   if (isdefined(user.hatModel))
   user detach( user.hatModel, "" );
   user.hatModel = "char_usa_marine_wet_helm1";      //this is the helmet model, should match the one in radiant
   user attach(user.hatModel);
   user iprintlnbold("+40 Percent Resistance To All Damage");   //says this when picked up
   }
}

Thanks again!
Title: Re: REVELATIONS HAT/MASK
Post by: AdvancedDecay on November 30, 2016, 03:10:19 am
hello Reaper..... can I ask how I would have as many as I wanted of these as I cant get it to work


Double Post Merge: November 30, 2016, 03:13:43 am

can u pm me please I need some major help with this script
Title: Re: REVELATIONS HAT/MASK
Post by: death_reaper0 on November 30, 2016, 03:37:11 am
Code Snippet
Plaintext
hat_ee2()
{
flag_wait( "all_players_connected" );
helmet2 = GetEnt( "helmet2", "targetname" );
helmet2_ta = GetEnt( helmet2.target, "targetname" );
helmet2_ta hide();
helmet2 SetCursorHint( "HINT_NOICON" );
helmet2 UseTriggerRequireLookAt();
kills = 150; //kills required, feel free to edit
players = get_players();
for (i = 0; i < players.size; i++)
players[i] thread mask_kills_tracker();
while(kills > 0)
{
level waittill("got_a_mask_kill");
kills -=1;
}
players = get_players();
for (i = 0; i < players.size; i++)
players[i] playsound("laugh_child"); //play a sound to notify upon completion
helmet2_ta show();
helmet2 SetHintString( "Hold &&1 To Take" ); //the trigger will say this
while(1)
{
helmet2 waittill( "trigger", user );
if (isdefined(user.hatModel))
user detach( user.hatModel, "" );
user.hatModel = "char_usa_marine_wet_helm1"; //this is the helmet model, should match the one in radiant
user attach(user.hatModel);
user iprintlnbold("+40 Percent Resistance To All Damage"); //says this when picked up
}
}

this is pretty much the same, unlocked the same and gives the same hat, you will need to script your own way of unlocking, change the hat and effect, to make more just copy + paste and change all  the "2"s to "3"
dont have the free time to script in more so you'll have to do them yourself
Title: Re: REVELATIONS HAT/MASK
Post by: AdvancedDecay on November 30, 2016, 12:49:10 pm
Code Snippet
Plaintext
hat_ee2()
{
flag_wait( "all_players_connected" );
helmet2 = GetEnt( "helmet2", "targetname" );
helmet2_ta = GetEnt( helmet2.target, "targetname" );
helmet2_ta hide();
helmet2 SetCursorHint( "HINT_NOICON" );
helmet2 UseTriggerRequireLookAt();
kills = 150; //kills required, feel free to edit
players = get_players();
for (i = 0; i < players.size; i++)
players[i] thread mask_kills_tracker();
while(kills > 0)
{
level waittill("got_a_mask_kill");
kills -=1;
}
players = get_players();
for (i = 0; i < players.size; i++)
players[i] playsound("laugh_child"); //play a sound to notify upon completion
helmet2_ta show();
helmet2 SetHintString( "Hold &&1 To Take" ); //the trigger will say this
while(1)
{
helmet2 waittill( "trigger", user );
if (isdefined(user.hatModel))
user detach( user.hatModel, "" );
user.hatModel = "char_usa_marine_wet_helm1"; //this is the helmet model, should match the one in radiant
user attach(user.hatModel);
user iprintlnbold("+40 Percent Resistance To All Damage"); //says this when picked up
}
}

this is pretty much the same, unlocked the same and gives the same hat, you will need to script your own way of unlocking, change the hat and effect, to make more just copy + paste and change all  the "2"s to "3"
dont have the free time to script in more so you'll have to do them yourself

can I juss change the kills to 250 for unlocking as u said I need to script a way of unlocking but cant I juss change the kills and it work


Double Post Merge: November 30, 2016, 02:38:54 pm
Code Snippet
Plaintext
hat_ee2()
{
flag_wait( "all_players_connected" );
helmet2 = GetEnt( "helmet2", "targetname" );
helmet2_ta = GetEnt( helmet2.target, "targetname" );
helmet2_ta hide();
helmet2 SetCursorHint( "HINT_NOICON" );
helmet2 UseTriggerRequireLookAt();
kills = 150; //kills required, feel free to edit
players = get_players();
for (i = 0; i < players.size; i++)
players[i] thread mask_kills_tracker();
while(kills > 0)
{
level waittill("got_a_mask_kill");
kills -=1;
}
players = get_players();
for (i = 0; i < players.size; i++)
players[i] playsound("laugh_child"); //play a sound to notify upon completion
helmet2_ta show();
helmet2 SetHintString( "Hold &&1 To Take" ); //the trigger will say this
while(1)
{
helmet2 waittill( "trigger", user );
if (isdefined(user.hatModel))
user detach( user.hatModel, "" );
user.hatModel = "char_usa_marine_wet_helm1"; //this is the helmet model, should match the one in radiant
user attach(user.hatModel);
user iprintlnbold("+40 Percent Resistance To All Damage"); //says this when picked up
}
}

this is pretty much the same, unlocked the same and gives the same hat, you will need to script your own way of unlocking, change the hat and effect, to make more just copy + paste and change all  the "2"s to "3"
dont have the free time to script in more so you'll have to do them yourself

hey how do I edit this
 "    if(isdefined(self.hatModel) && self.hatModel == "char_usa_raider_helm2")
   finalDamage = int(finalDamage*0.12);   "

so that instead of a extra hit it gives me longer sprint duration
Title: Re: REVELATIONS HAT/MASK
Post by: IamTIMMEHHH on December 13, 2016, 04:30:31 pm
can you add multiple of these an if its possible how?
Title: Re: REVELATIONS HAT/MASK
Post by: ColdShrimp2 on May 24, 2017, 10:10:59 pm
This is a little late, but how do I make the reward be zombies ignore you on random occasions?
Title: Re: REVELATIONS HAT/MASK
Post by: Centric on May 25, 2017, 06:48:29 pm
This is a little late, but how do I make the reward be zombies ignore you on random occasions?

Create a zombie point of interest when you don't want the zombies attacking and just delete it when you want them to attack again. The scripting reference should have documentation on it.
Title: Re: REVELATIONS HAT/MASK
Post by: ColdShrimp2 on May 29, 2017, 06:55:32 pm
I want the reward to be that it gives a perk, I edited it and got this:

Code Snippet
Plaintext
if(IsDefined(self.hatModel) && self.hatModel == "char_rus_guard_ushankaup1")
{
self SetPerk("specialty_detectexplosive");
}

Where would I put this if it's correct?