This page describes how to set up the Dialogue System with Emerald AI 2024 by Black Horizon Studios. (Emerald AI 2024 is required.)
Emerald AI copyright © Black Horizon Studios.
\htmlonly
This package works with Emerald AI 2024.
You can use the Lua functions below in your dialogue entry Scripts and Conditions (or anywhere you use Lua). Note the exact number and type of parameters required for each function.
In the '...' Lua wizard dropdowns, these functions are available in Custom > Emerald.
Lua Function | Description |
---|---|
GetEmeraldAIHealth("ai") | Returns the current health of an AI specified by GameObject name. |
DamageEmeraldAI("ai", amount, "targetType") | Damages an AI. Damage comes from the type specified by targetType (Player, AI, or NonAITarget). |
EmeraldAIEmote("ai", soundID, animationID) | Plays a sound effect ID and/or animation ID. Pass -1 as the ID if you don't want to play either one. |
EmeraldAIFollow("ai", "target") | Makes an AI follow a target (name of a GameObject). |
EmeraldAIStay("ai") | Makes an AI stop following. |
GetEmeraldPlayerRelation("ai") | Returns the AI's faction relation to the player ("Player" faction). |
GetEmeraldFactionRelation("ai", "targetFaction") | Returns the AI's faction relation to a target faction. |
SetEmeraldPlayerRelation("ai", "relation") | Sets the AI's relation to the player to "Enemy", "Neutral", or "Friendly". |
SetEmeraldFactionRelation("ai", "targetFaction", "relation") | Sets the AI's relation to targetFaction to "Enemy", "Neutral", or "Friendly". |
SetEmeraldFaction("ai", "newFaction") | Changes an AI's faction. |
SetEmeraldBehavior("ai", "behavior") | Sets an AI's behavior (Aggressive, Cautious, Passive). |
SetEmeraldDestination("ai", "destination") | Sets an AI's movement destination (name of a GameObject). |
SetEmeraldItem("ai", itemID, enable) | Sets an item enabled or disabled. To disable all items, pass -1 for itemID and false for enable. |
SetEmeraldWeapon("ai", "type", enable) | Enables or disables an AI's weapon. For "type", you must specify "Weapon Type 1" or "Weapon Type 2". |
SetEmeraldWander("ai", "wander") | Sets an AI's wander type (Destination, Dynamic, Stationary, Waypoints). |
Examples: