UGX-Mods

Call of Duty: Black Ops 3 => Help Desk => Scripting => Topic started by: OptomusPrime22 on December 10, 2016, 01:16:22 am

Title: Phd Flopper
Post by: OptomusPrime22 on December 10, 2016, 01:16:22 am
So I seen a map floating around with phd, it was legacy city I think. Well any way I want to add phd to my map, I have the model and shader done but for the life of me I cant not take explosive damage. I could care less about the exploding flop unless we could incorporate sliding into it. So if some one could provide the script or point me in the right direction for a noob at scripting that would be great!
Title: Re: Phd Flopper
Post by: Cxwh on December 10, 2016, 02:27:54 pm
Could be wrong I've never tried it but I know that's the way I did it in BO2 GSC
Code Snippet
Plaintext
self SetPerk("specialty_detectexplosive"); //specialty_detectexplosive -> phd
Title: Re: Phd Flopper
Post by: OptomusPrime22 on December 11, 2016, 02:24:24 am
Could be wrong I've never tried it but I know that's the way I did it in BO2 GSC
Code Snippet
Plaintext
self SetPerk("specialty_detectexplosive"); //specialty_detectexplosive -> phd

I personally don't think this would work because of the changes from bo2 to bo3 but I may be wrong...

Double Post Merge: December 11, 2016, 06:53:55 am
This is my current code which was shown to me but when I get flopper than take any form of damage it tells me connection interrupted even in local solo...

Code Snippet
Plaintext
function checkCustomPerk()
{
level.overridePlayerDamage = &player_damage_override;
}

function player_damage_override( sMeansOfDeath )
{
if ( sMeansOfDeath == "MOD_PROJECTILE" || sMeansOfDeath == "MOD_PROJECTILE_SPLASH" || sMeansOfDeath == "MOD_GRENADE" || sMeansOfDeath == "MOD_GRENADE_SPLASH" || sMeansOfDeath == "MOD_EXPLOSIVE" )
{
if( self hasperk("specialty_phd" ) )
{
finalDamage = 0;
return;
}
}
}


If a mod could put this in the code format for me that would be great... The button doesn't do any thing when I click it...
Title: Re: Phd Flopper
Post by: DeletedUser on December 11, 2016, 11:15:15 am
"specialty_phd" is not a perk recognised by the bo3 engine. Use what the previous guy said of "specialty_detectexplosive" as the game will recognise it
Title: Re: Phd Flopper
Post by: OptomusPrime22 on December 11, 2016, 05:11:24 pm
"specialty_phd" is not a perk recognised by the bo3 engine. Use what the previous guy said of "specialty_detectexplosive" as the game will recognise it

I used the custom perk tutorial and I thought this is what you would do, natesmith the guy who scripted bananas colada told me this is what it would look like... I guess I could try it though...

EDIT
I'm still getting the same error as before when I take explosive damage... Connection interrupted...

EDIT 2
If I replace the whole thing from the script from the first reply I don't get connection interrupted but I do take explosive damage...
Title: Re: Phd Flopper
Post by: PROxFTW on December 11, 2016, 09:23:04 pm
This is my perk script for phd, it prevents explosive damage since thats all I really cared to do for now. The shader doesnt show but have not focused on fixing that however you can spawn a hud elem for now or try to figure it out. In the gsh file you can change the perk machine model and the cost if you want to edit either of those as well. However just download the file and then open it and place the files in the rar file in BO3 Root/usermaps/mapname/scripts/pro_custom you will have to create the pro_custom folder. Then open mapname.gsc and mapname.csc and put this line somewhere at the top
Code Snippet
Plaintext
#using scripts\zm\pro_custom\_zm_perk_divetonuke;
then open mapname.zone and add
Code Snippet
Plaintext
scriptparsetree,scripts/zm/pro_custom/_zm_perk_divetonuke.gsh
scriptparsetree,scripts/zm/pro_custom/_zm_perk_divetonuke.gsc
scriptparsetree,scripts/zm/pro_custom/_zm_perk_divetonuke.csc
www.mediafire.com
Title: Re: Phd Flopper
Post by: OptomusPrime22 on December 11, 2016, 09:30:42 pm
This is my perk script for phd, it prevents explosive damage since thats all I really cared to do for now. The shader doesnt show but have not focused on fixing that however you can spawn a hud elem for now or try to figure it out. In the gsh file you can change the perk machine model and the cost if you want to edit either of those as well. However just download the file and then open it and place the files in the rar file in BO3 Root/usermaps/mapname/scripts/pro_custom you will have to create the pro_custom folder. Then open mapname.gsc and mapname.csc and put this line somewhere at the top
Code Snippet
Plaintext
#using scripts\zm\pro_custom\_zm_perk_divetonuke;
then open mapname.zone and add
Code Snippet
Plaintext
scriptparsetree,scripts/zm/pro_custom/_zm_perk_divetonuke.gsh
scriptparsetree,scripts/zm/pro_custom/_zm_perk_divetonuke.gsc
scriptparsetree,scripts/zm/pro_custom/_zm_perk_divetonuke.csc
www.mediafire.com

Thanks this is what I was looking for, hopefully I can learn what I was doing wrong with this (:
Title: Re: Phd Flopper
Post by: TheKillerey on December 11, 2016, 10:52:25 pm
Yeah it was my map "Legacy City" :)
I am using this code to display the shader and disable the shader:
Code Snippet
Plaintext
 function give_phd_perk()
{
    if(!self HasPerk(PERK_PHDFLOPPER))
            return undefined;
   
    num = self GetEntityNumber();

    self.hud_phd = NewHudElem();
    self.hud_phd.alignX = "left";
    self.hud_phd.alignY = "bottom";
    self.hud_phd.horzAlign = "left";
    self.hud_phd.vertAlign = "bottom";
    self.hud_phd.foreground = true;
    self.hud_phd.sort = 1;
    self.hud_phd.hidewheninmenu = true;

    x = 86; //how far from the left of the game it should be
    y = -44;//the y value - is up + is down

    y += (-30 * num); //you probably won't need this

    self.hud_phd.x = x; // 2
    self.hud_phd.y = y; // -90

    self.hud_phd.alpha = 1;
    self.hud_phd SetShader(PHD_SHADER, PHD_SHADER_WIDTH, PHD_SHADER_HEIGHT);
    //iprintln ("Hud Enabled");
}

function take_phd_perk( b_pause, str_perk, str_result )
{
self clientfield::set_to_player( "phd_perk", 0);
self.hud_phd Destroy();
//iprintln ("Hud Destroyed");
self.hud_phd = undefined;
self waittill("death");


}

Credit me if your using this :3
Title: Re: Phd Flopper
Post by: Aven on December 18, 2016, 07:33:13 pm
I keep getting this error once I have everything set up, I tried tinkering with it but i couldn't find why it wasn't initialized but its probably pretty obvious and I am bad at it

^1ERR(6E) scripts/zm/pro_custom/_zm_perk_divetonuke.gsc (49,1)  : Compiler Internal Error :  Uninitialized local variable 'perk_phdflopper'
Title: Re: Phd Flopper
Post by: Aven on December 19, 2016, 12:00:49 am
oops sorry bout that i fixed it and i dont know how to delete my post sooooo. Anyways I don't know how to get the script to go with my phd model, I have the script_struct and the model its using with the target name as zm_perk_machine and everything else fine. But when I go in game the model resets to speed cola even though i changed the gsh file to match the correct model, and finally when I try to buy the perk it says power must be turned on even when power is on, I can buy other perks but not that. thanks
Title: Re: Phd Flopper
Post by: PROxFTW on December 27, 2016, 03:08:48 am
oops sorry bout that i fixed it and i dont know how to delete my post sooooo. Anyways I don't know how to get the script to go with my phd model, I have the script_struct and the model its using with the target name as zm_perk_machine and everything else fine. But when I go in game the model resets to speed cola even though i changed the gsh file to match the correct model, and finally when I try to buy the perk it says power must be turned on even when power is on, I can buy other perks but not that. thanks
Meant to get to this earlier but got distracted with other things but if you havent got it working just download this prefab
www.mediafire.com
and for changing the model make sure these two get changed
Code Snippet
Plaintext
#define DIVETONUKE_MACHINE_DISABLED_MODEL		"p6_zm_al_vending_nuke"
#define DIVETONUKE_MACHINE_ACTIVE_MODEL "p6_zm_al_vending_nuke_on"
If this doesnt work then idk but same prefab I use and works for me but if there is anything else just let me know
Title: Re: Phd Flopper
Post by: Aven on December 30, 2016, 04:37:15 pm
Thanks man, will try this, I've tweaked those divetonuke machines already but i guess my struct was setup wrong
Title: Re: Phd Flopper
Post by: nehpets1999 on January 08, 2017, 05:11:17 pm
This is my perk script for phd, it prevents explosive damage since thats all I really cared to do for now. The shader doesnt show but have not focused on fixing that however you can spawn a hud elem for now or try to figure it out. In the gsh file you can change the perk machine model and the cost if you want to edit either of those as well. However just download the file and then open it and place the files in the rar file in BO3 Root/usermaps/mapname/scripts/pro_custom you will have to create the pro_custom folder. Then open mapname.gsc and mapname.csc and put this line somewhere at the top
Code Snippet
Plaintext
#using scripts\zm\pro_custom\_zm_perk_divetonuke;
then open mapname.zone and add
Code Snippet
Plaintext
scriptparsetree,scripts/zm/pro_custom/_zm_perk_divetonuke.gsh
scriptparsetree,scripts/zm/pro_custom/_zm_perk_divetonuke.gsc
scriptparsetree,scripts/zm/pro_custom/_zm_perk_divetonuke.csc
www.mediafire.com
This is great, thanks! Any idea on how I can get the perk shader to show?
Title: Re: Phd Flopper
Post by: Doubletap3 on April 09, 2021, 12:02:30 am
This is my perk script for phd, it prevents explosive damage since thats all I really cared to do for now. The shader doesnt show but have not focused on fixing that however you can spawn a hud elem for now or try to figure it out. In the gsh file you can change the perk machine model and the cost if you want to edit either of those as well. However just download the file and then open it and place the files in the rar file in BO3 Root/usermaps/mapname/scripts/pro_custom you will have to create the pro_custom folder. Then open mapname.gsc and mapname.csc and put this line somewhere at the top
Code Snippet
Plaintext
#using scripts\zm\pro_custom\_zm_perk_divetonuke;
then open mapname.zone and add
Code Snippet
Plaintext
scriptparsetree,scripts/zm/pro_custom/_zm_perk_divetonuke.gsh
scriptparsetree,scripts/zm/pro_custom/_zm_perk_divetonuke.gsc
scriptparsetree,scripts/zm/pro_custom/_zm_perk_divetonuke.csc
www.mediafire.com

i got this error.
^1ERR(83) scripts/zm/zm_fuck.gsc (30,49)  : Compiler Internal Error :  Compile error processing "using" file - file not found : scripts/zm/pro_custom/_zm_perk_divetonuke.gsc
 
any help?