The 3D actor object allows you to access the properties of your 3D actors. 3D actor objects are created by loading an actor definition file using the Game.LoadActor3D or Scene.LoadActor3D methods.
Actions | |
GoTo | Makes the actor walk to a given point. |
GoToObject | Makes the actor walk to a specified entity. |
TurnTo | Makes actor turn to the given direction or to a given object. |
TurnToAngle | Makes actor turn to the given angle. |
IsWalking | Queries whether the actor is currently walking. |
PlayAnim | Plays an animation. |
PlayAnimChannel | Plays an animation in a specified channel. |
StopAnim | Stops a currently playing animation. |
StopAnimChannel | Stops a currently playing animation in the specified channel. |
IsAnimPlaying | Checks whether the actor is currently playing an animation |
IsAnimChannelPlaying | Checks whether the actor is currently playing an animation in a specified channel |
SetAnimTransitionTime | Sets a transition time for an animation pair |
GetAnimTransitionTime | Queries a transition time for an animation pair |
SkipTo3D | Moves the actor to a specified point in 3D space |
SetTexture | Assigns a new texture to a specified material |
Direct control | |
DirectWalk | Makes the character walk forward. |
DirectWalkBack | Makes the character walk backwards. |
DirectWalkStop | Stops character from walking. |
DirectTurnLeft | Makes the character turn counter-clockwise. |
DirectTurnRight | Makes the character turn clockwise. |
DirectTurnStop | Stops character from turning. |
Shadow related functions | |
SetShadowImage | Sets and image to be used as a simple shadow for this actor |
GetShadowImage | Gets the currently assigned image to be used as a simple shadow for this actor |
SetLightPosition | Sets the position of a light to project a real-time shadow |
Attachment functions | |
AddAttachment | Load a new model from a file and attaches it to a specified bone of this actor |
RemoveAttachment | Permanently removes a specified attachment from this actor |
GetAttachment | Gets a reference to a specified attachment object |
Animation management | |
MergeAnims | Loads animations from X file |
UnloadAnim | Unload specified named animation from memory |
Mesh related functions (deprecated) | |
HideMesh | Hides a specified part (mesh) of this actor |
ShowMesh | Shows a specified part (mesh) of this actor |
AddMesh | Load a new model from a file and attaches it to a specified bone of this actor |
RemoveMesh | Permanently removes a specified mesh from this actor |
Предметы инвентаря | |
TakeItem | Добавляет предмет в инвентарь. |
DropItem | Удаляет предмет из инвентаря. |
GetItem | Возвращает ссылку на предмет инвентаря. |
HasItem | Выясняет, есть ли в инвентаре объекта (персонажа) указанный предмет. |
Функции управления курсором | |
SetCursor | Устанавливает стандартный курсор. |
GetCursor | Возвращает имя файла спрайта курсора или null, если курсор не задан |
GetCursorObject | Возвращает ссылку на спрайт курсора (объект) или null, если курсор не задан |
RemoveCursor | Удаляет стандартный курсор. |
HasCursor | Выясняет, задан ли стандартный курсор для объекта. |
Функции для работы со сценариями | |
AttachScript | Выполняет файл сценария и прикрепляет его к объекту. |
DetachScript | Выгружает из памяти файл сценария и удаляет его связку с объектом. |
IsScriptRunning | Выясняет, прикреплён ли указанный файл сценария к объекту. |
CanHandleMethod | Выясняет, поддерживает ли объект метод с указанным именем. |
PlaySound | Воспроизводит звук. Если имя файла не указано, воспроизводится прикреплённый на настоящий момент звук (если есть). |
PlaySoundEvent | Воспроизводит звук и генерирует событие, когда воспроизведение закончится. Если имя файла не указано, воспроизводится прикреплённый на настоящий момент звук (если есть). |
StopSound | Останавливает воспроизведение звука (если есть). |
PauseSound | Ставит на паузу воспроизведение звука. |
ResumeSound | Продолжает воспроизведение после паузы. |
IsSoundPlaying | Выясняет, воспроизводится ли в настоящий момент звуковой файл. |
SetSoundPosition | Задаёт текущую позицию для воспроизведения в звуковом файле. |
GetSoundPosition | Возвращает текущую позицию для воспроизведения в звуковом файле |
SetSoundVolume | Устанавливает громкость звука. |
GetSoundVolume | Возвращает значение уровня громкости звука. |
LoadSound | Инициализирует звук из файла, подготавливая его к воспроизведению. |
Звуковые эффекты | |
SoundFXNone | Удаляет любой звуковой эффект, прикреплённый к объекту. |
SoundFXEcho | Задаёт эффект эха для любого звука, привязанного к объекту. |
SoundFXReverb | Задаёт эффект реверберации для любого звука, привязанного к объекту. |
Обработка событий | |
ApplyEvent | Вызывает указанное событие для объекта. |
CanHandleEvent | Выясняет, имеет ли объект обработчик для указанного события. |
Miscelaneous functions | |
SkipTo | Перемещает объект в указанную точку. |
Reset | Cancels the action the object was currently performing (like talking, walking etc.). |
IsTalking | Queries whether the object is currently talking. |
StopTalking | Cancels object's talking. |
Talk | Makes the object talk. |
StickToRegion | Forces this actor/entity to act like it's inside a given region |
SetFont | Sets font of this object. |
GetFont | Gets a font assigned to this object. |
Particle functions | |
CreateParticleEmitter | Initializes the particle emitter attached to this object. |
DeleteParticleEmitter | Deletes the particle emitter attached to this object. |
Type (только для чтения) | Returns always "actor3d" |
Direction | The direction the actor is currently facing |
DirectionAngle | The angle the actor is currently facing, in degrees |
Active | Specifies whether the object is visible on screen |
IgnoreItems | Specifies whether the object appears to be non-interactive when an inventory item is used on it |
SubtitlesPosRelative | Specifies whether the SubtitlesPosX and SubtitlesPosY attributes are relative to default position, or absolute screen coordinates |
SubtitlesPosX | The X position of speech subtitles (either relative to speaker's position or absolute screen coordinates) |
SubtitlesPosY | The Y position of speech subtitles (either relative to speaker's position or absolute screen coordinates) |
SubtitlesWidth | Width of speech subtitles. Set to zero to restore the default behavior. |
SubtitlesPosXCenter | Specifies if the SubtitlesPosX attribute affects the center of the subtitle or its left side. |
ParticleEmitter (только для чтения) | Returns the reference to the particle emitter object attached to this object, or null if the emitter haven't been initialized yet |
NumAttachments (только для чтения) | Returns the number of entities attached to this object. |
Name | Внутреннее имя объекта. |
Caption | Заголовок объекта. |
AccCaption | Специальный заголовок объекта, используемый специальными фукциями движка для людей с ослабленным зрением. |
X | Координата X объекта. |
Y | Координата Y объекта. |
Height (только для чтения) | Возвращает текущую высоту объекта (учитывает масштаб персонажей). |
Filename (только для чтения) | Возвращает имя файла объекта. |
Ready (только для чтения) | Возвращает true, если объект в настоящий момент не совершает никакого действия. |
Interactive | Указывает, должен ли объект реагировать на действия пользователя (быть интерактивным). |
SoundPanning | Указывает, должен ли звук, воспроизводимый данным объектом, панорамироваться в зависимости от его позиции на экране. |
NonIntMouseEvents | Указывает, должен ли объект реагировать на события MouseEntry и MouseLeave, даже в том случае, если игра работает в неинтерактивном режиме. |
Scale | The scale of this character in percent. The scale affects both the character model and its shadow. |
PosX | The 3D X coordinate of the actor's current position |
PosY | The 3D Y coordinate of the actor's current position |
PosZ | The 3D Z coordinate of the actor's current position |
Velocity | The movement velocity to be used for walking |
AngularVelocity | The turning velocity to be used for turning |
ShadowType | Specifies the shadow detail level to be used for this actor (0..none, 1..simple, 2..flat, 3..stencil shadows) |
ShadowColor | The RGBA color of the real-time shadow cast by this character |
Shadow | Specified if this character casts shadow (obsolete, use ShadowType) |
SimpleShadow | Specifies if simple shadow is used instead of real-time one (obsolete, use ShadowType) |
DrawBackfaces | Specifies whether the 3D model should display also polygons facing away from the camera. |
TalkAnimName | The name of an animation sequence to be used for talking |
WalkAnimName | The name of an animation sequence to be used for walking |
IdleAnimName | The name of an animation sequence to be used for standing still |
TurnLeftAnimName | The name of an animation sequence to be used for turning left (counter clockwise) |
TurnRightAnimName | The name of an animation sequence to be used for turning right (clockwise) |
TalkAnimChannel | The animation channel to be used for playing talking animations. |
GoToTolerance | Specifies the shortest distance between the actor's current position and its GoTo target (in pixels); If the distance is shorter than this value, GoTo command is ignored. |
AnimTransitionTime | Specifies the time taken to smoothly transition between two animations (in milliseconds) |
DropToFloor | Specifies whether the actor is always standing on the ground, no matter what Y coordinate is assigned to it. |
MouseEntry | The mouse pointer has been just moved over the object. |
MouseLeave | The mouse pointer has been just moved away from the object. |
Makes the actor walk to a given point.
The GoTo method blocks the script execution until the walking is over, while the GoToAsync method returns immediately.
Makes the actor walk to a specified entity.
This method utilizes the WalkToX, WalkToY and WalkToDirection properties of the target entity. They can be set directly in SceneEdit.
Makes actor turn to the given direction or to a given object.
The TurnTo method blocks the script execution until the turning is over, while the TurnToAsync method returns immediately. The direction can be one of the following constants: DI_UP, DI_UPRIGHT, DI_RIGHT, DI_DOWNRIGHT, DI_DOWN, DI_DOWNLEFT, DI_LEFT or DI_UPLEFT (those equal to numbers 0 to 7).
Makes actor turn to the given angle.
The TurnToAngle method blocks the script execution until the turning is over, while the TurnToAngleAsync method returns immediately.
Queries whether the actor is currently walking.
Returns true if the actor is walking.
Plays an animation.
Returns true if the animation has been played successfuly.
The PlayAnim method blocks the script execution until the animation is over, while the PlayAnimAsync method returns immediately. PlayAnim is equivalent to PlayAnimChannel with channel set to zero.
Plays an animation in a specified channel.
Returns true if the animation has been played successfuly.
The PlayAnimChannel method blocks the script execution until the animation is over, while the PlayAnimChannelAsync method returns immediately.
Stops a currently playing animation.
Returns true if the animation has been stopped successfuly.
Stops a currently playing animation in the specified channel.
Returns true if the animation has been stopped successfuly.
Checks whether the actor is currently playing an animation
Returns true if the actor is playing an animation.
If you don't specify an animation name, this method checks if any animaton is playing. Otherwise it checks if the specified animation is playing.
Checks whether the actor is currently playing an animation in a specified channel
Returns true if the actor is playing an animation in a specified channel.
If you don't specify an animation name, this method checks if any animaton is playing. Otherwise it checks if the specified animation is playing.
Sets a transition time for an animation pair
Returns true if the method succeeded.
For example, if you want to set the transition from walking to idle animation to 1 second, you'd call: actor.SetAnimTransitionTime("walk", "idle", 1000); Specify a negative Time value to restore the default transition time.
Queries a transition time for an animation pair
Returns the transition time for the specified animation pair, or a negative value if no transition time is defined.
Moves the actor to a specified point in 3D space
Assigns a new texture to a specified material
MaterialName defaults to the name of the original texture assigned to the model, without extension. For example, if the model uses texture called "path\some_texture.png", the material will be called "some_texture". TextureFilename can be either a static image or WME sprite.
Makes the character walk forward.
Makes the character walk backwards.
Stops character from walking.
Makes the character turn counter-clockwise.
Makes the character turn clockwise.
Stops character from turning.
Sets and image to be used as a simple shadow for this actor
Returns true if the image has been successfuly set.
Gets the currently assigned image to be used as a simple shadow for this actor
Returns the filename of currently assigned shadow image or null if no image is set.
Sets the position of a light to project a real-time shadow
The light position is relative to actor's position.
Load a new model from a file and attaches it to a specified bone of this actor
Returns true if the attachment has been successfuly loaded and attached.
Permanently removes a specified attachment from this actor
Returns true if the attachment has been successfuly removed.
Gets a reference to a specified attachment object
Returns a reference to an attachment object or null if there's no attachment with a specified name.
Loads animations from X file
Returns true if the animations have been successfuly merged.
Unload specified named animation from memory
Returns true if the animation has been successfuly removed.
Hides a specified part (mesh) of this actor
Returns true if the mesh has been successfuly hidden.
This method is DEPRECATED and not supported by .X models.
Shows a specified part (mesh) of this actor
Returns true if the mesh has been successfuly shown.
This method is DEPRECATED and not supported by .X models.
Load a new model from a file and attaches it to a specified bone of this actor
Returns true if the mesh has been successfuly loaded and attached.
This method is DEPRECATED and not supported by .X models.
Permanently removes a specified mesh from this actor
Returns true if the mesh has been successfuly removed.
This method is DEPRECATED and not supported by .X models.
Добавляет предмет в инвентарь.
Удаляет предмет из инвентаря.
Возвращает ссылку на предмет инвентаря.
Ссылка на объект item в инвентаре.
Выясняет, есть ли в инвентаре объекта (персонажа) указанный предмет.
Если указанный предмет есть в инвентаре объекта (персонажа), метод вернёт true.
Следует обратить внимание, что данный метод ищет предмет в инвентаре только текущего объекта (персонажа), если Вам нужно просмотреть все существующие инвентари, используйте метод Game.IsItemTaken().
Устанавливает стандартный курсор.
Возвращает true в случае успеха.
Возвращает имя файла спрайта курсора или null, если курсор не задан
Возвращает ссылку на спрайт курсора (объект) или null, если курсор не задан
Удаляет стандартный курсор.
Выясняет, задан ли стандартный курсор для объекта.
Возвращает true, если для объекта задан свой собственный стандартный курсор.
Выполняет файл сценария и прикрепляет его к объекту.
Возвращает true, если сценарий был успешно выполнен.
К каждому объекту WME можно прикреплять несколько сценариев.
Выгружает из памяти файл сценария и удаляет его связку с объектом.
В случае удачного выполнения, метод вернёт значение true.
Экземпляры сценария (threads) - это исполняемые в настоящий момент обработчики событий и методы, которые тем или иным образом включают в себя выполнение данного сценария.
Выясняет, прикреплён ли указанный файл сценария к объекту.
Возвращает true, если указанный сценарий прикреплён к объекту.
Выясняет, поддерживает ли объект метод с указанным именем.
Возвращает true, если объект поддерживает метод с указанным именем.
Воспроизводит звук. Если имя файла не указано, воспроизводится прикреплённый на настоящий момент звук (если есть).
В случае удачного выполнения, метод вернёт значение true.
Воспроизводит звук и генерирует событие, когда воспроизведение закончится. Если имя файла не указано, воспроизводится прикреплённый на настоящий момент звук (если есть).
В случае удачного выполнения, метод вернёт значение true.
Останавливает воспроизведение звука (если есть).
В случае удачного выполнения, метод вернёт значение true.
Ставит на паузу воспроизведение звука.
В случае удачного выполнения, метод вернёт значение true.
Продолжает воспроизведение после паузы.
В случае удачного выполнения, метод вернёт значение true.
Выясняет, воспроизводится ли в настоящий момент звуковой файл.
Если звук воспроизводится, метод вернёт true.
Задаёт текущую позицию для воспроизведения в звуковом файле.
В случае удачного выполнения, метод вернёт значение true.
Возвращает текущую позицию для воспроизведения в звуковом файле
Позиция в мс.
Устанавливает громкость звука.
В случае удачного выполнения, метод вернёт значение true.
Возвращает значение уровня громкости звука.
Текущий уровень громкости в процентах.
Инициализирует звук из файла, подготавливая его к воспроизведению.
В случае удачного выполнения, метод вернёт значение true.
Этот метод используется для кэширования звуковых файлов. Инициализация звука занимает некоторое время, поэтому желательно разместить её в стартовом сценарии сцены, чтобы метод PlaySound не замедлял игру. Для этой цели и служит метод LoadSound. Чтобы воспроизвести кэшированный звук, нужно просто вызвать метод PlaySound без указания имени файла, например, SomeObject.PlaySound(false);
Удаляет любой звуковой эффект, прикреплённый к объекту.
Задаёт эффект эха для любого звука, привязанного к объекту.
Пример: actor.SoundFXEcho(50, 50);
Задаёт эффект реверберации для любого звука, привязанного к объекту.
Пример: actor.SoundFXReverb(0, 0, 2000);
Вызывает указанное событие для объекта.
Возвращает true, если событие было вызвано успешно.
Выясняет, имеет ли объект обработчик для указанного события.
Возвращает true, если объект может обрабатывать запрашиваемое событие.
Перемещает объект в указанную точку.
Cancels the action the object was currently performing (like talking, walking etc.).
Queries whether the object is currently talking.
Returns true if the object is talking.
Cancels object's talking.
You can also use StopTalk() abbreviation.
Makes the object talk.
Talk method blocks the script execution until the animation is over, while the TalkAsync method returns immediately. If the duration is set to zero, it's calculated automatically either from the sound file or from the length of the subtitle.
Forces this actor/entity to act like it's inside a given region
Use this method to "lock" a z-order value of an actor or an entity.
Sets font of this object.
If the method succeeds, the return value is true.
Gets a font assigned to this object.
Returns the filename of currently assigned font.
Initializes the particle emitter attached to this object.
Returns the reference to the particle emitter object
Once initialized with this method, the particle emitter object can be queried using the ParticleEmitter property.
Deletes the particle emitter attached to this object.
Returns true if the method succeeded.