From e436c618434c1eb145dc818c4727840a94ac30d9 Mon Sep 17 00:00:00 2001 From: Johnathan Kemp Date: Tue, 29 May 2012 10:06:01 +0000 Subject: [PATCH] JK Added destination page for game end and improved game end sequence. git-svn-id: https://xerteonlinetoolkits.googlecode.com/svn/trunk@357 912cdd6b-5c7d-d5a7-a2ba-d0f0cdb91641 --- .../Nottingham/models/scenario.rlm | 2 +- .../Nottingham/wizards/en-GB/data.xwd | 14 +++++++++++--- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/modules/xerte/parent_templates/Nottingham/models/scenario.rlm b/modules/xerte/parent_templates/Nottingham/models/scenario.rlm index c3ca2b0f6c..5a4d29a108 100644 --- a/modules/xerte/parent_templates/Nottingham/models/scenario.rlm +++ b/modules/xerte/parent_templates/Nottingham/models/scenario.rlm @@ -1 +1 @@ - '; clipBoardText = clipBoardText + chr(13) + chr(10); clipBoardText = clipBoardText + '' + reportTitle + ''; clipBoardText = clipBoardText + chr(13) + chr(10); clipBoardText = clipBoardText + '' + chr(13) + chr(10); clipBoardText = clipBoardText + '' + chr(13) + chr(10); for (i = 0; i < pageID_array.length; i++){ clipBoardText = clipBoardText + '' + chr(13) + chr(10); } clipBoardText = clipBoardText + '
' + pageLabel + '' + titleLabel + '' + idLabel + '
' + (i + 1) + '' + pageTitle_array[i] + '' + pageID_array[i] + '
' + chr(13) + chr(10); System.setClipboard(clipBoardText); } else { // do nothing }]]>
= rootIcon.scenario.propArray[i][j][0][k].scoreVal){ // test is current but condition scenario value is not current scenario allowAction = "false"; } break; case "GT": if (testScore <= rootIcon.scenario.propArray[i][j][0][k].scoreVal){ // test is notCurrent but condition scenario value is the current scenario allowAction = "false"; } break; case "EQ": if (testScore != rootIcon.scenario.propArray[i][j][0][k].scoreVal){ // test is notCurrent but condition scenario value is the current scenario allowAction = "false"; } break; default: // undefined // reject action as improperly formed condition allowAction = "false"; } // switch } // if scoreNumber specified // now test the chanceAct option against a random number if (rootIcon.scenario.propArray[i][j][0][k].chanceAct != undefined){ // // need to test values for scenarioState myRand = Math.floor(Math.random() * 10); // returns 0 through 9 myChanceAct = parseInt(rootIcon.scenario.propArray[i][j][0][k].chanceAct); if (myRand >= myChanceAct){ allowAction = "false"; } } } // allowAction test } // end condition loop // still looping through actions if (allowAction == "true") { if (rootIcon.scenario.propArray[i][j][1].length == undefined) { // there are no outcomes so only use it if it is an effect if (currentActionType == "effect") { // add effect to effect array myArrayIndex = effectArray.length; effectArray[myArrayIndex] = new Array(); effectArray[myArrayIndex].title = rootIcon.scenario.propArray[i][j].title; effectArray[myArrayIndex].actionText = rootIcon.scenario.propArray[i][j].actionText; } } else { // we have at least one outcome so create an entry for the action or effect if (currentActionType == "action") { // create a new actionArray entry myArrayIndex = actionArray.length; actionArray[myArrayIndex] = new Array(); actionArray[myArrayIndex].title = rootIcon.scenario.propArray[i][j].title; actionArray[myArrayIndex].actionText = rootIcon.scenario.propArray[i][j].actionText; } else { // create a new effectArray entry myArrayIndex = effectArray.length; effectArray[myArrayIndex] = new Array(); effectArray[myArrayIndex].title = rootIcon.scenario.propArray[i][j].title; effectArray[myArrayIndex].actionText = rootIcon.scenario.propArray[i][j].actionText; } // now loop through the outcomes adding only those where all outcome conditions are valid for (l = 0; l < rootIcon.scenario.propArray[i][j][1].length; l++) { // does the outcome have any outcome conditions? if (rootIcon.scenario.propArray[i][j][1][l].length == undefined) { // no conditions so we can simply add the outcome to the action or effect if (currentActionType == "action") { outcomeIndex = actionArray[myArrayIndex].length; actionArray[myArrayIndex][outcomeIndex] = new Array(); actionArray[myArrayIndex][outcomeIndex].outcomeText = rootIcon.scenario.propArray[i][j][1][l].outcomeText; actionArray[myArrayIndex][outcomeIndex].score1Inc = rootIcon.scenario.propArray[i][j][1][l].score1Inc; actionArray[myArrayIndex][outcomeIndex].score2Inc = rootIcon.scenario.propArray[i][j][1][l].score2Inc; actionArray[myArrayIndex][outcomeIndex].score3Inc = rootIcon.scenario.propArray[i][j][1][l].score3Inc; actionArray[myArrayIndex][outcomeIndex].soundEffect = rootIcon.scenario.propArray[i][j][1][l].soundEffect; // if propName has not been set in the outcome it must be set here to the current prop so that // the author can just select a change of state without having to always set the prop if (rootIcon.scenario.propArray[i][j][1][l].propName == undefined){ actionArray[myArrayIndex][outcomeIndex].propName = rootIcon.scenario.propArray[i].name; } else { actionArray[myArrayIndex][outcomeIndex].propName = rootIcon.scenario.propArray[i][j][1][l].propName; } actionArray[myArrayIndex][outcomeIndex].propState = rootIcon.scenario.propArray[i][j][1][l].propState; actionArray[myArrayIndex][outcomeIndex].propAction = rootIcon.scenario.propArray[i][j][1][l].propAction; actionArray[myArrayIndex][outcomeIndex].specifiedLoc = rootIcon.scenario.propArray[i][j][1][l].specifiedLoc; actionArray[myArrayIndex][outcomeIndex].destination = rootIcon.scenario.propArray[i][j][1][l].destination; actionArray[myArrayIndex][outcomeIndex].exitNav = rootIcon.scenario.propArray[i][j][1][l].exitNav; } else { outcomeIndex = effectArray[myArrayIndex].length; effectArray[myArrayIndex][outcomeIndex] = new Array(); effectArray[myArrayIndex][outcomeIndex].outcomeText = rootIcon.scenario.propArray[i][j][1][l].outcomeText; effectArray[myArrayIndex][outcomeIndex].score1Inc = rootIcon.scenario.propArray[i][j][1][l].score1Inc; effectArray[myArrayIndex][outcomeIndex].score2Inc = rootIcon.scenario.propArray[i][j][1][l].score2Inc; effectArray[myArrayIndex][outcomeIndex].score3Inc = rootIcon.scenario.propArray[i][j][1][l].score3Inc; effectArray[myArrayIndex][outcomeIndex].soundEffect = rootIcon.scenario.propArray[i][j][1][l].soundEffect; // if propName has not been set in the outcome it must be set here to the current prop so that // the author can just select a change of state without having to always set the prop if (rootIcon.scenario.propArray[i][j][1][l].propName == undefined){ effectArray[myArrayIndex][outcomeIndex].propName = rootIcon.scenario.propArray[i].name; } else { effectArray[myArrayIndex][outcomeIndex].propName = rootIcon.scenario.propArray[i][j][1][l].propName; } effectArray[myArrayIndex][outcomeIndex].propState = rootIcon.scenario.propArray[i][j][1][l].propState; effectArray[myArrayIndex][outcomeIndex].propAction = rootIcon.scenario.propArray[i][j][1][l].propAction; effectArray[myArrayIndex][outcomeIndex].specifiedLoc = rootIcon.scenario.propArray[i][j][1][l].specifiedLoc; effectArray[myArrayIndex][outcomeIndex].destination = rootIcon.scenario.propArray[i][j][1][l].destination; effectArray[myArrayIndex][outcomeIndex].exitNav = rootIcon.scenario.propArray[i][j][1][l].exitNav; } } else { // we have outcome conditions so we must check all outcome conditions // to see if all conditions are met before the action can be added to // the action array allowOutcome = "true"; for (m = 0; m < rootIcon.scenario.propArray[i][j][1][l].length; m++) { // looping through the outcomeConditions and test them // check which prop we using in this condition for conditions that relate to a prop if (rootIcon.scenario.propArray[i][j][1][l][m].propName == undefined){ thisProp = rootIcon.scenario.propArray[i].name; thisPropIndex = i; } else { thisProp = rootIcon.scenario.propArray[i][j][1][l][m].propName; thisPropIndex = rootIcon.scenario.propIndexArray.findValue(thisProp); } // test for propState if (rootIcon.scenario.propArray[i][j][1][l][m].propState != undefined){ // we have a prop related condition so find out which prop it relates to // confirm prop exists if (thisPropIndex == -1){ allowOutcome = "false"; // prop not found } else { // now test for propState conditions switch(rootIcon.scenario.propArray[i][j][1][l][m].propState){ // prop that is the subject of the condition may not be the same as the prop that has the action case "visible": if (visibleArray.findValue(thisPropIndex) == -1){ // prop is not present in presentArray allowOutcome = "false"; } break; case "hidden": if (hiddenArray.findValue(thisPropIndex) == -1){ // prop not in absent list allowOutcome = "false"; } break; default: // undefined // no action required if no propState value specified } // end switch case propState } // this propIndex } // propState not undefined // end of propState tests // test for propLoc if (rootIcon.scenario.propArray[i][j][1][l][m].propLoc != undefined){ // we have a prop related condition so find out which prop it relates to // confirm prop exists if (thisPropIndex == -1){ allowOutcome = "false"; // prop not found } else { // now test for propLoc conditions switch(rootIcon.scenario.propArray[i][j][1][l][m].propLoc){ // prop that is the subject of the condition may not be the same as the prop that has the action case "onStage": if (onStageArray.findValue(thisPropIndex) == -1){ // prop is not present in presentArray allowOutcome = "false"; } break; case "carried": if (carriedArray.findValue(thisPropIndex) == -1){ // prop not in absent list allowOutcome = "false"; } break; case "offStage": if (offStageArray.findValue(thisPropIndex) == -1){ // not carried; allowOutcome = "false"; } break; case "notOnStage": if (notOnStageArray.findValue(thisPropIndex) == -1){ // not carried; allowOutcome = "false"; } break; case "notCarried": if (notCarriedArray.findValue(thisPropIndex) == -1){ // carried; allowOutcome = "false"; } break; case "inScene": if (inSceneArray.findValue(thisPropIndex) == -1){ // carried; allowOutcome = "false"; } break; default: // undefined // no action required if no propState value specified } // end switch case propState } // this propIndex } // propLoc not undefined // end of propLoc tests // now test the scenario related options if (rootIcon.scenario.propArray[i][j][1][l][m].scenarioID != undefined){ // name of scenario in condition // need to test values for scenarioState switch(rootIcon.scenario.propArray[i][j][1][l][m].scenarioState){ // prop that is the subject of the condition may not be the same as the prop that has the action case "current": if (rootIcon.scenario.propArray[i][j][1][l][m].scenarioID != currentscenario){ // test is current but condition scenario value is not current scenario allowOutcome = "false"; } break; case "notCurrent": if (rootIcon.scenario.propArray[i][j][1][l][m].scenarioID == currentscenario){ // test is notCurrent but condition scenario value is the current scenario allowOutcome = "false"; } break; default: // undefined // reject action as improperly formed condition allowOutcome = "false"; } // switch } // if scenarioID specified // now test for score value if (rootIcon.scenario.propArray[i][j][1][l][m].scoreNumber != undefined){ // name of scenario in condition // need to test values for specified score switch(rootIcon.scenario.propArray[i][j][1][l][m].scoreNumber){ case "1": testScore = rootIcon.scenario.scoreArray[0].score; break; case "2": testScore = rootIcon.scenario.scoreArray[1].score; break; case "3": testScore = rootIcon.scenario.scoreArray[2].score; break; case "4": // inventory testScore = inventoryArray.length; break; default: // undefined // reject action as improperly formed condition allowOutcome = "false"; } // switch switch(rootIcon.scenario.propArray[i][j][1][l][m].scoreComp){ // prop that is the subject of the condition may not be the same as the prop that has the action case "LT": if (testScore >= rootIcon.scenario.propArray[i][j][1][l][m].scoreVal){ // test is current but condition scenario value is not current scenario allowOutcome = "false"; } break; case "GT": if (testScore <= rootIcon.scenario.propArray[i][j][1][l][m].scoreVal){ // test is notCurrent but condition scenario value is the current scenario allowOutcome = "false"; } break; case "EQ": if (testScore != rootIcon.scenario.propArray[i][j][1][l][m].scoreVal){ // test is notCurrent but condition scenario value is the current scenario allowOutcome = "false"; } break; default: // undefined // reject action as improperly formed condition allowOutcome = "false"; } // switch } // if scoreNumber specified // now test the chanceAct option against a random number if (rootIcon.scenario.propArray[i][j][1][l][m].chanceAct != undefined){ // // need to test values for scenarioState myRand = Math.floor(Math.random() * 10); // returns 0 through 9 myChanceAct = parseInt(rootIcon.scenario.propArray[i][j][1][l][m].chanceAct); if (myRand >= myChanceAct){ allowOutcome = "false"; } } } // outcome condition loop if (allowOutcome == "true") { // add outcome to effect or action if (currentActionType == "action") { outcomeIndex = actionArray[myArrayIndex].length; actionArray[myArrayIndex][outcomeIndex] = new Array(); actionArray[myArrayIndex][outcomeIndex].name = rootIcon.scenario.propArray[i][j][1][l].name; actionArray[myArrayIndex][outcomeIndex].outcomeText = rootIcon.scenario.propArray[i][j][1][l].outcomeText; actionArray[myArrayIndex][outcomeIndex].score1Inc = rootIcon.scenario.propArray[i][j][1][l].score1Inc; actionArray[myArrayIndex][outcomeIndex].score2Inc = rootIcon.scenario.propArray[i][j][1][l].score2Inc; actionArray[myArrayIndex][outcomeIndex].score3Inc = rootIcon.scenario.propArray[i][j][1][l].score3Inc; actionArray[myArrayIndex][outcomeIndex].soundEffect = rootIcon.scenario.propArray[i][j][1][l].soundEffect; // if propName has not been set in the outcome it must be set here to the current prop so that // the author can just select a change of state without having to always set the prop if (rootIcon.scenario.propArray[i][j][1][l].propName == undefined){ actionArray[myArrayIndex][outcomeIndex].propName = rootIcon.scenario.propArray[i].name; } else { actionArray[myArrayIndex][outcomeIndex].propName = rootIcon.scenario.propArray[i][j][1][l].propName; } actionArray[myArrayIndex][outcomeIndex].propState = rootIcon.scenario.propArray[i][j][1][l].propState; actionArray[myArrayIndex][outcomeIndex].propAction = rootIcon.scenario.propArray[i][j][1][l].propAction; actionArray[myArrayIndex][outcomeIndex].specifiedLoc = rootIcon.scenario.propArray[i][j][1][l].specifiedLoc; actionArray[myArrayIndex][outcomeIndex].destination = rootIcon.scenario.propArray[i][j][1][l].destination; actionArray[myArrayIndex][outcomeIndex].exitNav = rootIcon.scenario.propArray[i][j][1][l].exitNav; } else { outcomeIndex = effectArray[myArrayIndex].length; effectArray[myArrayIndex][outcomeIndex] = new Array(); effectArray[myArrayIndex][outcomeIndex].outcomeText = rootIcon.scenario.propArray[i][j][1][l].outcomeText; effectArray[myArrayIndex][outcomeIndex].score1Inc = rootIcon.scenario.propArray[i][j][1][l].score1Inc; effectArray[myArrayIndex][outcomeIndex].score2Inc = rootIcon.scenario.propArray[i][j][1][l].score2Inc; effectArray[myArrayIndex][outcomeIndex].score3Inc = rootIcon.scenario.propArray[i][j][1][l].score3Inc; effectArray[myArrayIndex][outcomeIndex].soundEffect = rootIcon.scenario.propArray[i][j][1][l].soundEffect; // if propName has not been set in the outcome it must be set here to the current prop so that // the author can just select a change of state without having to always set the prop if (rootIcon.scenario.propArray[i][j][1][l].propName == undefined){ effectArray[myArrayIndex][outcomeIndex].propName = rootIcon.scenario.propArray[i].name; } else { effectArray[myArrayIndex][outcomeIndex].propName = rootIcon.scenario.propArray[i][j][1][l].propName; } effectArray[myArrayIndex][outcomeIndex].propState = rootIcon.scenario.propArray[i][j][1][l].propState; effectArray[myArrayIndex][outcomeIndex].propAction = rootIcon.scenario.propArray[i][j][1][l].propAction; effectArray[myArrayIndex][outcomeIndex].specifiedLoc = rootIcon.scenario.propArray[i][j][1][l].specifiedLoc; effectArray[myArrayIndex][outcomeIndex].destination = rootIcon.scenario.propArray[i][j][1][l].destination; effectArray[myArrayIndex][outcomeIndex].exitNav = rootIcon.scenario.propArray[i][j][1][l].exitNav; } } // allowOutcomes is true } // if we have outcome conditions } // outcomes loop // need to remove the action if it has no outcomes if (currentActionType == "action") { if (actionArray[myArrayIndex].length == 0) { // there are no outcomes actionArray.pop(); } } } // are there outcomes test } // if allowableAction == true } // loop through actions / effects } // propArray[i].length defined } // loop through props } // inSceneArray.length is defined ]]> = pageIcon.templateData.scenario[projPI].scenarioActions[0].userAction[i].actionCondition[j].scoreVal){ // test is current but condition scenario value is not current scenario allowAction = "false"; } break; case "GT": if (testScore <= pageIcon.templateData.scenario[projPI].scenarioActions[0].userAction[i].actionCondition[j].scoreVal){ // test is notCurrent but condition scenario value is the current scenario allowAction = "false"; } break; case "EQ": if (testScore != pageIcon.templateData.scenario[projPI].scenarioActions[0].userAction[i].actionCondition[j].scoreVal){ // test is notCurrent but condition scenario value is the current scenario allowAction = "false"; } break; default: // undefined // reject action as improperly formed condition allowAction = "false"; } // case } // if scoreNumber specified // now test the chanceAct option against a random number if (pageIcon.templateData.scenario[projPI].scenarioActions[0].userAction[i].actionCondition[j].chanceAct != undefined){ // name of scenario in condition // need to test values for scenarioState myRand = Math.floor(Math.random() * 10); // returns 0 through 9 myChanceAct = parseInt(pageIcon.templateData.scenario[projPI].scenarioActions[0].userAction[i].actionCondition[j].chanceAct); if (myRand >= myChanceAct){ allowAction = false; } } // end of all condition checks } // if allowed = true } // end of condition loop j counter } // end of if action conditions.length if (allowAction == "true") { if (pageIcon.templateData.scenario[projPI].scenarioActions[0].userAction[i].actionOutcome.length == undefined){ // there are no outcomes so only use it if it is an effect if (currentActionType == "effect") { // add effect to effect array myArrayIndex = effectArray.length; effectArray[myArrayIndex] = new Array(); effectArray[myArrayIndex].title = pageIcon.templateData.scenario[projPI].scenarioActions[0].userAction[i].title; effectArray[myArrayIndex].actionText = pageIcon.templateData.scenario[projPI].scenarioActions[0].userAction[i].actionText; } } else { // we have at least one outcome so create an entry for the action or effect if (currentActionType == "action") { // create a new actionArray entry myArrayIndex = actionArray.length; actionArray[myArrayIndex] = new Array(); actionArray[myArrayIndex].title = pageIcon.templateData.scenario[projPI].scenarioActions[0].userAction[i].title; actionArray[myArrayIndex].actionText = pageIcon.templateData.scenario[projPI].scenarioActions[0].userAction[i].actionText; } else { // create a new effectArray entry myArrayIndex = effectArray.length; effectArray[myArrayIndex] = new Array(); effectArray[myArrayIndex].title = pageIcon.templateData.scenario[projPI].scenarioActions[0].userAction[i].title; effectArray[myArrayIndex].actionText = pageIcon.templateData.scenario[projPI].scenarioActions[0].userAction[i].actionText; } // now loop through the outcomes adding only those where all outcome conditions are valid for (l = 0; l < pageIcon.templateData.scenario[projPI].scenarioActions[0].userAction[i].actionOutcome.length; l++) { // does the outcome have any outcome conditions? if (pageIcon.templateData.scenario[projPI].scenarioActions[0].userAction[i].actionOutcome[l].length == undefined) { // no conditions so we can simply add the outcome to the action or effect if (currentActionType == "action") { outcomeIndex = actionArray[myArrayIndex].length; actionArray[myArrayIndex][outcomeIndex] = new Array(); actionArray[myArrayIndex][outcomeIndex].name = pageIcon.templateData.scenario[projPI].scenarioActions[0].userAction[i].actionOutcome[l].name; actionArray[myArrayIndex][outcomeIndex].outcomeText = pageIcon.templateData.scenario[projPI].scenarioActions[0].userAction[i].actionOutcome[l].outcomeText; actionArray[myArrayIndex][outcomeIndex].score1Inc = pageIcon.templateData.scenario[projPI].scenarioActions[0].userAction[i].actionOutcome[l].score1Inc; actionArray[myArrayIndex][outcomeIndex].score2Inc = pageIcon.templateData.scenario[projPI].scenarioActions[0].userAction[i].actionOutcome[l].score2Inc; actionArray[myArrayIndex][outcomeIndex].score3Inc = pageIcon.templateData.scenario[projPI].scenarioActions[0].userAction[i].actionOutcome[l].score3Inc; actionArray[myArrayIndex][outcomeIndex].soundEffect = pageIcon.templateData.scenario[projPI].scenarioActions[0].userAction[i].actionOutcome[l].soundEffect; actionArray[myArrayIndex][outcomeIndex].propName = pageIcon.templateData.scenario[projPI].scenarioActions[0].userAction[i].actionOutcome[l].propName; actionArray[myArrayIndex][outcomeIndex].propState = pageIcon.templateData.scenario[projPI].scenarioActions[0].userAction[i].actionOutcome[l].propState; actionArray[myArrayIndex][outcomeIndex].propAction = pageIcon.templateData.scenario[projPI].scenarioActions[0].userAction[i].actionOutcome[l].propAction; actionArray[myArrayIndex][outcomeIndex].specifiedLoc = pageIcon.templateData.scenario[projPI].scenarioActions[0].userAction[i].actionOutcome[l].specifiedLoc; actionArray[myArrayIndex][outcomeIndex].destination = pageIcon.templateData.scenario[projPI].scenarioActions[0].userAction[i].actionOutcome[l].destination; actionArray[myArrayIndex][outcomeIndex].exitNav = pageIcon.templateData.scenario[projPI].scenarioActions[0].userAction[i].actionOutcome[l].exitNav; } else { outcomeIndex = effectArray[myArrayIndex].length; effectArray[myArrayIndex][outcomeIndex] = new Array(); effectArray[myArrayIndex][outcomeIndex].name = pageIcon.templateData.scenario[projPI].scenarioActions[0].userAction[i].actionOutcome[l].name; effectArray[myArrayIndex][outcomeIndex].outcomeText = pageIcon.templateData.scenario[projPI].scenarioActions[0].userAction[i].actionOutcome[l].outcomeText; effectArray[myArrayIndex][outcomeIndex].score1Inc = pageIcon.templateData.scenario[projPI].scenarioActions[0].userAction[i].actionOutcome[l].score1Inc; effectArray[myArrayIndex][outcomeIndex].score2Inc = pageIcon.templateData.scenario[projPI].scenarioActions[0].userAction[i].actionOutcome[l].score2Inc; effectArray[myArrayIndex][outcomeIndex].score3Inc = pageIcon.templateData.scenario[projPI].scenarioActions[0].userAction[i].actionOutcome[l].score3Inc; effectArray[myArrayIndex][outcomeIndex].soundEffect = pageIcon.templateData.scenario[projPI].scenarioActions[0].userAction[i].actionOutcome[l].soundEffect; effectArray[myArrayIndex][outcomeIndex].propName = pageIcon.templateData.scenario[projPI].scenarioActions[0].userAction[i].actionOutcome[l].propName; effectArray[myArrayIndex][outcomeIndex].propState = pageIcon.templateData.scenario[projPI].scenarioActions[0].userAction[i].actionOutcome[l].propState; effectArray[myArrayIndex][outcomeIndex].propAction = pageIcon.templateData.scenario[projPI].scenarioActions[0].userAction[i].actionOutcome[l].propAction; effectArray[myArrayIndex][outcomeIndex].specifiedLoc = pageIcon.templateData.scenario[projPI].scenarioActions[0].userAction[i].actionOutcome[l].specifiedLoc; effectArray[myArrayIndex][outcomeIndex].destination = pageIcon.templateData.scenario[projPI].scenarioActions[0].userAction[i].actionOutcome[l].destination; effectArray[myArrayIndex][outcomeIndex].exitNav = pageIcon.templateData.scenario[projPI].scenarioActions[0].userAction[i].actionOutcome[l].exitNav; } } else { // we have outcome conditions so we must check all outcome conditions // to see if all conditions are met before the action can be added to // the action array allowOutcome = "true"; for (m = 0; m < pageIcon.templateData.scenario[projPI].scenarioActions[0].userAction[i].actionOutcome[l].length; m++) { // looping through the outcomeConditions and test them thisProp = pageIcon.templateData.scenario[projPI].scenarioActions[0].userAction[i].actionOutcome[l].outcomeCondition[m].propName; thisPropIndex = rootIcon.scenario.propIndexArray.findValue(thisProp); // test for propState if (pageIcon.templateData.scenario[projPI].scenarioActions[0].userAction[i].actionOutcome[l].outcomeCondition[m].propState != undefined){ // we have a prop related condition so find out which prop it relates to // confirm prop exists if (thisPropIndex == -1){ allowOutcome = "false"; // prop not found } else { // now test for propState conditions switch(pageIcon.templateData.scenario[projPI].scenarioActions[0].userAction[i].actionOutcome[l].outcomeCondition[m].propState){ // prop that is the subject of the condition may not be the same as the prop that has the action case "visible": if (visibleArray.findValue(thisPropIndex) == -1){ // prop is not present in presentArray allowOutcome = "false"; } break; case "hidden": if (hiddenArray.findValue(thisPropIndex) == -1){ // prop not in absent list allowOutcome = "false"; } break; default: // undefined // no action required if no propState value specified } // end switch case propState } // this propIndex } // propState not undefined // end of propState tests // test for propLoc if (pageIcon.templateData.scenario[projPI].scenarioActions[0].userAction[i].actionOutcome[l].outcomeCondition[m].propLoc != undefined){ // we have a prop related condition so find out which prop it relates to // confirm prop exists if (thisPropIndex == -1){ allowOutcome = "false"; // prop not found } else { // now test for propLoc conditions switch(pageIcon.templateData.scenario[projPI].scenarioActions[0].userAction[i].actionOutcome[l].outcomeCondition[m].propLoc){ // prop that is the subject of the condition may not be the same as the prop that has the action case "onStage": if (onStageArray.findValue(thisPropIndex) == -1){ // prop is not present in presentArray allowOutcome = "false"; } break; case "carried": if (carriedArray.findValue(thisPropIndex) == -1){ // prop not in absent list allowOutcome = "false"; } break; case "offStage": if (offStageArray.findValue(thisPropIndex) == -1){ // not carried; allowOutcome = "false"; } break; case "notOnStage": if (notOnStageArray.findValue(thisPropIndex) == -1){ // not carried; allowOutcome = "false"; } break; case "notCarried": if (notCarriedArray.findValue(thisPropIndex) == -1){ // carried; allowOutcome = "false"; } break; case "inScene": if (inSceneArray.findValue(thisPropIndex) == -1){ // carried; allowOutcome = "false"; } break; default: // undefined // no action required if no propState value specified } // end switch case propState } // this propIndex } // propLoc not undefined // end of propLoc tests // now test the scenario related options if (pageIcon.templateData.scenario[projPI].scenarioActions[0].userAction[i].actionOutcome[l].outcomeCondition[m].scenarioID != undefined){ // name of scenario in condition // need to test values for scenarioState switch(pageIcon.templateData.scenario[projPI].scenarioActions[0].userAction[i].actionOutcome[l].outcomeCondition[m].scenarioState){ // prop that is the subject of the condition may not be the same as the prop that has the action case "current": if (pageIcon.templateData.scenario[projPI].scenarioActions[0].userAction[i].actionOutcome[l].outcomeCondition[m].scenarioID != currentscenario){ // test is current but condition scenario value is not current scenario allowOutcome = "false"; } break; case "notCurrent": if (pageIcon.templateData.scenario[projPI].scenarioActions[0].userAction[i].actionOutcome[l].outcomeCondition[m].scenarioID == currentscenario){ // test is notCurrent but condition scenario value is the current scenario allowOutcome = "false"; } break; default: // undefined // reject action as improperly formed condition allowOutcome = "false"; } // switch } // if scenarioID specified // now test for score value if (pageIcon.templateData.scenario[projPI].scenarioActions[0].userAction[i].actionOutcome[l].outcomeCondition[m].scoreNumber != undefined){ // name of scenario in condition // need to test values for specified score switch(pageIcon.templateData.scenario[projPI].scenarioActions[0].userAction[i].actionOutcome[l].outcomeCondition[m].scoreNumber){ case "1": testScore = rootIcon.scenario.scoreArray[0].score; break; case "2": testScore = rootIcon.scenario.scoreArray[1].score; break; case "3": testScore = rootIcon.scenario.scoreArray[2].score; break; case "4": // inventory testScore = inventoryArray.length; break; default: // undefined // reject action as improperly formed condition allowOutcome = "false"; } // switch switch(pageIcon.templateData.scenario[projPI].scenarioActions[0].userAction[i].actionOutcome[l].outcomeCondition[m].scoreComp){ // prop that is the subject of the condition may not be the same as the prop that has the action case "LT": if (testScore >= pageIcon.templateData.scenario[projPI].scenarioActions[0].userAction[i].actionOutcome[l].outcomeCondition[m].scoreVal){ // test is current but condition scenario value is not current scenario allowOutcome = "false"; } break; case "GT": if (testScore <= pageIcon.templateData.scenario[projPI].scenarioActions[0].userAction[i].actionOutcome[l].outcomeCondition[m].scoreVal){ // test is notCurrent but condition scenario value is the current scenario allowOutcome = "false"; } break; case "EQ": if (testScore != pageIcon.templateData.scenario[projPI].scenarioActions[0].userAction[i].actionOutcome[l].outcomeCondition[m].scoreVal){ // test is notCurrent but condition scenario value is the current scenario allowOutcome = "false"; } break; default: // undefined // reject action as improperly formed condition allowOutcome = "false"; } // switch } // if scoreNumber specified // now test the chanceAct option against a random number if (pageIcon.templateData.scenario[projPI].scenarioActions[0].userAction[i].actionOutcome[l].outcomeCondition[m].chanceAct != undefined){ // // need to test values for scenarioState myRand = Math.floor(Math.random() * 10); // returns 0 through 9 myChanceAct = parseInt(pageIcon.templateData.scenario[projPI].scenarioActions[0].userAction[i].actionOutcome[l].outcomeCondition[m].chanceAct); if (myRand >= myChanceAct){ allowOutcome = "false"; } } } // outcome condition loop if (allowOutcome == "true") { // add outcome to effect or action if (currentActionType == "action") { outcomeIndex = actionArray[myArrayIndex].length; actionArray[myArrayIndex][outcomeIndex] = new Array(); actionArray[myArrayIndex][outcomeIndex].name = pageIcon.templateData.scenario[projPI].scenarioActions[0].userAction[i].actionOutcome[l].name; actionArray[myArrayIndex][outcomeIndex].outcomeText = pageIcon.templateData.scenario[projPI].scenarioActions[0].userAction[i].actionOutcome[l].outcomeText; actionArray[myArrayIndex][outcomeIndex].score1Inc = pageIcon.templateData.scenario[projPI].scenarioActions[0].userAction[i].actionOutcome[l].score1Inc; actionArray[myArrayIndex][outcomeIndex].score2Inc = pageIcon.templateData.scenario[projPI].scenarioActions[0].userAction[i].actionOutcome[l].score2Inc; actionArray[myArrayIndex][outcomeIndex].score3Inc = pageIcon.templateData.scenario[projPI].scenarioActions[0].userAction[i].actionOutcome[l].score3Inc; actionArray[myArrayIndex][outcomeIndex].soundEffect = pageIcon.templateData.scenario[projPI].scenarioActions[0].userAction[i].actionOutcome[l].soundEffect; actionArray[myArrayIndex][outcomeIndex].propName = pageIcon.templateData.scenario[projPI].scenarioActions[0].userAction[i].actionOutcome[l].propName; actionArray[myArrayIndex][outcomeIndex].propState = pageIcon.templateData.scenario[projPI].scenarioActions[0].userAction[i].actionOutcome[l].propState; actionArray[myArrayIndex][outcomeIndex].propAction = pageIcon.templateData.scenario[projPI].scenarioActions[0].userAction[i].actionOutcome[l].propAction; actionArray[myArrayIndex][outcomeIndex].specifiedLoc = pageIcon.templateData.scenario[projPI].scenarioActions[0].userAction[i].actionOutcome[l].specifiedLoc; actionArray[myArrayIndex][outcomeIndex].destination = pageIcon.templateData.scenario[projPI].scenarioActions[0].userAction[i].actionOutcome[l].destination; actionArray[myArrayIndex][outcomeIndex].exitNav = pageIcon.templateData.scenario[projPI].scenarioActions[0].userAction[i].actionOutcome[l].exitNav; } else { outcomeIndex = effectArray[myArrayIndex].length; effectArray[myArrayIndex][outcomeIndex] = new Array(); effectArray[myArrayIndex][outcomeIndex].name = pageIcon.templateData.scenario[projPI].scenarioActions[0].userAction[i].actionOutcome[l].name; effectArray[myArrayIndex][outcomeIndex].outcomeText = pageIcon.templateData.scenario[projPI].scenarioActions[0].userAction[i].actionOutcome[l].outcomeText; effectArray[myArrayIndex][outcomeIndex].score1Inc = pageIcon.templateData.scenario[projPI].scenarioActions[0].userAction[i].actionOutcome[l].score1Inc; effectArray[myArrayIndex][outcomeIndex].score2Inc = pageIcon.templateData.scenario[projPI].scenarioActions[0].userAction[i].actionOutcome[l].score2Inc; effectArray[myArrayIndex][outcomeIndex].score3Inc = pageIcon.templateData.scenario[projPI].scenarioActions[0].userAction[i].actionOutcome[l].score3Inc; effectArray[myArrayIndex][outcomeIndex].soundEffect = pageIcon.templateData.scenario[projPI].scenarioActions[0].userAction[i].actionOutcome[l].soundEffect; effectArray[myArrayIndex][outcomeIndex].propName = pageIcon.templateData.scenario[projPI].scenarioActions[0].userAction[i].actionOutcome[l].propName; effectArray[myArrayIndex][outcomeIndex].propState = pageIcon.templateData.scenario[projPI].scenarioActions[0].userAction[i].actionOutcome[l].propState; effectArray[myArrayIndex][outcomeIndex].propAction = pageIcon.templateData.scenario[projPI].scenarioActions[0].userAction[i].actionOutcome[l].propAction; effectArray[myArrayIndex][outcomeIndex].specifiedLoc = pageIcon.templateData.scenario[projPI].scenarioActions[0].userAction[i].actionOutcome[l].specifiedLoc; effectArray[myArrayIndex][outcomeIndex].destination = pageIcon.templateData.scenario[projPI].scenarioActions[0].userAction[i].actionOutcome[l].destination; effectArray[myArrayIndex][outcomeIndex].exitNav = pageIcon.templateData.scenario[projPI].scenarioActions[0].userAction[i].actionOutcome[l].exitNav; } } // allowOutcomes is true } // if we have outcome conditions } // outcomes loop // need to remove the action if it has no outcomes if (currentActionType == "action") { if (actionArray[myArrayIndex].length == 0) { // there are no outcomes actionArray.pop(); } } } // are there outcomes test } // if allowableAction == true } // loop through actions / effects } // if there are user actions ]]> parseInt(rootIcon.scenario.scoreArray[scoreIndex].maxScore)){ // score above highest setting if (rootIcon.scenario.scoreArray[scoreIndex].lose == "max"){ // this score loses the game rootIcon.scenario.scoreArray[scoreIndex].endGameState = "L"; rootIcon.scenario.scoreArray[scoreIndex].score = parseInt(rootIcon.scenario.scoreArray[scoreIndex].minScore); if (rootIcon.scenario.scoreArray.loseEffect != undefined){ narration = rootIcon.scenario.scoreArray.loseEffect; rootIcon.broadcast('showAudio'); } rootIcon.broadcast('onGameEnd'); } else if (rootIcon.scenario.scoreArray[scoreIndex].win == "max") { // this score wins the game rootIcon.scenario.scoreArray[scoreIndex].endGameState = "W"; rootIcon.scenario.scoreArray[scoreIndex].score = parseInt(rootIcon.scenario.scoreArray[scoreIndex].maxScore); if (rootIcon.scenario.scoreArray.winEffect != undefined){ narration = rootIcon.scenario.scoreArray.winEffect; rootIcon.broadcast('showAudio'); } rootIcon.broadcast('onGameEnd'); } else { rootIcon.scenario.scoreArray[scoreIndex].score = parseInt(rootIcon.scenario.scoreArray[scoreIndex].maxScore); } }]]> "; if (i < 2){ scoreString = scoreString + "
"; } } } // help the page author by reminding them if (pageMode = "development"){ if (scoreString == "" || scoreString == undefined){ scoreString = rootIcon.scenario.lang[0].scoresDebugMessage; } } ]]>
" + scenarioTitle + ""); fnPropAction(); // call function to set up prop based actions fnscenarioAction(); // call function to set up scenario based actions scenarioDesc = pageIcon.templateData.scenario[projPI].description; // add any effects and their outcomes to the scenario //effectList = ""; if (effectArray.length != undefined){ scenarioDesc = scenarioDesc + "

"; for (i = 0; i < effectArray.length; i++) { // go through each effect that has by now been checked for action conditions being met // we still have to consider outcomeConditions if (!(effectArray[i].actionText == undefined || effectArray[i] == "")){ scenarioDesc = scenarioDesc + "
" + effectArray[i].actionText; } if (effectArray[i].length != undefined) { // there are outcomes for (j = 0; j < effectArray[i].length; j++) { allowOutcome = "true"; // need to set up test for outcomeConditions here if (effectArray[i][j].length != undefined) { // we have outcome conditions for (k = 0; k < effectArray[i][j].length; k++) { // we have outcomeConditions for this outcome if (effectArray[i][j][k].propName != undefined) { thisProp = effectArray[i][j][k].propName; // find array for this prop thisPropIndex = rootIcon.scenario.propIndexArray.findValue(thisProp); if (thisPropIndex != -1){ // prop can be found switch(effectArray[i][j][k].propState){ case "visible": if (visibleArray.findValue(thisPropIndex) == -1){ // prop is not present in visibleArray allowOutcome = "false"; } break; case "hidden": if (hiddenArray.findValue(thisPropIndex) == -1){ // not hiding; allowOutcome = "false"; } break; default: // undefined } // switch case propLoc switch(effectArray[i][j][k].propLoc){ case "onStage": if (onStageArray.findValue(thisPropIndex) == -1) { // prop is not present in presentArray allowOutcome = "false"; } break; case "carried": if (carriedArray.findValue(thisPropIndex) == -1){ // carried; allowOutcome = "false"; } break; case "offStage": if (offStageArray.findValue(thisPropIndex) == -1){ allowOutcome = "false"; } break; case "notOnStage": if (notOnStageArray.findValue(thisPropIndex) == -1){ // not hiding; allowOutcome = "false"; } break; case "notCarried": if (notCarriedArray.findValue(thisPropIndex) == -1){ // not carried; allowOutcome = "false"; } break; case "inScene": if (inSceneArray.findValue(thisPropIndex) == -1){ // not accessible; allowOutcome = "false"; } break; default: // undefined // no action required if no propState value specified } // end switch case propState } else { // this prop does not exist in propIndexArray allowOutcome = "false"; } // end if propIndex test } // if propName undefined - end of prop condition tests // now test the scenario related options if (effectArray[i][j][k].scenarioID != undefined){ // name of scenario in condition // need to test values for scenarioState switch(effectArray[i][j][k].scenarioState){ // prop that is the subject of the condition may not be the same as the prop that has the action case "current": if (effectArray[i][j][k].scenarioID != currentscenario){ // test is current but condition scenario value is not current scenario allowOutcome = "false"; } break; case "notCurrent": if (effectArray[i][j][k].scenarioID == currentscenario){ // test is notCurrent but condition scenario value is the current scenario allowOutcome = "false"; } break; default: // undefined // reject action as improperly formed condition allowOutcome = "false"; } // switch } // if scenarioID specified // now test for score value if (effectArray[i][j][k].scoreNumber != undefined){ // name of scenario in condition // need to test values for specified score switch(effectArray[i][j][k].scoreNumber){ case "1": testScore = rootIcon.scenario.scoreArray[0].score; break; case "2": testScore = rootIcon.scenario.scoreArray[1].score; break; case "3": testScore = rootIcon.scenario.scoreArray[2].score; break; case "4": // inventory testScore = inventoryArray.length; break; default: // undefined // reject action as improperly formed condition allowOutcome = "false"; } switch(effectArray[i][j][k].scoreComp){ // prop that is the subject of the condition may not be the same as the prop that has the action case "LT": if (testScore >= effectArray[i][j][k].scoreVal){ // test is current but condition scenario value is not current scenario allowOutcome = "false"; } break; case "GT": if (testScore <= effectArray[i][j][k].scoreVal){ // test is notCurrent but condition scenario value is the current scenario allowOutcome = "false"; } break; case "EQ": if (effectArray[i][j][k].scoreVal){ // test is notCurrent but condition scenario value is the current scenario allowOutcome = "false"; } break; default: // undefined // reject action as improperly formed condition allowOutcome = "false"; } // switch } // if scoreNumber specified // now test the chanceAct option against a random number if (effectArray[i][j][k].chanceAct != undefined){ // name of scenario in condition // need to test values for scenarioState myRand = Math.floor(Math.random() * 10); // returns 0 through 9 myChanceAct = parseInt(effectArray[i][j][k].chanceAct); if (myRand >= myChanceAct){ allowOutcome = "false"; } } } // end of outcomeCondition tests loop // process outcomes of effect only if allowOutcome == "true" if (allowOutcome == "true") { if (!(effectArray[i][j].outcomeText == undefined !! effectArray[i][j].outcomeText == "")){ scenarioDesc = scenarioDesc + "
" + effectArray[i][j].outcomeText; // add processing of other outcomes here // handle any score increments if (effectArray[i][j].score1Inc != undefined){ scoreIndex = 0; scoreInc = parseInt(effectArray[i][j].score1Inc); fnUpdateScore(); } if (effectArray[i][j].score2Inc != undefined){ scoreIndex = 1; scoreInc = parseInt(effectArray[i][j].score2Inc); fnUpdateScore(); } if (effectArray[i][j].score3Inc != undefined){ scoreIndex = 2; scoreInc = parseInt(effectArray[i][j].score3Inc); fnUpdateScore(); } // handle changes to a prop if (effectArray[i][j].propName != undefined){ // identify the prop outcomeProp = effectArray[i][j].propName; outcomePropIndex = rootIcon.scenario.propIndexArray.findValue(outcomeProp); if (outcomePropIndex != -1){ // the prop has been found switch(effectArray[i][j].propState){ case "show": rootIcon.scenario.propArray[outcomePropIndex].state = "visible"; break; case "hide": rootIcon.scenario.propArray[outcomePropIndex].state = "hidden"; break; case "carry": rootIcon.scenario.propArray[outcomePropIndex].scenario = "Inventory"; break; case "drop": rootIcon.scenario.propArray[outcomePropIndex].scenario = currentscenario; break; case "offStage": rootIcon.scenario.propArray[outcomePropIndex].scenario = "Off Stage"; break; default } // switch } // if outcomePropIndex } // if actionArray.Propname // play soundEffect if one has been provided if (effectArray[i][j].soundEffect != undefined){ // play sound narration = effectArray[i][j].soundEffect; // do not broadcast showAudio event from inside the function as this will // stop the hot text working } // destination change not implemented for effects as this could be confusing // and is inconsistent with the concept of an effect } } } } } } } // add list of props present at the scenario //if (presentArray.length > 0){ if (propsInscenarioArray.length > 0){ // scenarioDesc = scenarioDesc + "

" + rootIcon.scenario.lang[0].scenarioPropsTitle + " " + presentArray.length + " " + rootIcon.scenario.lang[0].scenarioPropsName + "

"; // for (i=0; i < presentArray.length; i++){ scenarioDesc = scenarioDesc + "

" + rootIcon.scenario.lang[0].scenarioPropsTitle + " " + propsInscenarioArray.length + " " + rootIcon.scenario.lang[0].scenarioPropsName + "

"; for (i=0; i < propsInscenarioArray.length; i++){ // list each item in present array to be displayed under the scenario description as hot text items scenarioDesc = scenarioDesc + '
  • ' + propsInscenarioArray[i].title+ '
  • '; } } scenarioDescText.setText(scenarioDesc); // set up actions actionList = ""; if (actionArray.length != undefined){ for (i=0; i < actionArray.length; i++){ actionList = actionList + '' + actionArray[i].title + '

    '; } } actionListText.setText(actionList); // inventory list invList = ""; if (inventoryArray.length > 0){ inventoryDesc = rootIcon.scenario.lang[0].inventoryTitle + " " + inventoryArray.length + " " + rootIcon.scenario.lang[0].inventoryItemName; for (i=0; i < inventoryArray.length; i++){ invList = invList + '
  • ' + inventoryArray[i].title + '
  • '; } } else { invList = rootIcon.scenario.lang[0].inventoryEmpty; inventoryDesc = rootIcon.scenario.lang[0].inventoryTitle; } inventoryListText.setText(invList); inventoryTitleText.setText("" + inventoryDesc + ""); // scores fnScoreDisplay(); scoreText.setText(scoreString); ]]>
    " + rootIcon.scenario.lang[0].actionTitle + ""}]]> " + rootIcon.scenario.lang[0].scoresTitle + ""}]]>
    "; // loop through actionArray outcomes for this action (there is only one action here selected by the user!) for (i = 0; i < actionArray[outcomeIndex].length; i++) { // loop through the outcomes actionOutcomeText = actionOutcomeText + actionArray[outcomeIndex][i].outcomeText + "
    "; // handle any score increments if (actionArray[outcomeIndex][i].score1Inc != undefined){ scoreIndex = 0; scoreInc = parseInt(actionArray[outcomeIndex][i].score1Inc); fnUpdateScore(); } if (actionArray[outcomeIndex][i].score2Inc != undefined){ scoreIndex = 1; scoreInc = parseInt(actionArray[outcomeIndex][i].score2Inc); fnUpdateScore(); } if (actionArray[outcomeIndex][i].score3Inc != undefined){ scoreIndex = 2; scoreInc = parseInt(actionArray[outcomeIndex][i].score3Inc); fnUpdateScore(); } // handle changes to a prop if (actionArray[outcomeIndex][i].propName != undefined){ // identify the prop outcomeProp = actionArray[outcomeIndex][i].propName; outcomePropIndex = rootIcon.scenario.propIndexArray.findValue(outcomeProp); if (outcomePropIndex != -1){ // the prop has been found // do state switch(actionArray[outcomeIndex][i].propState){ case "visible": rootIcon.scenario.propArray[outcomePropIndex].state = "visible"; break; case "hidden": rootIcon.scenario.propArray[outcomePropIndex].state = "hidden"; break; default: // do nothing } // switch // do propAction switch(actionArray[outcomeIndex][i].propAction){ case "carry": rootIcon.scenario.propArray[outcomePropIndex].scenario = "Inventory"; break; case "drop": rootIcon.scenario.propArray[outcomePropIndex].scenario = currentscenario; break; case "specified": // check if specified location exists propScenarioIndex = rootIcon.scenario.scenarioIndexArray.findValue(actionArray[outcomeIndex][i].specifiedLoc); if (propScenarioIndex != -1){ rootIcon.scenario.propArray[outcomePropIndex].scenario = specifiedLoc; } break; case "destroy": rootIcon.scenario.propArray[outcomePropIndex].scenario = "Off Stage"; break; default: // do nothing } // switch } // if outcomePropIndex } // if actionArray.Propname // play soundEffect if one has been provided if (actionArray[outcomeIndex][i].soundEffect != undefined){ // play sound narration = actionArray[outcomeIndex][i].soundEffect; rootIcon.broadcast('showAudio'); } // now need to set up the destination if (actionArray[outcomeIndex][i].destination != undefined){ destPageName = actionArray[outcomeIndex][i].destination; exitNav = actionArray[outcomeIndex][i].exitNav; } } // outcome index loop } //outcomeIndex undefined } else if (actionSource == "I"){ // inventory list item selected actionOutcomeText = inventoryArray[outcomeIndex].description; } else { // you can see list actionOutcomeText = propsInscenarioArray[outcomeIndex].description } actionText.setText(actionOutcomeText); actionText._visible = true; largePanel._visible = true;]]>
    " + destPageName + "
    " + notFoundMessage) } } } if ((pageFound == "false") && (pageMode == "development")){ txtPageNotFound.clear(); // txtPageNotFound.setText("Page name
    " + destPageName + "
    cannot be found
    in the
    Interface"); // set up page not found text box txtPageNotFound.beginFill(0xFFFFCC, 100); txtPageNotFound.lineStyle(1,0x000000,100); // txtPageNotFound.drawRect(-10,-10,250,200,20); txtPageNotFound.drawRect(0,0,txtPageNotFoundw,txtPageNotFoundh,10); txtPageNotFound.dropShadow(7,45,0x999999,50); txtPageNotFound._visible = 1; txtPageNotFound.wipe('in',0.25,'Strong','easeIn',2) } ]]>
    " + rootIcon.scenario.scoreArray[i].winMessage; } else if (rootIcon.scenario.scoreArray[i].endGameState == "L") { gameOverText = gameOverText + "
    " + rootIcon.scenario.scoreArray[i].loseMessage; } } endGameText.setText(gameOverText); endGameText._visible = true; largePanelGE._visible = true; // destroy simulation array so that initialisation will be triggered rootIcon.scenario.splice(0); rootIcon.scenario = null; ]]>
    \ No newline at end of file + '; clipBoardText = clipBoardText + chr(13) + chr(10); clipBoardText = clipBoardText + '' + reportTitle + ''; clipBoardText = clipBoardText + chr(13) + chr(10); clipBoardText = clipBoardText + '' + chr(13) + chr(10); clipBoardText = clipBoardText + '' + chr(13) + chr(10); for (i = 0; i < pageID_array.length; i++){ clipBoardText = clipBoardText + '' + chr(13) + chr(10); } clipBoardText = clipBoardText + '
    ' + pageLabel + '' + titleLabel + '' + idLabel + '
    ' + (i + 1) + '' + pageTitle_array[i] + '' + pageID_array[i] + '
    ' + chr(13) + chr(10); System.setClipboard(clipBoardText); } else { // do nothing }]]>
    = rootIcon.scenario.propArray[i][j][0][k].scoreVal){ // test is current but condition scenario value is not current scenario allowAction = "false"; } break; case "GT": if (testScore <= rootIcon.scenario.propArray[i][j][0][k].scoreVal){ // test is notCurrent but condition scenario value is the current scenario allowAction = "false"; } break; case "EQ": if (testScore != rootIcon.scenario.propArray[i][j][0][k].scoreVal){ // test is notCurrent but condition scenario value is the current scenario allowAction = "false"; } break; default: // undefined // reject action as improperly formed condition allowAction = "false"; } // switch } // if scoreNumber specified // now test the chanceAct option against a random number if (rootIcon.scenario.propArray[i][j][0][k].chanceAct != undefined){ // // need to test values for scenarioState myRand = Math.floor(Math.random() * 10); // returns 0 through 9 myChanceAct = parseInt(rootIcon.scenario.propArray[i][j][0][k].chanceAct); if (myRand >= myChanceAct){ allowAction = "false"; } } } // allowAction test } // end condition loop // still looping through actions if (allowAction == "true") { if (rootIcon.scenario.propArray[i][j][1].length == undefined) { // there are no outcomes so only use it if it is an effect if (currentActionType == "effect") { // add effect to effect array myArrayIndex = effectArray.length; effectArray[myArrayIndex] = new Array(); effectArray[myArrayIndex].title = rootIcon.scenario.propArray[i][j].title; effectArray[myArrayIndex].actionText = rootIcon.scenario.propArray[i][j].actionText; } } else { // we have at least one outcome so create an entry for the action or effect if (currentActionType == "action") { // create a new actionArray entry myArrayIndex = actionArray.length; actionArray[myArrayIndex] = new Array(); actionArray[myArrayIndex].title = rootIcon.scenario.propArray[i][j].title; actionArray[myArrayIndex].actionText = rootIcon.scenario.propArray[i][j].actionText; } else { // create a new effectArray entry myArrayIndex = effectArray.length; effectArray[myArrayIndex] = new Array(); effectArray[myArrayIndex].title = rootIcon.scenario.propArray[i][j].title; effectArray[myArrayIndex].actionText = rootIcon.scenario.propArray[i][j].actionText; } // now loop through the outcomes adding only those where all outcome conditions are valid for (l = 0; l < rootIcon.scenario.propArray[i][j][1].length; l++) { // does the outcome have any outcome conditions? if (rootIcon.scenario.propArray[i][j][1][l].length == undefined) { // no conditions so we can simply add the outcome to the action or effect if (currentActionType == "action") { outcomeIndex = actionArray[myArrayIndex].length; actionArray[myArrayIndex][outcomeIndex] = new Array(); actionArray[myArrayIndex][outcomeIndex].outcomeText = rootIcon.scenario.propArray[i][j][1][l].outcomeText; actionArray[myArrayIndex][outcomeIndex].score1Inc = rootIcon.scenario.propArray[i][j][1][l].score1Inc; actionArray[myArrayIndex][outcomeIndex].score2Inc = rootIcon.scenario.propArray[i][j][1][l].score2Inc; actionArray[myArrayIndex][outcomeIndex].score3Inc = rootIcon.scenario.propArray[i][j][1][l].score3Inc; actionArray[myArrayIndex][outcomeIndex].soundEffect = rootIcon.scenario.propArray[i][j][1][l].soundEffect; // if propName has not been set in the outcome it must be set here to the current prop so that // the author can just select a change of state without having to always set the prop if (rootIcon.scenario.propArray[i][j][1][l].propName == undefined){ actionArray[myArrayIndex][outcomeIndex].propName = rootIcon.scenario.propArray[i].name; } else { actionArray[myArrayIndex][outcomeIndex].propName = rootIcon.scenario.propArray[i][j][1][l].propName; } actionArray[myArrayIndex][outcomeIndex].propState = rootIcon.scenario.propArray[i][j][1][l].propState; actionArray[myArrayIndex][outcomeIndex].propAction = rootIcon.scenario.propArray[i][j][1][l].propAction; actionArray[myArrayIndex][outcomeIndex].specifiedLoc = rootIcon.scenario.propArray[i][j][1][l].specifiedLoc; actionArray[myArrayIndex][outcomeIndex].destination = rootIcon.scenario.propArray[i][j][1][l].destination; actionArray[myArrayIndex][outcomeIndex].exitNav = rootIcon.scenario.propArray[i][j][1][l].exitNav; } else { outcomeIndex = effectArray[myArrayIndex].length; effectArray[myArrayIndex][outcomeIndex] = new Array(); effectArray[myArrayIndex][outcomeIndex].outcomeText = rootIcon.scenario.propArray[i][j][1][l].outcomeText; effectArray[myArrayIndex][outcomeIndex].score1Inc = rootIcon.scenario.propArray[i][j][1][l].score1Inc; effectArray[myArrayIndex][outcomeIndex].score2Inc = rootIcon.scenario.propArray[i][j][1][l].score2Inc; effectArray[myArrayIndex][outcomeIndex].score3Inc = rootIcon.scenario.propArray[i][j][1][l].score3Inc; effectArray[myArrayIndex][outcomeIndex].soundEffect = rootIcon.scenario.propArray[i][j][1][l].soundEffect; // if propName has not been set in the outcome it must be set here to the current prop so that // the author can just select a change of state without having to always set the prop if (rootIcon.scenario.propArray[i][j][1][l].propName == undefined){ effectArray[myArrayIndex][outcomeIndex].propName = rootIcon.scenario.propArray[i].name; } else { effectArray[myArrayIndex][outcomeIndex].propName = rootIcon.scenario.propArray[i][j][1][l].propName; } effectArray[myArrayIndex][outcomeIndex].propState = rootIcon.scenario.propArray[i][j][1][l].propState; effectArray[myArrayIndex][outcomeIndex].propAction = rootIcon.scenario.propArray[i][j][1][l].propAction; effectArray[myArrayIndex][outcomeIndex].specifiedLoc = rootIcon.scenario.propArray[i][j][1][l].specifiedLoc; effectArray[myArrayIndex][outcomeIndex].destination = rootIcon.scenario.propArray[i][j][1][l].destination; effectArray[myArrayIndex][outcomeIndex].exitNav = rootIcon.scenario.propArray[i][j][1][l].exitNav; } } else { // we have outcome conditions so we must check all outcome conditions // to see if all conditions are met before the action can be added to // the action array allowOutcome = "true"; for (m = 0; m < rootIcon.scenario.propArray[i][j][1][l].length; m++) { // looping through the outcomeConditions and test them // check which prop we using in this condition for conditions that relate to a prop if (rootIcon.scenario.propArray[i][j][1][l][m].propName == undefined){ thisProp = rootIcon.scenario.propArray[i].name; thisPropIndex = i; } else { thisProp = rootIcon.scenario.propArray[i][j][1][l][m].propName; thisPropIndex = rootIcon.scenario.propIndexArray.findValue(thisProp); } // test for propState if (rootIcon.scenario.propArray[i][j][1][l][m].propState != undefined){ // we have a prop related condition so find out which prop it relates to // confirm prop exists if (thisPropIndex == -1){ allowOutcome = "false"; // prop not found } else { // now test for propState conditions switch(rootIcon.scenario.propArray[i][j][1][l][m].propState){ // prop that is the subject of the condition may not be the same as the prop that has the action case "visible": if (visibleArray.findValue(thisPropIndex) == -1){ // prop is not present in presentArray allowOutcome = "false"; } break; case "hidden": if (hiddenArray.findValue(thisPropIndex) == -1){ // prop not in absent list allowOutcome = "false"; } break; default: // undefined // no action required if no propState value specified } // end switch case propState } // this propIndex } // propState not undefined // end of propState tests // test for propLoc if (rootIcon.scenario.propArray[i][j][1][l][m].propLoc != undefined){ // we have a prop related condition so find out which prop it relates to // confirm prop exists if (thisPropIndex == -1){ allowOutcome = "false"; // prop not found } else { // now test for propLoc conditions switch(rootIcon.scenario.propArray[i][j][1][l][m].propLoc){ // prop that is the subject of the condition may not be the same as the prop that has the action case "onStage": if (onStageArray.findValue(thisPropIndex) == -1){ // prop is not present in presentArray allowOutcome = "false"; } break; case "carried": if (carriedArray.findValue(thisPropIndex) == -1){ // prop not in absent list allowOutcome = "false"; } break; case "offStage": if (offStageArray.findValue(thisPropIndex) == -1){ // not carried; allowOutcome = "false"; } break; case "notOnStage": if (notOnStageArray.findValue(thisPropIndex) == -1){ // not carried; allowOutcome = "false"; } break; case "notCarried": if (notCarriedArray.findValue(thisPropIndex) == -1){ // carried; allowOutcome = "false"; } break; case "inScene": if (inSceneArray.findValue(thisPropIndex) == -1){ // carried; allowOutcome = "false"; } break; default: // undefined // no action required if no propState value specified } // end switch case propState } // this propIndex } // propLoc not undefined // end of propLoc tests // now test the scenario related options if (rootIcon.scenario.propArray[i][j][1][l][m].scenarioID != undefined){ // name of scenario in condition // need to test values for scenarioState switch(rootIcon.scenario.propArray[i][j][1][l][m].scenarioState){ // prop that is the subject of the condition may not be the same as the prop that has the action case "current": if (rootIcon.scenario.propArray[i][j][1][l][m].scenarioID != currentscenario){ // test is current but condition scenario value is not current scenario allowOutcome = "false"; } break; case "notCurrent": if (rootIcon.scenario.propArray[i][j][1][l][m].scenarioID == currentscenario){ // test is notCurrent but condition scenario value is the current scenario allowOutcome = "false"; } break; default: // undefined // reject action as improperly formed condition allowOutcome = "false"; } // switch } // if scenarioID specified // now test for score value if (rootIcon.scenario.propArray[i][j][1][l][m].scoreNumber != undefined){ // name of scenario in condition // need to test values for specified score switch(rootIcon.scenario.propArray[i][j][1][l][m].scoreNumber){ case "1": testScore = rootIcon.scenario.scoreArray[0].score; break; case "2": testScore = rootIcon.scenario.scoreArray[1].score; break; case "3": testScore = rootIcon.scenario.scoreArray[2].score; break; case "4": // inventory testScore = inventoryArray.length; break; default: // undefined // reject action as improperly formed condition allowOutcome = "false"; } // switch switch(rootIcon.scenario.propArray[i][j][1][l][m].scoreComp){ // prop that is the subject of the condition may not be the same as the prop that has the action case "LT": if (testScore >= rootIcon.scenario.propArray[i][j][1][l][m].scoreVal){ // test is current but condition scenario value is not current scenario allowOutcome = "false"; } break; case "GT": if (testScore <= rootIcon.scenario.propArray[i][j][1][l][m].scoreVal){ // test is notCurrent but condition scenario value is the current scenario allowOutcome = "false"; } break; case "EQ": if (testScore != rootIcon.scenario.propArray[i][j][1][l][m].scoreVal){ // test is notCurrent but condition scenario value is the current scenario allowOutcome = "false"; } break; default: // undefined // reject action as improperly formed condition allowOutcome = "false"; } // switch } // if scoreNumber specified // now test the chanceAct option against a random number if (rootIcon.scenario.propArray[i][j][1][l][m].chanceAct != undefined){ // // need to test values for scenarioState myRand = Math.floor(Math.random() * 10); // returns 0 through 9 myChanceAct = parseInt(rootIcon.scenario.propArray[i][j][1][l][m].chanceAct); if (myRand >= myChanceAct){ allowOutcome = "false"; } } } // outcome condition loop if (allowOutcome == "true") { // add outcome to effect or action if (currentActionType == "action") { outcomeIndex = actionArray[myArrayIndex].length; actionArray[myArrayIndex][outcomeIndex] = new Array(); actionArray[myArrayIndex][outcomeIndex].name = rootIcon.scenario.propArray[i][j][1][l].name; actionArray[myArrayIndex][outcomeIndex].outcomeText = rootIcon.scenario.propArray[i][j][1][l].outcomeText; actionArray[myArrayIndex][outcomeIndex].score1Inc = rootIcon.scenario.propArray[i][j][1][l].score1Inc; actionArray[myArrayIndex][outcomeIndex].score2Inc = rootIcon.scenario.propArray[i][j][1][l].score2Inc; actionArray[myArrayIndex][outcomeIndex].score3Inc = rootIcon.scenario.propArray[i][j][1][l].score3Inc; actionArray[myArrayIndex][outcomeIndex].soundEffect = rootIcon.scenario.propArray[i][j][1][l].soundEffect; // if propName has not been set in the outcome it must be set here to the current prop so that // the author can just select a change of state without having to always set the prop if (rootIcon.scenario.propArray[i][j][1][l].propName == undefined){ actionArray[myArrayIndex][outcomeIndex].propName = rootIcon.scenario.propArray[i].name; } else { actionArray[myArrayIndex][outcomeIndex].propName = rootIcon.scenario.propArray[i][j][1][l].propName; } actionArray[myArrayIndex][outcomeIndex].propState = rootIcon.scenario.propArray[i][j][1][l].propState; actionArray[myArrayIndex][outcomeIndex].propAction = rootIcon.scenario.propArray[i][j][1][l].propAction; actionArray[myArrayIndex][outcomeIndex].specifiedLoc = rootIcon.scenario.propArray[i][j][1][l].specifiedLoc; actionArray[myArrayIndex][outcomeIndex].destination = rootIcon.scenario.propArray[i][j][1][l].destination; actionArray[myArrayIndex][outcomeIndex].exitNav = rootIcon.scenario.propArray[i][j][1][l].exitNav; } else { outcomeIndex = effectArray[myArrayIndex].length; effectArray[myArrayIndex][outcomeIndex] = new Array(); effectArray[myArrayIndex][outcomeIndex].outcomeText = rootIcon.scenario.propArray[i][j][1][l].outcomeText; effectArray[myArrayIndex][outcomeIndex].score1Inc = rootIcon.scenario.propArray[i][j][1][l].score1Inc; effectArray[myArrayIndex][outcomeIndex].score2Inc = rootIcon.scenario.propArray[i][j][1][l].score2Inc; effectArray[myArrayIndex][outcomeIndex].score3Inc = rootIcon.scenario.propArray[i][j][1][l].score3Inc; effectArray[myArrayIndex][outcomeIndex].soundEffect = rootIcon.scenario.propArray[i][j][1][l].soundEffect; // if propName has not been set in the outcome it must be set here to the current prop so that // the author can just select a change of state without having to always set the prop if (rootIcon.scenario.propArray[i][j][1][l].propName == undefined){ effectArray[myArrayIndex][outcomeIndex].propName = rootIcon.scenario.propArray[i].name; } else { effectArray[myArrayIndex][outcomeIndex].propName = rootIcon.scenario.propArray[i][j][1][l].propName; } effectArray[myArrayIndex][outcomeIndex].propState = rootIcon.scenario.propArray[i][j][1][l].propState; effectArray[myArrayIndex][outcomeIndex].propAction = rootIcon.scenario.propArray[i][j][1][l].propAction; effectArray[myArrayIndex][outcomeIndex].specifiedLoc = rootIcon.scenario.propArray[i][j][1][l].specifiedLoc; effectArray[myArrayIndex][outcomeIndex].destination = rootIcon.scenario.propArray[i][j][1][l].destination; effectArray[myArrayIndex][outcomeIndex].exitNav = rootIcon.scenario.propArray[i][j][1][l].exitNav; } } // allowOutcomes is true } // if we have outcome conditions } // outcomes loop // need to remove the action if it has no outcomes if (currentActionType == "action") { if (actionArray[myArrayIndex].length == 0) { // there are no outcomes actionArray.pop(); } } } // are there outcomes test } // if allowableAction == true } // loop through actions / effects } // propArray[i].length defined } // loop through props } // inSceneArray.length is defined ]]> = pageIcon.templateData.scenario[projPI].scenarioActions[0].userAction[i].actionCondition[j].scoreVal){ // test is current but condition scenario value is not current scenario allowAction = "false"; } break; case "GT": if (testScore <= pageIcon.templateData.scenario[projPI].scenarioActions[0].userAction[i].actionCondition[j].scoreVal){ // test is notCurrent but condition scenario value is the current scenario allowAction = "false"; } break; case "EQ": if (testScore != pageIcon.templateData.scenario[projPI].scenarioActions[0].userAction[i].actionCondition[j].scoreVal){ // test is notCurrent but condition scenario value is the current scenario allowAction = "false"; } break; default: // undefined // reject action as improperly formed condition allowAction = "false"; } // case } // if scoreNumber specified // now test the chanceAct option against a random number if (pageIcon.templateData.scenario[projPI].scenarioActions[0].userAction[i].actionCondition[j].chanceAct != undefined){ // name of scenario in condition // need to test values for scenarioState myRand = Math.floor(Math.random() * 10); // returns 0 through 9 myChanceAct = parseInt(pageIcon.templateData.scenario[projPI].scenarioActions[0].userAction[i].actionCondition[j].chanceAct); if (myRand >= myChanceAct){ allowAction = false; } } // end of all condition checks } // if allowed = true } // end of condition loop j counter } // end of if action conditions.length if (allowAction == "true") { if (pageIcon.templateData.scenario[projPI].scenarioActions[0].userAction[i].actionOutcome.length == undefined){ // there are no outcomes so only use it if it is an effect if (currentActionType == "effect") { // add effect to effect array myArrayIndex = effectArray.length; effectArray[myArrayIndex] = new Array(); effectArray[myArrayIndex].title = pageIcon.templateData.scenario[projPI].scenarioActions[0].userAction[i].title; effectArray[myArrayIndex].actionText = pageIcon.templateData.scenario[projPI].scenarioActions[0].userAction[i].actionText; } } else { // we have at least one outcome so create an entry for the action or effect if (currentActionType == "action") { // create a new actionArray entry myArrayIndex = actionArray.length; actionArray[myArrayIndex] = new Array(); actionArray[myArrayIndex].title = pageIcon.templateData.scenario[projPI].scenarioActions[0].userAction[i].title; actionArray[myArrayIndex].actionText = pageIcon.templateData.scenario[projPI].scenarioActions[0].userAction[i].actionText; } else { // create a new effectArray entry myArrayIndex = effectArray.length; effectArray[myArrayIndex] = new Array(); effectArray[myArrayIndex].title = pageIcon.templateData.scenario[projPI].scenarioActions[0].userAction[i].title; effectArray[myArrayIndex].actionText = pageIcon.templateData.scenario[projPI].scenarioActions[0].userAction[i].actionText; } // now loop through the outcomes adding only those where all outcome conditions are valid for (l = 0; l < pageIcon.templateData.scenario[projPI].scenarioActions[0].userAction[i].actionOutcome.length; l++) { // does the outcome have any outcome conditions? if (pageIcon.templateData.scenario[projPI].scenarioActions[0].userAction[i].actionOutcome[l].length == undefined) { // no conditions so we can simply add the outcome to the action or effect if (currentActionType == "action") { outcomeIndex = actionArray[myArrayIndex].length; actionArray[myArrayIndex][outcomeIndex] = new Array(); actionArray[myArrayIndex][outcomeIndex].name = pageIcon.templateData.scenario[projPI].scenarioActions[0].userAction[i].actionOutcome[l].name; actionArray[myArrayIndex][outcomeIndex].outcomeText = pageIcon.templateData.scenario[projPI].scenarioActions[0].userAction[i].actionOutcome[l].outcomeText; actionArray[myArrayIndex][outcomeIndex].score1Inc = pageIcon.templateData.scenario[projPI].scenarioActions[0].userAction[i].actionOutcome[l].score1Inc; actionArray[myArrayIndex][outcomeIndex].score2Inc = pageIcon.templateData.scenario[projPI].scenarioActions[0].userAction[i].actionOutcome[l].score2Inc; actionArray[myArrayIndex][outcomeIndex].score3Inc = pageIcon.templateData.scenario[projPI].scenarioActions[0].userAction[i].actionOutcome[l].score3Inc; actionArray[myArrayIndex][outcomeIndex].soundEffect = pageIcon.templateData.scenario[projPI].scenarioActions[0].userAction[i].actionOutcome[l].soundEffect; actionArray[myArrayIndex][outcomeIndex].propName = pageIcon.templateData.scenario[projPI].scenarioActions[0].userAction[i].actionOutcome[l].propName; actionArray[myArrayIndex][outcomeIndex].propState = pageIcon.templateData.scenario[projPI].scenarioActions[0].userAction[i].actionOutcome[l].propState; actionArray[myArrayIndex][outcomeIndex].propAction = pageIcon.templateData.scenario[projPI].scenarioActions[0].userAction[i].actionOutcome[l].propAction; actionArray[myArrayIndex][outcomeIndex].specifiedLoc = pageIcon.templateData.scenario[projPI].scenarioActions[0].userAction[i].actionOutcome[l].specifiedLoc; actionArray[myArrayIndex][outcomeIndex].destination = pageIcon.templateData.scenario[projPI].scenarioActions[0].userAction[i].actionOutcome[l].destination; actionArray[myArrayIndex][outcomeIndex].exitNav = pageIcon.templateData.scenario[projPI].scenarioActions[0].userAction[i].actionOutcome[l].exitNav; } else { outcomeIndex = effectArray[myArrayIndex].length; effectArray[myArrayIndex][outcomeIndex] = new Array(); effectArray[myArrayIndex][outcomeIndex].name = pageIcon.templateData.scenario[projPI].scenarioActions[0].userAction[i].actionOutcome[l].name; effectArray[myArrayIndex][outcomeIndex].outcomeText = pageIcon.templateData.scenario[projPI].scenarioActions[0].userAction[i].actionOutcome[l].outcomeText; effectArray[myArrayIndex][outcomeIndex].score1Inc = pageIcon.templateData.scenario[projPI].scenarioActions[0].userAction[i].actionOutcome[l].score1Inc; effectArray[myArrayIndex][outcomeIndex].score2Inc = pageIcon.templateData.scenario[projPI].scenarioActions[0].userAction[i].actionOutcome[l].score2Inc; effectArray[myArrayIndex][outcomeIndex].score3Inc = pageIcon.templateData.scenario[projPI].scenarioActions[0].userAction[i].actionOutcome[l].score3Inc; effectArray[myArrayIndex][outcomeIndex].soundEffect = pageIcon.templateData.scenario[projPI].scenarioActions[0].userAction[i].actionOutcome[l].soundEffect; effectArray[myArrayIndex][outcomeIndex].propName = pageIcon.templateData.scenario[projPI].scenarioActions[0].userAction[i].actionOutcome[l].propName; effectArray[myArrayIndex][outcomeIndex].propState = pageIcon.templateData.scenario[projPI].scenarioActions[0].userAction[i].actionOutcome[l].propState; effectArray[myArrayIndex][outcomeIndex].propAction = pageIcon.templateData.scenario[projPI].scenarioActions[0].userAction[i].actionOutcome[l].propAction; effectArray[myArrayIndex][outcomeIndex].specifiedLoc = pageIcon.templateData.scenario[projPI].scenarioActions[0].userAction[i].actionOutcome[l].specifiedLoc; effectArray[myArrayIndex][outcomeIndex].destination = pageIcon.templateData.scenario[projPI].scenarioActions[0].userAction[i].actionOutcome[l].destination; effectArray[myArrayIndex][outcomeIndex].exitNav = pageIcon.templateData.scenario[projPI].scenarioActions[0].userAction[i].actionOutcome[l].exitNav; } } else { // we have outcome conditions so we must check all outcome conditions // to see if all conditions are met before the action can be added to // the action array allowOutcome = "true"; for (m = 0; m < pageIcon.templateData.scenario[projPI].scenarioActions[0].userAction[i].actionOutcome[l].length; m++) { // looping through the outcomeConditions and test them thisProp = pageIcon.templateData.scenario[projPI].scenarioActions[0].userAction[i].actionOutcome[l].outcomeCondition[m].propName; thisPropIndex = rootIcon.scenario.propIndexArray.findValue(thisProp); // test for propState if (pageIcon.templateData.scenario[projPI].scenarioActions[0].userAction[i].actionOutcome[l].outcomeCondition[m].propState != undefined){ // we have a prop related condition so find out which prop it relates to // confirm prop exists if (thisPropIndex == -1){ allowOutcome = "false"; // prop not found } else { // now test for propState conditions switch(pageIcon.templateData.scenario[projPI].scenarioActions[0].userAction[i].actionOutcome[l].outcomeCondition[m].propState){ // prop that is the subject of the condition may not be the same as the prop that has the action case "visible": if (visibleArray.findValue(thisPropIndex) == -1){ // prop is not present in presentArray allowOutcome = "false"; } break; case "hidden": if (hiddenArray.findValue(thisPropIndex) == -1){ // prop not in absent list allowOutcome = "false"; } break; default: // undefined // no action required if no propState value specified } // end switch case propState } // this propIndex } // propState not undefined // end of propState tests // test for propLoc if (pageIcon.templateData.scenario[projPI].scenarioActions[0].userAction[i].actionOutcome[l].outcomeCondition[m].propLoc != undefined){ // we have a prop related condition so find out which prop it relates to // confirm prop exists if (thisPropIndex == -1){ allowOutcome = "false"; // prop not found } else { // now test for propLoc conditions switch(pageIcon.templateData.scenario[projPI].scenarioActions[0].userAction[i].actionOutcome[l].outcomeCondition[m].propLoc){ // prop that is the subject of the condition may not be the same as the prop that has the action case "onStage": if (onStageArray.findValue(thisPropIndex) == -1){ // prop is not present in presentArray allowOutcome = "false"; } break; case "carried": if (carriedArray.findValue(thisPropIndex) == -1){ // prop not in absent list allowOutcome = "false"; } break; case "offStage": if (offStageArray.findValue(thisPropIndex) == -1){ // not carried; allowOutcome = "false"; } break; case "notOnStage": if (notOnStageArray.findValue(thisPropIndex) == -1){ // not carried; allowOutcome = "false"; } break; case "notCarried": if (notCarriedArray.findValue(thisPropIndex) == -1){ // carried; allowOutcome = "false"; } break; case "inScene": if (inSceneArray.findValue(thisPropIndex) == -1){ // carried; allowOutcome = "false"; } break; default: // undefined // no action required if no propState value specified } // end switch case propState } // this propIndex } // propLoc not undefined // end of propLoc tests // now test the scenario related options if (pageIcon.templateData.scenario[projPI].scenarioActions[0].userAction[i].actionOutcome[l].outcomeCondition[m].scenarioID != undefined){ // name of scenario in condition // need to test values for scenarioState switch(pageIcon.templateData.scenario[projPI].scenarioActions[0].userAction[i].actionOutcome[l].outcomeCondition[m].scenarioState){ // prop that is the subject of the condition may not be the same as the prop that has the action case "current": if (pageIcon.templateData.scenario[projPI].scenarioActions[0].userAction[i].actionOutcome[l].outcomeCondition[m].scenarioID != currentscenario){ // test is current but condition scenario value is not current scenario allowOutcome = "false"; } break; case "notCurrent": if (pageIcon.templateData.scenario[projPI].scenarioActions[0].userAction[i].actionOutcome[l].outcomeCondition[m].scenarioID == currentscenario){ // test is notCurrent but condition scenario value is the current scenario allowOutcome = "false"; } break; default: // undefined // reject action as improperly formed condition allowOutcome = "false"; } // switch } // if scenarioID specified // now test for score value if (pageIcon.templateData.scenario[projPI].scenarioActions[0].userAction[i].actionOutcome[l].outcomeCondition[m].scoreNumber != undefined){ // name of scenario in condition // need to test values for specified score switch(pageIcon.templateData.scenario[projPI].scenarioActions[0].userAction[i].actionOutcome[l].outcomeCondition[m].scoreNumber){ case "1": testScore = rootIcon.scenario.scoreArray[0].score; break; case "2": testScore = rootIcon.scenario.scoreArray[1].score; break; case "3": testScore = rootIcon.scenario.scoreArray[2].score; break; case "4": // inventory testScore = inventoryArray.length; break; default: // undefined // reject action as improperly formed condition allowOutcome = "false"; } // switch switch(pageIcon.templateData.scenario[projPI].scenarioActions[0].userAction[i].actionOutcome[l].outcomeCondition[m].scoreComp){ // prop that is the subject of the condition may not be the same as the prop that has the action case "LT": if (testScore >= pageIcon.templateData.scenario[projPI].scenarioActions[0].userAction[i].actionOutcome[l].outcomeCondition[m].scoreVal){ // test is current but condition scenario value is not current scenario allowOutcome = "false"; } break; case "GT": if (testScore <= pageIcon.templateData.scenario[projPI].scenarioActions[0].userAction[i].actionOutcome[l].outcomeCondition[m].scoreVal){ // test is notCurrent but condition scenario value is the current scenario allowOutcome = "false"; } break; case "EQ": if (testScore != pageIcon.templateData.scenario[projPI].scenarioActions[0].userAction[i].actionOutcome[l].outcomeCondition[m].scoreVal){ // test is notCurrent but condition scenario value is the current scenario allowOutcome = "false"; } break; default: // undefined // reject action as improperly formed condition allowOutcome = "false"; } // switch } // if scoreNumber specified // now test the chanceAct option against a random number if (pageIcon.templateData.scenario[projPI].scenarioActions[0].userAction[i].actionOutcome[l].outcomeCondition[m].chanceAct != undefined){ // // need to test values for scenarioState myRand = Math.floor(Math.random() * 10); // returns 0 through 9 myChanceAct = parseInt(pageIcon.templateData.scenario[projPI].scenarioActions[0].userAction[i].actionOutcome[l].outcomeCondition[m].chanceAct); if (myRand >= myChanceAct){ allowOutcome = "false"; } } } // outcome condition loop if (allowOutcome == "true") { // add outcome to effect or action if (currentActionType == "action") { outcomeIndex = actionArray[myArrayIndex].length; actionArray[myArrayIndex][outcomeIndex] = new Array(); actionArray[myArrayIndex][outcomeIndex].name = pageIcon.templateData.scenario[projPI].scenarioActions[0].userAction[i].actionOutcome[l].name; actionArray[myArrayIndex][outcomeIndex].outcomeText = pageIcon.templateData.scenario[projPI].scenarioActions[0].userAction[i].actionOutcome[l].outcomeText; actionArray[myArrayIndex][outcomeIndex].score1Inc = pageIcon.templateData.scenario[projPI].scenarioActions[0].userAction[i].actionOutcome[l].score1Inc; actionArray[myArrayIndex][outcomeIndex].score2Inc = pageIcon.templateData.scenario[projPI].scenarioActions[0].userAction[i].actionOutcome[l].score2Inc; actionArray[myArrayIndex][outcomeIndex].score3Inc = pageIcon.templateData.scenario[projPI].scenarioActions[0].userAction[i].actionOutcome[l].score3Inc; actionArray[myArrayIndex][outcomeIndex].soundEffect = pageIcon.templateData.scenario[projPI].scenarioActions[0].userAction[i].actionOutcome[l].soundEffect; actionArray[myArrayIndex][outcomeIndex].propName = pageIcon.templateData.scenario[projPI].scenarioActions[0].userAction[i].actionOutcome[l].propName; actionArray[myArrayIndex][outcomeIndex].propState = pageIcon.templateData.scenario[projPI].scenarioActions[0].userAction[i].actionOutcome[l].propState; actionArray[myArrayIndex][outcomeIndex].propAction = pageIcon.templateData.scenario[projPI].scenarioActions[0].userAction[i].actionOutcome[l].propAction; actionArray[myArrayIndex][outcomeIndex].specifiedLoc = pageIcon.templateData.scenario[projPI].scenarioActions[0].userAction[i].actionOutcome[l].specifiedLoc; actionArray[myArrayIndex][outcomeIndex].destination = pageIcon.templateData.scenario[projPI].scenarioActions[0].userAction[i].actionOutcome[l].destination; actionArray[myArrayIndex][outcomeIndex].exitNav = pageIcon.templateData.scenario[projPI].scenarioActions[0].userAction[i].actionOutcome[l].exitNav; } else { outcomeIndex = effectArray[myArrayIndex].length; effectArray[myArrayIndex][outcomeIndex] = new Array(); effectArray[myArrayIndex][outcomeIndex].name = pageIcon.templateData.scenario[projPI].scenarioActions[0].userAction[i].actionOutcome[l].name; effectArray[myArrayIndex][outcomeIndex].outcomeText = pageIcon.templateData.scenario[projPI].scenarioActions[0].userAction[i].actionOutcome[l].outcomeText; effectArray[myArrayIndex][outcomeIndex].score1Inc = pageIcon.templateData.scenario[projPI].scenarioActions[0].userAction[i].actionOutcome[l].score1Inc; effectArray[myArrayIndex][outcomeIndex].score2Inc = pageIcon.templateData.scenario[projPI].scenarioActions[0].userAction[i].actionOutcome[l].score2Inc; effectArray[myArrayIndex][outcomeIndex].score3Inc = pageIcon.templateData.scenario[projPI].scenarioActions[0].userAction[i].actionOutcome[l].score3Inc; effectArray[myArrayIndex][outcomeIndex].soundEffect = pageIcon.templateData.scenario[projPI].scenarioActions[0].userAction[i].actionOutcome[l].soundEffect; effectArray[myArrayIndex][outcomeIndex].propName = pageIcon.templateData.scenario[projPI].scenarioActions[0].userAction[i].actionOutcome[l].propName; effectArray[myArrayIndex][outcomeIndex].propState = pageIcon.templateData.scenario[projPI].scenarioActions[0].userAction[i].actionOutcome[l].propState; effectArray[myArrayIndex][outcomeIndex].propAction = pageIcon.templateData.scenario[projPI].scenarioActions[0].userAction[i].actionOutcome[l].propAction; effectArray[myArrayIndex][outcomeIndex].specifiedLoc = pageIcon.templateData.scenario[projPI].scenarioActions[0].userAction[i].actionOutcome[l].specifiedLoc; effectArray[myArrayIndex][outcomeIndex].destination = pageIcon.templateData.scenario[projPI].scenarioActions[0].userAction[i].actionOutcome[l].destination; effectArray[myArrayIndex][outcomeIndex].exitNav = pageIcon.templateData.scenario[projPI].scenarioActions[0].userAction[i].actionOutcome[l].exitNav; } } // allowOutcomes is true } // if we have outcome conditions } // outcomes loop // need to remove the action if it has no outcomes if (currentActionType == "action") { if (actionArray[myArrayIndex].length == 0) { // there are no outcomes actionArray.pop(); } } } // are there outcomes test } // if allowableAction == true } // loop through actions / effects } // if there are user actions ]]> parseInt(rootIcon.scenario.scoreArray[scoreIndex].maxScore)){ // score above highest setting if (rootIcon.scenario.scoreArray[scoreIndex].lose == "max"){ // this score loses the game rootIcon.scenario.scoreArray[scoreIndex].endGameState = "L"; rootIcon.scenario.scoreArray[scoreIndex].score = parseInt(rootIcon.scenario.scoreArray[scoreIndex].minScore); if (rootIcon.scenario.scoreArray.loseEffect != undefined){ narration = rootIcon.scenario.scoreArray.loseEffect; rootIcon.broadcast('showAudio'); } rootIcon.broadcast('onGameEnd'); } else if (rootIcon.scenario.scoreArray[scoreIndex].win == "max") { // this score wins the game rootIcon.scenario.scoreArray[scoreIndex].endGameState = "W"; rootIcon.scenario.scoreArray[scoreIndex].score = parseInt(rootIcon.scenario.scoreArray[scoreIndex].maxScore); if (rootIcon.scenario.scoreArray.winEffect != undefined){ narration = rootIcon.scenario.scoreArray.winEffect; rootIcon.broadcast('showAudio'); } rootIcon.broadcast('onGameEnd'); } else { rootIcon.scenario.scoreArray[scoreIndex].score = parseInt(rootIcon.scenario.scoreArray[scoreIndex].maxScore); } }]]> "; if (i < 2){ scoreString = scoreString + "
    "; } } } // help the page author by reminding them if (pageMode = "development"){ if (scoreString == "" || scoreString == undefined){ scoreString = rootIcon.scenario.lang[0].scoresDebugMessage; } } ]]>
    " + scenarioTitle + ""); fnPropAction(); // call function to set up prop based actions fnscenarioAction(); // call function to set up scenario based actions scenarioDesc = pageIcon.templateData.scenario[projPI].description; // add any effects and their outcomes to the scenario //effectList = ""; if (effectArray.length != undefined){ scenarioDesc = scenarioDesc + "

    "; for (i = 0; i < effectArray.length; i++) { // go through each effect that has by now been checked for action conditions being met // we still have to consider outcomeConditions if (!(effectArray[i].actionText == undefined || effectArray[i] == "")){ scenarioDesc = scenarioDesc + "
    " + effectArray[i].actionText; } if (effectArray[i].length != undefined) { // there are outcomes for (j = 0; j < effectArray[i].length; j++) { allowOutcome = "true"; // need to set up test for outcomeConditions here if (effectArray[i][j].length != undefined) { // we have outcome conditions for (k = 0; k < effectArray[i][j].length; k++) { // we have outcomeConditions for this outcome if (effectArray[i][j][k].propName != undefined) { thisProp = effectArray[i][j][k].propName; // find array for this prop thisPropIndex = rootIcon.scenario.propIndexArray.findValue(thisProp); if (thisPropIndex != -1){ // prop can be found switch(effectArray[i][j][k].propState){ case "visible": if (visibleArray.findValue(thisPropIndex) == -1){ // prop is not present in visibleArray allowOutcome = "false"; } break; case "hidden": if (hiddenArray.findValue(thisPropIndex) == -1){ // not hiding; allowOutcome = "false"; } break; default: // undefined } // switch case propLoc switch(effectArray[i][j][k].propLoc){ case "onStage": if (onStageArray.findValue(thisPropIndex) == -1) { // prop is not present in presentArray allowOutcome = "false"; } break; case "carried": if (carriedArray.findValue(thisPropIndex) == -1){ // carried; allowOutcome = "false"; } break; case "offStage": if (offStageArray.findValue(thisPropIndex) == -1){ allowOutcome = "false"; } break; case "notOnStage": if (notOnStageArray.findValue(thisPropIndex) == -1){ // not hiding; allowOutcome = "false"; } break; case "notCarried": if (notCarriedArray.findValue(thisPropIndex) == -1){ // not carried; allowOutcome = "false"; } break; case "inScene": if (inSceneArray.findValue(thisPropIndex) == -1){ // not accessible; allowOutcome = "false"; } break; default: // undefined // no action required if no propState value specified } // end switch case propState } else { // this prop does not exist in propIndexArray allowOutcome = "false"; } // end if propIndex test } // if propName undefined - end of prop condition tests // now test the scenario related options if (effectArray[i][j][k].scenarioID != undefined){ // name of scenario in condition // need to test values for scenarioState switch(effectArray[i][j][k].scenarioState){ // prop that is the subject of the condition may not be the same as the prop that has the action case "current": if (effectArray[i][j][k].scenarioID != currentscenario){ // test is current but condition scenario value is not current scenario allowOutcome = "false"; } break; case "notCurrent": if (effectArray[i][j][k].scenarioID == currentscenario){ // test is notCurrent but condition scenario value is the current scenario allowOutcome = "false"; } break; default: // undefined // reject action as improperly formed condition allowOutcome = "false"; } // switch } // if scenarioID specified // now test for score value if (effectArray[i][j][k].scoreNumber != undefined){ // name of scenario in condition // need to test values for specified score switch(effectArray[i][j][k].scoreNumber){ case "1": testScore = rootIcon.scenario.scoreArray[0].score; break; case "2": testScore = rootIcon.scenario.scoreArray[1].score; break; case "3": testScore = rootIcon.scenario.scoreArray[2].score; break; case "4": // inventory testScore = inventoryArray.length; break; default: // undefined // reject action as improperly formed condition allowOutcome = "false"; } switch(effectArray[i][j][k].scoreComp){ // prop that is the subject of the condition may not be the same as the prop that has the action case "LT": if (testScore >= effectArray[i][j][k].scoreVal){ // test is current but condition scenario value is not current scenario allowOutcome = "false"; } break; case "GT": if (testScore <= effectArray[i][j][k].scoreVal){ // test is notCurrent but condition scenario value is the current scenario allowOutcome = "false"; } break; case "EQ": if (effectArray[i][j][k].scoreVal){ // test is notCurrent but condition scenario value is the current scenario allowOutcome = "false"; } break; default: // undefined // reject action as improperly formed condition allowOutcome = "false"; } // switch } // if scoreNumber specified // now test the chanceAct option against a random number if (effectArray[i][j][k].chanceAct != undefined){ // name of scenario in condition // need to test values for scenarioState myRand = Math.floor(Math.random() * 10); // returns 0 through 9 myChanceAct = parseInt(effectArray[i][j][k].chanceAct); if (myRand >= myChanceAct){ allowOutcome = "false"; } } } // end of outcomeCondition tests loop // process outcomes of effect only if allowOutcome == "true" if (allowOutcome == "true") { if (!(effectArray[i][j].outcomeText == undefined !! effectArray[i][j].outcomeText == "")){ scenarioDesc = scenarioDesc + "
    " + effectArray[i][j].outcomeText; // add processing of other outcomes here // handle any score increments if (effectArray[i][j].score1Inc != undefined){ scoreIndex = 0; scoreInc = parseInt(effectArray[i][j].score1Inc); fnUpdateScore(); } if (effectArray[i][j].score2Inc != undefined){ scoreIndex = 1; scoreInc = parseInt(effectArray[i][j].score2Inc); fnUpdateScore(); } if (effectArray[i][j].score3Inc != undefined){ scoreIndex = 2; scoreInc = parseInt(effectArray[i][j].score3Inc); fnUpdateScore(); } // handle changes to a prop if (effectArray[i][j].propName != undefined){ // identify the prop outcomeProp = effectArray[i][j].propName; outcomePropIndex = rootIcon.scenario.propIndexArray.findValue(outcomeProp); if (outcomePropIndex != -1){ // the prop has been found switch(effectArray[i][j].propState){ case "show": rootIcon.scenario.propArray[outcomePropIndex].state = "visible"; break; case "hide": rootIcon.scenario.propArray[outcomePropIndex].state = "hidden"; break; case "carry": rootIcon.scenario.propArray[outcomePropIndex].scenario = "Inventory"; break; case "drop": rootIcon.scenario.propArray[outcomePropIndex].scenario = currentscenario; break; case "offStage": rootIcon.scenario.propArray[outcomePropIndex].scenario = "Off Stage"; break; default } // switch } // if outcomePropIndex } // if actionArray.Propname // play soundEffect if one has been provided if (effectArray[i][j].soundEffect != undefined){ // play sound narration = effectArray[i][j].soundEffect; // do not broadcast showAudio event from inside the function as this will // stop the hot text working } // destination change not implemented for effects as this could be confusing // and is inconsistent with the concept of an effect } } } } } } } // add list of props present at the scenario //if (presentArray.length > 0){ if (propsInscenarioArray.length > 0){ // scenarioDesc = scenarioDesc + "

    " + rootIcon.scenario.lang[0].scenarioPropsTitle + " " + presentArray.length + " " + rootIcon.scenario.lang[0].scenarioPropsName + "

    "; // for (i=0; i < presentArray.length; i++){ scenarioDesc = scenarioDesc + "

    " + rootIcon.scenario.lang[0].scenarioPropsTitle + " " + propsInscenarioArray.length + " " + rootIcon.scenario.lang[0].scenarioPropsName + "

    "; for (i=0; i < propsInscenarioArray.length; i++){ // list each item in present array to be displayed under the scenario description as hot text items scenarioDesc = scenarioDesc + '
  • ' + propsInscenarioArray[i].title+ '
  • '; } } scenarioDescText.setText(scenarioDesc); // set up actions actionList = ""; if (actionArray.length != undefined){ for (i=0; i < actionArray.length; i++){ actionList = actionList + '' + actionArray[i].title + '

    '; } } actionListText.setText(actionList); // inventory list invList = ""; if (inventoryArray.length > 0){ inventoryDesc = rootIcon.scenario.lang[0].inventoryTitle + " " + inventoryArray.length + " " + rootIcon.scenario.lang[0].inventoryItemName; for (i=0; i < inventoryArray.length; i++){ invList = invList + '
  • ' + inventoryArray[i].title + '
  • '; } } else { invList = rootIcon.scenario.lang[0].inventoryEmpty; inventoryDesc = rootIcon.scenario.lang[0].inventoryTitle; } inventoryListText.setText(invList); inventoryTitleText.setText("" + inventoryDesc + ""); // scores fnScoreDisplay(); scoreText.setText(scoreString); ]]>
    " + rootIcon.scenario.lang[0].actionTitle + ""}]]> " + rootIcon.scenario.lang[0].scoresTitle + ""}]]>
    "; // loop through actionArray outcomes for this action (there is only one action here selected by the user!) for (i = 0; i < actionArray[outcomeIndex].length; i++) { // loop through the outcomes actionOutcomeText = actionOutcomeText + actionArray[outcomeIndex][i].outcomeText + "
    "; // handle any score increments if (actionArray[outcomeIndex][i].score1Inc != undefined){ changeScore1 = changeScore1 + parseInt(actionArray[outcomeIndex][i].score1Inc); } if (actionArray[outcomeIndex][i].score2Inc != undefined){ changeScore2 = changeScore2 + parseInt(actionArray[outcomeIndex][i].score2Inc); } if (actionArray[outcomeIndex][i].score3Inc != undefined){ changeScore3 = changeScore3 + parseInt(actionArray[outcomeIndex][i].score3Inc); } // handle changes to a prop if (actionArray[outcomeIndex][i].propName != undefined){ // identify the prop outcomeProp = actionArray[outcomeIndex][i].propName; outcomePropIndex = rootIcon.scenario.propIndexArray.findValue(outcomeProp); if (outcomePropIndex != -1){ // the prop has been found // do state switch(actionArray[outcomeIndex][i].propState){ case "visible": rootIcon.scenario.propArray[outcomePropIndex].state = "visible"; break; case "hidden": rootIcon.scenario.propArray[outcomePropIndex].state = "hidden"; break; default: // do nothing } // switch // do propAction switch(actionArray[outcomeIndex][i].propAction){ case "carry": rootIcon.scenario.propArray[outcomePropIndex].scenario = "Inventory"; break; case "drop": rootIcon.scenario.propArray[outcomePropIndex].scenario = currentscenario; break; case "specified": // check if specified location exists propScenarioIndex = rootIcon.scenario.scenarioIndexArray.findValue(actionArray[outcomeIndex][i].specifiedLoc); if (propScenarioIndex != -1){ rootIcon.scenario.propArray[outcomePropIndex].scenario = specifiedLoc; } break; case "destroy": rootIcon.scenario.propArray[outcomePropIndex].scenario = "Off Stage"; break; default: // do nothing } // switch } // if outcomePropIndex } // if actionArray.Propname // play soundEffect if one has been provided if (actionArray[outcomeIndex][i].soundEffect != undefined){ // play sound narration = actionArray[outcomeIndex][i].soundEffect; rootIcon.broadcast('showAudio'); } // now need to set up the destination if (actionArray[outcomeIndex][i].destination != undefined){ destPageName = actionArray[outcomeIndex][i].destination; exitNav = actionArray[outcomeIndex][i].exitNav; } } // outcome index loop } //outcomeIndex undefined } else if (actionSource == "I"){ // inventory list item selected actionOutcomeText = inventoryArray[outcomeIndex].description; } else { // you can see list actionOutcomeText = propsInscenarioArray[outcomeIndex].description } actionText.setText(actionOutcomeText); actionText._visible = true; largePanel._visible = true;]]>
    " + destPageName + "
    " + notFoundMessage) } } } if ((pageFound == "false") && (pageMode == "development")){ txtPageNotFound.clear(); // set up page not found text box txtPageNotFound.beginFill(0xFFFFCC, 100); txtPageNotFound.lineStyle(1,0x000000,100); txtPageNotFound.drawRect(0,0,txtPageNotFoundw,txtPageNotFoundh,10); txtPageNotFound.dropShadow(7,45,0x999999,50); txtPageNotFound._visible = 1; txtPageNotFound.wipe('in',0.25,'Strong','easeIn',2) } ]]>
    " + rootIcon.scenario.scoreArray[i].winMessage; endDestination = rootIcon.scenario.scoreArray[i].winEndID; } else if (rootIcon.scenario.scoreArray[i].endGameState == "L") { gameOverText = gameOverText + "
    " + rootIcon.scenario.scoreArray[i].loseMessage; endDestination = rootIcon.scenario.scoreArray[i].loseEndID; } } endGameText.setText(gameOverText); endGameText._visible = true; largePanelGE._visible = true; // destroy simulation array so that initialisation will be triggered rootIcon.scenario.splice(0); rootIcon.scenario = null; ]]>
    \ No newline at end of file diff --git a/modules/xerte/parent_templates/Nottingham/wizards/en-GB/data.xwd b/modules/xerte/parent_templates/Nottingham/wizards/en-GB/data.xwd index 4b16996322..91785eecc8 100644 --- a/modules/xerte/parent_templates/Nottingham/wizards/en-GB/data.xwd +++ b/modules/xerte/parent_templates/Nottingham/wizards/en-GB/data.xwd @@ -1,5 +1,5 @@ - + @@ -1259,7 +1259,9 @@ - ]]> + ]]> ]]> ]]> @@ -1277,7 +1279,9 @@ - + + + @@ -1290,6 +1294,8 @@ + + @@ -1302,6 +1308,8 @@ + +