The Actor object allows you to access the properties of your actors. Actor objects are created by loading an actor definition file using the Game.LoadActor or Scene.LoadActor methods.
Miscelaneous functions | |
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. |
PlayAnim | Plays an animation. |
ForceTalkAnim | Force a special animation to be used for a subsequent Talk call. |
AddAttachment | Adds an attached entity to this object. |
RemoveAttachment | Removes an attached entity from this object. |
GetAttachment | Gets a reference to an attached entity object. |
SkipTo | Перемещает объект в указанную точку. |
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. |
IsWalking | Queries whether the actor is currently walking. |
SetSprite | Sets the sprite to be used instead of actor's standing animations. |
GetSprite | Queries a sprite set by SetSprite(). |
GetSpriteObject | Queries a sprite set by SetSprite(). |
MergeAnims | Loads one or more animation sets from a file |
UnloadAnim | Unloads a specified animation set from memory |
HasAnim | Checks if the actor has an animation set with the specified name |
Предметы инвентаря | |
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 | Выясняет, имеет ли объект обработчик для указанного события. |
Type (только для чтения) | Returns always "actor" |
Direction | The direction the actor is currently facing |
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, даже в том случае, если игра работает в неинтерактивном режиме. |
Movable | Specifies whether the object can be moved by its sprites (in case the sprite frames have a "move" property set). |
Scalable | Specifies whether the object is affected by scene's scaling levels. |
Rotatable | Specifies whether the object is affected by scene's rotation levels. |
Colorable | Specifies whether the object is affected by scene's color regions. |
AlphaColor | Specifies an RGBA color of this object (overrides scene coloring); set to 0 to reset default behavior. |
BlendMode | Specifies how the object's image is blended with the background colors; 0...normal mode, 1...additive blending, 2...subtractive blending |
Scale | Specifies a scale of this object (overrides scene scaling); set to null to reset default behavior. |
ScaleX | Specifies horizontal scale of this object; set to null to reset default behavior. |
ScaleY | Specifies vertical scale of this object; set to null to reset default behavior. |
RelativeScale | Specifies a scale amount to be added to the default scene scale. |
Rotate | Specifies rotation of this object (in degrees); overrides scene rotation; set to null to reset default behavior; not available in compatibility mode |
RelativeRotate | Specifies a rotation amount to be added to the default scene rotation. |
TalkAnimName | The name of an animation set to be used for talking |
WalkAnimName | The name of an animation set to be used for walking |
IdleAnimName | The name of an animation set to be used for standing still |
TurnLeftAnimName | The name of an animation set to be used for turning left (counter clockwise) |
TurnRightAnimName | The name of an animation set to be used for turning right (clockwise) |
MouseEntry | The mouse pointer has been just moved over the object. |
MouseLeave | The mouse pointer has been just moved away from the object. |
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.
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. For actors, you can also specify an animation set name instead of filename.
Force a special animation to be used for a subsequent Talk call.
This setting has only effect on one subsequent Talk() method call. After the talking is over, the talking animation is reset back to default.
Adds an attached entity to this object.
Returns true is the attachment has been successfuly attached.
This method is typically used for attaching a "blob" shadow image to an actor or an entity. The X and Y offset is scaled accordingly to object's current scale.
Removes an attached entity from this object.
Returns true if the attachment has been successfuly detached.
Gets a reference to an attached entity object.
Returns a reference to the attached entity or null if specified attachement cannot be found.
Перемещает объект в указанную точку.
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).
Queries whether the actor is currently walking.
Returns true if the actor is walking.
Sets the sprite to be used instead of actor's standing animations.
If the method succeeds, the return value is true.
Use null as a parameter to reset the default behaviour.
Queries a sprite set by SetSprite().
Returns filename of the currently assigned sprite or null.
Queries a sprite set by SetSprite().
Returns a reference to the currently assigned sprite object or null.
Loads one or more animation sets from a file
Returns true if the method succeeded.
The file should only contain one or more ANIMATION blocks, as described in the "Actors" chapter.
Unloads a specified animation set from memory
Returns true if the method succeeded.
Checks if the actor has an animation set with the specified name
Returns true if the actor has an animation set with the specified name.
Добавляет предмет в инвентарь.
Удаляет предмет из инвентаря.
Возвращает ссылку на предмет инвентаря.
Ссылка на объект 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, если объект может обрабатывать запрашиваемое событие.