And erf file containing 5 sit scripts I collected over a year ago and can no longer find anywhere. I did not write any of these scripts, I only copy and pasted them into my module, then extracted them.
The scripts included allow the creation of a sittable chair object, NPC's sit on the floor or on chairs, and stay seated while talking.
Simple script to make the creature using a
placeable sit on it
*/
//:://////////////////////////////////////////////
//:: Created By: Georg Zoeller
//:: Created On: 2003-09-18
//:://////////////////////////////////////////////
//:://////////////////////////////////////////////
/*
Will make the NPC sit down
*/
//:://////////////////////////////////////////////
//:: Created By:
//:: Created On:
//:://////////////////////////////////////////////
void main()
{
// ActionPlayAnimation(ANIMATION_LOOPING_SIT_CHAIR,1.0,5000.0);
// * do not do this if already sitting
// * May 2002 (Brent): Don't do this if I am in combat or conversation
if (!GetIsInCombat() && !IsInConversation(OBJECT_SELF))
if (GetCurrentAction() != ACTION_SIT)
{
ClearAllActions();
int i = 1;
// * find first free chair
object oChair = GetNearestObjectByTag("NW_CHAIR", OBJECT_SELF,i);
int bFoundChair = FALSE;
while (bFoundChair == FALSE && GetIsObjectValid(oChair) == TRUE)
{
// * This chair is free
if (GetIsObjectValid(GetSittingCreature(oChair)) == FALSE)
{
bFoundChair = TRUE;
ActionSit(oChair);
}
else
{
i++;
oChair = GetNearestObjectByTag("NW_CHAIR", OBJECT_SELF,i);
}
}
if (bFoundChair == FALSE)
{
// SpeakString("This sucks I have no place to sit");
ClearAllActions();
ActionPlayAnimation(ANIMATION_FIREFORGET_PAUSE_SCRATCH_HEAD);
}
}
}
x2_am_sit
// * click on me and you shall sit
void main()
{
object oSelf = OBJECT_SELF;
AssignCommand(GetLastUsedBy(), ActionSit(oSelf));
}