home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Singles (French)
/
Singles-FrenchVersion-Win95.iso
/
data1.cab
/
Statemachine
/
kommodeChar.lua
< prev
next >
Wrap
Text File
|
2004-03-05
|
2KB
|
83 lines
-- kommode character state machine
beginStateMachine()
onEnter(function(msg)
local kommode = getStateObjectFromID(msg.sender);
storeStateObject("kommode", kommode);
if (kommode) then
-- kommode does exist
local actionPointName = retrieveData("actionPointName");
local actionPoint = getParent().getFreeActionPoint(kommode, actionPointName);
if exitIfWrongPosition(getParent(), kommode, actionPointName) then return end;
if (not actionPoint) then
-- action points is locked
getParent().setEmoticon(EMOTICON_CANNOT, EMOTICON_DELAY);
sendMsg("emoThink", getParent().walkSO);
exitStateMachine();
else
getParent().lockActionPoint(kommode, actionPointName);
end
else
-- kommode does not exist anymore
getParent().setEmoticon(EMOTICON_CANNOT, EMOTICON_DELAY);
sendMsg("emoThink", getParent().walkSO);
exitStateMachine();
end
freeHands(getParent());
end )
onExit(function(msg)
local kommode = retrieveStateObject("kommode");
getParent().unlockActionPoints(kommode);
removeStateObject("kommode");
end )
state("outfit")
onEnter(function(msg)
--startAnimation("ausziehen2");
startAnimation(getChangeOutfitAnim(getParent()));
sendDelayedMsgThis("change", 1600);
end )
onMsg("change", function(msg)
local outfit = retrieveData("outfit")
changeOutfit(getParent(), getParent().numberToOutfit(outfit)); -- lua function checks if out fit allready on
end )
onMsg("end", function(msg)
exitAndGoAway();
end )
-- onEnter(function(msg)
-- setPose(archize(getParent(), "stand1"));
-- end )
--
-- onMsg("end", function(msg)
-- local outfit = retrieveData("outfit")
-- getParent().changeOutfit(getParent().numberToOutfit(outfit));
-- exitAndGoAway();
-- end)
--
endStateMachine()