CheckPoints and Killzone

Tutorial 10
CheckPoints and Killzone
Changing Maps in Game
Creating a Basic Gametype
Note: when you build your level you may get a kill mapz error – to
stop this from happening, go into View > World Properties and locate
the Zone Info. Change the Kill Z property to -40000.
CheckPoints and Killzone
Checkpoints are points on a map where the player will continue from should they die
during play. It means they do not have to start all over again from the beginning.
Create a floor: 1024 x 1024 x 16. Add two boxes at say 896 x 128 x 256. These will act
as runs.
Move the builder brush below the floor and give it
larger dimensions e.g., 1536 x 1536 x 64. Right
click on the Volume icon and select
UTKillzVolume.
You should
have
something
similar to
this:
(Killzone
highlighted
pink):
2
Place some point lights around. Add three player starts as shown below.
2
3
1
Select Player Start 3, hit F4 to bring up its
properties and turn off Enabled and Primary Start.
Do the same for Player Start 2.
Place a builder brush around Player Start 2, right click on the Volume icon and select
Trigger Volume. Do the same for Player Start 3.
With the 1st Trigger Volume selected, open up Kismet.
3
Right click in the grey window and select New
Event Using TriggerVolume0 > Touch.
Right click in the grey window again and select New Action > Toggle > Toggle.
Create a copy of the toggle (CTL W). Connect Touched to Turn On. Connect the Out
node to Turn Off.
Select the Player Start inside the Trigger Volume
and in Kismet right click in the window and choose
New Object Variable using Player Start_1.
Link the first Toggle Target to this Player Start
4
Select the 1st Player Start (0), right click again in Kismet and
create another New Object Variable. Link this to the 2nd
Toggle Target.
Select the second Trigger Volume and create another New
Event Using Trigger Volume_1 > Touch.
Create another two Toggle sequences (New Action > Toggle
> Toggle).
Select the last Player Start placed and create another New Object Variable. Select the
2nd Player Start and create New Object Variable. Attach as seen below.
Close Kismet, SAVE, build all and play!
5
Changing Maps in Game
Place a static mesh in the level as a marker for where the player will switch maps. Add
a Trigger (right click > Add Actor > Add Trigger). Place the trigger on the static mesh.
With the trigger selected, open Kismet. Right click and choose New Event Using Trigger
> Touch. Right click in the grey window again and select New Action > Misc > Console
Command. With the Console Command sequence selected, expand the Seq
Act_Console Command properties. Type open and choose the name of a map for the
destination.
Right click again and select New Variable > Player. Uncheck the All Players box if we
only require one player.
6
Connect as seen below.
SAVE > Build All. The map change will only take effect by running the map in PC mode.
It will not work running from the editor. Test your map change!
Creating a Basic Gametype
Locate and copy the UTDeathmatch.uc found under
Development|Src\UTGame\Classes. Save it to the MyMod folder or if you prefer, make
a new folder and name it whatever (just remember, all classes must be held in a subfolder called Classes). I created a folder and called it JSM_Game_Mod and created a
sub folder in here to hold my classes. Now copy the UTGame.uc and paste it into the
new classes folder.
Rename the copy of the UTDeathmatch (e,.g., JSMDeathmatch). Open both classes in
a text editor such as ConTEXT, Notepadd++ or Wotgreal (I use the latter).
In UTDeathmatch change the class to JSMDeathmatch and change extends UTGame to
UTDeathmatch. NOTE: The class name must always be the same name as the name
of the class file!
7
Highlight all the code under config(game); up to default properties and delete it. This
code is already in the UTDeathmatch we are extending from and therefore not required.
Also delete the default properties EXCEPT Map Prefixes.
Your code should now be looking like as below (with your own class name of course!)
Change the “DM” to JSM (or whatever you prefixed your class with). Let’s just compile
this (I suggest using Frontend).
Now we need to create an .ini file for our new class (a configuration file which tells the
engine how to deal with the game).
Find the UDKGame.ini in the Config folder:
Open it up and do a search (CTRL F) for Deathmatch … keep hitting Find Next until you
reach the one as shown below. Copy the whole section.
8
Paste it at the bottom of the file but above the [IniVersion] and change the name
accordingly. Also change the GameMode to the folder name of your class followed by
the appropriate class name, e.g.,
SAVE
the file.
Now, in order for our game type to show up in the menus we need to add entries into the
Localisation folder. The one we require at the moment is the utgame.int found in
UDKGame\Localisation folder:
9
With the utgame.int file open, search again for Deathmatch until you find as seen below.
Copy this section.
Scroll to the section where the line states ; UT3 Game
Modes
Paste the code at the bottom of this section. Add a semi colon and some back slashes.
Create another line with the same semi colon and back slashes and paste the code and
rename accordingly. It should be similar to as seen below.
Go back to the UT3 Game Modes section and copy the first 3 lines as shown: Copy.
10
Go down to the last line of your pasted Game_Mod section and paste.
SAVE and run the level.
You will see your game type show up in the menu!
11