Difference between revisions of "GetSittingCreature"

From NWN Lexicon
Jump to: navigation, search
(Description)
 
Line 24: Line 24:
  
 
Returns the creature that is currently sitting on the oChair <br /><br /> Returns OBJECT_INVALID if oChair is not a valid placeable or no creature is sitting on oChair.
 
Returns the creature that is currently sitting on the oChair <br /><br /> Returns OBJECT_INVALID if oChair is not a valid placeable or no creature is sitting on oChair.
 
+
<br /><br />See comment on ActionSit.
<br /><br />
 
  
 
====Version====
 
====Version====

Latest revision as of 18:33, 8 January 2020



GetSittingCreature(object)

Determines which creature sitting on a particular object.

object GetSittingCreature(
    object oChair
);

Parameters

oChair

The object to check who is sitting on.


Description

Returns the creature that is currently sitting on the oChair

Returns OBJECT_INVALID if oChair is not a valid placeable or no creature is sitting on oChair.

See comment on ActionSit.

Version

1.61

Example

//Make everybody stop sitting in chairs tagged "SITTING_CHAIR"
void main()
{
int nCount=0;
 
object oSitter;
 
object oChair=GetObjectByTag("SITTING_CHAIR", nCount);
 
while (GetIsObjectValid(oChair))
   {
   oSitter=GetSittingCreature(oChair);
   if (GetIsObjectValid(oSitter))
         AssignCommand(oSitter, ClearAllActions());
 
   nCount++;
   oChair=GetObjectByTag("SITTING_CHAIR", nCount);
   }
}

See Also

functions: 

ActionSit



 author: Tom Cassiotis, editor: Lilac Soul