Difference between revisions of "Event"

From Dragon Age Toolset Wiki
Jump to: navigation, search
(getting started on splitting this monster up)
(saving work in progress)
Line 49: Line 49:
 
**[[EVENT_TYPE_APPLY_EFFECT]] - an effect is applied to the receiving object
 
**[[EVENT_TYPE_APPLY_EFFECT]] - an effect is applied to the receiving object
 
**[[EVENT_TYPE_REMOVE_EFFECT]] - an effect is removed from the receiving object
 
**[[EVENT_TYPE_REMOVE_EFFECT]] - an effect is removed from the receiving object
 
+
* Combat
== Combat ==
+
**[[ EVENT_TYPE_COMBAT_INITIATED ]] - Fires whenever the attack command is added into the command queue. Used to set combat mode and combat camera/music. Also fires by scripting to trigger combat after being attacked or an ally is attack.  
 
+
**[[ EVENT_TYPE_COMBAT_END ]] - a creature doesn't perceive any more hostiles.  
=== EVENT_TYPE_COMBAT_INITIATED ===
+
**[[ EVENT_TYPE_MELEE_ATTACK_START ]] - {{undocumented}}
 
+
**[[ EVENT_TYPE_COMMAND_PENDING ]] - Fires at the beginning of the attack part of the attack command OR at the beginning of an ability execution.  
*<b>Sent When:</b> Fires whenever the attack command is added into the command queue. Used to set combat mode and combat camera/music. Also fires by scripting to trigger combat after being attacked or an ally is attack.
+
**[[ EVENT_TYPE_COMMAND_COMPLETE ]] - creature finishes doing a command(attack, special ability, spell, conversation, etc)  
*<b>Sent From:</b> Engine
+
**[[ EVENT_TYPE_ATTACK_IMPACT ]] -- An attack has impacted the target. This can be melee (sword hit), ranged (arrow hit) or spell (fireball explodes). Used for applying damage, and handling abilities that function on hit (Berserk etc').  
*<b>Sent To:</b> creatures, players.
+
**[[ EVENT_TYPE_ATTACKED ]] - another object tried attacking this creature using melee/ranged weapons (hit or miss), talents or spells.  
 
+
**[[ EVENT_TYPE_ALLY_ATTACKED ]] - an ally has received the ATTACKED event. An ally is an object with the same group ID.  
Parameters:
+
* Damage and death
*<b>Creator:</b> attacking creature
+
**[[ EVENT_TYPE_DAMAGED ]] - an object loses 1 hit point or more
*<b>Object 0:</b> target creature
+
**[[ EVENT_TYPE_DOT_TICK ]] - Damage over time tick event.
 
+
**[[ EVENT_TYPE_DYING ]] - a creature received the killing blow.
=== EVENT_TYPE_COMBAT_END ===
+
**[[ EVENT_TYPE_DEATH ]] - creature or placeable have the death effect applied (regardless of hitpoints)
 
+
**[[ EVENT_TYPE_RESURRECTION ]] - Creature resurrected.
*<b>Sent When:</b> a creature doesn't perceive any more hostiles.
+
**[[ EVENT_TYPE_TEAM_DESTROYED ]] - Fires when an entire team of creatures is destroyed.  
*<b>Sent From:</b>
+
* Inventory
*<b>Sent To:</b>
+
**[[ EVENT_TYPE_INVENTORY_ADDED ]] - An item is added to the personal inventory of the object receiving the event or the party inventory.
 
+
*[[ EVENT_TYPE_INVENTORY_REMOVED ]] - An item is removed from the personal inventory of the object receiving the event or the party inventory.
Parameters:
+
**[[ EVENT_TYPE_EQUIP ]] - The current creature has equipped an item
 
+
**[[ EVENT_TYPE_UNEQUIP ]] - The current creature has unequipped an item
=== EVENT_TYPE_MELEE_ATTACK_START ===
+
**[[ EVENT_TYPE_CAMPAIGN_ITEM_ACQUIRED ]] - items with the ITEM_ACQUIRED_EVENT_ID variable set are picked up.
 
+
**[[ EVENT_TYPE_INVENTORY_FULL ]] - {{undocumented}}
*<b>Sent When:</b>
+
**[[ EVENT_TYPE_OUT_OF_AMMO ]] - {{undocumented}}
*<b>Sent From:</b>
+
* Movement
*<b>Sent To:</b>
+
**[[ EVENT_TYPE_BLOCKED ]] - The current creature's path has been blocked while moving by a creature or door. This event will NOT fire when blocked by placeables who can not change the walk mesh or terrain.
 
+
**[[ EVENT_TYPE_ENTER ]] - A creature enters the object receiving the event
Parameters:
+
**[[ EVENT_TYPE_EXIT ]] - A creature exits the object receiving the event
 
+
**[[ EVENT_TYPE_REACHED_WAYPOINT ]] - {{undocumented}}
=== EVENT_TYPE_COMMAND_PENDING ===
+
 
+
*<b>Sent When:</b> Fires at the beginning of the attack part of the attack command OR at the beginning of an ability execution. The attack command includes walk->orient->attack - this event fires right before the attack part. When this event is received, the script is supposed to check if we need to disable a modal talent, verify mana/stamina values, verify valid target, calculate an attack roll (hit/miss/critical) and then calculate damage and inform the engine of the results.
+
*<b>Sent From:</b> Engine
+
*<b>Sent To:</b> creatures, players
+
 
+
Parameters:
+
*<b>Creator:</b> attacking creature
+
*<b>Object 0:</b> creature triggering the command
+
*<b>Object 1:</b> target creature, if applicable
+
*<b>Int 0:</b> command ID of the pending command
+
*<b>Int 1:</b> command sub-type, if applicable - used mostly for ability ID for CommandUseAbility.
+
*<b>Int 2:</b> ResistenceCheckResult (set in ability_core.nss)
+
 
+
=== EVENT_TYPE_COMMAND_COMPLETE ===
+
*<b>Sent When:</b> creature finishes doing a command(attack, special ability, spell, conversation, etc)
+
*<b>Sent From:</b> engine
+
*<b>Sent To:</b> creatures, player
+
 
+
Parameters:
+
*<b>Creator:</b> creature acting
+
*<b>Int 0</b> Type of the last command (e.g. COMMAND_TYPE_ATTACKED)
+
*<b>Int 1</b> The status of the execution (COMMAND_SUCCESSFUL, etc)
+
*<b>Int 2</b> last sub command
+
*<b>obj(0)</b> The target that command was applied to
+
 
+
=== EVENT_TYPE_ATTACK_IMPACT ===
+
 
+
An attack has impacted the target. This can be melee (sword hit), ranged (arrow hit) or spell (fireball explodes). Used for applying damage, and handling abilities that function on hit (Berserk etc').
+
*<b>Sent When:</b> Exact moment of impact
+
*<b>Sent From:</b> Engine
+
*<b>Sent To:</b> attacking creature or player.
+
 
+
Parameters:
+
*<b>Creator:</b> attacker
+
*<b>Object 0:</b> attacker
+
*<b>Object 1:</b> target
+
*<b>Int 0:</b> hit result (hit, miss, critical etc')
+
*<b>Int 1:</b> damage
+
 
+
=== EVENT_TYPE_ATTACKED ===
+
 
+
*<b>Sent When:</b> another object tried attacking this creature using melee/ranged weapons (hit or miss), talents or spells.
+
*<b>Sent From:</b> scripts (Rules_ResolveAttack function)
+
*<b>Sent To:</b> creatures, placeables
+
 
+
Parameters:
+
*<b>Creator:</b> attacking object
+
*<b>Object 0:</b> attacking object
+
 
+
=== EVENT_TYPE_ALLY_ATTACKED ===
+
 
+
*<b>Sent When:</b> an ally has received the ATTACKED event. An ally is an object with the same group ID.
+
*<b>Sent From:</b> scripts (rules_core - attack event handler)
+
*<b>Sent To:</b> Allied creatures, placeables (of the same group as the sender)
+
 
+
Parameters:
+
*<b>Creator:</b> ally object (object being attacked)
+
*<b>Object 0:</b> attacking object
+
 
+
 
+
== Damage and death ==
+
 
+
=== EVENT_TYPE_DAMAGED ===
+
 
+
*<b>Sent When:</b> an object loses 1 hit point or more
+
*<b>Sent From:</b> scripts
+
*<b>Sent To:</b> creatures, placeables
+
 
+
Parameters:
+
*<b>Creator:</b> creature dealing the damage
+
*<b>Int 0:</b> amount of damage dealt
+
*<b>Int 1:</b> type of damage dealt
+
 
+
=== EVENT_TYPE_DOT_TICK ===
+
 
+
Damage over time tick event.
+
This is activated from EffectDOT and keeps rescheduling itself while DOTs are in effect on the creature
+
 
+
*<b>Sent When:</b>
+
*<b>Sent From:</b>
+
*<b>Sent To:</b> creatures
+
 
+
Parameters:
+
 
+
=== EVENT_TYPE_DYING ===
+
 
+
*<b>Sent When:</b> a creature received the killing blow.
+
*<b>Sent From:</b> effect_death_h
+
*<b>Sent To:</b> the creature getting the killing blow.
+
 
+
creature_core handles XP and treasure awards.
+
 
+
Parameters:
+
* Object 0: Killer
+
 
+
 
+
=== EVENT_TYPE_DEATH ===
+
*<b>Sent When:</b> creature or placeable have the death effect applied (regardless of hitpoints)
+
*<b>Sent From:</b> scripts
+
*<b>Sent To:</b> creatures, placeables
+
 
+
Handles shutdown of creature's AI, perception, etc. and replaces it with a bodybag.
+
 
+
Parameters:
+
*<b>Creator:</b> killing object
+
 
+
=== EVENT_TYPE_RESURRECTION ===
+
 
+
*<b>Sent When:</b> Creature resurrected.
+
*<b>Sent From:</b>
+
*<b>Sent To:</b>
+
 
+
Parameters:
+
 
+
=== EVENT_TYPE_TEAM_DESTROYED ===
+
 
+
*<b>Sent When:</b> Fires when an entire team of creatures is destroyed.  
+
*<b>Sent From:</b>
+
*<b>Sent To:</b> Area the team is in
+
 
+
The event is fired to the last living creature on the team.
+
 
+
Parameters:
+
 
+
*integer 0 is the team number that was destroyed.
+
 
+
 
+
== Inventory ==
+
 
+
=== EVENT_TYPE_INVENTORY_ADDED ===
+
 
+
*<b>Sent When:</b> An item is added to the personal inventory of the object receiving the event or the party inventory.
+
*<b>Sent From:</b> engine
+
*<b>Sent To:</b> creatures, placeables, player/party
+
 
+
Parameters:
+
*<b>Creator:</b> old owner of the item, OBJECT_INVALID if item is created on object
+
*<b>Object 0:</b> item being added
+
 
+
=== EVENT_TYPE_INVENTORY_REMOVED ===
+
 
+
*<b>Sent When:</b> An item is removed from the personal inventory of the object receiving the event or the party inventory.
+
*<b>Sent From:</b> engine
+
*<b>Sent To:</b> creatures, placeables, player/party
+
 
+
Parameters:
+
*<b>Creator:</b> new owner of the item, OBJECT_INVALID if item is being destroyed on object
+
*<b>Object 0:</b> item being added
+
 
+
=== EVENT_TYPE_EQUIP ===
+
 
+
*<b>Sent When:</b> The current creature has equipped an item
+
*<b>Sent From:</b> engine
+
*<b>Sent To:</b> creatures
+
 
+
Parameters:
+
*<b>Creator:</b> The object equipping an item
+
*<b>Object0:</b> The item being equipped
+
 
+
=== EVENT_TYPE_UNEQUIP ===
+
 
+
*<b>Sent When:</b> The current creature has unequipped an item
+
*<b>Sent From:</b> engine
+
*<b>Sent To:</b> creatures
+
 
+
Parameters:
+
*<b>Creator:</b> item being unequipped
+
 
+
=== EVENT_TYPE_CAMPAIGN_ITEM_ACQUIRED ===
+
 
+
*<b>Sent When:</b> items with the ITEM_ACQUIRED_EVENT_ID variable set are picked up.
+
*<b>Sent From:</b>
+
*<b>Sent To:</b> module
+
 
+
Parameters:
+
*Creator: item acquirer
+
*Object 0: the item that's been acquired
+
 
+
=== EVENT_TYPE_INVENTORY_FULL ===
+
 
+
*<b>Sent When:</b>
+
*<b>Sent From:</b>
+
*<b>Sent To:</b> module
+
 
+
Parameters:
+
 
+
=== EVENT_TYPE_OUT_OF_AMMO ===
+
 
+
*<b>Sent When:</b>
+
*<b>Sent From:</b>
+
*<b>Sent To:</b>
+
 
+
Parameters:
+
 
+
 
+
== Movement ==
+
 
+
=== EVENT_TYPE_BLOCKED ===
+
*<b>Sent When:</b> The current creature's path has been blocked while moving by a creature or door. This event will NOT fire when blocked by placeables who can not change the walk mesh or terrain.
+
*<b>Sent From:</b> engine
+
*<b>Sent To:</b> creatures
+
 
+
Parameters:
+
*<b>Creator:</b> blocking object. Also, this doesn't exist yet, but we'll need this event to fire for any time that the pathfinding failed.
+
 
+
=== EVENT_TYPE_ENTER ===
+
*<b>Sent When:</b> A creature enters the object receiving the event
+
*<b>Sent From:</b> engine
+
*<b>Sent To:</b> AOEs, areas, triggers
+
 
+
Parameters:
+
*<b>Creator:</b> creature entering the object
+
 
+
=== EVENT_TYPE_EXIT ===
+
*<b>Sent When:</b> A creature exits the object receiving the event
+
*<b>Sent From:</b> engine
+
*<b>Sent To:</b> AOEs, areas, triggers
+
Parameters:
+
*<b>Creator:</b> creature exiting the object
+
 
+
=== EVENT_TYPE_REACHED_WAYPOINT ===
+
 
+
*<b>Sent When:</b>
+
*<b>Sent From:</b>
+
*<b>Sent To:</b>
+
 
+
Parameters:
+
 
+
  
 
== Traps ==
 
== Traps ==
  
=== EVENT_TYPE_APPROACH_TRAP ===
+
[[ EVENT_TYPE_APPROACH_TRAP ]]
  
 
*<b>Sent When:</b> Trap triggered and the creature receiving this event should approach the trap
 
*<b>Sent When:</b> Trap triggered and the creature receiving this event should approach the trap
Line 319: Line 90:
 
*Object 0: trap
 
*Object 0: trap
  
=== EVENT_TYPE_TRAP_ARM ===
+
[[ EVENT_TYPE_TRAP_ARM ]]
  
 
*<b>Sent When:</b> Sent by script to request that a trap arm itself.
 
*<b>Sent When:</b> Sent by script to request that a trap arm itself.
Line 327: Line 98:
 
Parameters:
 
Parameters:
  
=== EVENT_TYPE_TRAP_TRIGGER_ENTER ===
+
[[ EVENT_TYPE_TRAP_TRIGGER_ENTER ]]
  
 
*<b>Sent When:</b>  
 
*<b>Sent When:</b>  
Line 335: Line 106:
 
Parameters:
 
Parameters:
  
=== EVENT_TYPE_TRAP_DISARMED ===
+
[[ EVENT_TYPE_TRAP_DISARMED ]]
  
 
*<b>Sent When:</b>  
 
*<b>Sent When:</b>  
Line 343: Line 114:
 
Parameters:
 
Parameters:
  
=== EVENT_TYPE_TRAP_TRIGGER_ARMED ===
+
[[ EVENT_TYPE_TRAP_TRIGGER_ARMED ]]
  
 
*<b>Sent When:</b>  
 
*<b>Sent When:</b>  
Line 351: Line 122:
 
Parameters:
 
Parameters:
  
=== EVENT_TYPE_TRAP_TRIGGER_EXIT ===
+
[[ EVENT_TYPE_TRAP_TRIGGER_EXIT ]]
  
 
*<b>Sent When:</b>  
 
*<b>Sent When:</b>  
Line 358: Line 129:
  
 
Parameters:
 
Parameters:
=== EVENT_TYPE_TRAP_TRIGGERED ===
+
[[ EVENT_TYPE_TRAP_TRIGGERED ]]
  
 
*<b>Sent When:</b>  
 
*<b>Sent When:</b>  
Line 370: Line 141:
 
== Game state events ==
 
== Game state events ==
  
=== EVENT_TYPE_SPAWN ===
+
[[ EVENT_TYPE_SPAWN ]]
 
*<b>Sent When:</b> an object spawns into the game. This event can fire only once per game for each object, regardless of save games.
 
*<b>Sent When:</b> an object spawns into the game. This event can fire only once per game for each object, regardless of save games.
 
*<b>Sent From:</b> engine
 
*<b>Sent From:</b> engine
Line 378: Line 149:
 
*<b>Creator:</b> ??? -> should probably be parent of object spawning (area. module etc')
 
*<b>Creator:</b> ??? -> should probably be parent of object spawning (area. module etc')
  
=== EVENT_TYPE_MODULE_START ===
+
[[ EVENT_TYPE_MODULE_START ]]
 
*<b>Sent When:</b> The module starts. This can happen only once for a single game instance.
 
*<b>Sent When:</b> The module starts. This can happen only once for a single game instance.
 
*<b>Sent From:</b> engine
 
*<b>Sent From:</b> engine
Line 385: Line 156:
 
*<b>Creator:</b> ???
 
*<b>Creator:</b> ???
  
=== EVENT_TYPE_MODULE_LOAD ===
+
[[ EVENT_TYPE_MODULE_LOAD ]]
 
*<b>Sent When:</b> The module loads from a save game. This event can fire more than once for a single module or game instance.
 
*<b>Sent When:</b> The module loads from a save game. This event can fire more than once for a single module or game instance.
 
*<b>Sent From:</b> engine
 
*<b>Sent From:</b> engine
Line 393: Line 164:
 
*<b>Creator:</b> ???
 
*<b>Creator:</b> ???
  
=== EVENT_TYPE_AREALOAD_SPECIAL ===
+
[[ EVENT_TYPE_AREALOAD_SPECIAL ]]
  
 
*<b>Sent When:</b> it is for playing things like cutscenes and movies when you enter an area, things that do not involve AI or actual game play
 
*<b>Sent When:</b> it is for playing things like cutscenes and movies when you enter an area, things that do not involve AI or actual game play
Line 401: Line 172:
 
Parameters:
 
Parameters:
  
=== EVENT_TYPE_AREALOAD_PRELOADEXIT ===
+
[[ EVENT_TYPE_AREALOAD_PRELOADEXIT ]]
  
 
*<b>Sent When:</b> for things you want to happen while the load screen is still up, things like moving creatures around
 
*<b>Sent When:</b> for things you want to happen while the load screen is still up, things like moving creatures around
Line 409: Line 180:
 
Parameters:
 
Parameters:
  
=== EVENT_TYPE_AREALOAD_POSTLOADEXIT ===
+
[[ EVENT_TYPE_AREALOAD_POSTLOADEXIT ]]
  
 
*<b>Sent When:</b>  
 
*<b>Sent When:</b>  
Line 420: Line 191:
 
When: fires at the same time that the load screen is going away, and can be used for things that you want to make sure the player sees.
 
When: fires at the same time that the load screen is going away, and can be used for things that you want to make sure the player sees.
  
=== EVENT_TYPE_AREALOADSAVE_POSTLOADEXIT ===
+
[[ EVENT_TYPE_AREALOADSAVE_POSTLOADEXIT ]]
  
 
*<b>Sent When:</b> fires at the same time that the load screen is going away, but only when loading a savegame.
 
*<b>Sent When:</b> fires at the same time that the load screen is going away, but only when loading a savegame.
Line 428: Line 199:
 
Parameters:
 
Parameters:
  
=== EVENT_TYPE_GAMEMODE_CHANGE ===
+
[[ EVENT_TYPE_GAMEMODE_CHANGE ]]
  
 
*<b>Sent When:</b> Game Mode Switch
 
*<b>Sent When:</b> Game Mode Switch
Line 439: Line 210:
 
*int(1) - Old Game Mode (GM_* constant)
 
*int(1) - Old Game Mode (GM_* constant)
  
=== EVENT_TYPE_DELAYED_GM_CHANGE ===
+
[[ EVENT_TYPE_DELAYED_GM_CHANGE ]]
  
 
*<b>Sent When:</b>  
 
*<b>Sent When:</b>  
Line 447: Line 218:
 
Parameters:
 
Parameters:
  
=== EVENT_TYPE_SET_GAME_MODE ===
+
[[ EVENT_TYPE_SET_GAME_MODE ]]
  
 
*<b>Sent When:</b> the game mode is set
 
*<b>Sent When:</b> the game mode is set
Line 460: Line 231:
 
== Plots ==
 
== Plots ==
  
=== EVENT_TYPE_SET_PLOT ===
+
[[ EVENT_TYPE_SET_PLOT ]]
 
*<b>Sent When:</b> A plot is setting a plot flag
 
*<b>Sent When:</b> A plot is setting a plot flag
 
*<b>Sent From:</b> engine
 
*<b>Sent From:</b> engine
Line 475: Line 246:
 
IMPORTANT: The flag value on a SET event is set only AFTER this script finishes running!
 
IMPORTANT: The flag value on a SET event is set only AFTER this script finishes running!
  
=== EVENT_TYPE_GET_PLOT ===
+
[[ EVENT_TYPE_GET_PLOT ]]
 
*<b>Sent When:</b> A plot is setting a plot flag
 
*<b>Sent When:</b> A plot is setting a plot flag
 
*<b>Sent From:</b> engine
 
*<b>Sent From:</b> engine
Line 491: Line 262:
  
  
=== EVENT_TYPE_DIALOGUE ===
+
[[ EVENT_TYPE_DIALOGUE ]]
 
*<b>Sent When:</b> An object tries to initiate dialog with the object receiving the event, either by clicking or by scripting
 
*<b>Sent When:</b> An object tries to initiate dialog with the object receiving the event, either by clicking or by scripting
 
*<b>Sent From:</b> engine (clicking on object to talk) or scripts (manually sending this event)
 
*<b>Sent From:</b> engine (clicking on object to talk) or scripts (manually sending this event)
Line 500: Line 271:
 
*<b>String 0:</b> Dialog to initiate, "" to use default object dialog
 
*<b>String 0:</b> Dialog to initiate, "" to use default object dialog
  
=== EVENT_TYPE_DELAYED_SHOUT ===
+
[[ EVENT_TYPE_DELAYED_SHOUT ]]
  
 
*<b>Sent When:</b> Used to fire a dialog shout every few seconds.
 
*<b>Sent When:</b> Used to fire a dialog shout every few seconds.
Line 508: Line 279:
 
Parameters:
 
Parameters:
  
=== EVENT_TYPE_AMBIENT_CONTINUE ===
+
[[ EVENT_TYPE_AMBIENT_CONTINUE ]]
  
 
*<b>Sent When:</b> conversation ends or player is nearby to resume ambient behaviour  
 
*<b>Sent When:</b> conversation ends or player is nearby to resume ambient behaviour  
Line 521: Line 292:
 
== Party management ==
 
== Party management ==
  
=== EVENT_TYPE_PARTYMEMBER_ADDED ===
+
[[ EVENT_TYPE_PARTYMEMBER_ADDED ]]
  
 
*<b>Sent When:</b> Party member added to active party using the party GUI  
 
*<b>Sent When:</b> Party member added to active party using the party GUI  
Line 529: Line 300:
 
Parameters:
 
Parameters:
  
=== EVENT_TYPE_PARTYMEMBER_DROPPED ===
+
[[ EVENT_TYPE_PARTYMEMBER_DROPPED ]]
  
 
*<b>Sent When:</b> Party member removed from active party using the party GUI  
 
*<b>Sent When:</b> Party member removed from active party using the party GUI  
Line 537: Line 308:
 
Parameters:
 
Parameters:
  
=== EVENT_TYPE_PARTYPICKER_CLOSED ===
+
[[ EVENT_TYPE_PARTYPICKER_CLOSED ]]
  
 
*<b>Sent When:</b>  
 
*<b>Sent When:</b>  
Line 545: Line 316:
 
Parameters:
 
Parameters:
  
=== EVENT_TYPE_PARTY_MEMBER_HIRED ===
+
[[ EVENT_TYPE_PARTY_MEMBER_HIRED ]]
  
 
*<b>Sent When:</b> Fires first time a party member is added to the party. For plot followers: follower recruited (added to pool). For other followers: UT_Hire called
 
*<b>Sent When:</b> Fires first time a party member is added to the party. For plot followers: follower recruited (added to pool). For other followers: UT_Hire called
Line 553: Line 324:
 
Parameters:
 
Parameters:
  
=== EVENT_TYPE_PARTY_MEMBER_FIRED ===
+
[[ EVENT_TYPE_PARTY_MEMBER_FIRED ]]
  
 
*<b>Sent When:</b> Fires when an active or locked-active party member is removed from the active party
 
*<b>Sent When:</b> Fires when an active or locked-active party member is removed from the active party
Line 562: Line 333:
  
  
=== EVENT_TYPE_PARTY_MEMBER_RES_TIMER ===
+
[[ EVENT_TYPE_PARTY_MEMBER_RES_TIMER ]]
  
 
Resurrection timer used if a creature dies in explore mode.
 
Resurrection timer used if a creature dies in explore mode.
Line 574: Line 345:
 
Parameters:
 
Parameters:
  
=== EVENT_TYPE_GIFT_ITEM ===
+
[[ EVENT_TYPE_GIFT_ITEM ]]
  
 
*<b>Sent When:</b>  
 
*<b>Sent When:</b>  
Line 582: Line 353:
 
Parameters:
 
Parameters:
  
=== EVENT_TYPE_MODULE_HANDLE_FOLLOWER_DEATH ===
+
[[ EVENT_TYPE_MODULE_HANDLE_FOLLOWER_DEATH ]]
  
 
*<b>Sent When:</b>  
 
*<b>Sent When:</b>  
Line 590: Line 361:
 
Parameters:
 
Parameters:
  
=== EVENT_TYPE_MODULE_HANDLE_GIFT ===
+
[[ EVENT_TYPE_MODULE_HANDLE_GIFT ]]
  
 
*<b>Sent When:</b>  
 
*<b>Sent When:</b>  
Line 600: Line 371:
 
* GiftTag: String 0
 
* GiftTag: String 0
  
=== EVENT_TYPE_SUMMON_DIED ===
+
[[ EVENT_TYPE_SUMMON_DIED ]]
  
 
*<b>Sent When:</b>  
 
*<b>Sent When:</b>  
Line 612: Line 383:
 
== Character generation and level advancement ==
 
== Character generation and level advancement ==
  
=== EVENT_TYPE_CHARGEN_START and EVENT_TYPE_CHARGEN_END ===
+
[[ EVENT_TYPE_CHARGEN_START and EVENT_TYPE_CHARGEN_END ]]
  
 
A range of event constants (nEvent >= EVENT_TYPE_CHARGEN_START && nEvent <= EVENT_TYPE_CHARGEN_END) that occur during character generation.
 
A range of event constants (nEvent >= EVENT_TYPE_CHARGEN_START && nEvent <= EVENT_TYPE_CHARGEN_END) that occur during character generation.
Line 622: Line 393:
 
Parameters:
 
Parameters:
  
=== EVENT_TYPE_PLAYER_LEVELUP ===
+
[[ EVENT_TYPE_PLAYER_LEVELUP ]]
  
 
*<b>Sent When:</b> Creature is spawned.
 
*<b>Sent When:</b> Creature is spawned.
Line 630: Line 401:
 
Parameters:
 
Parameters:
  
=== EVENT_TYPE_PLAYERLEVELUP ===
+
[[ EVENT_TYPE_PLAYERLEVELUP ]]
  
 
*<b>Sent When:</b>  
 
*<b>Sent When:</b>  
Line 638: Line 409:
 
Parameters:
 
Parameters:
  
=== EVENT_TYPE_CHARGEN_AUTOLEVEL ===
+
[[ EVENT_TYPE_CHARGEN_AUTOLEVEL ]]
  
 
*<b>Sent When:</b>  
 
*<b>Sent When:</b>  
Line 646: Line 417:
 
Parameters:
 
Parameters:
  
=== EVENT_TYPE_MODULE_CHARGEN_DONE ===
+
[[ EVENT_TYPE_MODULE_CHARGEN_DONE ]]
  
 
Fired the the core chargen script into the module
 
Fired the the core chargen script into the module
Line 656: Line 427:
 
Parameters:
 
Parameters:
  
=== EVENT_TYPE_GUI_OPENED ===
+
[[ EVENT_TYPE_GUI_OPENED ]]
  
 
GUI tutorial calls
 
GUI tutorial calls
Line 668: Line 439:
 
== World map ==
 
== World map ==
  
=== EVENT_TYPE_TRANSITION_TO_WORLD_MAP ===
+
[[ EVENT_TYPE_TRANSITION_TO_WORLD_MAP ]]
  
 
*<b>Sent When:</b> Player uses the generic transition system to open the world map
 
*<b>Sent When:</b> Player uses the generic transition system to open the world map
Line 684: Line 455:
  
  
=== EVENT_TYPE_WORLD_MAP_CLOSED ===
+
[[ EVENT_TYPE_WORLD_MAP_CLOSED ]]
  
 
*<b>Sent When:</b>  
 
*<b>Sent When:</b>  
Line 693: Line 464:
 
*Integer 0: close type, 0 for cancel, 1 for travel.
 
*Integer 0: close type, 0 for cancel, 1 for travel.
  
=== EVENT_TYPE_WORLD_MAP_USED ===
+
[[ EVENT_TYPE_WORLD_MAP_USED ]]
  
 
!!Note: This event may be obsolete, I think EVENT_TYPE_BEGIN_TRAVEL is the one that actually fires now.!!
 
!!Note: This event may be obsolete, I think EVENT_TYPE_BEGIN_TRAVEL is the one that actually fires now.!!
Line 706: Line 477:
 
*int nTo = GetEventInteger(ev, 1); // travel target location
 
*int nTo = GetEventInteger(ev, 1); // travel target location
  
=== EVENT_TYPE_BEGIN_TRAVEL ===
+
[[ EVENT_TYPE_BEGIN_TRAVEL ]]
  
 
*<b>Sent When:</b>
 
*<b>Sent When:</b>
Line 722: Line 493:
 
*            object oSourceLocation = GetEventObject(ev, 0); // source location object
 
*            object oSourceLocation = GetEventObject(ev, 0); // source location object
  
=== EVENT_TYPE_WORLDMAP_PRETRANSITION ===
+
[[ EVENT_TYPE_WORLDMAP_PRETRANSITION ]]
  
 
*<b>Sent When:</b>
 
*<b>Sent When:</b>
Line 730: Line 501:
 
Parameters:
 
Parameters:
  
=== EVENT_TYPE_WORLDMAP_POSTTRANSITION ===
+
[[ EVENT_TYPE_WORLDMAP_POSTTRANSITION ]]
  
 
*<b>Sent When:</b>
 
*<b>Sent When:</b>
Line 738: Line 509:
 
Parameters:
 
Parameters:
  
=== EVENT_TYPE_FINISH_TRAVEL ===
+
[[ EVENT_TYPE_FINISH_TRAVEL ]]
  
 
*<b>Sent When:</b>
 
*<b>Sent When:</b>
Line 749: Line 520:
 
== Found in placeable_core ==
 
== Found in placeable_core ==
  
=== EVENT_TYPE_PLACEABLE_ONCLICK ===
+
[[ EVENT_TYPE_PLACEABLE_ONCLICK ]]
  
 
*<b>Sent When:</b> player clicks on object.
 
*<b>Sent When:</b> player clicks on object.
Line 757: Line 528:
 
Parameters:
 
Parameters:
  
=== EVENT_TYPE_USE ===
+
[[ EVENT_TYPE_USE ]]
  
 
*<b>Sent When:</b> creature clicks on the placeable.
 
*<b>Sent When:</b> creature clicks on the placeable.
Line 766: Line 537:
  
  
=== EVENT_TYPE_UNLOCKED ===
+
[[ EVENT_TYPE_UNLOCKED ]]
  
 
*<b>Sent When:</b> Sent by script when placeable is unlocked.
 
*<b>Sent When:</b> Sent by script when placeable is unlocked.
Line 774: Line 545:
 
Parameters:
 
Parameters:
  
=== EVENT_TYPE_SET_OBJECT_ACTIVE ===
+
[[ EVENT_TYPE_SET_OBJECT_ACTIVE ]]
  
 
*<b>Sent When:</b> Sent by script to change active state. Needed since CommandDoFunction was removed and we're using CommandDoEvent
 
*<b>Sent When:</b> Sent by script to change active state. Needed since CommandDoFunction was removed and we're using CommandDoEvent
Line 784: Line 555:
  
  
=== EVENT_TYPE_PLACEABLE_COLLISION ===
+
[[ EVENT_TYPE_PLACEABLE_COLLISION ]]
  
 
*<b>Sent When:</b> player collides with object (if EnableCollisionEvent column in placeables.xls is non-zero).
 
*<b>Sent When:</b> player collides with object (if EnableCollisionEvent column in placeables.xls is non-zero).
Line 792: Line 563:
 
Parameters:
 
Parameters:
  
=== EVENT_TYPE_POPUP_RESULT ===
+
[[ EVENT_TYPE_POPUP_RESULT ]]
  
 
*<b>Sent When:</b> player responds to area transition prompt.
 
*<b>Sent When:</b> player responds to area transition prompt.
Line 809: Line 580:
 
== Found in rules_core ==
 
== Found in rules_core ==
  
=== EVENT_TYPE_ITEM_ONHIT ===
+
[[ EVENT_TYPE_ITEM_ONHIT ]]
  
 
*<b>Sent When:</b>  
 
*<b>Sent When:</b>  
Line 817: Line 588:
 
Parameters:
 
Parameters:
  
=== EVENT_TYPE_CONFUSION_CALLBACK ===
+
[[ EVENT_TYPE_CONFUSION_CALLBACK ]]
  
 
*<b>Sent When:</b>  
 
*<b>Sent When:</b>  
Line 828: Line 599:
  
  
=== EVENT_TYPE_DESTROY_OBJECT ===
+
[[ EVENT_TYPE_DESTROY_OBJECT ]]
  
 
*<b>Sent When:</b> Object should be destroyed
 
*<b>Sent When:</b> Object should be destroyed
Line 838: Line 609:
 
== Found in player_core ==
 
== Found in player_core ==
  
=== EVENT_TYPE_HEARTBEAT ===
+
[[ EVENT_TYPE_HEARTBEAT ]]
  
 
*<b>Sent When:</b>  
 
*<b>Sent When:</b>  
Line 847: Line 618:
  
  
=== EVENT_TYPE_LOAD_TACTICS_PRESET ===
+
[[ EVENT_TYPE_LOAD_TACTICS_PRESET ]]
  
 
*<b>Sent When:</b>  
 
*<b>Sent When:</b>  
Line 863: Line 634:
 
== Spellcasting ==
 
== Spellcasting ==
  
=== EVENT_TYPE_ABILITY_CAST_START ===
+
[[ EVENT_TYPE_ABILITY_CAST_START ]]
  
 
- Update mana/stamina
 
- Update mana/stamina
Line 881: Line 652:
 
note: in case of a projectile impact, there might be more than one target (object 2+...) this allows doing things like lightning bolts going through targets, but this is not currently made use of in Dragon Age.
 
note: in case of a projectile impact, there might be more than one target (object 2+...) this allows doing things like lightning bolts going through targets, but this is not currently made use of in Dragon Age.
  
=== EVENT_TYPE_ABILITY_CAST_IMPACT ===
+
[[ EVENT_TYPE_ABILITY_CAST_IMPACT ]]
  
 
*<b>Sent When:</b> Fires for the moment of impact for every ability. This is where damage should be applied, fireballs explode, enemies get poisoned etc. We assume that stamina/mana have been deducted when the ability was triggered (COMMAND_PENDING stage)  
 
*<b>Sent When:</b> Fires for the moment of impact for every ability. This is where damage should be applied, fireballs explode, enemies get poisoned etc. We assume that stamina/mana have been deducted when the ability was triggered (COMMAND_PENDING stage)  
Line 894: Line 665:
 
note: in case of a projectile impact, there might be more than one target (object 2+...) this allows doing things like lightning bolts going through targets, but this is not currently made use of in Dragon Age.
 
note: in case of a projectile impact, there might be more than one target (object 2+...) this allows doing things like lightning bolts going through targets, but this is not currently made use of in Dragon Age.
  
=== EVENT_TYPE_CAST_AT ===
+
[[ EVENT_TYPE_CAST_AT ]]
  
 
*<b>Sent When:</b> placeable is hit by a spell.
 
*<b>Sent When:</b> placeable is hit by a spell.
Line 902: Line 673:
 
Parameters:
 
Parameters:
  
=== EVENT_TYPE_COMBO_IGNITE ===
+
[[ EVENT_TYPE_COMBO_IGNITE ]]
  
 
*<b>Sent When:</b>  
 
*<b>Sent When:</b>  
Line 912: Line 683:
  
  
=== EVENT_TYPE_SPELLCASTAT ===
+
[[ EVENT_TYPE_SPELLCASTAT ]]
  
 
*<b>Sent When:</b>  
 
*<b>Sent When:</b>  
Line 919: Line 690:
  
 
Parameters:
 
Parameters:
=== EVENT_TYPE_SPELLSCRIPT_CAST ===
+
[[ EVENT_TYPE_SPELLSCRIPT_CAST ]]
  
 
*<b>Sent When:</b>  
 
*<b>Sent When:</b>  
Line 926: Line 697:
  
 
Parameters:
 
Parameters:
=== EVENT_TYPE_SPELLSCRIPT_DEACTIVATE ===
+
[[ EVENT_TYPE_SPELLSCRIPT_DEACTIVATE ]]
  
 
*<b>Sent When:</b> Talent deactivated
 
*<b>Sent When:</b> Talent deactivated
Line 934: Line 705:
 
Parameters:
 
Parameters:
  
=== EVENT_TYPE_SPELLSCRIPT_IMPACT ===
+
[[ EVENT_TYPE_SPELLSCRIPT_IMPACT ]]
  
 
*<b>Sent When:</b>  
 
*<b>Sent When:</b>  
Line 941: Line 712:
  
 
Parameters:
 
Parameters:
=== EVENT_TYPE_SPELLSCRIPT_PENDING ===
+
[[ EVENT_TYPE_SPELLSCRIPT_PENDING ]]
  
 
*<b>Sent When:</b>  
 
*<b>Sent When:</b>  
Line 953: Line 724:
 
== Proving events ==
 
== Proving events ==
  
=== EVENT_TYPE_PROVING_ENTER ===
+
[[ EVENT_TYPE_PROVING_ENTER ]]
  
 
*<b>Sent When:</b>  
 
*<b>Sent When:</b>  
Line 960: Line 731:
  
 
Parameters:
 
Parameters:
=== EVENT_TYPE_PROVING_EXIT ===
+
[[ EVENT_TYPE_PROVING_EXIT ]]
  
 
*<b>Sent When:</b>  
 
*<b>Sent When:</b>  
Line 967: Line 738:
  
 
Parameters:
 
Parameters:
=== EVENT_TYPE_PROVING_LOSE ===
+
[[ EVENT_TYPE_PROVING_LOSE ]]
  
 
*<b>Sent When:</b>  
 
*<b>Sent When:</b>  
Line 974: Line 745:
  
 
Parameters:
 
Parameters:
=== EVENT_TYPE_PROVING_START ===
+
[[ EVENT_TYPE_PROVING_START ]]
  
 
*<b>Sent When:</b>  
 
*<b>Sent When:</b>  
Line 981: Line 752:
  
 
Parameters:
 
Parameters:
=== EVENT_TYPE_PROVING_WIN ===
+
[[ EVENT_TYPE_PROVING_WIN ]]
  
 
*<b>Sent When:</b>  
 
*<b>Sent When:</b>  
Line 994: Line 765:
 
== Debugging ==
 
== Debugging ==
  
=== EVENT_TYPE_DEBUG_KICKSTART_AI ===
+
[[ EVENT_TYPE_DEBUG_KICKSTART_AI ]]
  
 
*<b>Sent When:</b> Kickstart the AI if it was frozen out. Debug Event, do not use in production scripts
 
*<b>Sent When:</b> Kickstart the AI if it was frozen out. Debug Event, do not use in production scripts
Line 1,002: Line 773:
 
Parameters:
 
Parameters:
  
=== EVENT_TYPE_DEATH_RES_PARTY ===
+
[[ EVENT_TYPE_DEATH_RES_PARTY ]]
  
 
Party Resurrection button (cheat, death UI)
 
Party Resurrection button (cheat, death UI)
Line 1,013: Line 784:
  
  
=== EVENT_TYPE_DEBUG_RESURRECTION ===
+
[[ EVENT_TYPE_DEBUG_RESURRECTION ]]
  
 
This makes the resurrection button work.
 
This makes the resurrection button work.
Line 1,026: Line 797:
 
== Stats ==
 
== Stats ==
  
=== EVENT_TYPE_STAT_REGEN ===
+
[[ EVENT_TYPE_STAT_REGEN ]]
  
 
*<b>Sent When:</b> Stat regeneration. might be changed in the future.  
 
*<b>Sent When:</b> Stat regeneration. might be changed in the future.  
Line 1,034: Line 805:
 
Parameters:
 
Parameters:
  
=== EVENT_TYPE_MANA_STAM_DEPLETED ===
+
[[ EVENT_TYPE_MANA_STAM_DEPLETED ]]
  
 
*<b>Sent When:</b> Creature ran out of mana or stamina
 
*<b>Sent When:</b> Creature ran out of mana or stamina
Line 1,045: Line 816:
 
== Miscellaney ==
 
== Miscellaney ==
  
=== EVENT_TYPE_CLICK ===
+
[[ EVENT_TYPE_CLICK ]]
  
 
*<b>Sent When:</b>  
 
*<b>Sent When:</b>  
Line 1,053: Line 824:
 
Parameters:
 
Parameters:
  
=== EVENT_TYPE_CUSTOM_COMMAND_COMPLETE ===
+
[[ EVENT_TYPE_CUSTOM_COMMAND_COMPLETE ]]
  
 
Also EVENT_TYPE_CUSTOM_EVENT_01 to EVENT_TYPE_CUSTOM_EVENT_08
 
Also EVENT_TYPE_CUSTOM_EVENT_01 to EVENT_TYPE_CUSTOM_EVENT_08
Line 1,063: Line 834:
 
Parameters:
 
Parameters:
  
=== EVENT_TYPE_FAILTOOPEN ===
+
[[ EVENT_TYPE_FAILTOOPEN ]]
  
 
*<b>Sent When:</b>  
 
*<b>Sent When:</b>  
Line 1,071: Line 842:
 
Parameters:
 
Parameters:
  
=== EVENT_TYPE_HANDLE_CUSTOM_AI ===
+
[[ EVENT_TYPE_HANDLE_CUSTOM_AI ]]
  
 
Handle any custom AI before handling the built-in AI.
 
Handle any custom AI before handling the built-in AI.
Line 1,083: Line 854:
 
Parameters:
 
Parameters:
  
=== EVENT_TYPE_INVALID ===
+
[[ EVENT_TYPE_INVALID ]]
  
 
*<b>Sent When:</b>  
 
*<b>Sent When:</b>  
Line 1,091: Line 862:
 
Parameters:
 
Parameters:
  
=== EVENT_TYPE_LISTENER ===
+
[[ EVENT_TYPE_LISTENER ]]
  
  
Line 1,099: Line 870:
  
 
Parameters:
 
Parameters:
=== EVENT_TYPE_LOCKED ===
+
[[ EVENT_TYPE_LOCKED ]]
  
 
*<b>Sent When:</b>  
 
*<b>Sent When:</b>  
Line 1,107: Line 878:
 
Parameters:
 
Parameters:
  
=== EVENT_TYPE_QA_EVENT ===
+
[[ EVENT_TYPE_QA_EVENT ]]
  
 
*<b>Sent When:</b>  
 
*<b>Sent When:</b>  
Line 1,114: Line 885:
  
 
Parameters:
 
Parameters:
=== EVENT_TYPE_QA_EVENT_BLA ===
+
[[ EVENT_TYPE_QA_EVENT_BLA ]]
  
 
*<b>Sent When:</b>  
 
*<b>Sent When:</b>  
Line 1,122: Line 893:
 
Parameters:
 
Parameters:
  
=== EVENT_TYPE_STEALING_FAILURE ===
+
[[ EVENT_TYPE_STEALING_FAILURE ]]
  
 
*<b>Sent When:</b>  
 
*<b>Sent When:</b>  
Line 1,129: Line 900:
  
 
Parameters:
 
Parameters:
=== EVENT_TYPE_STEALING_SUCCESS ===
+
[[ EVENT_TYPE_STEALING_SUCCESS ]]
  
 
*<b>Sent When:</b>  
 
*<b>Sent When:</b>  
Line 1,137: Line 908:
 
Parameters:
 
Parameters:
  
=== EVENT_TYPE_UNIQUE_POWER ===
+
[[ EVENT_TYPE_UNIQUE_POWER ]]
  
 
*<b>Sent When: a unique power for an item is used</b>  
 
*<b>Sent When: a unique power for an item is used</b>  
Line 1,155: Line 926:
 
Shouts (events) are used to make creatures communicate with one another. This is a list of all the shouts referenced in the AI documentation.  
 
Shouts (events) are used to make creatures communicate with one another. This is a list of all the shouts referenced in the AI documentation.  
  
=== Creature Shouts ===
+
[[ Creature Shouts ]]
  
 
*SHOUT_TYPE_WASATTACKED When I am attacked, signal this event for all allies. What do the allies do? They will go into combat round, not specifically targeting this attacker but becoming combat ready.  
 
*SHOUT_TYPE_WASATTACKED When I am attacked, signal this event for all allies. What do the allies do? They will go into combat round, not specifically targeting this attacker but becoming combat ready.  
Line 1,164: Line 935:
 
*SHOUT_TYPE_FOUND_SOMEONE (YaronToDo) a scout sees someone they broadcasts this event. Allies go here. (NOT DONE)
 
*SHOUT_TYPE_FOUND_SOMEONE (YaronToDo) a scout sees someone they broadcasts this event. Allies go here. (NOT DONE)
  
=== Commander-Specific Orders ===
+
[[ Commander-Specific Orders ]]
  
 
*SHOUT_TYPE_FINISHHIM Attacks a specified enemy till they are dead. A Commander issues order generally.  
 
*SHOUT_TYPE_FINISHHIM Attacks a specified enemy till they are dead. A Commander issues order generally.  

Revision as of 16:53, 20 July 2009

Events are a package of information that can be passed around in the game to trigger some behaviour. They are usually passed off to an object's event script for handling, but there are a few engine-only event types that are not exposed to the end-users.

Scripting Events have an integer type, target object, a time delay and a package of parameters (arbitrary number of ints, objects, floats and strings). Certain event types will be defined by the engine and referenced as #defines in the scripts.

Events are handled in the scripting language with the following types of commands:

  • Event() Constructor — Scripters can create events of any type and signal them to other objects
  • Signal Event commands — Events can be signalled to a single object, by proximity or to all objects with a certain group id
  • Parameter access — All of the parameters on an event can be get and set through scripting.
  • Event handling — Events can be passed to other script files through the HandleEvent command. This command will be run inline so that hierarchies of event-handling behaviour can be built.

A typical event-handling script would have the form

void main()
{
    event ev = GetCurrentEvent();
    int nEventType = GetEventType(ev); //extract event type from current event
    int nEventHandled = FALSE; //keep track of whether the event has been handled
    switch(nEventType)
    {
         case EVENT_TYPE_AREALOAD_SPECIAL:
         {
             ...
             nEventHandled = TRUE; //set this if no further action is required for this event
             break;
         }
    }
    if (!nEventHandled) //If this event wasn't handled by this script, let the core script try
    {
        HandleEvent(ev, RESOURCE_SCRIPT_AREA_CORE);
    }
}

In the event that you want to intercept some events but leave others to be handled by a default script (for example if you're overriding one aspect of a creature's event response but the rest of the default creature_core responses responses are fine) you can pass execution to the default script with the following:

    HandleEvent(ev, RESOURCE_SCRIPT_CREATURE_CORE);

(constants for referencing core script resources are available in the "global_objects_h" include file)

Below is a list of the event types that are defined within the core resources:

Traps

EVENT_TYPE_APPROACH_TRAP

  • Sent When: Trap triggered and the creature receiving this event should approach the trap
  • Sent From:
  • Sent To: creature

Parameters:

  • Object 0: trap

EVENT_TYPE_TRAP_ARM

  • Sent When: Sent by script to request that a trap arm itself.
  • Sent From:
  • Sent To:

Parameters:

EVENT_TYPE_TRAP_TRIGGER_ENTER

  • Sent When:
  • Sent From: area of effect 'trigger'
  • Sent To: trap's signal target(s).

Parameters:

EVENT_TYPE_TRAP_DISARMED

  • Sent When:
  • Sent From:
  • Sent To:

Parameters:

EVENT_TYPE_TRAP_TRIGGER_ARMED

  • Sent When:
  • Sent From:
  • Sent To:

Parameters:

EVENT_TYPE_TRAP_TRIGGER_EXIT

  • Sent When:
  • Sent From:
  • Sent To:

Parameters: EVENT_TYPE_TRAP_TRIGGERED

  • Sent When:
  • Sent From:
  • Sent To:

Parameters:


Game state events

EVENT_TYPE_SPAWN

  • Sent When: an object spawns into the game. This event can fire only once per game for each object, regardless of save games.
  • Sent From: engine
  • Sent To: creatures, placeables, triggers, AOEs,

Parameters:

  • Creator: ??? -> should probably be parent of object spawning (area. module etc')

EVENT_TYPE_MODULE_START

  • Sent When: The module starts. This can happen only once for a single game instance.
  • Sent From: engine
  • Sent To: module

Parameters:

  • Creator: ???

EVENT_TYPE_MODULE_LOAD

  • Sent When: The module loads from a save game. This event can fire more than once for a single module or game instance.
  • Sent From: engine
  • Sent To: module

Parameters:

  • Creator: ???

EVENT_TYPE_AREALOAD_SPECIAL

  • Sent When: it is for playing things like cutscenes and movies when you enter an area, things that do not involve AI or actual game play
  • Sent From: engine
  • Sent To:

Parameters:

EVENT_TYPE_AREALOAD_PRELOADEXIT

  • Sent When: for things you want to happen while the load screen is still up, things like moving creatures around
  • Sent From: engine
  • Sent To:

Parameters:

EVENT_TYPE_AREALOAD_POSTLOADEXIT

  • Sent When:
  • Sent From:
  • Sent To:

Parameters:

Sent by: The engine When: fires at the same time that the load screen is going away, and can be used for things that you want to make sure the player sees.

EVENT_TYPE_AREALOADSAVE_POSTLOADEXIT

  • Sent When: fires at the same time that the load screen is going away, but only when loading a savegame.
  • Sent From: engine
  • Sent To:

Parameters:

EVENT_TYPE_GAMEMODE_CHANGE

  • Sent When: Game Mode Switch
  • Sent From:
  • Sent To: module

Parameters:

  • int(0) - New Game Mode (GM_* constant)
  • int(1) - Old Game Mode (GM_* constant)

EVENT_TYPE_DELAYED_GM_CHANGE

  • Sent When:
  • Sent From:
  • Sent To: module

Parameters:

EVENT_TYPE_SET_GAME_MODE

  • Sent When: the game mode is set
  • Sent From:
  • Sent To: module

Parameters:

  • the game mode being set is carried as an integer on the event.


Plots

EVENT_TYPE_SET_PLOT

  • Sent When: A plot is setting a plot flag
  • Sent From: engine
  • Sent To: plot script

Parameters:

  • Creator: owner of the plot table, should be a player
  • String 0: plot GUID, defined as string constant
  • Int 1: bit flag number being affected
  • Int 2: the value about to be written (on a normal SET that should be '1', and on a 'clear' it should be '0')
  • Int 3: On SET call, the current flag value (can be either 1 or 0 regardless if it's a set or clear event)
  • Int 4: 1 if the current flag (Int 1) is defined, 0 for normal flag.

IMPORTANT: The flag value on a SET event is set only AFTER this script finishes running!

EVENT_TYPE_GET_PLOT

  • Sent When: A plot is setting a plot flag
  • Sent From: engine
  • Sent To: plot script

Parameters:

  • Creator: owner of the plot table, should be a player
  • String 0: plot GUID, defined as string constants
  • Int 1: bit flag number being affected
  • Int 4: 1 if the current flag (Int 1) is defined, 0 for normal flag.


Dialogue

EVENT_TYPE_DIALOGUE

  • Sent When: An object tries to initiate dialog with the object receiving the event, either by clicking or by scripting
  • Sent From: engine (clicking on object to talk) or scripts (manually sending this event)
  • Sent To: creatures, placeables

Parameters:

  • Creator: Initiating object
  • String 0: Dialog to initiate, "" to use default object dialog

EVENT_TYPE_DELAYED_SHOUT

  • Sent When: Used to fire a dialog shout every few seconds.
  • Sent From:
  • Sent To:

Parameters:

EVENT_TYPE_AMBIENT_CONTINUE

  • Sent When: conversation ends or player is nearby to resume ambient behaviour
  • Sent From: engine
  • Sent To: creature

If the event was fired because the party is near a creature, the 'instigator' is the nearest party member. If the event was fired at the end of a conversation, the 'instigator' is the creature conversing.

Parameters:

  • Object 0: Instigator

Party management

EVENT_TYPE_PARTYMEMBER_ADDED

  • Sent When: Party member added to active party using the party GUI
  • Sent From:
  • Sent To: module

Parameters:

EVENT_TYPE_PARTYMEMBER_DROPPED

  • Sent When: Party member removed from active party using the party GUI
  • Sent From:
  • Sent To: module

Parameters:

EVENT_TYPE_PARTYPICKER_CLOSED

  • Sent When:
  • Sent From:
  • Sent To: module

Parameters:

EVENT_TYPE_PARTY_MEMBER_HIRED

  • Sent When: Fires first time a party member is added to the party. For plot followers: follower recruited (added to pool). For other followers: UT_Hire called
  • Sent From:
  • Sent To:

Parameters:

EVENT_TYPE_PARTY_MEMBER_FIRED

  • Sent When: Fires when an active or locked-active party member is removed from the active party
  • Sent From:
  • Sent To:

Parameters:


EVENT_TYPE_PARTY_MEMBER_RES_TIMER

Resurrection timer used if a creature dies in explore mode.

party members are rezzed on this event if it happens outside of combat.

  • Sent When:
  • Sent From:
  • Sent To:

Parameters:

EVENT_TYPE_GIFT_ITEM

  • Sent When:
  • Sent From:
  • Sent To:

Parameters:

EVENT_TYPE_MODULE_HANDLE_FOLLOWER_DEATH

  • Sent When:
  • Sent From:
  • Sent To:

Parameters:

EVENT_TYPE_MODULE_HANDLE_GIFT

  • Sent When:
  • Sent From:
  • Sent To:

Parameters:

  • Follower: Object 0
  • GiftTag: String 0

EVENT_TYPE_SUMMON_DIED

  • Sent When:
  • Sent From:
  • Sent To:

Parameters:


Character generation and level advancement

EVENT_TYPE_CHARGEN_START and EVENT_TYPE_CHARGEN_END

A range of event constants (nEvent >= EVENT_TYPE_CHARGEN_START && nEvent <= EVENT_TYPE_CHARGEN_END) that occur during character generation.

  • Sent When:
  • Sent From:
  • Sent To: module

Parameters:

EVENT_TYPE_PLAYER_LEVELUP

  • Sent When: Creature is spawned.
  • Sent From: Fired by sys_rewards_h.RewardXP (the levelup system)
  • Sent To: player_core

Parameters:

EVENT_TYPE_PLAYERLEVELUP

  • Sent When:
  • Sent From:
  • Sent To: module

Parameters:

EVENT_TYPE_CHARGEN_AUTOLEVEL

  • Sent When:
  • Sent From:
  • Sent To:

Parameters:

EVENT_TYPE_MODULE_CHARGEN_DONE

Fired the the core chargen script into the module

  • Sent When:
  • Sent From:
  • Sent To:

Parameters:

EVENT_TYPE_GUI_OPENED

GUI tutorial calls

  • Sent When:
  • Sent From:
  • Sent To: module

Parameters:

World map

EVENT_TYPE_TRANSITION_TO_WORLD_MAP

  • Sent When: Player uses the generic transition system to open the world map
  • Sent From:
  • Sent To: module

Parameters:

  • string sWorldMap = GetEventString(ev, 0);
  • string sTransType = GetEventString(ev, 1);
  • string sWorldMapLoc1 = GetEventString(ev, 2);
  • string sWorldMapLoc2 = GetEventString(ev, 3);
  • string sWorldMapLoc3 = GetEventString(ev, 4);
  • string sWorldMapLoc4 = GetEventString(ev, 5);
  • string sWorldMapLoc5 = GetEventString(ev, 6);


EVENT_TYPE_WORLD_MAP_CLOSED

  • Sent When:
  • Sent From:
  • Sent To: module

Parameters:

  • Integer 0: close type, 0 for cancel, 1 for travel.

EVENT_TYPE_WORLD_MAP_USED

!!Note: This event may be obsolete, I think EVENT_TYPE_BEGIN_TRAVEL is the one that actually fires now.!!

  • Sent When: the player clicks on a destination in the world map
  • Sent From: engine
  • Sent To: module

Parameters:

  • int nFrom = GetEventInteger(ev, 0); // travel start location
  • int nTo = GetEventInteger(ev, 1); // travel target location

EVENT_TYPE_BEGIN_TRAVEL

  • Sent When:
  • Sent From:
  • Sent To: module

Parameters:

  • string sSource = GetEventString(ev, 0); // area tag source location
  • string sTarget = GetEventString(ev, 1); // area tag target location
  • string sWPOverride = GetEventString(ev, 2); // waypoint tag override
  • int nSourceTerrain = GetEventInteger(ev, 0);
  • int nTargetTerrain = GetEventInteger(ev, 1);
  • int nWorldMap = GetEventInteger(ev, 2);
  • object oSourceLocation = GetEventObject(ev, 0); // source location object

EVENT_TYPE_WORLDMAP_PRETRANSITION

  • Sent When:
  • Sent From:
  • Sent To: module

Parameters:

EVENT_TYPE_WORLDMAP_POSTTRANSITION

  • Sent When:
  • Sent From:
  • Sent To: module

Parameters:

EVENT_TYPE_FINISH_TRAVEL

  • Sent When:
  • Sent From:
  • Sent To: module

Parameters:


Found in placeable_core

EVENT_TYPE_PLACEABLE_ONCLICK

  • Sent When: player clicks on object.
  • Sent From: engine
  • Sent To: placeable

Parameters:

EVENT_TYPE_USE

  • Sent When: creature clicks on the placeable.
  • Sent From: engine
  • Sent To: placeable

Parameters:


EVENT_TYPE_UNLOCKED

  • Sent When: Sent by script when placeable is unlocked.
  • Sent From:
  • Sent To: placeable

Parameters:

EVENT_TYPE_SET_OBJECT_ACTIVE

  • Sent When: Sent by script to change active state. Needed since CommandDoFunction was removed and we're using CommandDoEvent
  • Sent From:
  • Sent To:

Parameters:


EVENT_TYPE_PLACEABLE_COLLISION

  • Sent When: player collides with object (if EnableCollisionEvent column in placeables.xls is non-zero).
  • Sent From: engine
  • Sent To:

Parameters:

EVENT_TYPE_POPUP_RESULT

  • Sent When: player responds to area transition prompt.
  • Sent From:
  • Sent To: module

Parameters:

  • object oOwner = GetEventObject(ev, 0); // owner of popup
  • int nPopupID = GetEventInteger(ev, 0); // popup ID
  • int nButton = GetEventInteger(ev, 1); // button result (1 - 4)
  • string sInput = GetEventString(ev,0); // string entered into optional text field

Calling the "ShowPopup" script function causes a popup window to be displayed to the user, with up to four buttons whose text is defined in the "popups" 2DA and up to one text input field (with a filter on the input the player can type there that's the same as the filter on player names - up to 20 characters, no spaces, limited punctuation, no empty strings). This event is generated and sent to the module script with the popup's result.

Found in rules_core

EVENT_TYPE_ITEM_ONHIT

  • Sent When:
  • Sent From:
  • Sent To:

Parameters:

EVENT_TYPE_CONFUSION_CALLBACK

  • Sent When:
  • Sent From:
  • Sent To:

Parameters:



EVENT_TYPE_DESTROY_OBJECT

  • Sent When: Object should be destroyed
  • Sent From:
  • Sent To:

Parameters:

Found in player_core

EVENT_TYPE_HEARTBEAT

  • Sent When:
  • Sent From:
  • Sent To:

Parameters:


EVENT_TYPE_LOAD_TACTICS_PRESET

  • Sent When:
  • Sent From:
  • Sent To:

Parameters:




Spellcasting

EVENT_TYPE_ABILITY_CAST_START

- Update mana/stamina - Calculate *combat* attack/miss (only for hit based talents like Deadly Strike) - Calculate resistance check/failure for non-AOE abilities (if valid) - Calculate *combat* damage (only for hit based talents like Deadly Strike) Most of the above information is then passed on to the engine who need to decide what animations to play (or not to play). The engine then returns most of this information along with the CAST_IMPACT event back to this script (see below)

  • Sent When: whenever any ability (spell, talent) is used
  • Sent From: engine
  • Sent To:

Parameters:

  • Object 1 - the item used to cast the ability (optional)
  • Object 2 - the object that the ability was targeted

note: in case of a projectile impact, there might be more than one target (object 2+...) this allows doing things like lightning bolts going through targets, but this is not currently made use of in Dragon Age.

EVENT_TYPE_ABILITY_CAST_IMPACT

  • Sent When: Fires for the moment of impact for every ability. This is where damage should be applied, fireballs explode, enemies get poisoned etc. We assume that stamina/mana have been deducted when the ability was triggered (COMMAND_PENDING stage)
  • Sent From: engine
  • Sent To:

Parameters:

  • Object 1 - the item used to cast the ability (optional)
  • Object 2 - the object that the ability was targeted

note: in case of a projectile impact, there might be more than one target (object 2+...) this allows doing things like lightning bolts going through targets, but this is not currently made use of in Dragon Age.

EVENT_TYPE_CAST_AT

  • Sent When: placeable is hit by a spell.
  • Sent From: engine
  • Sent To: placeable

Parameters:

EVENT_TYPE_COMBO_IGNITE

  • Sent When:
  • Sent From:
  • Sent To: module

Parameters:


EVENT_TYPE_SPELLCASTAT

  • Sent When:
  • Sent From:
  • Sent To:

Parameters: EVENT_TYPE_SPELLSCRIPT_CAST

  • Sent When:
  • Sent From:
  • Sent To:

Parameters: EVENT_TYPE_SPELLSCRIPT_DEACTIVATE

  • Sent When: Talent deactivated
  • Sent From:
  • Sent To:

Parameters:

EVENT_TYPE_SPELLSCRIPT_IMPACT

  • Sent When:
  • Sent From:
  • Sent To:

Parameters: EVENT_TYPE_SPELLSCRIPT_PENDING

  • Sent When:
  • Sent From:
  • Sent To:

Parameters:


Proving events

EVENT_TYPE_PROVING_ENTER

  • Sent When:
  • Sent From:
  • Sent To:

Parameters: EVENT_TYPE_PROVING_EXIT

  • Sent When:
  • Sent From:
  • Sent To:

Parameters: EVENT_TYPE_PROVING_LOSE

  • Sent When:
  • Sent From:
  • Sent To:

Parameters: EVENT_TYPE_PROVING_START

  • Sent When:
  • Sent From:
  • Sent To:

Parameters: EVENT_TYPE_PROVING_WIN

  • Sent When:
  • Sent From:
  • Sent To:

Parameters:



Debugging

EVENT_TYPE_DEBUG_KICKSTART_AI

  • Sent When: Kickstart the AI if it was frozen out. Debug Event, do not use in production scripts
  • Sent From:
  • Sent To:

Parameters:

EVENT_TYPE_DEATH_RES_PARTY

Party Resurrection button (cheat, death UI)

  • Sent When:
  • Sent From:
  • Sent To: module

Parameters:


EVENT_TYPE_DEBUG_RESURRECTION

This makes the resurrection button work.

  • Sent When:
  • Sent From:
  • Sent To: module

Parameters:


Stats

EVENT_TYPE_STAT_REGEN

  • Sent When: Stat regeneration. might be changed in the future.
  • Sent From:
  • Sent To:

Parameters:

EVENT_TYPE_MANA_STAM_DEPLETED

  • Sent When: Creature ran out of mana or stamina
  • Sent From:
  • Sent To:

Parameters:


Miscellaney

EVENT_TYPE_CLICK

  • Sent When:
  • Sent From:
  • Sent To:

Parameters:

EVENT_TYPE_CUSTOM_COMMAND_COMPLETE

Also EVENT_TYPE_CUSTOM_EVENT_01 to EVENT_TYPE_CUSTOM_EVENT_08

  • Sent When:
  • Sent From:
  • Sent To:

Parameters:

EVENT_TYPE_FAILTOOPEN

  • Sent When:
  • Sent From:
  • Sent To:

Parameters:

EVENT_TYPE_HANDLE_CUSTOM_AI

Handle any custom AI before handling the built-in AI.

This event is sent to creature scripts after custom AI has been enabled (call CAI_SetCustomAI(OBJECT_SELF, CAI_INITIATE) in the EVENT_TYPE_SPAWN event).

  • Sent When:
  • Sent From:
  • Sent To:

Parameters:

EVENT_TYPE_INVALID

  • Sent When:
  • Sent From:
  • Sent To:

Parameters:

EVENT_TYPE_LISTENER


  • Sent When:
  • Sent From:
  • Sent To:

Parameters: EVENT_TYPE_LOCKED

  • Sent When:
  • Sent From:
  • Sent To:

Parameters:

EVENT_TYPE_QA_EVENT

  • Sent When:
  • Sent From:
  • Sent To:

Parameters: EVENT_TYPE_QA_EVENT_BLA

  • Sent When:
  • Sent From:
  • Sent To:

Parameters:

EVENT_TYPE_STEALING_FAILURE

  • Sent When:
  • Sent From:
  • Sent To:

Parameters: EVENT_TYPE_STEALING_SUCCESS

  • Sent When:
  • Sent From:
  • Sent To:

Parameters:

EVENT_TYPE_UNIQUE_POWER

  • Sent When: a unique power for an item is used
  • Sent From:
  • Sent To:

Parameters:

  • Ability = Integer 0
  • Item = Object 0
  • Caster = Object 1
  • Target = Object 2


Shouts

Shouts (events) are used to make creatures communicate with one another. This is a list of all the shouts referenced in the AI documentation.

Creature Shouts

  • SHOUT_TYPE_WASATTACKED When I am attacked, signal this event for all allies. What do the allies do? They will go into combat round, not specifically targeting this attacker but becoming combat ready.
  • SHOUT_TYPE_SAWENEMY Attack enemy.
  • SHOUT_TYPE_KILLEDME Attack enemy.
  • SHOUT_TYPE_SWITCH_MELEE Will switch to melee weapons, useful for certain plot situations
  • SHOUT_TYPE_WAKE_UP Any creature that hears this shout will wake up, if sleeping. This shout needs to be manually called.
  • SHOUT_TYPE_FOUND_SOMEONE (YaronToDo) a scout sees someone they broadcasts this event. Allies go here. (NOT DONE)

Commander-Specific Orders

  • SHOUT_TYPE_FINISHHIM Attacks a specified enemy till they are dead. A Commander issues order generally.
  • SHOUT_TYPE_ATTACK_WIZARD (YaronToDo) Starting targeting wizard class enemies instead of others.
  • SHOUT_TYPE_FLANK Rogues will get into a flanking position to an appropriate enemy
  • SHOUT_TYPE_SWITCH_RANGED Will randomly choose one ally and ask them to switch to a ranged weapon. This is mostly done to even out the number of participants in melee battle for animation purposes (closer to even the sides are, the better things look)