User Tools

Site Tools


hpl3:game:eventdb

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
Last revision Both sides next revision
hpl3:game:eventdb [2012/06/12 09:26]
thomas [Standard Triggers]
hpl3:game:eventdb [2012/09/25 16:41]
thomas [Standard Global Facts]
Line 1: Line 1:
 ====== Event Database ====== ====== Event Database ======
  
-====== ​Basics ​======+====== ​Overview ​======
  
-For events can be used in a map, the current scene name must be set. Do this in the OnEnter method of the map, and easiest is to use the helper function: ​ 
-//​EventDB_SetCurrentScene(...)//​. 
  
-The best way to manage ​the events, is to keep the owners ​and scenes (and any global events) in a global file. And then load all other events per level in the OnEnter method (before setting the current scene).+The event database is a sort of hidden system inside the game that can be used to trigger all kinds of stuff. The current main usage is with the [[hpl3:​game:​voicehandler|voicesystem]]where it is used to trigger different voices ​and handles dynamic dialog flow.
  
-For the stand facts and triggers to work,  EventDatabase/​UseStandardTriggers must be set to true in game.cfg.+Most of the stuff below is not scene directly and handled internally, but all info is provided for the sake of completion. Normally the system implementing it refers to the sections here as needed. 
 + 
 +Note that for the standard ​facts and triggers to work,  EventDatabase/​UseStandardTriggers must be set to true in game.cfg.
  
 ====== Properties ====== ====== Properties ======
Line 41: Line 41:
 Owner is where an event belongs. Is basically only there to easily subdivide and sort the events. Owner is where an event belongs. Is basically only there to easily subdivide and sort the events.
  
-**ID**\\+=== ID ===
 The id of the owner, this must be unique and mostly only be set by the tool and never exposed. The id of the owner, this must be unique and mostly only be set by the tool and never exposed.
  
-**Name**\\+=== Name ===
 Name of the owner. Name of the owner.
  
-**GroupFlags**\\+=== GroupFlags ​===
 This is a bitflag container that can be used to set different owners into groups (and make it possible to send queries to owners of belonging to certain groups only). This is a bitflag container that can be used to set different owners into groups (and make it possible to send queries to owners of belonging to certain groups only).
  
Line 53: Line 53:
 Scene is basically like owner, and yet another way to subdivide events. Scene is basically like owner, and yet another way to subdivide events.
  
-**ID**\\+=== ID ===
 The id of the scene, this must be unique and mostly only be set by the tool and never exposed. The id of the scene, this must be unique and mostly only be set by the tool and never exposed.
  
-**Name**\\+=== Name ===
 Name of the scene. Name of the scene.
  
Line 63: Line 63:
 The event is basically the important payload of the database. The following is a list of all properties of an event and what they do. The event is basically the important payload of the database. The following is a list of all properties of an event and what they do.
  
-**OwnerId**\\ +=== Owner === 
-The id of the owner connected to this event.\\+The id of the owner connected to this event. ​Normally always set internally\\
  
-**SceneId**\\ +=== Scene === 
-The id of the scene connected to this event. If -1 then this is a global event that will be check in every scene.\\+The id of the scene connected to this event. If -1 then this is a global event that will be check in every scene. ​Normally always set internally\\
  
-**Trigger**\\+=== Trigger ​===
 This is the trigger for this event. See below for some standard triggers. Triggers can also be user defined though (for instance as  callback whena voice line is over). This is the trigger for this event. See below for some standard triggers. Triggers can also be user defined though (for instance as  callback whena voice line is over).
  
-**Name**\\+=== Name ===
 The name of the event, only used to easier track-keeping. The name of the event, only used to easier track-keeping.
  
-**Criteria**\\ +=== Criteria ​=== 
-This outlines the facts that need to be true for the event to happen. See "Command String Formatting" ​above for general info. Available operators are:\\+This outlines the facts that need to be true for the event to happen. See [[hpl3:​game:​eventdb#​command_string_formatting|Command String Formatting]] above for general info. Available operators are:\\
 <​code>​== (=), >, >=, <, <=, != </​code>​\\ <​code>​== (=), >, >=, <, <=, != </​code>​\\
 Also, it is possible to check intervals using the syntax:\\ Also, it is possible to check intervals using the syntax:\\
Line 87: Line 87:
 Health[0.1 0.75]</​code>​ Health[0.1 0.75]</​code>​
  
-**Actions**\\ +=== Actions ​=== 
-This outlines the actions made to the facts when the event is chosen in a query. See "Command String Formatting" ​above for general info. Available operators are:\\+This outlines the actions made to the facts when the event is chosen in a query and after the time set byt OutputDelay. See [[hpl3:​game:​eventdb#​command_string_formatting|Command String Formatting]]  ​above for general info. Available operators are:\\
 <​code>​=,​ +=, -=, /=, *=</​code>​ <​code>​=,​ +=, -=, /=, *=</​code>​
  
-**Output**\\+=== Output ​===
 The output string, depends on the type of output. The output string, depends on the type of output.
  
-**OutputType**\\+=== OutputType ​===
 This type is user defined, but the default types are:\\ This type is user defined, but the default types are:\\
-0: A voice subject\\ +0: Script callback function. //Syntax: "​[Output](const tString&​ in asEventName)"//​\\ 
-1: A description. Output is a category and entry in the lang file.//​Syntax:​ "​[category] [entry]"//​\\ +1: A voice subject\\ 
-2: Script callback function. //Syntax: "​[Output](const tString&​ in asEventName)"//​\\+2 and above are application dependant. Change "​EventDatabaseHandler.hps"​ to specify.
  
-**OutputDelay**\\ +=== OutputDelay ​=== 
-How long (in sec) the output of the event happens. ​+How long (in sec) the output of the event happens. ​This includes the actions
  
-**MaxRepetitions**\\+=== MaxRepetitions ​===
 The number of times an event can be repeated. 0 means unlimted number of times. Max number is 255.  The number of times an event can be repeated. 0 means unlimted number of times. Max number is 255. 
 ====== Standard Triggers ====== ====== Standard Triggers ======
Line 109: Line 109:
 Standard trigger types that can be checked for in any map. Below the name are the facts that are related to the triggers. Note that these must be enabled (in Player or any other module that triggers them for them to happpen). Standard trigger types that can be checked for in any map. Below the name are the facts that are related to the triggers. Note that these must be enabled (in Player or any other module that triggers them for them to happpen).
  
-**PlayerCollide**\\+**PlayerCollide** ​''​(NOTE:​ Currently not in use!)''​\\
 //​CollideEntity://​ Entity that is collided with.\\ //​CollideEntity://​ Entity that is collided with.\\
 If the player collides with an entity. Note that this one is not checked every update and might miss very brief collisions. Mostly useful to check if player is in an area. If the player collides with an entity. Note that this one is not checked every update and might miss very brief collisions. Mostly useful to check if player is in an area.
  
-**PlayerLeaveCollide**\\+**PlayerLeaveCollide**''​(NOTE:​ Currently not in use!)''​\\
 //​CollideEntity://​ Entity that player has collided with.\\ //​CollideEntity://​ Entity that player has collided with.\\
 Triggered when player stops colliding with an entity. Mostly useful to check if player leaves an area. Triggered when player stops colliding with an entity. Mostly useful to check if player leaves an area.
Line 121: Line 121:
 If the player interacts with an entity. Note that this is triggered through the basic script. If the player interacts with an entity. Note that this is triggered through the basic script.
  
-**PlayerLookAt**\\+**PlayerLookAt** ​''​(NOTE:​ Currently not in use!)''​\\
 //​LookAtEntity://​ Entity that is look upon.\\ //​LookAtEntity://​ Entity that is look upon.\\
 //​LookAtDistance://​ The distance to the entity that is looked upon.\\ //​LookAtDistance://​ The distance to the entity that is looked upon.\\
Line 128: Line 128:
 Note that if you want to do this check on an area, make sure it has BlocksLineOfSight set to true! Note that if you want to do this check on an area, make sure it has BlocksLineOfSight set to true!
  
-**VoiceLineOver**\\+**VoiceLineOver**''​(NOTE:​ Currently not in use!)''​\\
 //​VoiceSubject://​ The name of the subject, syntax = [Character]_[Scene]_[Subject],​ eg "​Simon_00_01_Apartment_Greeting"​.\\ //​VoiceSubject://​ The name of the subject, syntax = [Character]_[Scene]_[Subject],​ eg "​Simon_00_01_Apartment_Greeting"​.\\
-//VoiceLine:// The name of the line, note that if line name is "",​ then this will be the index, eg "​0",​ "​1",​ etc.\\+//VoiceLineIndex:// The index of the line.\\
 When a voice line is over. When a voice line is over.
  
-**VoiceSoundOver**\\+**VoiceSoundOver**''​(NOTE:​ Currently not in use!)''​\\
 //​VoiceSubject://​ The name of the subject, syntax = [Character]_[Scene]_[Subject],​ eg "​Simon_00_01_Apartment_Greeting"​.\\ //​VoiceSubject://​ The name of the subject, syntax = [Character]_[Scene]_[Subject],​ eg "​Simon_00_01_Apartment_Greeting"​.\\
-//VoiceLine:// The name of the line, note that if line name is "",​ then this will be the index, eg "​0",​ "​1",​ etc.\\+//VoiceLineIndex:// The name of the line, note that if line name is "",​ then this will be the index, eg "​0",​ "​1",​ etc.\\
 //​VoiceSoundIndex://​ The index of the sound that was just completed.\\ //​VoiceSoundIndex://​ The index of the sound that was just completed.\\
 When a voice sound file is over. When a voice sound file is over.
  
 **VoiceIdle**\\ **VoiceIdle**\\
-//​VoiceIdleDuration:/​ The time the voice has been idle.+//​VoiceIdleDuration:​// The time the voice has been idle.\\ 
 +//​VoiceCharacterIdleDuration_[character]://​ The idle time for a specific character.\\
 Called every 3rd seconds when there is no voice playing. Called every 3rd seconds when there is no voice playing.
 ====== Standard Global Facts ====== ====== Standard Global Facts ======
Line 161: Line 162:
 The last sound line that was over. Used by //​VoiceLineOver//​ and //​VoiceSoundOver//​ triggers. syntax = [Character]_[Scene]_[Subject],​ eg "​Simon_00_01_Apartment_Greeting"​. The last sound line that was over. Used by //​VoiceLineOver//​ and //​VoiceSoundOver//​ triggers. syntax = [Character]_[Scene]_[Subject],​ eg "​Simon_00_01_Apartment_Greeting"​.
  
-**VoiceLine**\\ +**VoiceLineIndex**\\ 
-The last sound line that was over. Used by //​VoiceLineOver//​ and //​VoiceSoundOver//​ triggers.+The index of the last sound line that was over. Used by //​VoiceLineOver//​ and //​VoiceSoundOver//​ triggers.
  
 **VoiceSoundIndex**\\ **VoiceSoundIndex**\\
Line 172: Line 173:
 **VoiceIdleDuration**\\ **VoiceIdleDuration**\\
 The amount of time since there was a voice playing (messured in whole seconds only). The amount of time since there was a voice playing (messured in whole seconds only).
 +
 +**VoiceCharacterIdleDuration_[charater]**\\
 +How long it has been since a certain character has spoken. [character] is simply the name of the character, eg: "​VoiceCharacterIdleDuration_Jack"​.
  
 **EventIsQueued**\\ **EventIsQueued**\\
hpl3/game/eventdb.txt · Last modified: 2015/09/17 10:19 by ian.thomas