BioWare Atari
Información sobre BioWare Juegos de BioWare Soporte Foros Visit the BioWare Store
Neverwinter Nights Home
Neverwinter Nights Home

Sitting In Chairs and Sleeping

Intended Audience: For Builders
By David Gaider

[Printer Friendly / Syntax Highlight]

How do I get my PC to sit on a chair?
There is currently no emote to sit in a chair. Until one is added for PC characters to use, the script to make a PC sit down in a chair has to be on the object, itself.

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:

NWScript:

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();
effect eSnore = EffectVisualEffect (VFX_IMP_SLEEP);
effect eSleep = EffectLinkEffects (eLieDown, eSnore);
ApplyEffectToObject (DURATION_TYPE_PERMANENT, eSleep, OBJECT_SELF);


Waking Up Your NPC

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):

NWScript:

 

 

Dragon Age: Origins Preorder
Neverwinter Nights 2 Forums
Mostrar/Ocultar

English
Deutsch
Français
Español
Italiano

Mostrar/Ocultar

Ver las últimas pantallas 

Ver las últimas pantallas
Mostrar/Ocultar

Multiplayer Games at Neverwinter Connections

Today
Schedule a Game...



La hora actual es: (insertar hora)
sáb, 21 noviembre 2009 09:48

Mostrar/Ocultar

Download Modules

Top NWN: HotU Modules:
1. Good vs Evil III
2. More...

Top NWN: SoU Modules:
1. Good vs Evil III
2. More...

Top CEP Modules:
1. The Lord of Terror The Diablo Campa...
2. More...

Top Modules - NWVault:
1. Hall of Fame
2. More...

Total Modules: 4423

Mostrar/Ocultar

5,046,973 usuarios de BioWare:
  63 conectados
  8 ocultos
  38 invitados

1554 Playing Online
  100% NWN
  99% NWN: SoU
  99% NWN: HotU

447 Registered Guilds

8,768,259 mensajes en los foros

Temas más recientes de los foros:
1. Stupid MAKO!! (Mass Effect 1 General Discussion (No spoilers allowed))

2. An Idea Realized and Marquee Abi... (Mass Effect 2 General Discussion (No Spoilers Allowed))

3. I've never playe... (Baldur's Gate II: SoA and ToB General Discussion)

4. Why are you developers scared to... (Mass Effect 2 General Discussion (No Spoilers Allowed))

5. hidden trail (NWN2: Builders - NWN2 Toolset)