Please login or register.

Login with username, password and session length
Advanced search  

News:

For WME related articles and tutorials visit WME Resource Center.

Author Topic: Subtitles Problem  (Read 5142 times)

0 Members and 1 Guest are viewing this topic.

Adventure Bird

  • Lurker
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 13
    • View Profile
Subtitles Problem
« 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:
Code: [Select]
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:

Code: [Select]
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:
Code: [Select]
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
Logged

Mnemonic

  • WME developer
  • Administrator
  • Addicted to WME forum
  • *
  • Karma: 41
  • Offline Offline
  • Gender: Male
  • Posts: 5683
    • View Profile
    • Dead:Code Site
Re: Subtitles Problem
« Reply #1 on: August 09, 2010, 11:41:55 AM »

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?
Logged
Yes, I do have a twitter account
Please don't send me technical questions in private messages, use the forum. ::wave

Adventure Bird

  • Lurker
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 13
    • View Profile
Re: Subtitles Problem
« Reply #2 on: August 09, 2010, 05:17:49 PM »

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.
Logged

Mnemonic

  • WME developer
  • Administrator
  • Addicted to WME forum
  • *
  • Karma: 41
  • Offline Offline
  • Gender: Male
  • Posts: 5683
    • View Profile
    • Dead:Code Site
Re: Subtitles Problem
« Reply #3 on: August 09, 2010, 05:34:58 PM »

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.
Logged
Yes, I do have a twitter account
Please don't send me technical questions in private messages, use the forum. ::wave

Adventure Bird

  • Lurker
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 13
    • View Profile
Re: Subtitles Problem
« Reply #4 on: August 09, 2010, 06:00:40 PM »

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.

Code: [Select]
ANIMATION
  {
    NAME       = "talk"
   
    // nothing
  }

don't show text

and this works
Code: [Select]
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"
  }
Logged

metamorphium

  • Global Moderator
  • Addicted to WME forum
  • *
  • Karma: 12
  • Offline Offline
  • Gender: Male
  • Posts: 1511
  • Vampires!
    • View Profile
    • CBE  software s.r.o.
Re: Subtitles Problem
« Reply #5 on: August 13, 2010, 08:07:28 AM »

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.
Logged
J.U.L.I.A. Enhanced Edition, Vampires!, J.U.L.I.A., J.U.L.I.A. Untold, Ghost in the Sheet
 

Page created in 0.31 seconds with 20 queries.