home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Singles (French)
/
Singles-FrenchVersion-Win95.iso
/
data1.cab
/
Statemachine
/
questTrouble3b.lua
< prev
next >
Wrap
Text File
|
2004-03-05
|
2KB
|
64 lines
beginStateMachine()
-- called when questor builds up all known questScripts
onEnter(function(msg)
print("questTrouble3b 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);
getParent().getParent().getCharacter(ELAINE).decRelationshipCondition(MIKE, 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) >= 3 )
then
mike.queueCommand("pm_talkCutscene", "talkCutscene", elaine, "questTrouble3b");
setState("talktome");
end
end )
state("talktome")
-- assoon as arrived - start dialog
----------------
onMsg("talking", function(msg)
if (msg.data == "questTrouble3b") then
popupConversation("dialogTrouble3b");
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()