Page 1 of 1

What's the class name for unconscious NPC's?

PostPosted: Fri Dec 31, 10 12:53 am
by Machina
I need to know the class name for unconscious NPC's. Corpses have easy class names, terroristcarcass, mechaniccarcass, etc. What are the unconscious "corpses" called? I have a trigger that the player needs to activate by knocking someone unconscious but if I use -carcass it only works if he actually kills the NPC.

PostPosted: Fri Dec 31, 10 2:25 am
by Dae
Unconscious corpses are corpses with bNotDead property set to true.

PostPosted: Sun Jan 02, 11 6:56 am
by Machina
I don't find any bNotDead property in the carcass properties.

I need to know the classname for unconscious characters, is there one?

PostPosted: Sun Jan 02, 11 10:36 am
by Alex
DeusExCarcass wrote:var bool bNotDead; // this body is just unconscious


Not in the carcass properties?

And as Dae said, there is no classname. A dead body and an unconscious body is the same class.

PostPosted: Mon Jan 03, 11 9:05 am
by Machina
Ok, the thing is I've got this NPC that needs to be either killed or knocked unconscious by the player. So I've set up a class-trigger to toggle when a -carcass hits the floor. It works when the player kills him but not when he knocks him unconscious. Does anyone know why this is?

PostPosted: Mon Jan 03, 11 3:22 pm
by Dae
Code: Select all
var bool bNotDead;

I was wrong, it looks like a "local" variable which is not changeable within preferences.

Otherwise it would've been var() bool or var(ScriptedPawn) bool or something.

<s>If what you're making is a singleplayer map, then I guess you could make a mission script which would knock out the NPC. See the Mission00 class:</s>

Code: Select all
class Mission00 extends MissionScript;

function FirstFrame()
{
   local UNATCOTroop troop;
   local LAM lam;

   Super.FirstFrame();

   // zero the player's skill points
   Player.SkillPointsTotal = 0;
   Player.SkillPointsAvail = 0;

   if (localURL == "00_TRAINING")
   {
      // knock this guy out
      foreach AllActors(class'UNATCOTroop', troop, 'Test_Subject')
      {
         troop.HealthTorso = 0;
         troop.Health = 0;
         troop.bStunned = True;
         troop.TakeDamage(1, troop, troop.Location, vect(0,0,0), 'KnockedOut');
      }
   }
   else if (localURL == "00_TRAININGCOMBAT")
   {
      // fool a lam into thinking that the player set it
      foreach AllActors(class'LAM', lam, 'Bot1LAM')
         lam.SetOwner(Player);
   }
}


Upd: sorry did not read your above message.

Machina wrote:So I've set up a class-trigger to toggle when a -carcass hits the floor. It works when the player kills him but not when he knocks him unconscious. Does anyone know why this is?

Could you just post the code?

PostPosted: Tue Jan 04, 11 6:26 am
by Machina
I'm not coding. I'm just building maps.

It seems I'll have to create a missionscript for it. The first level in Deus Ex has the same thing when at the top of the statue you can knock out the UNATCO troop and take his assaultgun. Then later Manderley says the soldier turned up dead or unconscious. I think that was done with missionscript too. What I want to do isn't even that elaborate, I just want to trigger something with a corpse (using a normal trigger set to trigger only a specific class, in this case terroristcarcass) But the problem is that it won't trigger if you knock the terrorist unconscious, it only works if you kill him. I can't really figure out why.

Well, since my coding skills are crap and the map isn't finished yet I'll have to look into it some other time. Thanks for posting that code! And yeah it's a single player map.