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
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
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
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.
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?
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.