One major change is the new mission screen handling, and the introduction of the callback function for mission screens.
Before I go and translate a lot of code in my OXPs with a lot of mission screens, I have a question. For the sake of simplicity (and laziness, and keeping mission screens together in my script), I want to change as little as possible in the general structure of my script. Therefore I'd like to know whether the following code would work, or whether calling the own mother function as a call back would be able to bring about the end of the world as we know it (actually: some sort of stack overflow and crash):
Code: Select all
this.missionScreens = function()
{
if(!missionVariables.mymission && system.ID == 100)
{
mission.runScreen({messageKey:"mymission_message1a", choicesKey:"mymission_continue"}, this.missionScreens);
missionVariables.mymission = "STAGE1a";
}
else if(missionVariables.mymission == "STAGE1a")
{
mission.runScreen({messageKey:"mymission_message1b", choicesKey:"mymission_continue"}, this.missionScreens);
missionVariables.mymission = "STAGE1b";
}
else if(missionVariables.mymission == "STAGE1b")
{
mission.runScreen({messageKey:"mymission_message1c", choicesKey:"mymission_continue"}, this.missionScreens);
missionVariables.mymission = "STAGE1c";
}
else if(missionVariables.mymission == "STAGE1c")
{
mission.runScreen({messageKey:"mymission_message1d"});
missionVariables.mymission = "STAGE2";
}
else if(missionVariables.mymission == "STAGE2" && system.ID == 150)
{
mission.runScreen({messageKey:"mymission_message2a", choicesKey:"mymission_continue"}, this.missionScreens);
missionVariables.mymission = "STAGE2a";
}
else if(missionVariables.mymission == "STAGE2a")
{
mission.runScreen({messageKey:"mymission_message2b"});
missionVariables.mymission = "STAGE3";
}
}
this.missionScreenOpportunity = function()
{
this.missionScreens();
}
Another question: do I actually need to define a choices-key with one choice only for this type of consecutive mission screens (as it was necessary in the old model), or could I alternatively use the call back function without a choicesKey?