http://wiki.wolfire.com/api.php?action=feedcontributions&user=Doctorgester&feedformat=atomWolfire Games Wiki - User contributions [en]2024-03-28T19:07:04ZUser contributionsMediaWiki 1.30.0http://wiki.wolfire.com/index.php?title=Checkpoints&diff=4758Checkpoints2017-09-09T22:21:18Z<p>Doctorgester: </p>
<hr />
<div>Checkpoints allow you to set up goals that the player can achieve to advance progress in a level.<br />
<br />
With them you can move the player spawn point upon death and allow defeated enemies to remain dead.<br />
<br />
When the player advances progress, you can do nothing, play a dialog, spawn new enemies, or trigger a level win (load the next level).<br />
<br />
You can make some of the checkpoints optional, so player progress is saved, but the player does not have to touch them to complete the level.<br />
<br />
== Using the checkpoint system ==<br />
<br />
Start by creating a new level, or opening an existing level, and activating the editor by hitting "F1".<br />
<br />
You might want to enable debug text (Settings -> Debug -> Enable "Draw In-Game Debug Window").<br />
<br />
'''Debug keys (these will work once a level has checkpoints):'''<br />
<br />
{| class="wikitable" border="1"<br />
|-<br />
|L<br />
|reset the level to the currently achieved checkpoint<br />
|-<br />
|K<br />
|swap to the next checkpoint, or wrap around to the first (remember to hit "L" after to reset)<br />
|}<br />
<br />
'''To add the checkpoint system to a level:'''<br />
<br />
Load -> Load Item... -> Data/Objects/Hotspots/overgrowth_level.xml<br />
<br />
The table below shows the types of goals that can be used as checkpoints. Below the table are instructions for how to use each goal.<br />
<br />
{| class="wikitable" border="1"<br />
|-<br />
|reach<br />
|when touched, moves the player spawn point and saves defeated enemies. must touch it to complete the level/advance progress<br />
|-<br />
|reach_skippable<br />
|same as "reach" checkpoint but the player never has to reach it to complete the level/advance progress<br />
|-<br />
|defeat<br />
|the player must defeat a list of enemies to complete the level/advance progress<br />
|-<br />
|spawn_defeat<br />
|same as "defeat" checkpoint but the enemies to defeat are spawned at the beginning of that checkpoint<br />
|}<br />
<br />
=== "reach" checkpoint ===<br />
<br />
# Add the checkpoint hotspot to the scene. This is the trigger for the checkpoint. Load -> Load Item... -> Data/Objects/Hotspots/overgrowth_level_checkpoint.xml<br />
# Add the placeholder object to the scene. This is the player spawn. Load -> Utility -> Placeholder <br />
# Set the checkpoint hotspot "checkpoint_id" parameter to a value starting at 0 and increasing for each checkpoint you add<br />
# Set the checkpoint hotspot "level_hotspot_id" parameter to the object id of the overgrowth_level hotspot<br />
# Add a "goal_<number>" parameter to the overgrowth_level hotspot and set the value to "reach <number>", with the number from step 3<br />
# Add a value to the overgrowth_level hotspot "player_spawn" parameter, delimited with spaces, with the id of the placeholder object from step 2 ("437 243 121"). The order matters, and the id for checkpoint 0 should go in the first spot, checkpoint 1 in the second spot, etc. You can see that you've written the correct ID if a transparent character model appears in the placeholder hotspot.<br />
<br />
The numbers in checkpoints are tricky to get right. To add an additional checkpoint:<br />
<br />
# Add another goal param to the overgrowth_level hotspot, and give it a number one higher than the previous goal. So if your previous goal was <code>goal_0</code>, you would add another one with the name <code>goal_1</code><br />
# Set the goal param's value to one higher than the previous goal. So if the previous one was <code>reach 5</code>, this new param's value would be <code>reach 6</code><br />
# Load a checkpoint object, and set its <code>checkpoint_id</code> parameter to a value that matches the reach goal in step #2. So, if the goal is <code>reach 6</code>, then this would just be <code>6</code><br />
# Set the checkpoint object's <code>level_hotspot_id</code> param<br />
# Load a placeholder object for the player to spawn at<br />
# Add the id of the placeholder object to the end of the overgrowth_level's <code>player_spawn</code> param. So if it was previously <code>123 456</code> then it would now be something like <code>123 456 784</code><br />
<br />
=== "reach_skippable" checkpoint ===<br />
<br />
Do all the same as a "reach" hotspot, but in step 5 set the value to "reach_skippable <number>" instead of "reach <number>"<br />
<br />
=== "defeat" checkpoint ===<br />
<br />
# Add an enemy to the level<br />
# Add a "goal_<number>" parameter to the overgrowth_level hotspot and set the value to "defeat <number>", with the object id of the enemy from step 1<br />
# Add additional enemy ids in the form of "defeat <some_enemy_id> <other_enemy_id>", just like in step two (e.g. "defeat 4 72 8")<br />
<br />
=== "spawn_defeat" checkpoint ===<br />
<br />
Do all the same as a "defeat" hotspot, but in step 2 set the value to "spawn_defeat <numbers...>" instead of "defeat <numbers...>"<br />
<br />
== Triggering dialogs ==<br />
<br />
'''To trigger a dialog just before starting on a new goal (whether a "reach" or "defeat" goal):'''<br />
<br />
# Add a dialog to the level and get it working with the dialog editor<br />
# Add a "goal_<number>_pre" parameter to the overgrowth_level hotspot and set the value to "dialog <dialogname>", with the dialog name from step 1, and the number of the goal you want the dialog to be triggered before. (e.g. "goal_5_pre")<br />
# Note that the dialog will be started again if you die and respawn, and the dialog can be used to set a new spawn point for the player<br />
<br />
'''To trigger a dialog just after achieving a checkpoint goal (whether a "reach" or "defeat" checkpoint):'''<br />
<br />
Do all the same as a dialog triggered before progressing to a given checkpoint, but name the parameter "goal_<number>_post" (e.g. "goal_5_post")</div>Doctorgester