Author Topic: Dynamic Custom Tokens  (Read 555 times)

Legacy_Tazzvon

  • Newbie
  • *
  • Posts: 20
  • Karma: +0/-0
Dynamic Custom Tokens
« on: November 18, 2013, 01:13:02 am »


               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.
               
               

               
            

Legacy_Squatting Monk

  • Hero Member
  • *****
  • Posts: 776
  • Karma: +0/-0
Dynamic Custom Tokens
« Reply #1 on: November 18, 2013, 02:02:15 am »


               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 .
                     
                  


            

Legacy_Tazzvon

  • Newbie
  • *
  • Posts: 20
  • Karma: +0/-0
Dynamic Custom Tokens
« Reply #2 on: November 18, 2013, 11:52:25 am »


               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.
               
               

               
            

Legacy_Squatting Monk

  • Hero Member
  • *****
  • Posts: 776
  • Karma: +0/-0
Dynamic Custom Tokens
« Reply #3 on: November 20, 2013, 10:58:27 pm »


               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.
               
               

               
            

Legacy_henesua

  • Hero Member
  • *****
  • Posts: 6519
  • Karma: +0/-0
Dynamic Custom Tokens
« Reply #4 on: November 20, 2013, 11:05:15 pm »


               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. '<img'>