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

Swap suits in your map [Added v1.2 and a poll]

POLLHOT
broken avatar :(
Created 8 years ago
by MakeCents
0 Members and 1 Guest are viewing this topic.
13,654 views

Poll

Question: Which way is easier to understand how to add suits in script, the first way, or v1.1

The first way was easier
0 (0%)
v1.1 is easier
1 (100%)
They are the same really
0 (0%)

Total Members Voted: 1

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
Thank you for the quick response :) Works fine now :)

Sweet. I added the other version, v1.1, and a poll to see what people think is the easier method. v1.1 also comes with functions you can run when you put the suit on... if you decide to, optional.


I'm not sure why the original is no longer attached, oops.
Last Edit: June 30, 2016, 03:09:18 am by MakeCents
broken avatar :(
×
broken avatar :(
Location: usgeorgia
Date Registered: 24 April 2013
Last active: 8 months ago
Posts
560
Respect
Forum Rank
Zombie Enslaver
Primary Group
Community Mapper
×
whippytrout's Groups
Community Mapper Has released one or more maps to the UGX-Mods community which have been added to the UGX Map Manager.
whippytrout's Contact & Social LinksWhippyTroutWhippyTrout
I want to use this script but I can't seem to get my playermodel to swap back once I use a suit. I followed this other tutorial on random characters here: https://ugx-mods.com/forum/index.php/topic,7214.0.html

Does that affect anything? What happens is for example: I'm Dempsey and I go up to a suit and become a spaceman. When I return the spaceman suit I don't change back into Dempsey I'm just invisible.  :'(

Here is my code:

Code Snippet
Plaintext
init(){
level.switchsuitsweapon = "undefined";//"zombie_melee";//make undefined if no switching wanted

//     SetUp(suit,    viewmodel, hud,       ::function);
thread SuitSetup("normal","undefined", undefined, ::NormalSuit);
//Use the following for one type of suit and just copy the prefab for more of that type of suit
thread SuitSetup("suit0", "viewmodel_usa_marine_arms", undefined, ::Suit0Reward);//one type of suit, copy the prefab for more than one of this type of suit
//uncomment the following for as many different suits that you have, spacesuit, gas, halo, for example
// thread SuitSetup("suit1", undefined, undefined, ::Suit1Reward);//another type of suit, copy the prefab for more than one of this type of suit
// thread SuitSetup("suit2", undefined, undefined, ::Suit2Reward);//another type of suit, copy the prefab for more than one of this type of suit
// thread SuitSetup("suit3", undefined, undefined, ::Suit3Reward);//another type of suit and so on...
//add more suits if you like, and add reward functions if applicable

suits = getentarray("suit", "targetname");
array_thread( suits,::PickMeUp );
}
SuitSetUp(suit, viewmodel, hud, function){
/*suit = string, that matches script_noteworthy kvp of trigger for suit prefab
viewmodel = <optional> - change viewmodel
hud = <optional> - change hud
function = <optional> - function to run when suit is put on i.e. shield or fx or sounds or something
*/
if(!IsDefined( level.suits )) level.suits = [];
level.suits[suit] = [];
level.suits[suit]["viewarms"] = viewmodel;
level.suits[suit]["hud"] = hud;
level.suits[suit]["function"] = function;
}
Suit0Reward(){
self endon( "disconnect" );
self endon("suit_change");
while(1){
//your code here
iPrintLnBold("I'm a Spaceman!");
wait(1);
}
}
Suit1Reward(){
self endon( "disconnect" );
self endon("suit_change");
/*while(1){
//your code here

wait(1);
}*/
}
Suit2Reward(){
self endon( "disconnect" );
self endon("suit_change");
/*while(1){
//your code here

wait(1);
}*/
}
Suit3Reward(){
self endon( "disconnect" );
self endon("suit_change");
/*while(1){
//your code here

wait(1);
}*/
}
NormalSuit(){
self endon( "disconnect" );
self endon("suit_change");
//reset anything you changed here when no suit is on

}
PickMeUp(){
self.active = 1;
self SetCursorHint( "HINT_NOICON" );
while(1){
self FixTrigger();

self waittill("trigger", player);
if(!isdefined(player.suit)){
player.suit = "normal";
}
player PlayLocalSound( "deny" );
if(player.suit =="normal" & self.script_noteworthy=="normal") continue;

player PutOnSuit(self);
pieces = getentarray(self.target, "targetname");
for(i=0;i<pieces.size;i++){
pieces[i] thread RackSuit(player, player.suit);
}
suit = player.suit;
player.suit = self.script_noteworthy;
self.script_noteworthy = suit;
player notify("suit_change");
if(IsDefined( level.suits[player.suit]["function"] )) player thread [[level.suits[player.suit]["function"]]]();
wait(.01);
}
}
FixTrigger(){
self sethintstring("");
wait(2);
if(self.script_noteworthy == "normal") self sethintstring("Press &&1 to rack suit.");
else self sethintstring("Press &&1 to take Suit.");
}
RackSuit(player, suit){
if(self.script_noteworthy=="head"){
if(player.rackhead!=player.currenthead & player.headModel!=player.rackhead) player detach(player.rackhead);
self setmodel(player.rackhead);
}
if(self.script_noteworthy=="body") self setmodel(player.rackbody);
level notify("suit_change");
}
PutOnSuit(suit){
if(!IsDefined( self.currenthead )) self.currenthead = "tag_origin";
else self detach(self.currenthead , "", true);
if(!IsDefined( self.currentbody )) self.currentbody = "tag_origin";

if(isdefined(self.hatModel)) self detach(self.hatModel, "", true);

if(IsDefined( self.headModel )) self detach(self.headModel, "");

pieces = GetEntArray( suit.target,"targetname" );
doHead = 0;
swapHead = undefined;
for( i=0;i<pieces.size;i++ ){
if(pieces[i].script_noteworthy=="head"){
if(pieces[i].model=="tag_origin" &  isdefined(self.headModel)) {
if(suit.script_noteworthy=="normal") doHead = 1;
self.rackhead = self.currenthead;
self.currenthead = "tag_origin";

}else{
swapHead = pieces[i].model;
self.rackhead = self.currenthead;
self.currenthead = pieces[i].model;
}
}
if(pieces[i].script_noteworthy=="body"){
if(pieces[i].model=="tag_origin" &  isdefined(self.bodyModel)) {
if(suit.script_noteworthy=="normal") self setModel(self.bodyModel);
self.rackbody = self.currentbody;
self.currentbody = "tag_origin";
}else{
self setmodel(pieces[i].model);
self.rackbody = self.currentbody;
self.currentbody = pieces[i].model;
}
}
}
//moved down here so the head doesn't get attached before the body is swapped
if(doHead){
if(IsDefined( self.headModel )) self attach(self.headModel, "", true);
if(isdefined(self.hatModel)) self attach(self.hatModel, "", true);
}
if(IsDefined(swapHead)) self attach(swapHead);
//set viewarms
if(IsDefined( self.viewmodel ) & suit.script_noteworthy == "normal") self SetViewModel( self.viewmodel);
else if(IsDefined( level.suits[suit.script_noteworthy]["viewarms"] )) self SetViewModel( level.suits[suit.script_noteworthy]["viewarms"]);
else if(IsDefined( level.suits["normal"]["viewarms"] )) self setViewModel(level.suits["normal"]["viewarms"]);//take off suit arms if none defined but normal was defined
//add hud for suit for remove
self thread MakeHud(level.suits[suit.script_noteworthy]["hud"]);
//give affect for swaping
self thread ChangeSleeves();
}
ChangeSleeves(){
self endon( "disconnect" );
time = .6;
self.suithud["transistion"] = NewClientHudelem( self );
self.suithud["transistion"].horzAlign = "fullscreen";
self.suithud["transistion"].vertAlign = "fullscreen";
self.suithud["transistion"] SetShader( "black", 640, 480 );
self.suithud["transistion"].alpha = 1;
//show sleeves if the weapon is defined
if(IsDefined( level.switchsuitsweapon ))self thread ShowSleeves();
self.suithud["transistion"] fadeOverTime( time );
  self.suithud["transistion"].alpha = 0;
  wait(.5);
  wait(time-.5);
  self.suithud["transistion"] destroy();
  self.suithud["transistion"] = undefined; 
 
}
ShowSleeves(){
self DisableWeaponCycling(  );
  self GiveWeapon( level.switchsuitsweapon );
  self switchToWeapon(level.switchsuitsweapon);

  self waittill("weapon_change_complete");
  self takeWeapon( level.switchsuitsweapon );
  self enableWeaponCycling(  );
  self switchToWeapon(self GetWeaponsListPrimaries()[0]);
}
MakeHud(shader){
self endon( "disconnect" );
if(!isdefined(shader)){
if(isdefined(self.suithud["suits"])) self.suithud["suits"] destroy();
return;
}
if(isdefined(self.suithud["suits"])) self.suithud["suits"] destroy();
self.suithud["suits"] = create_simple_hud(self);

self.suithud["suits"].y = 0;
self.suithud["suits"].x = 0;
self.suithud["suits"].alpha = 1;
self.suithud["suits"].horzAlign = "fullscreen";
self.suithud["suits"].vertAlign = "fullscreen";
self.suithud["suits"].foreground = false;

self.suithud["suits"] SetShader( shader, 640, 480 );
}
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
I want to use this script but I can't seem to get my playermodel to swap back once I use a suit. I followed this other tutorial on random characters here: https://ugx-mods.com/forum/index.php/topic,7214.0.html

Does that affect anything? What happens is for example: I'm Dempsey and I go up to a suit and become a spaceman. When I return the spaceman suit I don't change back into Dempsey I'm just invisible.  :'(

Here is my code:

Code Snippet
Plaintext
init(){
level.switchsuitsweapon = "undefined";//"zombie_melee";//make undefined if no switching wanted

//     SetUp(suit,    viewmodel, hud,       ::function);
thread SuitSetup("normal","undefined", undefined, ::NormalSuit);
//Use the following for one type of suit and just copy the prefab for more of that type of suit
thread SuitSetup("suit0", "viewmodel_usa_marine_arms", undefined, ::Suit0Reward);//one type of suit, copy the prefab for more than one of this type of suit
//uncomment the following for as many different suits that you have, spacesuit, gas, halo, for example
// thread SuitSetup("suit1", undefined, undefined, ::Suit1Reward);//another type of suit, copy the prefab for more than one of this type of suit
// thread SuitSetup("suit2", undefined, undefined, ::Suit2Reward);//another type of suit, copy the prefab for more than one of this type of suit
// thread SuitSetup("suit3", undefined, undefined, ::Suit3Reward);//another type of suit and so on...
//add more suits if you like, and add reward functions if applicable

suits = getentarray("suit", "targetname");
array_thread( suits,::PickMeUp );
}
SuitSetUp(suit, viewmodel, hud, function){
/*suit = string, that matches script_noteworthy kvp of trigger for suit prefab
viewmodel = <optional> - change viewmodel
hud = <optional> - change hud
function = <optional> - function to run when suit is put on i.e. shield or fx or sounds or something
*/
if(!IsDefined( level.suits )) level.suits = [];
level.suits[suit] = [];
level.suits[suit]["viewarms"] = viewmodel;
level.suits[suit]["hud"] = hud;
level.suits[suit]["function"] = function;
}
Suit0Reward(){
self endon( "disconnect" );
self endon("suit_change");
while(1){
//your code here
iPrintLnBold("I'm a Spaceman!");
wait(1);
}
}
Suit1Reward(){
self endon( "disconnect" );
self endon("suit_change");
/*while(1){
//your code here

wait(1);
}*/
}
Suit2Reward(){
self endon( "disconnect" );
self endon("suit_change");
/*while(1){
//your code here

wait(1);
}*/
}
Suit3Reward(){
self endon( "disconnect" );
self endon("suit_change");
/*while(1){
//your code here

wait(1);
}*/
}
NormalSuit(){
self endon( "disconnect" );
self endon("suit_change");
//reset anything you changed here when no suit is on

}
PickMeUp(){
self.active = 1;
self SetCursorHint( "HINT_NOICON" );
while(1){
self FixTrigger();

self waittill("trigger", player);
if(!isdefined(player.suit)){
player.suit = "normal";
}
player PlayLocalSound( "deny" );
if(player.suit =="normal" & self.script_noteworthy=="normal") continue;

player PutOnSuit(self);
pieces = getentarray(self.target, "targetname");
for(i=0;i<pieces.size;i++){
pieces[i] thread RackSuit(player, player.suit);
}
suit = player.suit;
player.suit = self.script_noteworthy;
self.script_noteworthy = suit;
player notify("suit_change");
if(IsDefined( level.suits[player.suit]["function"] )) player thread [[level.suits[player.suit]["function"]]]();
wait(.01);
}
}
FixTrigger(){
self sethintstring("");
wait(2);
if(self.script_noteworthy == "normal") self sethintstring("Press &&1 to rack suit.");
else self sethintstring("Press &&1 to take Suit.");
}
RackSuit(player, suit){
if(self.script_noteworthy=="head"){
if(player.rackhead!=player.currenthead & player.headModel!=player.rackhead) player detach(player.rackhead);
self setmodel(player.rackhead);
}
if(self.script_noteworthy=="body") self setmodel(player.rackbody);
level notify("suit_change");
}
PutOnSuit(suit){
if(!IsDefined( self.currenthead )) self.currenthead = "tag_origin";
else self detach(self.currenthead , "", true);
if(!IsDefined( self.currentbody )) self.currentbody = "tag_origin";

if(isdefined(self.hatModel)) self detach(self.hatModel, "", true);

if(IsDefined( self.headModel )) self detach(self.headModel, "");

pieces = GetEntArray( suit.target,"targetname" );
doHead = 0;
swapHead = undefined;
for( i=0;i<pieces.size;i++ ){
if(pieces[i].script_noteworthy=="head"){
if(pieces[i].model=="tag_origin" &  isdefined(self.headModel)) {
if(suit.script_noteworthy=="normal") doHead = 1;
self.rackhead = self.currenthead;
self.currenthead = "tag_origin";

}else{
swapHead = pieces[i].model;
self.rackhead = self.currenthead;
self.currenthead = pieces[i].model;
}
}
if(pieces[i].script_noteworthy=="body"){
if(pieces[i].model=="tag_origin" &  isdefined(self.bodyModel)) {
if(suit.script_noteworthy=="normal") self setModel(self.bodyModel);
self.rackbody = self.currentbody;
self.currentbody = "tag_origin";
}else{
self setmodel(pieces[i].model);
self.rackbody = self.currentbody;
self.currentbody = pieces[i].model;
}
}
}
//moved down here so the head doesn't get attached before the body is swapped
if(doHead){
if(IsDefined( self.headModel )) self attach(self.headModel, "", true);
if(isdefined(self.hatModel)) self attach(self.hatModel, "", true);
}
if(IsDefined(swapHead)) self attach(swapHead);
//set viewarms
if(IsDefined( self.viewmodel ) & suit.script_noteworthy == "normal") self SetViewModel( self.viewmodel);
else if(IsDefined( level.suits[suit.script_noteworthy]["viewarms"] )) self SetViewModel( level.suits[suit.script_noteworthy]["viewarms"]);
else if(IsDefined( level.suits["normal"]["viewarms"] )) self setViewModel(level.suits["normal"]["viewarms"]);//take off suit arms if none defined but normal was defined
//add hud for suit for remove
self thread MakeHud(level.suits[suit.script_noteworthy]["hud"]);
//give affect for swaping
self thread ChangeSleeves();
}
ChangeSleeves(){
self endon( "disconnect" );
time = .6;
self.suithud["transistion"] = NewClientHudelem( self );
self.suithud["transistion"].horzAlign = "fullscreen";
self.suithud["transistion"].vertAlign = "fullscreen";
self.suithud["transistion"] SetShader( "black", 640, 480 );
self.suithud["transistion"].alpha = 1;
//show sleeves if the weapon is defined
if(IsDefined( level.switchsuitsweapon ))self thread ShowSleeves();
self.suithud["transistion"] fadeOverTime( time );
  self.suithud["transistion"].alpha = 0;
  wait(.5);
  wait(time-.5);
  self.suithud["transistion"] destroy();
  self.suithud["transistion"] = undefined; 
 
}
ShowSleeves(){
self DisableWeaponCycling(  );
  self GiveWeapon( level.switchsuitsweapon );
  self switchToWeapon(level.switchsuitsweapon);

  self waittill("weapon_change_complete");
  self takeWeapon( level.switchsuitsweapon );
  self enableWeaponCycling(  );
  self switchToWeapon(self GetWeaponsListPrimaries()[0]);
}
MakeHud(shader){
self endon( "disconnect" );
if(!isdefined(shader)){
if(isdefined(self.suithud["suits"])) self.suithud["suits"] destroy();
return;
}
if(isdefined(self.suithud["suits"])) self.suithud["suits"] destroy();
self.suithud["suits"] = create_simple_hud(self);

self.suithud["suits"].y = 0;
self.suithud["suits"].x = 0;
self.suithud["suits"].alpha = 1;
self.suithud["suits"].horzAlign = "fullscreen";
self.suithud["suits"].vertAlign = "fullscreen";
self.suithud["suits"].foreground = false;

self.suithud["suits"] SetShader( shader, 640, 480 );
}

Did you dl the character files? In those files, in the gscs, the attributes needed to switch back are initialized, such as self.bodyModel, and so on. If you are not using those, that could be why. I'm not sure the other tut would affect anything.

If it does do something, you can always use mine: https://ugx-mods.com/forum/index.php/topic,6924.0.html
Last Edit: December 21, 2016, 03:04:32 am by MakeCents
broken avatar :(
×
broken avatar :(
Location: usgeorgia
Date Registered: 24 April 2013
Last active: 8 months ago
Posts
560
Respect
Forum Rank
Zombie Enslaver
Primary Group
Community Mapper
My Groups
More
My Contact & Social Links
More
×
whippytrout's Groups
Community Mapper Has released one or more maps to the UGX-Mods community which have been added to the UGX Map Manager.
whippytrout's Contact & Social LinksWhippyTroutWhippyTrout
Oh I see it now! I'm sorry. It works fine now. I opened the character files but I didn't see the self.bodyModel change.

This is an amazing script. Thank you. Is there a way to swap the character dialog when you put on a suit? Say if I'm Dempsey and when I put on a Takeo suit it changes the voice to Takeo?
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
Oh I see it now! I'm sorry. It works fine now. I opened the character files but I didn't see the self.bodyModel change.

This is an amazing script. Thank you. Is there a way to swap the character dialog when you put on a suit? Say if I'm Dempsey and when I put on a Takeo suit it changes the voice to Takeo?

Cool. I'll be honest, I'm forgetting waw every day. But I believe their quotes were based off of self.entity_num, so if it was, changing that would change the quotes. I can't remember for sure though.
broken avatar :(
×
broken avatar :(
Location: usgeorgia
Date Registered: 24 April 2013
Last active: 8 months ago
Posts
560
Respect
Forum Rank
Zombie Enslaver
Primary Group
Community Mapper
My Groups
More
My Contact & Social Links
More
×
whippytrout's Groups
Community Mapper Has released one or more maps to the UGX-Mods community which have been added to the UGX Map Manager.
whippytrout's Contact & Social LinksWhippyTroutWhippyTrout
Oh ok cool thanks. I should be able to figure it out then. Your the best man. My Alcatraz map is going to have some crazy stuff now.  ::)
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
Oh ok cool thanks. I should be able to figure it out then. Your the best man. My Alcatraz map is going to have some crazy stuff now.  ::)

Awesome!
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 24 May 2016
Last active: 3 years ago
Posts
32
Respect
Forum Rank
Legless Crawler
Primary Group
Member
My Contact & Social Links
More
Personal Quote
Strangers are just friends you haven’t met yet.
Signature
I don't post often but when I do I probably make myself seem like an idiot. Also, I don't need people to help me grow up! I drink milk.
×
Fancygamer1738's Contact & Social LinksH3X-4h3x_4H3X--4
Never thought that I would want this. Turns out I did. Good work yet again!
broken avatar :(
×
broken avatar :(
Location: 00MIA - Last seen at [REDACTED].
Date Registered: 10 February 2018
Last active: 4 years ago
Posts
87
Respect
Forum Rank
Rotting Walker
Primary Group
Member
My Contact & Social Links
More
Personal Quote
Eating Doritos and making maps. LEAVE ME ALONE!
Signature
From how you all blew something so small up, I can tell that you all are libtards.  Just worthless fucking libtards.
You went full retard man... never go full retard. :derp:
×
TGMKTheII's Groups
TGMKTheII's Contact & Social Linkshttps://steamcommunity.co
Never thought that I would want this. Turns out I did. Good work yet again!

This thread is 2 years old. You just posted on like 20 different threads in a span of 5 minutes. Stop shit posting.
Last Edit: March 25, 2018, 10:15:51 pm by TGMKTheII
broken avatar :(
×
broken avatar :(
Location: cn托里市
Date Registered: 8 November 2022
Last active: 8 months ago
Posts
17
Respect
Forum Rank
Legless Crawler
Primary Group
Member
My Contact & Social Links
More
×
HunShen's Groups
HunShen's Contact & Social LinksHUNSHEN
How Do I replace it with my own model
broken avatar :(
×
broken avatar :(
Location: aznew york
Date Registered: 11 February 2023
Last active: 7 months ago
Posts
11
Respect
Forum Rank
Legless Crawler
Primary Group
Member
×
Мика Тян's Contact & Social Links
bro where can I get models like in the video?
broken avatar :(
×
broken avatar :(
Location: cn托里市
Date Registered: 8 November 2022
Last active: 8 months ago
Posts
17
Respect
Forum Rank
Legless Crawler
Primary Group
Member
My Contact & Social Links
More
×
HunShen's Groups
HunShen's Contact & Social LinksHUNSHEN
bro where can I get models like in the video?
sorry, you can't do it. Because The author has not been online for a long time.
:'(1

 
Loading ...