• The VOIDRUNNER'S CODEX is LIVE! Explore new worlds, fight oppressive empires, fend off fearsome aliens, and wield deadly psionics with this comprehensive boxed set expansion for 5E and A5E!

[NWN] Local Variables?

gothwalk

Explorer
I'm having some trouble with a conversation I'm making in a module I'm working on. I want to set a local variable at one point, and have a different start to the conversation based on this variable existing.

(The NPC asks the PC to do something. When the PC agrees, the variable is set. If that variable is set, the NPC opens conversation by asking if the task is done yet.)

It's not working, for some reason, and I can't currently see why. It must be because either the variable is not set, or not tested for properly. Since the conversation isn't that large, I may just nuke it and start over, but I'd like to know for future reference: Is there a way to check what local variables are set from within the game?
 

log in or register to remove this ad

Frosty

First Post
Perhaps you already know this. I find that the easiest way to do what you are suggesting is the following:

In conversation editor:
On the line of conversation you want a local variable to be set, click on the 'actions taken' tab. To the left of the script input window you will see a small red wizard's hat. Click on the hat. Choose local variable and follow the instructions.

In the next conversation:
On the line of conversation you want to only appear to those who spoke to the last guy, click on the 'text appears when' tab. Click the wizard's hat. Choose check variable (or some such). Follow the instructions.

Voila!

If this is not what you were looking for you can still generate scripts this way which you cannibalize later.

Remember that the text that should appear first is put last in the stack of conversations:

-Hi again. Are you finished yet?
-Hello stranger
 
Last edited:

gothwalk

Explorer
Got that much, alright, but the problem is that either the "Actions taken" script isn't working, or the "show text when" script isn't - within the game, it's fine in the toolset.

But, come to think of it, I have my second set of text last, not first. That'll be the problem, cheers!

What I was looking to do is start the game, start the module, speak to the NPC, and then somehow check the state of the local variable. I've had one suggestion elsewhere that I could put in an object nearby and have its onUse script be a quote of that variable, but I was hoping for something more generic - for future reference, now that this one is solved.
 

Voidrunner's Codex

Remove ads

Top