Aller au contenu

Photo

Dynamic Custom Tokens


  • Veuillez vous connecter pour répondre
4 réponses à ce sujet

#1
Tazzvon

Tazzvon
  • Members
  • 10 messages
Is there a way to put tokens into a conversation without knowing how many you need.

I want a single conversation that will display all the quests in the PC's current area.

I would script all the quests and in individual if statements based on the PC's current area and set the custom tokens within each if statement. The problem comes that i cant figure out how to get the conversation to display the custom tokens when the number of tokens changes based on the area. I'd rather not write a seperate script for each area and I know someone out there can give me a solution.

#2
Squatting Monk

Squatting Monk
  • Members
  • 445 messages
Instead of making each quest a different token, put them all into one token.

int StartingConditional()
{
    object oPC = GetPCSpeaker();
    string sArea = GetTag(GetArea(oPC));
    string sToken = "The following quests are available in this area:\\n";
    
    if (sArea == "area1")
    {
        sToken += "\\nQuest 1: Do the first thing!";
        sToken += "\\nQuest 2: Do the second thing!";
        sToken += "\\nQuest 3: Do the third thing!";
    }
    else if (sArea == "area2")
    {
        sToken += "\\nQuest 4: Do the fourth thing!";
        sToken += "\\nQuest 5: Do the fifth thing!";
        sToken += "\\nQuest 6: Do the sixth thing!";
    }
    else
        sToken = "Sorry, there are no quests in this area.";
    
    SetCustomToken(20000, sToken);
    return TRUE;
}

Modifié par Squatting Monk, 18 novembre 2013 - 02:03 .


#3
Tazzvon

Tazzvon
  • Members
  • 10 messages
So, that looks great but that won't separate them out to individual selections that the PC can select will it? I would like the conversation to say "here are the quests in your area" then the player can select one to get more info. I don't think it would work for that but thank you.

#4
Squatting Monk

Squatting Monk
  • Members
  • 445 messages
Ah. I thought you were just looking to list them in the NPC's dialog. In that case, I suggest using a dynamic dialog system like ZZ-Dialog. I'll try to whip up a simple demonstration of how you could go about doing it yourself, if you feel like doing it the hard way.

#5
henesua

henesua
  • Members
  • 3 864 messages
If Z-Dialog is the way to go, we will be happy to post our fixes to it. I'll see about that this week if I can ever get time outside of RL obligations. :)