Author Topic: Make an NPC stay seated during conversation - Can it be done?  (Read 302 times)

Legacy_Pstemarie

  • Hero Member
  • *****
  • Posts: 4368
  • Karma: +0/-0


               

Is it possible to make an NPC stay seated during a conversation? I can make a placeable with the NPC "mounted" to it, but its much better if I can use an actual creature for this sequence as the conversation could lead to a fight and its a lot cleaner if the creature just gets up and attacks.



               
               

               
            

Legacy_GhostOfGod

  • Hero Member
  • *****
  • Posts: 1490
  • Karma: +0/-0
Make an NPC stay seated during conversation - Can it be done?
« Reply #1 on: July 04, 2014, 11:20:23 pm »


               

Yep. You give them a script in their "OnSpawn" event to make them sit and then in the conversation on the very first line in the "ActionsTaken" tab you basically give them the same script. This just requires that they have at least a one line conversation. Example script:


 


void main()

{

    string sChair = GetLocalString(OBJECT_SELF, "MY_CHAIR");

    object oChair = GetObjectByTag(sChair);


    if (GetIsObjectValid(oChair))

    {

        ClearAllActions();

        ActionSit(oChair);

    }

}



               
               

               
            

Legacy_Pstemarie

  • Hero Member
  • *****
  • Posts: 4368
  • Karma: +0/-0
Make an NPC stay seated during conversation - Can it be done?
« Reply #2 on: July 05, 2014, 12:42:18 am »


               

Worked like a charm.