Please login or register.

Login with username, password and session length
Advanced search  

News:

Forum rules - please read before posting, it can save you a lot of time.

Author Topic: i cnt use animation charecter ???  (Read 2421 times)

0 Members and 1 Guest are viewing this topic.

Chris

  • Lurker
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 31
    • View Profile
i cnt use animation charecter ???
« on: October 22, 2009, 12:44:29 PM »

i use this method and then i cnt use animation talk for charecter .
my chaecter name is actor

how do use "method Talk" with animation charecter

plese help me

Code: WME Script
  1. method Talk(srcString,srcActor,xPosition)
  2. {
  3.  
  4.         var twin;
  5.         if (srcActor == null) twin = "talk"; // basic window with ghost
  6.         else
  7.         twin = srcActor; // NPC window
  8.  
  9.         var tmpState = Game.Interactive;
  10.         Game.Interactive = false// we save the interactivity state for later and turn it off
  11.  
  12.         var dlgWin = Game.LoadWindow("windows\dlgWindow.window"); // load the dialogue window
  13.         var  talkRobotEnt = Scene.CreateEntity()// create the entity used for talking
  14.         var tString = Game.ExpandString(srcString)// prepare the localized string to handle formatting
  15.         var tLength = tString.Length;
  16.         var lines = ToInt(tLength / 300) + 1; // find out how many lines will we need
  17.  
  18.         dlgWin.SetImage("windows/"+twin+".png");   // set the image
  19.         dlgWin.Y = 425
  20.  
  21.         // set the caption parameters
  22.         talkRobotEnt.SubtitlePosRelative = false;
  23.         talkRobotEnt.SubtitlesPosXCenter = false;
  24.         talkRobotEnt.SubtitlesWidth = 680;
  25.         talkRobotEnt.SubtitlesPosX = 90;       
  26.  
  27.         if (xPosition != null) talkRobotEnt.SubtitlesPosX = xPosition;
  28.  
  29.  
  30.         talkRobotEnt.SubtitlesPosY = 630 + 15* lines;  // position the caption in the window based on number of lines
  31.  
  32.  
  33.         talkRobotEnt.SetFont("fonts\verdana.font"); // set the speech font
  34.  
  35.         talkRobotEnt.SoundPanning = false// make the sound centered
  36.         talkRobotEnt.Talk(srcString, null, "", "", 0)// say the line
  37.  
  38.         Game.UnloadObject(dlgWin)// dispose of the window
  39.         Scene.DeleteEntity(talkRobotEnt); // kill the talk entity
  40.  
  41.         Game.Interactive = tmpState;   
  42.  
  43. }
  44.  
« Last Edit: October 23, 2009, 11:09:16 AM by Jyujinkai »
Logged

Mnemonic

  • WME developer
  • Administrator
  • Addicted to WME forum
  • *
  • Karma: 41
  • Offline Offline
  • Gender: Male
  • Posts: 5683
    • View Profile
    • Dead:Code Site
Re: i cnt use animation charecter ???
« Reply #1 on: October 23, 2009, 02:01:09 PM »

The usage is described in the original thread, isn't?
« Last Edit: October 23, 2009, 02:07:23 PM by Mnemonic »
Logged
Yes, I do have a twitter account
Please don't send me technical questions in private messages, use the forum. ::wave
 

Page created in 0.073 seconds with 21 queries.