Garry's Mod

Garry's Mod

Onvoldoende beoordelingen
Creating Checkpoints For Your Map In Hammer
Door Bump Attack ⊗
This guide will walk you through the steps required to add checkpoints to a linear map for singleplayer or multiplayer.
   
Prijs
Toevoegen aan favorieten
Toegevoegd aan favorieten
Verwijderen uit favorieten
Creating The Spawn Area
The first step to creating checkpoints is to create a separate area for the player respawn points. The player will never actually see this area because they will immediately be teleported to the map when they spawn.

Starting with a map that has no spawn points like this:

Create a box outside of the map with the info_player_start entities placed inside:

Next create a trigger_teleport entity filling the inside of the box, and set it up like this:


It is important to move the origin of the teleporter so that it touches the floor of the box:

Now Create an info target and give it the name which the teleporter is using as it's remote destination. This info target should be placed in your map at the place where you want players to initially spawn. Make sure that the space around the target is at least as big as the spawn area so that players don't become stuck when teleported:

Finally create the filter_activator_name entity which the teleporter will use and leave the filter name field blank. This will make the teleporter only affect unnamed entities:

At this point players who spawn into the map should be teleported to the info_target you placed without ever seeing the spawn area. Now we're ready to add Checkpoints!
Creating The First Checkpoint
To begin creating a checkpoint, create a copy of the info_target and the filter_activator_name from before:

Then rename each of them by increasing the number in their names by one. I prefer to use the replace text tool when renaming groups of entities:

Now edit the new filter_activator_name so that the filter name field is set to "Flag_01":

Next we also need to create a copy of the teleporter in the spawn area:

The new teleporter should have the number in it's own name and every name that it refers to increased by one:

Now place the new teleporter back into the spawn area so that it overlaps with the original teleporter:

Now we have a teleporter that will only accept entities named "Flag_01", so we need to create a checkpoint that will mark players who pass it with the name "Flag_01". To do this create a trigger_multiple set up like this:

Notice that the trigger_multiple uses the filter of the teleporter one number below itself. This makes it so that the checkpoints will only be activated if the player passes through them in the correct order.

At this point you should have a map with one checkpoint. Players who haven't reached the checkpoint will spawn at the beginning and players who have reached the checkpoint will spawn at the checkpoint.
Creating Subsequent Checkpoints
Now that you've created one checkpoint, creating more is as easy as copying it and replacing the numbers in its name and the names it refers to:

Make sure to change the filter on the trigger_multiple to the filter of the teleporter before it:

Also copy and rename another teleporter in the spawn room for the new checkpoint:

You should be able to repeat this process to add as many checkpoints as you want.
Finishing The Map And Testing
Now that the checkpoints are in place, lets seal of the map, add a death pit, and compile so that we can test it out:
Other Stuff
This section is just for extra ideas of things you could do instead of following this guide exactly.

1.Checkpoints that can be triggered multiple times and in any order:
Let's say your map isn't linear, but you still want players to respawn in the area they died. Simply don't include a filter on any of the trigger_multiple entities you create. Just remember that the initial spawn point for your map doesn't include a checkpoint unless you add one.

2.Optional checkpoints:
Instead of using trigger_multiple entities as checkpoints use func_buttons instead. This will let players skip checkpoints on linear maps or set their own spawn on open maps.

3.No checkpoint bonus:
Because the checkpoints label the player entity with a name that can be checked by filters, you can use these filters in other parts of your level. For example you could include a door which will only open for players who chose not to use any checkpoints to reward their skill.
5 opmerkingen
PepperoniByte 13 jul 2023 om 15:17 
I am going insane can someone please tell me how to reset the checkpoints back to the start I have been trying to figure this out for an hour
I know this thread is dead but I've got like nobody to help me
winkletinkle 20 dec 2020 om 15:16 
Thanks, Got it fixed!
Bump Attack ⊗  [auteur] 20 dec 2020 om 14:31 
Or you could just not use a local destination landmark, but this makes it so that if multiple players respawn at the checkpoint at the same time they might get stuck in eachother.
Bump Attack ⊗  [auteur] 20 dec 2020 om 14:30 
I've had some issues like this using trigger_teleport entities before. It's caused by the teleporter using the wrong entity as the local destination landmark. For some reason it will ignore the entity that you assign as the landmark and measure from a different point. The only way to fix it I've been able to find is deleting the trigger teleport and making a new one.
winkletinkle 20 dec 2020 om 13:45 
Instructions Unclear, ended up in the place I didn't put the checkpoint.