Please note that new user registrations disabled at this time.

Not sure why this isnt working

This forum is to be used for all discussions pertaining to BioWare's Neverwinter Nights, its Shadows of Undrentide and Hordes of the Underdark expansion packs, and any user-created or premium modules.
Post Reply
User avatar
Mini Me
Posts: 535
Joined: Tue Sep 25, 2001 10:00 pm
Location: England
Contact:

Not sure why this isnt working

Post by Mini Me »

I have made a character who talks and gives reward and then when i talk to him again he is just meant to say Hello, nothing else. I have on the first greeting put Actions Taken: set local variables, Int-nFirstTimeTalked and set value to 1. On the next greeting i have scripted 'Text appears when when local variable nFirstTimeTalked is 1'.

This is what is said to do in the tutorial, and i used it before and it worked fine. What am i doing wrong?
'My pantaloons are full of weasels. Inform the Queen, so that she might shoo them away. Here we go 'round the mulberry bush. Go monkey GO!'-Wanev
Have you ever heard any more inspiring or logical words? I sure haven't.
User avatar
Xyx
Posts: 3104
Joined: Mon Jun 04, 2001 10:00 pm
Location: The Netherlands
Contact:

Post by Xyx »

The order in which NPC dialogue options appear is important. Consider the following example:

NPC: "Well done!" IF quest done
NPC: "Hurry up!" IF quest accepted
NPC: "I have a job for you."

Set up like this, it works. When the game tries to decide which option gets picked for the NPC, it starts at the top. It looks at each option in turn, running any script needed. As soon as an option is found that does not have a script that returns FALSE (so that's either a script that returns TRUE or no script at all), that option immediately gets picked and the remaining options are ignored.
[url="http://www.sorcerers.net/Games/BG2/SpellsReference/Main.htm"]Baldur's Gate 2 Spells Reference[/url]: Strategy, tips, tricks, bugs, cheese and corrections to the manual.
User avatar
Mini Me
Posts: 535
Joined: Tue Sep 25, 2001 10:00 pm
Location: England
Contact:

Post by Mini Me »

Thanks!

I thought of that, because only after testing it did i realise it needed a second greeting so you couldnt get the key a billion times. Is there a way to insert the alternative greeting AFTER making the first one?
'My pantaloons are full of weasels. Inform the Queen, so that she might shoo them away. Here we go 'round the mulberry bush. Go monkey GO!'-Wanev
Have you ever heard any more inspiring or logical words? I sure haven't.
User avatar
Xyx
Posts: 3104
Joined: Mon Jun 04, 2001 10:00 pm
Location: The Netherlands
Contact:

Post by Xyx »

If you drag and drop a node onto its parent, it becomes the lowest option. Just drag all nodes onto the parent in the order you want them to appear.

If I mistook your question, do say so.
[url="http://www.sorcerers.net/Games/BG2/SpellsReference/Main.htm"]Baldur's Gate 2 Spells Reference[/url]: Strategy, tips, tricks, bugs, cheese and corrections to the manual.
User avatar
Mini Me
Posts: 535
Joined: Tue Sep 25, 2001 10:00 pm
Location: England
Contact:

Post by Mini Me »

Thanks again Xyx!
'My pantaloons are full of weasels. Inform the Queen, so that she might shoo them away. Here we go 'round the mulberry bush. Go monkey GO!'-Wanev
Have you ever heard any more inspiring or logical words? I sure haven't.
User avatar
Alisondre
Posts: 4
Joined: Wed Sep 04, 2002 2:04 am
Contact:

Post by Alisondre »

Hi. This is my first post here. Anyway, I'm having the same problem in my mod. I have the initial greeting at the bottom of the dialog tree, and here's the weird thing: I've got 2 NPC's, so far the only 2 that I've written nFirstTimeTalked dialogs for, and whichever one I talk to 1st, gives the initial greeting, and the other goes straight to "hello again".
People are more violently opposed to fur than leather, because it's safer to pick on rich women than biker gangs.
User avatar
Mr Sleep
Posts: 11273
Joined: Thu Oct 19, 2000 10:00 pm
Location: Dead End Street
Contact:

Post by Mr Sleep »

Welcome to the forums. :)

Is it possible that you are setting the variable to the the module (GetModule() ) rather than to the PC (GetPcSpeaker() )?
I'd have to get drunk every night and talk about virility...And those Pink elephants I'd see.
User avatar
Alisondre
Posts: 4
Joined: Wed Sep 04, 2002 2:04 am
Contact:

Post by Alisondre »

I used the dreaded SCRIPT WIZARD, and highlighted the text that my npc was supposed to say, so it shouldn't be set on the module. As a matter of fact no, it isn't. I checked. :confused:
People are more violently opposed to fur than leather, because it's safer to pick on rich women than biker gangs.
User avatar
Mr Sleep
Posts: 11273
Joined: Thu Oct 19, 2000 10:00 pm
Location: Dead End Street
Contact:

Post by Mr Sleep »

Originally posted by Alisondre
I used the dreaded SCRIPT WIZARD, and highlighted the text that my npc was supposed to say, so it shouldn't be set on the module. As a matter of fact no, it isn't. I checked. :confused:
What is the name of the quest, is it possible are both the same name? For instance if you named it "Story_1" did you then name both quests "Story_1"?

BTW I am fairly inexperienced with scripting myself, so bear with me :o
I'd have to get drunk every night and talk about virility...And those Pink elephants I'd see.
User avatar
Alisondre
Posts: 4
Joined: Wed Sep 04, 2002 2:04 am
Contact:

Post by Alisondre »

No, I didn't attach any parts of the quest to those conversations. It's 2 shopkeepers, and I just want them to say, the first time the pc talks to them, a "Hail and well met" sort of thing, and a "Hello, again" sort of thing after that. Bioware has an introduction to the toolset tutorial with a conversation like that. It basically shows you how to set up local variables, based on nFirstTimeTalked, to make that happen. Now, there was only 1 conversation like that in the module, the others had dialog trees that were dependent on things like completion of quest stages, but I figured that what works for 1 would work for 2. What is happening, it seems, is that those 2 npc's are, to the script, being treated as 1 person, which makes no sense to me; I did write 2 seperate conversations. It's been a pain; such a simple problem, I mean, it's not like I'm trying to have all the female citizens of the town turn in to werewolves on alternate full moons but only if it's that time of the month, and have them serve you drinks in the meantime! :p Matter of fact, it's so simple, that none of the webpages with posted scripts have anything even remotely applicable. AAAAAAAAA!!
People are more violently opposed to fur than leather, because it's safer to pick on rich women than biker gangs.
User avatar
garazdawi
Posts: 2563
Joined: Mon Jun 24, 2002 11:00 am
Location: Skövde, Sweden
Contact:

Post by garazdawi »

If you are using the same script on both NPC you have to put the LocalInt on OBJECT_SELF and not GetPCSpeaker() or GetModule(), if you put it on the PC they will indeed act as one NPC.

Use this line

SetLocalInt(OBJECT_SELF,"varname",1(or what ever));

To check just use the script wizard but make sure to change GetPCSpeaker() to OBJECT_SELF !!

If I remember correctly it should look something like this

iResult=TRUE;
if (!(GetLocalInt(OBJECT_SELF,"varname"))==0)
iResult=FALSE;
return iResult

not sure about the syntax I never ran it but it look like it might work. You ofcourse have to put starting conditional in there as well
"Those who control the past control the future, those who control the present control the past" And I rule the PRESENT!!
I put the 'laughter' back in 'slaughter'
User avatar
Alisondre
Posts: 4
Joined: Wed Sep 04, 2002 2:04 am
Contact:

Post by Alisondre »

That did it! Thanks, all. It's amazing to me that such a seemingly small and simple issue has been such a "bear". :D
People are more violently opposed to fur than leather, because it's safer to pick on rich women than biker gangs.
User avatar
garazdawi
Posts: 2563
Joined: Mon Jun 24, 2002 11:00 am
Location: Skövde, Sweden
Contact:

Post by garazdawi »

anytime, glad to help, np, my plasure aso
"Those who control the past control the future, those who control the present control the past" And I rule the PRESENT!!
I put the 'laughter' back in 'slaughter'
Post Reply