Author Topic: Conversation stuff  (Read 513 times)

Legacy_DarkEfes

  • Newbie
  • *
  • Posts: 8
  • Karma: +0/-0
Conversation stuff
« on: December 05, 2010, 10:22:16 pm »


               Well, actually i've been searching for a while now but i haven't found anything (I think..) that is in this situation:

Here is more something about the dialogues of a module that i'm trying to create, this is what i wanted to do-

1_ This dialogue with an NPC should change in various situations, the first is after talking with him for the first time
ex-"Hello there [...]". Here, if the PC tries to talk with this NPC again after ending the first dialogue, i want to make appear a different text that could be the one that appears above the head of the NPC
ex-"We have no more time to talk now, let's go." (i think i maked this work, but it would be better see the whole thing <<)

(I maked this character follow the PC at the end of the first dialogue, not as Henchman... but i think i gotta change that, if i want to take him in other areas, isn't? lol)

2_ I want this second line ("We have no more [...]") to change (and no more appear) when a certaint place/area has been reached. For example the NPC is in a forest the first time, then when they reach a town he says
ex-"Well, here we are. Did you have something to ask me?"
After this second change, i also want the NPC to leave the PC (Since he was following / Henchman) and go inside a building / palace that is in the area and that untill he hasn't reached it, he says
ex-"Why don't you go and buy something while i tell everyone we leave?".

3_ After reaching this NPC again, going in this building, he should say
ex-"So, are you ready?"
Or maybe ask to become a real Henchman or even give a quest, but for now i'd need help with only dialogues <w< The real point is that i wanna make the dialogue to change again after the NPC is in the building XD

I hope it's clear enough ( Sorry for english grammar horror   XD)
      .Thanks=]
-------
Oh.. if you need Tags..
NPC - " Argenteo "
Area1 - " SF01 "
Area2 - " QSA01 "

*still doesn't have the area said in n. 3.* lòl
-------
               
               

               
            

Legacy_ehye_khandee

  • Hero Member
  • *****
  • Posts: 1415
  • Karma: +0/-0
Conversation stuff
« Reply #1 on: December 05, 2010, 11:40:28 pm »


               The trick is to build one convo, with one main branch for each option you wish to have the NPC follow, so one for "We have no more [...]"  the TEXT APPEARS WHEN script needs to be set to NOT fire if the condition is NOT met (for example, a check of the Tag of the Area vs known positive). A similar TEXT APPEARS WHEN should be made for each branch of the convo EXCEPT the last which would be the 'default' convo branch. If you need more specific help, PM me and we can exchange some files.



Be well. Game on.

GM_ODA
               
               

               
            

Legacy_420

  • Sr. Member
  • ****
  • Posts: 370
  • Karma: +0/-0
Conversation stuff
« Reply #2 on: December 05, 2010, 11:44:02 pm »


               You'll want to use the "Text Appears When..." event in the dialog. You can either set local variables or campaign variables and then check for those variables to specify which lines of dialog should appear.



-420
               
               

               
            

Legacy_DarkEfes

  • Newbie
  • *
  • Posts: 8
  • Karma: +0/-0
Conversation stuff
« Reply #3 on: December 06, 2010, 06:02:24 pm »


               (sorry for late reply)


Well, actually my problem are these scripts i have to put in "Text Appears When" and Action Taken of the lines.
I mean, if it's the first time that i meet this NPC, in "Text Appears When" i have to put

int StartingConditional()
{

    // Ispeziona le variabili locali
    if(!(GetLocalInt(GetPCSpeaker(), "iGreet") == 1))
        return FALSE;

    return TRUE;
}

then when i'll try to talk to the NPC again he will say "We have no time [....]". But what i have to write if i want this second line to change again after that a certaint area has been reached? Or after that a certaint event has happened (ex- an enemy has been defeated)?
               
               

               
            

Legacy_DarkEfes

  • Newbie
  • *
  • Posts: 8
  • Karma: +0/-0
Conversation stuff
« Reply #4 on: December 08, 2010, 12:04:59 pm »


               So, noone can tell me what to do?
               
               

               
            

Legacy_ehye_khandee

  • Hero Member
  • *****
  • Posts: 1415
  • Karma: +0/-0
Conversation stuff
« Reply #5 on: December 08, 2010, 04:49:42 pm »


               

DarkEfes wrote...


Hope this helps.

Be well. Game on.
(sorry for late reply)


Well, actually my problem are these scripts i have to put in "Text Appears When" and Action Taken of the lines.
I mean, if it's the first time that i meet this NPC, in "Text Appears When" i have to put

int StartingConditional()
{

    // Ispeziona le variabili locali
    if(!(GetLocalInt(GetPCSpeaker(), "iGreet") == 1))
        return FALSE;

    return TRUE;
}

then when i'll try to talk to the NPC again he will say "We have no time [....]". But what i have to write if i want this second line to change again after that a certaint area has been reached? Or after that a certaint event has happened (ex- an enemy has been defeated)?



OK, it all revolves around scripts like the above, the other side of the problem is setting the variable after this 'one time only' branch of the conversation runs once.

so try this script instead -


int StartingConditional()
{

    // Ispeziona le variabili locali
    if(!(GetLocalInt(GetPCSpeaker(), "iGreet") == 1))
        {
    SetLocalInt(GetPCSpeaker(),"iGreet",1);
    return TRUE;
}
    return FALSE;
}


Let us know if this works out ok for you (not at my toolkit so the code is not tested).

Note - you should put a PLOT and UNDROPPABLE object in your PC's inventory and save all variables that you want to be trouble free onto that object, the reason is, variables saved on the PC might get dropped when your PC travels to another Area in game, but items in inventory are not handled the same way.

Also note, you may want to replace your script with THIS so that each time you use this ONE script it will 'customize' the variable used to the NPC in the convo.


int StartingConditional()
{

 // Ispeziona le variabili locali
 if(!(GetLocalInt(GetPCSpeaker(), "iGreet"+GetTag(OBJECT_SELF)) == 1))
{
    SetLocalInt(GetPCSpeaker(),"iGreet"+GetTag(OBJECT_SELF),1);
    return TRUE;
}
  return FALSE;
}



Hope this helps.

Be well. Game on.
GM_ODA
               
               

               
            

Legacy_Fester Pot

  • Hero Member
  • *****
  • Posts: 1698
  • Karma: +0/-0
Conversation stuff
« Reply #6 on: December 08, 2010, 04:58:11 pm »


               The order of a conversation has to be created in a step fashion.

Conversation Tree Example.

+ Well, here we are. Do you have anything to ask me? (TEXT APPEARS SCRIPT)
  We have no more time to talk. Let's go! (TEXT APPEARS SCRIPT)
+ Hello there. We've never met before. (ACTIONS TAKEN SCRIPT)


+ Hello There. We've never met before -

This line has nothing. No TEXT APPEARS because it's the line you want to appear the first time the player meets the NPC.

Somewhere along this conversation tree, you need to create an ACTIONS_TAKEN script to set a variable. This variable will be used on the conversation node above.

An example of an ACTIONS_TAKEN script to set a variable.

void main()
{
SetLocalInt(GetPCSpeaker(), "metcoolnpc", 1);
}


The conversation node - We have no more time to talk. Let's go - requires a TEXT APPEARS script.

This script checks the variable that was just set. If it equals 1, we know the player has met the NPC and the - Hello there. We've never met before - conversation node has fired and been read by the player.

An example of a TEXT APPEARS script to check a variable.

int StartingConditional()
{

if (!(GetLocalInt(GetPCSpeaker, "metcoolnpc") == 1)) return FALSE;

return TRUE;

}


The conversation node - We'll, here we are. Do you have anything to ask me? - requires a TEXT APPEARS script as well just like above.

Here's another example -

int StartingConditional()
{

if (!(GetLocalInt(GetPCSpeaker(), "spawnednameoftown") == 1)) return FALSE;

return TRUE;

}


Now in the OnEnter of your TOWN or AREA, you'll want to set this variable and make it unique to the AREA. This is so the conversation tree knows you're in that area. For your OnExit of the AREA, you'll want to set it back to 0, so the scripts know you've left the area and cannot fire that part of the conversation until you return.

Here is an example of an OnEnter and OnExit for an AREA.

ON ENTER

void main()
{
object oPC = GetEnteringObject();

if (!GetIsPC(oPC)) return;

SetLocalInt(oPC, "spawnednameoftown", 1);
}


ON EXIT

void main()
{
object oPC = GetExitingObject();

if (!GetIsPC(oPC)) return;

SetLocalInt(oPC, "spawnednameoftown", 0);
}


Hope that gives you some thing to work with.

FP!
               
               

               


                     Modifié par Fester Pot, 08 décembre 2010 - 05:01 .
                     
                  


            

Legacy_DarkEfes

  • Newbie
  • *
  • Posts: 8
  • Karma: +0/-0
Conversation stuff
« Reply #7 on: December 08, 2010, 08:58:17 pm »


               Err, there is something that i've got to fix also, before the "Well, here we are[...]"
The NPC follows me at the end of the first dialogue, but just in the area where he begin to do that. (He doesn't follow me if i go in the town)

this is what i put in action taken at the end of the first dialogue ("Hello there[...]")

void followPC(object oPC)
{
    if (GetIsObjectValid(oPC) == TRUE)
    {
        ClearAllActions();
        ActionForceMoveToObject(oPC,TRUE, 3.5, 3.0);
        DelayCommand(2.0, followPC(oPC));
    }
}
void main()
{
    object oPC = GetLastSpeaker();
    followPC(oPC);
}

------------------------

I've tried your scripts and they works, talking about the "we have no time[...]" and "Hello There[...]". I can't tell you if it changes after i reach the new area because of that thing above ':unsure:' Is there a way to make the NPC follow in other areas but not as a Henchman? Sorry ^^' if you can tell me how, so i'll see if the dialogue changes after that the "Town" has been reached.
               
               

               
            

Legacy_Fester Pot

  • Hero Member
  • *****
  • Posts: 1698
  • Karma: +0/-0
Conversation stuff
« Reply #8 on: December 08, 2010, 09:15:06 pm »


               You'll need something in the NPC's heartbeat to have them continue to follow you to other areas.

My suggestion is to look at this script if no one else gives you another solution. It's a tour guide script, which will make the NPC follow the player based on particular variables that are set.

This makes the NPC follow the PC anywhere until the variables are turned OFF. The NPC will follow the player for as long as required, until the PC tells them otherwise via conversation (which you will have to create and change the variable), as well as cross areas the PC goes to.

They do not become a member of the party either.

FP!
               
               

               


                     Modifié par Fester Pot, 08 décembre 2010 - 09:15 .