![]() |
![]() |
|||||||||||||||||||||||
|
|
||||||||||||||||||||||||
|
Sitting In Chairs and Sleeping Intended Audience: [Printer Friendly / Syntax Highlight] How do I get my PC to sit on a chair? If you put down a useable placeable object chair (the chair has the Useable box checked, and make sure the PC will have room to manoever while sitting), put this script in the OnUsed event in the Scripts tab: When I place an NPC in the toolset, they just stand there. Is there no way I can have them sitting down? Not in the toolset, no... the creature must be standing. The creature would have to be scripted so that when the game begins it finds a chair and performs the ActionSit command. Create a placeable object chair and give it the tag "CHAIR". Place the NPC next to the chair. Copy and save their OnSpawn script under another name, and add this line at the bottom: ActionSit (GetNearestObjectByTag ("CHAIR", OBJECT_SELF)); Note that when a PC speaks the the NPC, they will stand up. To get them to sit back down, you will need to go to the 'Other Files' tab in their dialogue. You will see spots for two scripts there, which activate when dialogue is either ended or aborted. Make a script that calls the above line and they will sit back down once dialogue is over. This is all fine and well, but what if I want the NPC to sit on the chairs already in the tileset? Some users have reported success by following the same process as sitting in a chair... except find the 'invisible object' placeable object and place that on the seat of the chair. Give that object the tag "CHAIR" and use the same ActionSit line as above and they should sit down for you just the same. What if I want my NPC sleeping on a bed? There is no way currently to actually get a creature into a placeable object bed or a tileset bed. A placeable object body can be placed onto a bed, but not a creature. A creature can, however, sleep on a placeable object bedroll or on the floor. If you wanted your NPC to start off the game sleeping, you need to copy the creature's OnSpawn script, save it under a different name, and then add this to the bottom of that script: effect eLieDown = EffectSleep();
If you want the NPC to wake up at some point, you must use the RemoveEffect command. An effect, once applied, cannot simply have another variable defined as EffectSleep, however, and removed by the command. The 'pointer' must be on that particular effect. If the effect is the same variable in the same script as when it was applied, you could simply use this: RemoveEffect (OBJECT_SELF, eSleep); Normally, however, you must scan through an object's effects and find the one you're looking for through the effect type. The following is a simple script to remove an object's sleep effect (this one in the OnHeartbeat of the creature should any hostile come within 5 metres):
|
|||||||||||||||||||||||
|
|
||
|
Multiplayer Games at Neverwinter Connections
|
||
|
Download Modules
|
||
|
5,046,973 usuarios de BioWare:
|
||