Forum Discussion
Compare Score in Storyline
Hi!
It is possible to do it using Storyline's number comparison, but it would be so much easier to use javascript because there are at least 6 comparisons. It would be something like this:
player = GetPlayer();
MartaScore = player.GetVar("MartaScoreVariable");
PauloScore = player.GetVar("PauloScoreVariable");
JoanaScore = player.GetVar("JoanaScoreVariable");
If (MartaScore > PauloScore && MartaScore > JoanaScore) {
player.SetVar("FirstPlaceScore", MartaScore);
if (PauloScore > JoanaScore) {
player.SetVar("SecondPlaceScore", PauloScore);
player.SetVar("ThirdPlaceScore", JoanaScore);
} else {
player.SetVar("SecondPlaceScore", JoanaScore);
player.SetVar("ThirdPlaceScore", PauloScore);
}
}
// Another if with Paulo being first
// And the last if with Joana being first