Difference between revisions of "Making challenges"

(Create and place the file)
m
 
(9 intermediate revisions by 2 users not shown)
Line 3: Line 3:
 
= Create and place the file =
 
= Create and place the file =
  
The easiest way is to copy an already existing .challenge file and edit to your liking. The files are in various track folders, and you need to place your own alongside in a not-empty track folder in order for STK to find it. See [[How_to_install_add-ons|this page]] if you don't know where the track folders are. If placed and formatted correctly, you should see your challenge alongside with the rest in 'Challenges' entry in the main menu. Should you not find it, start the game with a terminal and see if any warnings are printed.
+
The easiest way is to copy an already existing .challenge file and edit to your liking. The files are in various track folders, and you need to place your own alongside in a not-empty track folder in order for STK to find it. See [[Installing Add-Ons|this page]] if you don't know where the track folders are. If placed and formatted correctly, you should see your challenge alongside with the rest in 'Challenges' entry in the main menu. Should you not find it, start the game with a terminal and see if any warnings are printed.
  
The game auto-creates an entry for your challenge in the challenges.xml file upon game runtime. To find this file, refer to [[FAQ#Where_does_STK_store_the_user_config_file.3F|the FAQ]]. So if you created a challenge with ''id''="mychallenge", there should be a line <code>        <mychallenge solved="false" /></code>in challenges.xml. Simply change to ''false'' again if you need to test unlocking later, e.g. if you change ''unlock-track'' after fulfilling the challenge.
+
The game auto-creates an entry for your challenge in the challenges.xml file upon game runtime. To find this file, refer to [[FAQ#Where_does_STK_store_the_user_config_file.3F|the FAQ]]. So if you created a challenge with ''id''="mychallenge", there should be a line <code>        <mychallenge solved="false" /></code>in players.xml. Simply change to ''false'' again if you need to test unlocking later, e.g. if you change ''unlock-track'' after fulfilling the challenge.
 +
Do keep in mind that if you edit a challenge SuperTuxKart might stop working and you will have to restore the old challenge file.
  
 
= List of XML attributes =
 
= List of XML attributes =
  
<table cellpadding="50">
+
 
  <tr>
+
{| class="wikitable"
    <td STYLE="border-top: 1 px solid #000000; border-bottom: 1px solid #000000; border-left: 1px solid #000000">id</td>
+
!Name
    <td STYLE="border-top: 1 px solid #000000; border-bottom: 1px solid #000000; border-left: 1px solid #000000;border-right: 1px solid #000000">Unique identification which STK knows the challenge by. This can be referenced for ''depend-on'' in other challenges.</td>
+
!Description
  </tr>
+
|-
  <tr>
+
|id
    <td STYLE="border-bottom: 1px solid #000000; border-left: 1px solid #000000">name</td>
+
|Unique identification which STK knows the challenge by. This can be referenced for depend-on in other challenges.
    <td STYLE="border-bottom: 1px solid #000000; border-left: 1px solid #000000;border-right: 1px solid #000000">Short descriptive name for the challenge. Shows up over the main description.</td>
+
|-
  </tr>
+
|name
  <tr>
+
|Short descriptive name for the challenge. Shows up over the main description.
    <td STYLE="border-bottom: 1px solid #000000; border-left: 1px solid #000000">description</td>
+
|-
    <td STYLE="border-bottom: 1px solid #000000; border-left: 1px solid #000000;border-right: 1px solid #000000">Full description of the challenge.</td>
+
|description
  </tr>
+
|Full description of the challenge.
  <tr>
+
|-
    <td STYLE="border-bottom: 1px solid #000000; border-left: 1px solid #000000">unlock-track</td>
+
|unlock-track
    <td STYLE="border-bottom: 1px solid #000000; border-left: 1px solid #000000;border-right: 1px solid #000000">Track which the challenge unlocks if solved. Currently a requirement to fill in.</td>
+
|Track which the challenge unlocks if solved. Currently a requirement to fill in, if no other unlock- property is used.
  </tr>
+
|-
  <tr>
+
|unlock-gp
    <td STYLE="border-bottom: 1px solid #000000; border-left: 1px solid #000000">depend-on</td>
+
|Grand Prix which the challenge unlocks if solved.
    <td STYLE="border-bottom: 1px solid #000000; border-left: 1px solid #000000;border-right: 1px solid #000000">Challenge id(s) which the challenge depends on in order to be shown. This attribute is not required.</td>
+
|-
  </tr>
+
|unlock-mode
  <tr>
+
|Game mode which the challenge unlocks if solved. For example, ''FOLLOW_LEADER''.
    <td STYLE="border-bottom: 1px solid #000000; border-left: 1px solid #000000">major</td>
+
|-
    <td STYLE="border-bottom: 1px solid #000000; border-left: 1px solid #000000;border-right: 1px solid #000000">Major game mode type. For example, ''single'' for single player mode.</td>
+
|depend-on
  </tr>
+
|Challenge id(s) which the challenge depends on in order to be shown. This attribute is not required.
  <tr>
+
|-
    <td STYLE="border-bottom: 1px solid #000000; border-left: 1px solid #000000">minor</td>
+
|major
    <td STYLE="border-bottom: 1px solid #000000; border-left: 1px solid #000000;border-right: 1px solid #000000">Minor game mode type. For example, ''quickrace''.</td>
+
|Major game mode type. Currently, possible major modes are ''any'', ''grandprix'' and ''single''.
  </tr>
+
|-
  <tr>
+
|minor
    <td STYLE="border-bottom: 1px solid #000000; border-left: 1px solid #000000">track</td>
+
|Minor game mode type. Currently, possible minor modes are ''followtheleader'', ''timetrial'' and ''quickrace''.
    <td STYLE="border-bottom: 1px solid #000000; border-left: 1px solid #000000;border-right: 1px solid #000000">Track where challenge takes place.</td>
+
|-
  </tr>
+
|track
  <tr>
+
|Track where challenge takes place.
    <td STYLE="border-bottom: 1px solid #000000; border-left: 1px solid #000000">difficulty</td>
+
|-
    <td STYLE="border-bottom: 1px solid #000000; border-left: 1px solid #000000;border-right: 1px solid #000000">Difficulty mode for race. For example, ''medium''.</td>
+
|difficulty
  </tr>
+
|Difficulty mode for race. For example, ''medium''.
  <tr>
+
|-
    <td STYLE="border-bottom: 1px solid #000000; border-left: 1px solid #000000">karts</td>
+
|karts
    <td STYLE="border-bottom: 1px solid #000000; border-left: 1px solid #000000;border-right: 1px solid #000000">Number of karts.</td>
+
|Number of karts.
  </tr>
+
|-
  <tr>
+
|laps
    <td STYLE="border-bottom: 1px solid #000000; border-left: 1px solid #000000">laps</td>
+
|Number of laps.
    <td STYLE="border-bottom: 1px solid #000000; border-left: 1px solid #000000;border-right: 1px solid #000000">Number of laps.</td>
+
|-
  </tr>
+
|position
  <tr>
+
|Required rank.
    <td STYLE="border-bottom: 1px solid #000000; border-left: 1px solid #000000">energy</td>
+
|-
    <td STYLE="border-bottom: 1px solid #000000; border-left: 1px solid #000000;border-right: 1px solid #000000">Number of energy/nitro points to collect. This attribute is not required.</td>
+
|energy
  </tr>
+
|Number of energy/nitro points to collect. This attribute is not required.
  <tr>
+
|-
    <td STYLE="border-bottom: 1px solid #000000; border-left: 1px solid #000000">time</td>
+
|time
    <td STYLE="border-bottom: 1px solid #000000; border-left: 1px solid #000000;border-right: 1px solid #000000">Maximum amount of time.</td>
+
|Maximum amount of time in seconds.
  </tr>
+
|}
</table>
 

Latest revision as of 11:57, 29 May 2018

This page documents how challenge files are written, and how to ensure they are showing up in the game.

Create and place the file

The easiest way is to copy an already existing .challenge file and edit to your liking. The files are in various track folders, and you need to place your own alongside in a not-empty track folder in order for STK to find it. See this page if you don't know where the track folders are. If placed and formatted correctly, you should see your challenge alongside with the rest in 'Challenges' entry in the main menu. Should you not find it, start the game with a terminal and see if any warnings are printed.

The game auto-creates an entry for your challenge in the challenges.xml file upon game runtime. To find this file, refer to the FAQ. So if you created a challenge with id="mychallenge", there should be a line <mychallenge solved="false" />in players.xml. Simply change to false again if you need to test unlocking later, e.g. if you change unlock-track after fulfilling the challenge. Do keep in mind that if you edit a challenge SuperTuxKart might stop working and you will have to restore the old challenge file.

List of XML attributes

Name Description
id Unique identification which STK knows the challenge by. This can be referenced for depend-on in other challenges.
name Short descriptive name for the challenge. Shows up over the main description.
description Full description of the challenge.
unlock-track Track which the challenge unlocks if solved. Currently a requirement to fill in, if no other unlock- property is used.
unlock-gp Grand Prix which the challenge unlocks if solved.
unlock-mode Game mode which the challenge unlocks if solved. For example, FOLLOW_LEADER.
depend-on Challenge id(s) which the challenge depends on in order to be shown. This attribute is not required.
major Major game mode type. Currently, possible major modes are any, grandprix and single.
minor Minor game mode type. Currently, possible minor modes are followtheleader, timetrial and quickrace.
track Track where challenge takes place.
difficulty Difficulty mode for race. For example, medium.
karts Number of karts.
laps Number of laps.
position Required rank.
energy Number of energy/nitro points to collect. This attribute is not required.
time Maximum amount of time in seconds.