BioWare Atari
Informazioni BioWare Giochi BioWare Supporto Forum 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:

 

 

BioWare Store
Neverwinter Nights 2 Forums
Mostra/nascondi

English
Deutsch
Français
Español
Italiano

Mostra/nascondi

Vedi le immagini più recenti 

Vedi le immagini più recenti
Mostra/nascondi

Multiplayer Games at Neverwinter Connections

Today
Schedule a Game...



L'ora attuale è: (imposta ora)
sab, 21 novembre 2009 10:50

Mostra/nascondi

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

Mostra/nascondi

5,047,648 utenti BioWare:
  69 collegati
  5 nascosti
  244 ospiti

1575 Playing Online
  100% NWN
  100% NWN: SoU
  96% NWN: HotU

447 Registered Guilds

8,768,340 messaggi nei forum

Nuove discussioni:
1. Inferno armor available at Amaz... (Mass Effect 2 General Discussion (No Spoilers Allowed))

2. Will ME2 feature "ME1" or "DAO" ... (Mass Effect 2 General Discussion (No Spoilers Allowed))

3. conversation node spawning an it... (NWN2: Builders - NWN2 Scripting)

4. Stupid MAKO!! (Mass Effect 1 General Discussion (No spoilers allowed))

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