There really are a LOT of ways you could do this. Since HipMaestro already suggested one method lets take a look at doing it that way.
To keep things very simple let's just use the name of the objects/runes to build the right string sequence. This way you can also use the same script for all three rune/objects. So if you were to literally name these objects "Activate", "Summon demon" and "Enter" you could use a script in the objects "OnUsed" event like so:
void main()
{
//We can just use the name of the object to build the correct string sequence.
string sName = GetName(OBJECT_SELF);
//Get the player who last clicked the object.
object oPC = GetLastUsedBy();
//Get the stored string on the player under the title "RUNE_PUZZLE". If this is
//the first time the player has clicked one of the objects then this will just
//be blank.
string sPuzzle = GetLocalString(oPC, "RUNE_PUZZLE");
//Store the new string under the title "RUNE_PUZZLE" on the player.
SetLocalString(oPC, "RUNE_PUZZLE", sPuzzle + sName);
}
This script builds one long string, based on the order the objects were clicked, and saves it on the player to be checked by the script below. If the player clicked on the "Enter" rune 3 times then the saved string would be "EnterEnterEnter". I didn't add any kind of check for limitations though. If a player clicks the "Activate" rune six times then the stored string would be "AcitvateActivateActivateActivateActivateActivate". I hope that makes sense. And if you want some kind of feed back for the player you could always just add a bit to the bottom of the above script. Like adding a quick visual effect to the rune. Or send a message to the player, etc..
Then for the part of the conversation where the new node would show up if the correct string were stored on the player. The following would go in the "TextAppearsWhen" tab of the new node. It is basically saying that if the string stored on the player is "ActivateSummon demonEnter", then this conversation node will appear.
int StartingConditional()
{
object oPC = GetPCSpeaker();
string iString = GetLocalString(oPC, "RUNE_PUZZLE");
if (iString == "ActivateSummon demonEnter")return TRUE;
else return FALSE;
}
Of course you will also want to delete the stored string every time a player starts the conversation to check to see if they got it right. So in both nodes (correct or incorrect) in the ActionsTaken event of those lines put int something like so:
void main()
{
object oPC = GetPCSpeaker();
DeleteLocalString(oPC, "RUNE_PUZZLE");
}
That is pretty much it. This is a simple crude example but it should still work. Is it the best solution? I don't think there really is a BEST solution in this case. It really just depends on what you want to happen and the how and when and all that.
Hope this at least gets you started.
Good luck.
Modifié par GhostOfGod, 26 octobre 2010 - 03:46 .