[NWN] Modules and questions

Frosty

First Post
I'm making a module. Who, in this day and age isn't? I've stumbled upon a small obstacle, though. I know how to make a door work but how do you transport PCs from one area to another without the use of doors? I need to move people at the end of a conversation as well as moving people who stand in a certain spot (portal).

I've got another problem too. I have a switch (floorlever) that is set to deactivated. When used I want four braziers to become activated too. Preferably with a short delay inbetween braziers for cool effect.

If anyone could help me out here a bit I'd be eternally grateful. :)

Oh. And you get the module once finished. (Mystery and action).
 

log in or register to remove this ad

You use an area transition. It's in the "paint triggers" menu. Then you just draw a box which is your area transition, and then treat it like a door when setting up the transtion.
 

I must have missed that. It didn't look like the door dialogue window to me. At least I'm on the right track then, thanks. I'll meddle some more once I get home from work.

Does anyone know which scrip is used by an NPC, in conversation, to send the PC away to a transition?

Morrus: I'll send the module to you as soon it's done and ready, as promised.
 

On the switching lights/flames on and off I've found it really tricky.

I hope you have the "Commonly Asked Questions by David Gaider" PDF, that has a lot of helpful examples. One of which involves switching lights on and off.

Do the placeable object animations work the same way?
Yes. You can tell a chest to open by having it run its
ANIMATION_PLACEABLE_OPEN, or a lamp post to turn off using
ANIMATION_PLACEABLE_DEACTIVATE. A few things to keep in mind:
1) For placeable objects that are sources of illumination (such as the lamp post),
it is not enough to just use its ANIMATION_PLACEABLE_DEACTIVATE or
ANIMATION_PLACEABLE_ACTIVATE. That just affects the glowing part of the
animation, itself. You must also use the SetPlaceableIllumination command set
to TRUE and tell the area it's in to RecomputeStaticLighting.
The following is an example of placeable illumination use:
NWScript:

Code:
// will turn the lightable object on and off when selected
// placed in its OnUsed event
void main()
{
     if (GetLocalInt (OBJECT_SELF,"NW_L_AMION") == 0)
     {
         SetLocalInt (OBJECT_SELF,"NW_L_AMION",1);
         PlayAnimation (ANIMATION_PLACEABLE_ACTIVATE);
         SetPlaceableIllumination (OBJECT_SELF, TRUE);
         RecomputeStaticLighting (GetArea(OBJECT_SELF));
     }
     else
     {
         SetLocalInt (OBJECT_SELF,"NW_L_AMION",0);
         PlayAnimation (ANIMATION_PLACEABLE_DEACTIVATE);
         SetPlaceableIllumination (OBJECT_SELF, FALSE);
         RecomputeStaticLighting (GetArea(OBJECT_SELF));
     }
}

Now this is fine for a script on the items own OnUsed function but and its a big but. You try to attach something like this to a switch and you get a problem.

PlayAnimation( ) assumes you are talking about the object the script is attached to by the looks of things.

It also isn't a valid command to use with the DoPlaceableObjectAction ( ). For that you are stuck with PLACEABLE_ACTION_* BASH, KNOCK, UNLOCK, USE.

I tried putting the top script in the OnUsed function of the Fire then putting the DoPlaceableObjectAction (oFlame, PLACEABLE_ACTION_USE). But it didn't work for me, but then I didn't make the object usable as this means players can click on it....

Perhaps you could try making the object usable and adding a line of code to check GetIsPC() on the object using it, and for the rest of the script not to fire.

Let me know how it goes.
 

Yes. I solved it in another way (and created a new problem). Instead of using a lever to activate four lamps I made it so you need to activate each lamp in turn. However, you need to fill the lamp with oil (custom potion special use). A conversation takes care of the oil but here is the problem:

The lamp destroys the character's entire stack of oil (if he has any). I want each lamp to destroy one bottle of oil. So if a character has five bottles of oil after a conversation with a lamp (which makes it activate) the character is left with four bottles. As it is now that darned lamp sucks up the entire stack of five bottles. (If you have two stacks of bottles only one stack will be destroyed.) Weird, huh?:D

I guess it has to do with the DestroyObject-command. Perhaps there is a parameter to set if you want it to destroy one "charge" of a stack of objects.

Alternatively I want to make the bottles of oil unstackable. You know you can stack potions but not fire beetle bellies. A bottle of oil is rather large (I imagine) so each bottle should require it's own space in the PCs inventory.

[Nice tag-line. I'm one of the first kind, lol.]
 
Last edited:

Remove ads

Top