home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Singles (French)
/
Singles-FrenchVersion-Win95.iso
/
data1.cab
/
Statemachine
/
questTrouble1b.lua
< prev
next >
Wrap
Text File
|
2004-03-05
|
2KB
|
61 lines
beginStateMachine()
-- called when questor builds up all known questScripts
onEnter(function(msg)
print("questTrouble1b entered");
setState("initial");
end )
-- debug mechanism, should be implemented properly such that a reset by questormessage is possible
-- make sure that the initial condition wont be triggerd right away, maybe reset all prerequesites in order to prevent that
onMsg("questreset", function(msg)
getParent().getParent().getCharacter(MIKE).decRelationshipCondition(ELAINE, REL_TROUBLE,1);
setState("initial");
end )
---------------------------------------------------------------------------------------------------------------------------------------
state("initial")
onMsg("checkCondition", function(msg)
local mike = getParent().getParent().getCharacter(MIKE);
local elaine = getParent().getParent().getCharacter(ELAINE);
if ( mike.getRelationshipCondition(ELAINE, REL_TROUBLE) >= 1)
then
mike.queueCommand("pm_talkCutscene", "talkCutscene", elaine, "questTrouble1b");
setState("talktome");
end
end )
state("talktome")
-- assoon as arrived - start dialog
----------------
onMsg("talking", function(msg)
if ( msg.data == "questTrouble1b") then
popupConversation("dialogTrouble1b");
setState("donetalktome");
end
end )
state("donetalktome")
onMsg("yes", function(msg)
getParent().getParent().getCharacter(MIKE).cancelCurrentActivity();
getParent().getParent().getCharacter(ELAINE).cancelCurrentActivity();
setState("done");
end )
---------------------------------------------------------------------------------------------------------------------------------------
state("done")
-- sackgasse hier
endStateMachine()