How to make actor sit at random chair and drink?

Discussions and questions about the CS and mods for Oblivion
Post Reply
Oblis
Initiate
Initiate
Posts: 38
Joined: Fri May 18, 2007 2:07 pm
ES Games: Daggerfall, Morrowind, Oblivion
Platform: PC
Location: Greece

How to make actor sit at random chair and drink?

Post by Oblis »

Hello,
I created 2 packages

1 is FIND Furniture so the npc will find a chair and sit
2 is USEITEMAT Books and he is using idle animation for reading

The script works as it should be but i face a small problem.
The NPC sits on the chair and when the reading package starts he stands and reads.

The purpose was to make him read in random chair (not a specific place).

If I use on Reading Package the location "Furniture" the package is not running.
I used the GetSitting function to make a condition when to start reading.
Here is my script lines:

Do you know how to achieve reading by sitting on a random chair?

Code: Select all



short NPCSitting
short SittingTrigger

....
....
set NPCSitting to NPC.GetSitting
....
....
If Dice_Package == 2
if SittingTrigger == 0
NPC.AddScriptPackage NPCSittingCurrentLocation
set SittingTrigger to 1
endif
if NPCSitting == 3
NPC.RemoveScriptPackage NPCSittingCurrentLocation
NPC.AddScriptPackage NPCReadingCurrentLocation
PrintToConsole "%z is Reading" name
set SittingTrigger to 0
set DoOnceTrigger7 to 1
endif
endif
Post Reply