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

Communal Box

broken avatar :(
Created 10 years ago
by MakeCents
0 Members and 1 Guest are viewing this topic.
4,199 views
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 14 September 2013
Last active: 4 years ago
Posts
1,895
Respect
Forum Rank
Zombie Destroyer
Primary Group
Community Scripter
My Groups
More
My Contact & Social Links
More
Personal Quote
BE ORIGINAL
Signature
×
MakeCents'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.
BO3 Modtools Alpha
BO3 Modtools Alpha
This user has access to the Black Ops 3 Modtools Alpha
This will make the box weapon take-able for all players, not just the person that hit the box.

All changes will be in your _zombiemode_weapons.gsc, treasure_chest_think() function.

I have provided two options, the few steps necessary for this, or at the bottom of the page you can select and replace the entire function.

Step-by-step
Locate the treasure_chest_think() function.
Replace the following:
Code Snippet
Plaintext
		self setvisibletoplayer( user );
with
Code Snippet
Plaintext
		self setvisibletoplayer( user );
self thread GiveMeASecond(); //gives the player who hit the box time to take weapon

Replace the following:
Code Snippet
Plaintext
			if( grabber == user || grabber == level )
with
Code Snippet
Plaintext
			if( is_player_valid(grabber) || grabber == level )
Replace the following:
Code Snippet
Plaintext
				if( grabber == user && is_player_valid( user ) && user GetCurrentWeapon() != "mine_bouncing_betty" )


with
Code Snippet
Plaintext
				user = grabber;
if( is_player_valid( user ) && user GetCurrentWeapon() != "mine_bouncing_betty" )
Then add the following function after the treasure_chest_think() function function
Code Snippet
Plaintext
GiveMeASecond(){
wait(3); //gives the buyer 3 seconds to chose to take it
self SetVisibleToAll();
}



or, if it is easier for you, just replace your whole treasure_chest_think() function with this:
Code Snippet
Plaintext
treasure_chest_think()
{
cost = 950;
if( IsDefined( level.zombie_treasure_chest_cost ) )
{
cost = level.zombie_treasure_chest_cost;
}
else
{
cost = self.zombie_cost;
}

self set_hint_string( self, "default_treasure_chest_" + cost );
self setCursorHint( "HINT_NOICON" );

//self thread decide_hide_show_chest_hint( "move_imminent" );

// waittill someuses uses this
user = undefined;
while( 1 )
{
self waittill( "trigger", user );

if( user in_revive_trigger() )
{
wait( 0.1 );
continue;
}

// make sure the user is a player, and that they can afford it
if( is_player_valid( user ) && user.score >= cost )
{
user maps\_zombiemode_score::minus_to_player_score( cost );
break;
}
else if ( user.score < cost )
{
user thread maps\_zombiemode_perks::play_no_money_perk_dialog();
continue;
}

wait 0.05;
}

// trigger_use->script_brushmodel lid->script_origin in radiant
lid = getent( self.target, "targetname" );
weapon_spawn_org = getent( lid.target, "targetname" );

//open the lid
lid thread treasure_chest_lid_open();

// SRS 9/3/2008: added to help other functions know if we timed out on grabbing the item
self.timedOut = false;

// mario kart style weapon spawning
weapon_spawn_org thread treasure_chest_weapon_spawn( self, user );

// the glowfx
weapon_spawn_org thread treasure_chest_glowfx();

// take away usability until model is done randomizing
self disable_trigger();

weapon_spawn_org waittill( "randomization_done" );

if (flag("moving_chest_now"))
{
user thread treasure_chest_move_vo();
self treasure_chest_move(lid);

}
else
{
// Let the player grab the weapon and re-enable the box //
self.grab_weapon_hint = true;
self.chest_user = user;
self sethintstring( &"ZOMBIE_TRADE_WEAPONS" );
self setCursorHint( "HINT_NOICON" );
self setvisibletoplayer( user );
self thread GiveMeASecond();


// Limit its visibility to the player who bought the box
self enable_trigger();
self thread treasure_chest_timeout();

// make sure the guy that spent the money gets the item
// SRS 9/3/2008: ...or item goes back into the box if we time out
while( 1 )
{
self waittill( "trigger", grabber );

if( is_player_valid(grabber) || grabber == level )
{

user = grabber;
if( is_player_valid( user ) && user GetCurrentWeapon() != "mine_bouncing_betty" )
{
bbPrint( "zombie_uses: playername %s playerscore %d round %d cost %d name %s x %f y %f z %f type magic_accept",
user.playername, user.score, level.round_number, cost, weapon_spawn_org.weapon_string, self.origin );
self notify( "user_grabbed_weapon" );
user thread treasure_chest_give_weapon( weapon_spawn_org.weapon_string );
break;
}
else if( grabber == level )
{
// it timed out
self.timedOut = true;
bbPrint( "zombie_uses: playername %s playerscore %d round %d cost %d name %s x %f y %f z %f type magic_reject",
user.playername, user.score, level.round_number, cost, weapon_spawn_org.weapon_string, self.origin );
break;
}
}

wait 0.05;
}

self.grab_weapon_hint = false;
self.chest_user = undefined;

weapon_spawn_org notify( "weapon_grabbed" );

//increase counter of amount of time weapon grabbed.
if(level.script != "nazi_zombie_prototype")
{
level.chest_accessed += 1;

// PI_CHANGE_BEGIN
// JMA - we only update counters when it's available
if( isDefined(level.DLC3.useChestPulls) && level.DLC3.useChestPulls )
{
level.pulls_since_last_ray_gun += 1;
}

if( isDefined(level.DLC3.useChestPulls) && level.DLC3.useChestPulls )
{
level.pulls_since_last_tesla_gun += 1;
}
// PI_CHANGE_END
}
self disable_trigger();

// spend cash here...
// give weapon here...
lid thread treasure_chest_lid_close( self.timedOut );

//Chris_P
//magic box dissapears and moves to a new spot after a predetermined number of uses

wait 3;
self enable_trigger();
self setvisibletoall();
}

flag_clear("moving_chest_now");
self thread treasure_chest_think();
}
GiveMeASecond(){
wait(3);
self SetVisibleToAll();
}
Last Edit: June 21, 2014, 03:07:44 am by MakeCents
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
NICE! Been waiting for this tutorial forever. One question, does this make it so the players can automatically take other  players weapons or does it wait about 5-6 seconds before giving other players the option. If its the first way then can you show me how to make it so the player who spins the box can take it before it will let other players take it. That way no one can steal other peoples box weapons.
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 14 September 2013
Last active: 4 years ago
Posts
1,895
Respect
Forum Rank
Zombie Destroyer
Primary Group
Community Scripter
My Groups
More
My Contact & Social Links
More
Personal Quote
BE ORIGINAL
×
MakeCents'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.
BO3 Modtools Alpha
BO3 Modtools Alpha
This user has access to the Black Ops 3 Modtools Alpha
NICE! Been waiting for this tutorial forever. One question, does this make it so the players can automatically take other  players weapons or does it wait about 5-6 seconds before giving other players the option. If its the first way then can you show me how to make it so the player who spins the box can take it before it will let other players take it. That way no one can steal other peoples box weapons.

You could change:
Code Snippet
Plaintext
		//self setvisibletoplayer( user );
self SetVisibleToAll();
to
Code Snippet
Plaintext
		self setvisibletoplayer( user );
self thread GiveMeASecond();
and add this after the treasure_chest_think() function
Code Snippet
Plaintext
GiveMeASecond(){
wait(3); //gives the buyer 3 seconds to chose to take it
self SetVisibleToAll();
}

Edit: I updated the tut to include this. Good idea.
Last Edit: June 21, 2014, 03:19:13 am by MakeCents
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
You could change:
Code Snippet
Plaintext
		//self setvisibletoplayer( user );
self SetVisibleToAll();
to
Code Snippet
Plaintext
		self setvisibletoplayer( user );
self thread GiveMeASecond();
and add this after the treasure_chest_think() function
Code Snippet
Plaintext
GiveMeASecond(){
wait(3); //gives the buyer 3 seconds to chose to take it
self SetVisibleToAll();
}

Edit: I updated the tut to include this. Good idea.

Thanks! Will add this to my map and test it in a little bit
broken avatar :(
×
broken avatar :(
The Voice in your Eyes
Location: deBavaria
Date Registered: 26 June 2013
Last active: 2 years ago
Posts
830
Respect
Forum Rank
The Decider
Primary Group
Community Mapper
My Groups
More
My Contact & Social Links
More
Personal Quote
Breton boys do what Breton boys do.
×
Alerion's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Community Mapper Has released one or more maps to the UGX-Mods community which have been added to the UGX Map Manager.
Nice, thank you!

This will defuse some trolls:D
broken avatar :(
×
broken avatar :(
Location: gb
Date Registered: 16 March 2014
Last active: 4 years ago
Posts
32
Respect
Forum Rank
Legless Crawler
Primary Group
Member
×
mentality's Groups
mentality's Contact & Social Links
Sweet, I think I'm going to add this into my map with a twist :)

 
Loading ...