home *** CD-ROM | disk | FTP | other *** search
- -- 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")
- if (getParent().getOutfit() ~= outfit) then
- getParent().changeOutfit(outfit);
- end
- 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(outfit);
- -- exitAndGoAway();
- -- end)
- --
-
-
-
-
-
-
-
-
-
-
- endStateMachine()
-