home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Singles (French)
/
Singles-FrenchVersion-Win95.iso
/
data1.cab
/
Statemachine
/
mission.lua
< prev
next >
Wrap
Text File
|
2004-03-05
|
973b
|
45 lines
-- mission controller state machine
beginStateMachine()
onEnter(function(msg)
-- init available missions
local skipTutorial = (readConfig("Debug", "skipTutorial") == "true");
local missions = {"testMission","tutorialMoveIn"};
if (skipTutorial) then
print("starting questor");
missions = {"questor"};
else
print("starting tutorial");
end
storeData("missions", missions);
-- start first mission
sendDelayedMsgThis("next", 1000);
end )
onReturn(function(msg)
-- start next mission
sendDelayedMsgThis("next", 3000);
end )
onMsg("next", function(msg)
-- mission complete: choose next mission
print("Mission complete");
local missions = retrieveData("missions");
if getn(missions) > 0 then
local m = missions[1];
tremove(missions, 1);
storeData("missions", missions);
print("Starting next mission: "..m)
enterStateMachine(m);
end
end )
endStateMachine()