Difference between revisions of "HPL3/Amnesia: Rebirth/Tutorials/Wraiths"
(Created basic wraith setup tutorial) |
(clarified agent activation) |
||
(3 intermediate revisions by the same user not shown) | |||
Line 7: | Line 7: | ||
The agent requires path nodes to move around, so make sure your map is populated with plenty of nodes. You can use the PathNodeGenerator area type to easily generate a large amount of nodes automatically (make sure whatever surfaces you want to generate nodes on are inside the area), but you may still want to place nodes manually in areas with difficult or precise navigation. | The agent requires path nodes to move around, so make sure your map is populated with plenty of nodes. You can use the PathNodeGenerator area type to easily generate a large amount of nodes automatically (make sure whatever surfaces you want to generate nodes on are inside the area), but you may still want to place nodes manually in areas with difficult or precise navigation. | ||
− | Wraiths require special map setup to function properly. Import | + | Wraiths require special map setup to function properly. Import [https://mega.nz/file/bBNAWbBT#N3yaOVIKjlLxL4H9LpjnRnjVUB1i6lnPU6C3yq59Ox8/ this expobj file] and place the objects far below your map, such as at <code>0,-1000,0</code>. This allows the Wraith spotlight to function. |
− | + | ||
== Scripting Setup == | == Scripting Setup == | ||
− | In your map scripts OnEnter() routine, include the following function. This links the wraith billboard objects used for the spotlight to any Wraith agents in your map. | + | In your map scripts <code>OnEnter()</code> routine, include the following function. This links the wraith billboard objects used for the spotlight to any Wraith agents in your map. |
<syntaxhighlight lang="c++">Blackboard_AddWraithBillboards("WraithBillboard");</syntaxhighlight> | <syntaxhighlight lang="c++">Blackboard_AddWraithBillboards("WraithBillboard");</syntaxhighlight> | ||
− | If all other prerequisites are fulfilled, your Wraith should be reactive to the player upon being activated in the map script. | + | If all other prerequisites are fulfilled, your Wraith should be reactive to the player upon being activated via <code>Entity_SetActive()</code> in the map script. |
To give the Wraith additional behavior, set up and switch the Wraith into the appropriate mode and issue commands as desired. | To give the Wraith additional behavior, set up and switch the Wraith into the appropriate mode and issue commands as desired. |
Latest revision as of 12:07, 12 November 2020
This tutorial will go over the basic setup required to use a Wraith agent. This tutorial assumes you have basic mapping and scripting knowledge.
Map Setup
First, make sure any agents placed in your map are set to be inactive. This ensures that, when later activated in your map script, the agent is successfully added to AgentBlackboard.
The agent requires path nodes to move around, so make sure your map is populated with plenty of nodes. You can use the PathNodeGenerator area type to easily generate a large amount of nodes automatically (make sure whatever surfaces you want to generate nodes on are inside the area), but you may still want to place nodes manually in areas with difficult or precise navigation.
Wraiths require special map setup to function properly. Import this expobj file and place the objects far below your map, such as at 0,-1000,0
. This allows the Wraith spotlight to function.
Scripting Setup
In your map scripts OnEnter()
routine, include the following function. This links the wraith billboard objects used for the spotlight to any Wraith agents in your map.
Blackboard_AddWraithBillboards("WraithBillboard");
If all other prerequisites are fulfilled, your Wraith should be reactive to the player upon being activated via Entity_SetActive()
in the map script.
To give the Wraith additional behavior, set up and switch the Wraith into the appropriate mode and issue commands as desired.