Wintermute Engine Forum
Wintermute Engine => Technical forum => Topic started by: Chris on October 22, 2009, 12:44:29 PM
Title:
i cnt use animation charecter ???
Post by:
Chris
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
method
Talk
(
srcString,srcActor,xPosition
)
{
var
twin;
if
(
srcActor ==
null
)
twin =
"talk"
;
// basic window with ghost
else
twin = srcActor;
// NPC window
var
tmpState =
Game
.
Interactive
;
Game
.
Interactive
=
false
;
// we save the interactivity state for later and turn it off
var
dlgWin =
Game
.
LoadWindow
(
"windows\dlgWindow.window"
)
;
// load the dialogue window
var
talkRobotEnt =
Scene
.
CreateEntity
(
)
;
// create the entity used for talking
var
tString =
Game
.
ExpandString
(
srcString
)
;
// prepare the localized string to handle formatting
var
tLength = tString.
Length
;
var
lines =
ToInt
(
tLength /
300
)
+
1
;
// find out how many lines will we need
dlgWin.
SetImage
(
"windows/"
+twin+
".png"
)
;
// set the image
dlgWin.
Y
=
425
;
// set the caption parameters
talkRobotEnt.
SubtitlePosRelative
=
false
;
talkRobotEnt.
SubtitlesPosXCenter
=
false
;
talkRobotEnt.
SubtitlesWidth
=
680
;
talkRobotEnt.
SubtitlesPosX
=
90
;
if
(
xPosition !=
null
)
talkRobotEnt.
SubtitlesPosX
= xPosition;
talkRobotEnt.
SubtitlesPosY
=
630
+
15
* lines;
// position the caption in the window based on number of lines
talkRobotEnt.
SetFont
(
"fonts\verdana.font"
)
;
// set the speech font
talkRobotEnt.
SoundPanning
=
false
;
// make the sound centered
talkRobotEnt.
Talk
(
srcString,
null
,
""
,
""
,
0
)
;
// say the line
Game
.
UnloadObject
(
dlgWin
)
;
// dispose of the window
Scene
.
DeleteEntity
(
talkRobotEnt
)
;
// kill the talk entity
Game
.
Interactive
= tmpState;
}
Title:
Re: i cnt use animation charecter ???
Post by:
Mnemonic
on
October 23, 2009, 02:01:09 PM
The usage is described in the original thread (http://forum.dead-code.org/index.php?topic=3033), isn't?