Moderators: e_phoenix13
Go
New
Find
Notify
Tools
Reply
  
-star Rating Rate It!  Login/Join 
Member
Posted
Have a look at the following coffe machine.

I need some conditional logic in this scene, but I can't seem to work it out.
For instance, if I click on 'cover open' everything is fine. The way it is setup now is that when the cover is open and I click on 'coffee holder out' a new animation starts and the cover closes first, then opens again to let the coffee holder out. The same problem with the 'mouth' wich should come out after the coffee holder.

Of course the best would be if, when you click on 'coffee holder out', and the cover is open allready, it remains open. Wildcards in the timeline of the animation won't do it, since the animations are complex and needs values for every moment in time.

I tried fixing it with mtsactions and a statemachine. Also I tried using MTSCompareProperty with MTSAction. Also I have been looking at the 'if cond' option in the online xml reference, but couldn't find a workable sollution with that. Searching the forum on 'conditional' brings up only one article,
I gues I'll need to use some javascript but I don't know how. Any sollutions?

Regards,
Koen
 
Posts: 22 | Registered: January 24, 2003Reply With QuoteEdit or Delete MessageReport This Post
Member
Posted Hide Post
Hi Koen,

I m sure you can do it with state machine. I ll try to have a look at it today.
 
Posts: 181 | Registered: January 24, 2003Reply With QuoteEdit or Delete MessageReport This Post
Member
Posted Hide Post
Hi ibob,

did you manage to create some conditional logic through the state machine?
Do you want me to provide you with some more detail information about the cofee machine?

The basic problem is actualy very simple.
You have 3 objects:
- if object 1 is in position AA, object 2 should move to position UU
- if object 1 is in position AB, object 2 should move to position UV
- if object 1 and object 2 are in the positions AA and UU, object 3 should move to XX
- if object 1 and object 2 are in the positions AA and UV, object 3 should move to XY
- if object 1 and object 2 are in the positions AB and UU, object 3 should move to XZ
- if object 1 and object 2 are in the positions AB and UV, object 3 should move to ZZ

Well... something like that ;-)
 
Posts: 22 | Registered: January 24, 2003Reply With QuoteEdit or Delete MessageReport This Post
Member
Posted Hide Post
Hi streefkerk


I had a look at you files and solve the problem with a little of Interactor and Javascript.

1 - Split the animations so that one timeElem move one part

2- Built interactor on which one event fire the anim, another fire the pdir

3 - Built Javascript function wich test the states of interactor and send or not events to the player
exemple
if (vmp.GetProperty('MTSInteractor.Cover','stat')=='CoverClosed'){
	alert('I need first to open the cover');
	vmp.PostEvent('Cover_Open');
	vmp.PostEvent('Coffee_Out',3); 
	}  

you can see it at work here:

http://iibob.free.fr/senseo/
 
Posts: 181 | Registered: January 24, 2003Reply With QuoteEdit or Delete MessageReport This Post
Member
Posted Hide Post
Hi ibob,

Aahh, this was exactly what I was looking for. When I was trying the state machine indeed I splitted all the animation so that one timeelem ran only one animation. What was missing was the javascript to control it all.
Thanks very much.

Regards,
Koen
 
Posts: 22 | Registered: January 24, 2003Reply With QuoteEdit or Delete MessageReport This Post
Member
Posted Hide Post
Hi ibob,

saw your watches at tagheuer. Very nice work.
Have a look at the finished coffeemachine and let me know what you think.

Senseo Crema

Regards,
Koen
 
Posts: 22 | Registered: January 24, 2003Reply With QuoteEdit or Delete MessageReport This Post
  Powered by Eve Community