UGX-Mods

Call of Duty 5: World at War => Help Desk => Scripting => Topic started by: NaviLlicious on October 28, 2014, 02:07:00 am

Title: How to disable gibbing?
Post by: NaviLlicious on October 28, 2014, 02:07:00 am
I am trying to port a character model from BO2 and make It a zombie model and I am also trying to make some of the marine raider models zombies for my map, I got the models In and working as zombies but whenever you shoot off the limbs they revert back to the original zombie models, for the marine raiders I have setup the character file with the gibs and the xmodelaliases, not sure what I am doing wrong exactly under there, and for the BO2 model It didn't have any gibbed models so how do I disable gibbing for these character models?
Title: Re: How to disable gibbing?
Post by: Harry Bo21 on October 28, 2014, 06:49:11 am
I had this issue.

I made a seperate honorguard aliases for each type of zombie. As the array function seems to randomly pick, irrespective of what model was being used previously

Title: Re: How to disable gibbing?
Post by: MakeCents on October 28, 2014, 02:06:18 pm
I am trying to port a character model from BO2 and make It a zombie model and I am also trying to make some of the marine raider models zombies for my map, I got the models In and working as zombies but whenever you shoot off the limbs they revert back to the original zombie models, for the marine raiders I have setup the character file with the gibs and the xmodelaliases, not sure what I am doing wrong exactly under there, and for the BO2 model It didn't have any gibbed models so how do I disable gibbing for these character models?

there is gibbing is in zombiemode_spawner. Never tried to disable it but I did make things gib that normally don't, such as MOD_UNKNOWN for some of my traps. Not sure if that will help but there is a function it checks if the zombie should gib and returns true if it should, based on MOD, I think. You may be able to change them to false to stop gibbing?

P.S. This idea sounds cool. Good luck with it.
Title: Re: How to disable gibbing?
Post by: jei9363 on October 28, 2014, 03:42:36 pm
in _zombiemode_spawner.gsc

Code Snippet
Plaintext
self thread zombie_gib_on_damage();

Code Snippet
Plaintext
if(!isDefined(self.dontGib) || !self.dontGib)
self thread zombie_gib_on_damage();

but people will probably complain

set self.dontGib to true in the character file.
Title: Re: How to disable gibbing?
Post by: Harry Bo21 on October 28, 2014, 09:04:31 pm
They might, but if he isnt using zombie models, it could make sense ;)
Title: Re: How to disable gibbing?
Post by: NaviLlicious on November 14, 2014, 05:40:59 am
in _zombiemode_spawner.gsc

Code Snippet
Plaintext
self thread zombie_gib_on_damage();

Code Snippet
Plaintext
if(!isDefined(self.dontGib) || !self.dontGib)
self thread zombie_gib_on_damage();

but people will probably complain

set self.dontGib to true in the character file.
Sorry for the late reply been busy, I tried putting that In zombiemode_spawner but the zombies are still being gibbed
Title: Re: How to disable gibbing?
Post by: MakeCents on November 14, 2014, 01:27:04 pm
Sorry for the late reply been busy, I tried putting that In zombiemode_spawner but the zombies are still being gibbed

To stop gibbing completely you only need to add return false; in the should gib function. What he was doing was trying to give you an option to make it that if self.dontGib was not defined and/or it was not true then gib the zombies, but otherwise don't gib. To test that you can simply add self.dontGib = true; before the self thread zombie_gib_on_damage(); like this:

Code Snippet
Plaintext
self.dontGib = true;
if(!isDefined(self.dontGib) || !self.dontGib)
    self thread zombie_gib_on_damage();

With that you can define which zombies to gib if you can define "dontGib" for each zombie.
Title: Re: How to disable gibbing?
Post by: jei9363 on November 14, 2014, 03:01:36 pm
should just be

Code Snippet
Plaintext
if(!isDefined(self.dontGib))
    self thread zombie_gib_on_damage();
Title: Re: How to disable gibbing?
Post by: MakeCents on November 14, 2014, 03:13:58 pm
should just be

Code Snippet
Plaintext
if(!isDefined(self.dontGib))
    self thread zombie_gib_on_damage();

If he doesn't define dontGib for true and false conditions for each model, then yes. But if he defines it for all spawners then that will backfire. That is why I thought you did it the way you did it. Technically you could just put:
Code Snippet
Plaintext
if(!self.dontGib)
    self thread zombie_gib_on_damage();
which would gib on any dontGib atributes not defined and false.
Title: Re: How to disable gibbing?
Post by: NaviLlicious on November 14, 2014, 09:39:51 pm
Ah gotcha that got It working and when insta kill Is on only the heads pop off which Is perfect thanks guys! Now I just need to figure out how to get the BO perks working again

Double Post Merge: November 15, 2014, 06:21:56 am
May have prematurely marked best answer D: so I put
Code Snippet
Plaintext
if(!self.dontGib)
    self thread zombie_gib_on_damage();
In _zombiemode_spawner and I put selt.dontGib = true; In my character file but the models under that character file still gib
Title: Re: How to disable gibbing?
Post by: MakeCents on November 16, 2014, 10:24:59 pm
In _zombiemode_spawner and I put selt.dontGib = true; In my character file but the models under that character file still gib

Did you only have the typo here? self, not selt... You can add a print statement to check, something like in the zombie_death_even(zombie) script you could put iprintlnbold(zombie.dontGib, " dont gib"); before the zombie waittill( "death" ); to see.
Title: Re: How to disable gibbing?
Post by: NaviLlicious on November 17, 2014, 03:30:21 am
Did you only have the typo here? self, not selt... You can add a print statement to check, something like in the zombie_death_even(zombie) script you could put iprintlnbold(zombie.dontGib, " dont gib"); before the zombie waittill( "death" ); to see.
Oh I typed that wrong on here It's self.dontGib = true; In my character file under
Code Snippet
Plaintext
self.gibSpawnTag4 = "J_Knee_LE";
and the script above In my zombiemode_spawner.gsc but I added the iprintinbold to see what It says In game

After putting In the iprintinbold I didn't see anything written In game so I figured I would put what I have down In here this Is what I have In my character.gsc before the precache part of course
Code Snippet
Plaintext
main()
{
codescripts\character::setModelFromArray(xmodelalias\char_usa_raider_bodyalias::main());
self.headModel = codescripts\character::randomElement(xmodelalias\char_usa_raider_headalias::main());
self attach(self.headModel, "", true);
// self.hatModel = "char_usa_raider_helm1";
// self attach(self.hatModel);
self.gearModel = codescripts\character::randomElement(xmodelalias\char_usa_raider_gearalias::main());
self attach(self.gearModel, "", true);
self.voice = "american";
self.torsoDmg1 = "char_usa_raider_body1_g_upclean";
// self.torsoDmg2 = codescripts\character::randomElement(xmodelalias\char_usa_raider_body1_g_rarmoffalias::main());
// self.torsoDmg3 = codescripts\character::randomElement(xmodelalias\char_usa_raider_body1_g_larmoffalias::main());
// self.torsoDmg4 = codescripts\character::randomElement(xmodelalias\char_usa_raider_body1_g_torsoalias::main());
// self.torsoDmg5 = "char_usa_raider_body1_g_behead";
// self.legDmg1 = "char_usa_raider_body1_g_lowclean";
// self.legDmg2 = codescripts\character::randomElement(xmodelalias\char_usa_raider_body1_g_rlegoffalias::main());
// self.legDmg3 = codescripts\character::randomElement(xmodelalias\char_usa_raider_body1_g_llegoffalias::main());
// self.legDmg4 = codescripts\character::randomElement(xmodelalias\char_usa_raider_body1_g_legsoffalias::main());
// self.gibSpawn1 = "char_usa_raider_body1_g_rarmspawn";
// self.gibSpawnTag1 = "J_Elbow_RI";
// self.gibSpawn2 = "char_usa_raider_body1_g_larmspawn";
// self.gibSpawnTag2 = "J_Elbow_LE";
// self.gibSpawn3 = "char_usa_raider_body1_g_rlegspawn";
// self.gibSpawnTag3 = "J_Knee_RI";
// self.gibSpawn4 = "char_usa_raider_body1_g_llegspawn";
// self.gibSpawnTag4 = "J_Knee_LE";
self.dontGib = true;
}
and this Is the small part of the zombiemode_spawner.gsc
Code Snippet
Plaintext
//	self add_to_spectate_list();
self random_tan();
self set_zombie_run_cycle();
self thread zombie_think();
if(!self.dontGib)
    self thread zombie_gib_on_damage();
self thread zombie_damage_failsafe();
Title: Re: How to disable gibbing?
Post by: MakeCents on November 17, 2014, 08:49:58 pm
I can look at a _zombiemode_spawner.gsc tonight.

P.S. I know a lot of people that write code that way but it is easier to trouble shoot, I think, if you use your brackets.

Code Snippet
Plaintext
    if(!self.dontGib){
        self thread zombie_gib_on_damage();
    }

Then you don't wonder about your indentation or whatever. Totally up to you.

Double Post Merge: November 18, 2014, 01:37:46 am
Here is how I tested this. I used the Instant Five zombies (http://ugx-mods.com/forum/index.php?topic=2255.0) from jei9363's dl. I edited the char_ger_honorguard_zombies.gsc to include:

Code Snippet
Plaintext
self.dontGib = true;

Then in zombiemode_spawner.gsc in the zombie_spawn_init( animname_set ) function I put:
Code Snippet
Plaintext
	self random_tan(); 
self set_zombie_run_cycle();
self thread zombie_think();
if(!self.dontGib){
iprintlnbold("gonna gib");//delete when working
self thread zombie_gib_on_damage();
zombie_shader = "specialty_fastreload_zombies"; //delete when working
}
else{//delete when working
iprintlnbold("not gonna gib");//delete when working
zombie_shader = "specialty_juggernaut_zombies";//delete when working
}//delete when working
self.waypoint = NewClientHudElem(get_players()[0]);//delete when working
self.waypoint setShader(zombie_shader,64,64);//delete when working
self.waypoint setWaypoint( true, zombie_shader);//delete when working
self.waypoint SetTargetEnt(self);//delete when working
self.waypoint.alpha = .8;//delete when working

// self thread zombie_gib_on_damage();
self thread zombie_damage_failsafe();
(Another piece ^ from  jei9363)
Then as they spawned it printed whether or not that zombie was going to gib and added a jugg icon if they were not going to gib and a fast reload icon if then would.