Page 1 of 1

Not sure why this isnt working

Posted: Sun Aug 18, 2002 4:14 am
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?

Posted: Sun Aug 18, 2002 10:32 am
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.

Posted: Sun Aug 18, 2002 11:01 am
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?

Posted: Tue Aug 20, 2002 1:59 pm
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.

Posted: Fri Aug 23, 2002 1:05 pm
by Mini Me
Thanks again Xyx!

Posted: Thu Sep 05, 2002 5:08 am
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".

Posted: Thu Sep 05, 2002 5:27 am
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() )?

Posted: Thu Sep 05, 2002 7:58 pm
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:

Posted: Fri Sep 06, 2002 3:35 am
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

Posted: Fri Sep 06, 2002 9:26 pm
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!!

Posted: Sat Sep 07, 2002 4:01 am
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

Posted: Mon Sep 09, 2002 1:02 am
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

Posted: Mon Sep 09, 2002 8:30 am
by garazdawi
anytime, glad to help, np, my plasure aso