|
|
(5 intermediate revisions by the same user not shown) |
Line 1: |
Line 1: |
| Test for Tutorial: Creating a parkour
| |
|
| |
|
|
| |
| This tutorial provides a basis for scenario designers wanting to create a parkour. It explains the basics and some extended features of the parkour goal. Furthermore some elementary design issues for parkours will be addressed.
| |
|
| |
| == Parkour ==
| |
| A parkour is basically an extended race, players have to get from start to finish but have to pass checkpoints in between. The parkour goal gives the scenario designer options to adjust the path, thereby increasing the challenge for the players. Other features would be creating team parkours, where players need to split up and complete different paths to join forces later. On the player's side rounds get less frustrating since you would only have to redo parts of a parkour after having died, as you respawn at the latest passed checkpoint.
| |
|
| |
| == Scenario script ==
| |
| The parkour goal can not be created through a Scenario.txt entry, since the checkpoints have to be created manually. Thus the obvious location to create the parkour goal is in the scenario script, an example of such a script is given here.
| |
|
| |
| protected func Initialize()
| |
| {
| |
| // ''First create the goal and store it.''
| |
| var goal = CreateObject(Goal_Parkour);
| |
|
| |
| // ''Place the start at the left of the map.''
| |
| goal->SetStartpoint(50, LandscapeHeight() / 2);
| |
|
| |
| // ''Place some checkpoints from left to right at random height in between.''
| |
| var cp_count = 10;
| |
| for (var cp_num = 1; cp_num <= cp_count; cp_num++)
| |
| {
| |
| var x = cp_num * LandscapeWidth() / (cp_count + 1);
| |
| var y = Random(LandscapeHeight());
| |
| var cp_mode = PARKOUR_CP_Check | PARKOUR_CP_Respawn | PARKOUR_CP_Ordered;
| |
| goal->AddCheckpoint(x, y, cp_mode);
| |
| }
| |
|
| |
| // ''Place the finish at the right of the map.''
| |
| goal->SetFinishPoint(LandscapeWidth() - 50, LandscapeHeight() / 2);
| |
|
| |
| return;
| |
| }
| |
|
| |
| This of course cries for an explanation. First note that for a static map, i.e. those created from a Map.bmp, you can look for decent places for your checkpoints and create them. For dynamic maps you need to let a script search a decent location, in this example script we do not worry about such issues. So in the first line the parkour goal is created and stored in <nowiki>goal</nowiki>, cause we need that later. The second line creates the parkour start, only create one start checkpoint. The function
| |
| public func SetStartpoint(int x, int y)
| |
| creates a start checkpoint at the global coordinates <nowiki>x</nowiki> and <nowiki>y</nowiki> and returns the checkpoint just created. After that 10 checkpoints are created ordered along the x direction at random height, for this the function
| |
| public func AddCheckpoint(int x, int y, int mode)
| |
| is used. This creates a checkpoint at the global coordinates <nowiki>x</nowiki> and <nowiki>y</nowiki> with the specified mode and returns the checkpoint just created. Checkpoint modes will be explained later, just note here that the checkpoints created in the example have to be passed in order and respawn the player at the latest passed checkpoint. In the last line the the parkour finish is created, also here only one finish should be created.
| |
|
| |
| == Checkpoints ==
| |
|
| |
| A checkpoint can have various modes, these can be assigned using a bit mask. The different modes are
| |
| PARKOUR_CP_Start
| |
| PARKOUR_CP_Finish
| |
| PARKOUR_CP_Check
| |
| PARKOUR_CP_Respawn
| |
| PARKOUR_CP_Ordered
| |
| PARKOUR_CP_Team
| |
|
| |
| == Landscape ==
| |
|
| |
| Dynamic vs. static.
| |