Wintermute Engine Forum
Wintermute Engine => Technical forum => Topic started by: Adventure Bird on August 08, 2010, 12:54:40 PM
-
I have a problem with one actor. The subtitles of this actor aren't shown at the bottom of the screen. Usually there are two actors in the scene and for the first actor it works fine. Additionally I tried to load an additional actor to the scene and let him talk. Works fine, too. Because of that, I guess something is wrong with my actor. But the settings are the same.
Here the upper part of actor files:
ACTOR
{
NAME = "Mann"
CAPTION=""
SCALABLE = TRUE
INTERACTIVE = FALSE
X = 400
Y = 460
SCRIPT="actors\Mann\Mann.script"
FONT = "fonts\verdana_red.font"
...
}
NAME = "Frau"
CAPTION="Frau"
SCALABLE = TRUE
INTERACTIVE = TRUE
X = 600
Y = 660
SCRIPT="actors\Frau\Frau.script"
FONT = "fonts\verdana_red.font"
...
}
I overrode the talk methode that a picture appears and behind the text appears a black box/picture.
Here the code of "Frau" script:
method initFrau(Frau)
{
Frau.SubtitlesPosRelative = false;
Frau.SubtitlesPosXCenter = true;
Frau.SubtitlesPosX = 512;
Frau.SubtitlesPosY = 720;
Frau.SubtitlesWidth = Game.ScreenWidth - 40;
}
method TalkAnimation(Text, EntityPfad)
{
Game.Interactive = false;
//initFrau(this);
var vordergrundLayer = Scene.GetLayer("Vordergrund");
vordergrundLayer.AddEntity("faceEntity");
vordergrundLayer.AddEntity("sprechBox");
var entityObject = vordergrundLayer.GetNode("faceEntity");
var entitySprechbox = vordergrundLayer.GetNode("sprechBox");
entitySprechbox.SetSprite("\sprites\system\sprechBox.sprite");
entitySprechbox.Interactive = false;
entitySprechbox.X = 0;
entitySprechbox.Y = 706;
entitySprechbox.active = true;
entityObject.SetSprite(EntityPfad);
entityObject.Interactive = false;
entityObject.X = 876;
entityObject.Y = 706;
entityObject.Active = true;
this.Talk(Text);
vordergrundLayer.DeleteNode(entityObject);
vordergrundLayer.DeleteNode(entitySprechbox);
Game.Interactive = true;
}
The scene init script:
if(!StateTerasse_Ballon.Visited)
{
StateTerasse_Ballon.Visited = true;
var Tuer = Scene.GetNode("Tuer");
Tuer.SetSprite("scenes\Terasse_Ballon\Tuer_oeffnen.sprite");
Sleep(2000);
Tuer.SetSprite("scenes\Terasse_Ballon\Tuer_offen.sprite");
//var FrauActor = Scene.LoadActor("actors\Frau\Frau.actor");
var FrauActor = secondActor;
FrauActor.Active = true;
FrauActor.SkipTo(300, 520);
FrauActor.GoTo(450, 520);
var ServiceActor = Scene.LoadActor("actors\Frau\Frau.actor");
ServiceActor.Active = true;
ServiceActor.SkipTo(400, 520);
ServiceActor.Talk("Hallo Wie gehts.");
FrauActor.Talk("Was geht den jetzt ab, wo ist mein Text? Den suche ich und finde Ihn nicht!");
actor.SkipTo(300, 520);
actor.GoTo(500, 520);
actor.TalkAnimation("Sie sind uns Dicht auf den Versen.", "sprites\faces\normal.sprite");
actor.TalkAnimation("Wo geht es weiter?", "sprites\faces\normal.sprite");
FrauActor.TalkAnimation("Wir müssen die Tür blockieren, ich halte Sie zu, suchen Sie was zum Verriegeln. ", "sprites\faces\Frau_normal.sprite");
//Tuer.Visible = false;
var LayerMain = Scene.GetLayer("main");
LayerMain.DeleteNode(Tuer);
//Tuer.SetSprite("scenes\Terasse_Ballon\Tuer_geschlossen.sprite");
//Scene.DeleteEntity(Tuer);
var Tuer2 = Scene.GetNode("Tuer2");
Tuer2.SetSprite("scenes\Terasse_Ballon\Tuer_schliessen.sprite");
Sleep(2000);
LayerMain.DeleteNode(Tuer2);
//Tuer2.SetSprite("scenes\Terasse_Ballon\Tuer_geschlossen.sprite");
Scene.FadeOut();
//Scene.DeleteEntity(Tuer2);
FrauActor.Active = false;
Scene.UnloadObject(FrauActor);
var BlockierendeFrau = Scene.GetNode("Frau");
BlockierendeFrau.SetSprite("scenes\Terasse_Ballon\Frau_blockieren.sprite");
Scene.FadeIn();
// this is our first visit in this scene...
}
What is all necessary for showing text of an actor and is not depending on all actors?
Perheps someone find a failure in my code.
Thanks
-
So when you say the subtitles "aren't shown at the bottom of the screen", does it mean they don't show at all or they are misplaced? "frau" is the actor with subtitle problem?
-
The subtitle of the actor "frau" isn't showed. And it seems that the problem are not the position attributes because the attributes have the same values as the other actors.
-
Well I can't see anything apparently wrong in your scripts. I'd recommend simplifying them bit by bit to see what changes. For example, try commenting out the content of TalkAnimation and only keep this.Talk(Text); inside.
-
Hmmm, I found the failure and I'm not sure why this happens.
I had a bad animation in the actor file. But I don't know why it react this way.
I just deleted the animation sprite paths in the talk animation. There are no runtime errors and all works fine but text is not showed.
If i put the paths into script again it works.
ANIMATION
{
NAME = "talk"
// nothing
}
don't show text
and this works
ANIMATION
{
NAME = "talk"
LEFT = "actors\Frau\Stehen.sprite"
RIGHT = "actors\Frau\Stehen.sprite"
UP = "actors\Frau\Stehen.sprite"
DOWN = "actors\Frau\Stehen.sprite"
UP_LEFT = "actors\Frau\Stehen.sprite"
UP_RIGHT = "actors\Frau\Stehen.sprite"
DOWN_LEFT = "actors\Frau\Stehen.sprite"
DOWN_RIGHT = "actors\Frau\Stehen.sprite"
}
-
It's a long time I used 2D actors, but I think you MUST specify all animations even if by fake ones or actor object doesn't load/work at all. But might be my memory is hazy.