Hey Guys,
i am really new to wintermute. I try to set up a scene, where the character can interact with a "Toilet Flush pull".
I am not very used to oop, therefore i read through the code of the wintermute demo and took snippets of the fan.script.
I set up the Values for the ToiletFlush, just that the animation is not looping and the starting value is "false" in the initscene.script.
It works, but the problem is, the animation plays automtically once, everytime i press F5. Are there some options in the Editor i have forgotten?
Scene_Init
#include "scripts\base.inc"
// here comes the stuff which initializes the scene
actor.SkipTo(400, 400);
actor.Direction = DI_DOWN;
actor.Active = true;
////////////////////////////////////////////////////////////////////////////////
// scene state
global StateTestraum;
// default values
if(StateTestraum==null)
{
StateTestraum.Visited = false;
StateTestraum.Flush = 0; // <---- like the FanSpeed Variable in the Demo
// add scene states here
}
////////////////////////////////////////////////////////////////////////////////
// setup scene according to state variables
////////////////////////////////////////////////////////////////////////////////
if(!StateTestraum.Visited)
{
StateTestraum.Visited = true;
// this is our first visit in this scene...
}
ToiletFlush.scene
#include "scripts\base.inc"
global StateTestraum;
on "LeftClick" // just leftclick --> now submenue with rightclick
{
actor.GoToObject(this);
Game.Interactive = false;
// get the ToiletEntity
var EntToiletFlush = Scene.GetNode("ToiletFlush");
// set the ToiletFlush Pull entity sprite depending on the state variable
// (0= not used, 1 = used)
if(StateTestraum.Flush==0)
{
actor.Talk("It's turned off. I'll turn it on...");
actor.PlayAnim("actors\Volgar\rr\take1.sprite");
EntToiletFlush.PlaySound("sounds\Toilet.ogg");
EntToiletFlush.SetSprite("scenes\Testraum\sprites\ToiletFlush.sprite"); <--- animation and Sound are autoplayed at startup, why?!
actor.PlayAnim("actors\Volgar\rr\take2.sprite");
StateTestraum.Flush = 1; // save the new fan state
}
Game.Interactive = true;
}
By the way, i realized at moment, if you change the Value FanSpeed to 0 in the Demo ( to not running), the startsound of the Fan is hearable there as well for the startup and then dissapears.
Hope you can tell me what i've missed.
best regards Veritas