Difference between revisions of "Making challenges"

(List of XML attributes)
(Initial documentation of challenge designing)
Line 1: Line 1:
 
This page documents how challenge files are written, and how to ensure they are showing up in the game.
 
This page documents how challenge files are written, and how to ensure they are showing up in the game.
  
= Create and place the file =
+
= List of attributes =
  
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.
+
<table cellpadding="50">
 
+
  <tr>
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.
+
    <td STYLE="border-top: 1 px solid #000000; border-bottom: 1px solid #000000; border-left: 1px solid #000000">id</td>
Be Careful! If you mess up a file  SuperTuxKart might stop working and you will have to restore it!
+
    <td STYLE="border-top: 1 px solid #000000; border-bottom: 1px solid #000000; border-left: 1px solid #000000;border-right: 1px solid #000000">Identification which STK knows the challenge by. This can be referenced for attribute depend-on.</td>
 
+
  </tr>
= List of XML attributes =
+
  <tr>
 
+
    <td STYLE="border-bottom: 1px solid #000000; border-left: 1px solid #000000">name</td>
 
+
    <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>
{| class="wikitable"
+
  </tr>
!Name
+
  <tr>
!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>
|id
+
  </tr>
|Unique identification which STK knows the challenge by. This can be referenced for depend-on in other challenges.
+
  <tr>
|-
+
    <td STYLE="border-bottom: 1px solid #000000; border-left: 1px solid #000000">unlock-track</td>
|name
+
    <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>
|Short descriptive name for the challenge. Shows up over the main description.
+
  </tr>
|-
+
  <tr>
|description
+
    <td STYLE="border-bottom: 1px solid #000000; border-left: 1px solid #000000">depend-on</td>
|Full description of the challenge.
+
    <td STYLE="border-bottom: 1px solid #000000; border-left: 1px solid #000000;border-right: 1px solid #000000">Challenges which the challenge depends on in order to be shown. This attribute is not required.</td>
|-
+
  </tr>
|unlock-track
+
  <tr>
|Track which the challenge unlocks if solved. Currently a requirement to fill in, if no other unlock- property is used.
+
    <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>
|unlock-gp
+
  </tr>
|Grand Prix which the challenge unlocks if solved.
+
  <tr>
|-
+
    <td STYLE="border-bottom: 1px solid #000000; border-left: 1px solid #000000">minor</td>
|unlock-mode
+
    <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>
|Game mode which the challenge unlocks if solved. For example, ''FOLLOW_LEADER''.
+
  </tr>
|-
+
  <tr>
|depend-on
+
    <td STYLE="border-bottom: 1px solid #000000; border-left: 1px solid #000000">track</td>
|Challenge id(s) which the challenge depends on in order to be shown. This attribute is not required.
+
    <td STYLE="border-bottom: 1px solid #000000; border-left: 1px solid #000000;border-right: 1px solid #000000">Track where challenge takes place.</td>
|-
+
  </tr>
|major
+
  <tr>
|Major game mode type. For example, single for single player mode.
+
    <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>
|minor
+
  </tr>
|Minor game mode type. For example, quickrace.
+
  <tr>
|-
+
    <td STYLE="border-bottom: 1px solid #000000; border-left: 1px solid #000000">karts</td>
|track
+
    <td STYLE="border-bottom: 1px solid #000000; border-left: 1px solid #000000;border-right: 1px solid #000000">Number of karts.</td>
|Track where challenge takes place.
+
  </tr>
|-
+
  <tr>
|difficulty
+
    <td STYLE="border-bottom: 1px solid #000000; border-left: 1px solid #000000">laps</td>
|Difficulty mode for race. For example, ''medium''.
+
    <td STYLE="border-bottom: 1px solid #000000; border-left: 1px solid #000000;border-right: 1px solid #000000">Number of laps.</td>
|-
+
  </tr>
|karts
+
  <tr>
|Number of karts.
+
    <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 points to collect. This attribute is not required.</td>
|laps
+
  </tr>
|Number of laps.
+
  <tr>
|-
+
    <td STYLE="border-bottom: 1px solid #000000; border-left: 1px solid #000000">time</td>
|position
+
    <td STYLE="border-bottom: 1px solid #000000; border-left: 1px solid #000000;border-right: 1px solid #000000">Amount of time required to fulfill the challenge.</td>
|Required rank.
+
  </tr>
|-
+
</table>
|energy
 
|Number of energy/nitro points to collect. This attribute is not required.
 
|-
 
|time
 
|Maximum amount of time in seconds.
 
|}
 

Revision as of 20:38, 17 September 2016

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

List of attributes

id Identification which STK knows the challenge by. This can be referenced for attribute depend-on.
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.
depend-on Challenges which the challenge depends on in order to be shown. This attribute is not required.
major Major game mode type. For example, 'single' for single player mode.
minor Minor game mode type. For example, 'quickrace'.
track Track where challenge takes place.
difficulty Difficulty mode for race. For example, 'medium'.
karts Number of karts.
laps Number of laps.
energy Number of energy points to collect. This attribute is not required.
time Amount of time required to fulfill the challenge.