File not beginning with this magic are not detected as KMP text files and ignored.
Any order of the section is allowed. Because of the 2 pass compiler, any section can access to all variables of all section independent from the order. The KMP decoder starts with the setup sections followed by the KMP sections in alphabetically order.
For more information about sections see »Parser Syntax / Sections«.
Floats with comma (1,2) instead of a point (1.2) are always accepted.
If you copy complete lines, tell the scanner to switch to the SZS-Modifier mode.
Example:
[ENPT] 0 1.111 2.222 3.333 4.444 0x1234 0x5678 @szs-modifier = 1 1 1,111 2,222 3,333 4,444 12345678 @szs-modifier = 0 2 1.111 2.222 3.333 4.444 0x1234 0x5678 @smod 1 3 1,111 2,222 3,333 4,444 12345678 @smod 0 4 1.111 2.222 3.333 4.444 0x1234 0x5678
# Identify the tool and version, that have written this file: TOOL = wkmpt SYSTEM = x86_64 VERSION = 0.32a REVISION = 3617 DATE = 2012-04-02Some KMP tools support to add an info string at the end of the KMP file:
INFO = ""The KMP file header has one unknown member at offset 0x0c and the value is always 0x9d8.
UNKNOWN-0x0c = 0x9d8The info part contains also element counter for all sections.
The default setup define 7 different parameters with predefines meanings:
Name | Description |
---|---|
Create a KMP for the entered slot. The default value 0 means: Design for almost all slots. Use it with an if..then..else structure to support special slots. The default code is completely slot independent, so the user have to implement slot dependencies. | |
Create a KMP file for a |
|
Enable test mode, if |
|
If If |
|
If |
|
If |
|
This parameter controls the number of laps by changing the settings of the check point modes (section CKPT/@AUTO-MODE). Allowed values are:
|
@def slot ?= 0 # Enable support for special slots @def d ?= 0 # Enable support for _d files @def test ?= 0 # Enable test mode @def ocam ?= 0 # Test opening cam, only relevant if test>0 @def showrt ?= 0 # Show item boxes for route points. # Only relevant if test>0. Set bit combination: # 1:ENPT, 2:ITPT, 4:JGPT, 8:CNPT, 0x10:MSPT (-1:all) @def showck ?= 0 # Show objects a check point positions if test>0. # 0:off, 1:mandatory, 2:all, 3=left+right @def laps ?= 3 # Number of laps (0|1|3|4), only relevant if test>0
In a second step, global mode variables are defined and normalized
following the rules of the above table.
All conditions in a KMP text file should use these
@gdef mode$slot = slot > 0 ? slot : 0 @gdef mode$d = d > 0 @gdef mode$test = test > 0 ? test : 0 @gdef mode$ocam = mode$test && ocam >= 1 ? ocam : 0 @gdef mode$laps = mode$test && laps >= 0 ? laps : 3 @gdef mode$showrt = mode$test ? showrt : 0 @gdef mode$showck = mode$test ? showck : 0 @gdef mode$automode = select(mode$laps,AM$SHORT,AM$1LAP,AM$OFF,AM$OFF,AM$UNLIMIT)
Example:
wszst --const test=12,ocam=2,laps=0 ...Enable test mode 12, show opening camera 2 endless (until pressing A) and finish the race very fast to view the finish cameras very soon.
@REVISION = 1234
Parameter
@AREA-HEAD-VALUE = 0
Each entry is split at least into 3 lines.
The greater sign
@REVISION = 1234Parameters
@OPENING-INDEX = c1 @SELECTION-INDEX = c2
Column
For each camera, 3 global variables are defined, if a name is specified as
camera index (field
If zoom or view point speed is set to value -1, then the value is calculated so that the time coincides with the camera running time. If this calculation is not possible, value 1 will be used. The calculations are:
zoom_speed := 100.0 * NAME.zoom.len / NAME.came.time viewpt_speed := 100.0 * NAME.viewpt.len / NAME.came.time
Each entry is split at least into 4 lines.
The greater sign
This complete section is only informative and ignored on reading.
The content is created while scanning the parameter
@REVISION = 1234
The parameters
@CKPT-HEAD-VALUE = 0 @CKPH-HEAD-VALUE = 0
The KMP compiler can override the
@AUTO-MODE = mode$automode
If parameter
@AUTO-NEXT = 0
If a KMP text file is encoded and printed as text file again,
the scanned group names will be used for the output.
If parameter
@AUTO-GROUP-NAME = 0
If
@ROUTE-OBJECT-MODE | |||
---|---|---|---|
ROUTE-OBJECT-MODE | lap counter mode=0 |
mandatory0<mode<255 | all othersmode=255 |
0 | — | — | — |
1 | object 2 | object 1 | — |
2 | object 2 | object 2 | object 1 |
3 | left=object 1 right=object 2 |
left=object 1 right=object 2 |
left=object 1 right=object 2 |
Usually,
@ROUTE-OBJECT-MODE = mode$showck --- default settings: @ROUTE-OBJECT1 = o$castletree1 @ROUTE-OBJECT2 = o$TownTreeDS @ROUTE-OBJECT1-SCALE = v( 0.05, 12.00, 0.20 ) @ROUTE-OBJECT2-SCALE = v( 0.05, 12.00, 0.20 ) @ROUTE-OBJECT1-BASE = -2000 @ROUTE-OBJECT2-BASE = -2000If tool wszst is active and a route object is defined, then option --auto-add is implicitly set.
The default GROUP names are the result of analyzing the pathes
between the groups.
For clearness, each
A
Syntax:
'$GROUP' name: next1 ... next6 '$SPLIT' name
Syntax:
'$LINE' N '$BORDER' N '$BEZIER' N [ P1x P1y ] [ P2x P2y ]Command
Command
Command
@REVISION = 1234
Parameter
@CNPT-HEAD-VALUE = 0
If parameter
@AUTO-ID = 1
All points can be adjusted using the KCL-FALL
feature, if a reference KCL is loaded by option --load-kcl.
This is done before the
If parameter
Parameter
@HSNAP-TO-ENPT = $NONE # horizontal snap without adjust, y-rotation @SNAP-TO-ENPT = $NONE # 3D snap, y-rotation @SNAP2-TO-ENPT = $NONE # 3D snap, x- and y-rotation
If
@SHOW-ROUTE = ( mode$showrt & 8 ) > 0
This complete section is only informative and ignored on reading.
The content is created while scanning the parameter
@REVISION = 1234
The parameters
@ENPT-HEAD-VALUE = 0 @ENPH-HEAD-VALUE = 0
If parameter
@AUTO-FILL = 0.0
If a KMP text file is encoded and printed as text file again,
the scanned group names will be used for the output.
If parameter
@AUTO-GROUP-NAME = 0
If
@ROTATE-GROUP-LINKS = 0
All points can be adjusted using the KCL-FALL feature, if a reference KCL is loaded by option --load-kcl.
If
@SHOW-ROUTE = ( mode$showrt & 1 ) > 0
To allow the same definition for ENPT and ITPT,
a next name can be followed by
The default GROUP names are the result of analyzing the pathes
between the groups.
For clearness, each
A
Syntax:
'$GROUP' name: next1 ... next6 '$SPLIT' name
Syntax:
'$LINE' N '$BEZIER' N P1x P1y P1z [ P2x P2y P2z ]
If P1 and P2 are not set, then the points are set linear between the previous and the next point. If P1 is set, then a quadratic bézier curve and if P1 and P2 are set, then a cubic bézier curve is calculated. The settings and the GROUP are copied from the point behind.
@REVISION = 1234
Parameter
@GOBJ-HEAD-VALUE = 0
If parameter
@AUTO-ENEMY-ITEM = 0 # mode$test ?- : 0
If a text file is encoded and printed as text file again, the scanned object names will be used for the output. If parameter '@AUTO-OBJECT-NAME' to 1, then all objects will be renamed.
@AUTO-OBJECT-NAME = 0
All points can be adjusted using the KCL-FALL feature, if a reference KCL is loaded by option --load-kcl.
It is possible to sort the global objects.
If parameter
@SORT-OBJECTS = SORT$OFF
Column
The additional info about the meaning and the parameters of the objects are copied from the Custom Track Wiki. Please edit the pages if you find more infos or errors.
Each entry is split at least into 3 lines.
The greater sign
This complete section is only informative and ignored on reading.
The content is created while scanning the parameter
@REVISION = 1234
The parameters
@ITPT-HEAD-VALUE = 0 @ITPH-HEAD-VALUE = 0
If parameter
@AUTO-FILL = 0.0
If a KMP text file is encoded and printed as text file again,
the scanned group names will be used for the output.
If parameter
@AUTO-GROUP-NAME = 0
If
@ROTATE-GROUP-LINKS = 0
All points can be adjusted using the KCL-FALL feature, if a reference KCL is loaded by option --load-kcl.
If
@SHOW-ROUTE = ( mode$showrt & 2 ) > 0
To allow the same definition for ENPT and ITPT,
a next name can be followed by
The default GROUP names are the result of analyzing the pathes
between the groups.
For clearness, each
A
Syntax:
'$GROUP' name: next1 ... next6 '$SPLIT' name
Syntax:
'$LINE' N '$BEZIER' N P1x P1y P1z [ P2x P2y P2z ]
If P1 and P2 are not set, then the points are set linear between the previous and the next point. If P1 is set, then a quadratic bézier curve and if P1 and P2 are set, then a cubic bézier curve is calculated. The settings and the GROUP are copied from the point behind.
@REVISION = 1234
Parameter
@JGPT-HEAD-VALUE = 0
If parameter
@AUTO-ID = 1
All points can be adjusted using the KCL-FALL
feature, if a reference KCL is loaded by option --load-kcl.
This is done before the
If parameter
Parameter
@HSNAP-TO-ENPT = $NONE # horizontal snap without adjust, y-rotation @SNAP-TO-ENPT = $NONE # 3D snap, y-rotation @SNAP2-TO-ENPT = $NONE # 3D snap, x- and y-rotation
If
@SHOW-ROUTE = ( mode$showrt & 4 ) > 0
@REVISION = 1234Parameter
@KTPT-HEAD-VALUE = 0
All points can be adjusted using the KCL-FALL feature, if a reference KCL is loaded by option --load-kcl.
@REVISION = 1234
Parameter
@MSPT-HEAD-VALUE = 0
If parameter
@AUTO-ID = 1
All points can be adjusted using the KCL-FALL
feature, if a reference KCL is loaded by option --load-kcl.
This is done before the
If parameter
Parameter
@HSNAP-TO-ENPT = $NONE # horizontal snap without adjust, y-rotation @SNAP-TO-ENPT = $NONE # 3D snap, y-rotation @SNAP2-TO-ENPT = $NONE # 3D snap, x- and y-rotation
If
@SHOW-ROUTE = ( mode$showrt & 16 ) > 0
@REVISION = 1234
If a text file is encoded and printed as text file again, the scanned route
names will be used for the output.
If parameter
@AUTO-ROUTE-NAME = 0
The generic route name is
The keyword
If a route is closed, 3 global variables are defined for the route.
@KCL-FALL-WIDTH = CUBE_WIDTH @KCL-FALL-PRE-ADD = HEIGHT_OR_VECTOR @KCL-FALL-POST-ADD = HEIGHT_OR_VECTOR @KCL-FALL-TYPES = TYPEMASK
The next 9 parameters are computed after closing a route in this order:
@XSS = X1OLD, X1NEW, X2OLD, X2NEW @YSS = Y1OLD, Y1NEW, Y2OLD, Y2NEW @ZSS = Z1OLD, Z1NEW, Z2OLD, Z2NEW @SCALE = FACTOR [ORIGIN] @SHIFT = DELTA @HROTATE = DEGREE [ORIGIN] @REVERSE-ORDER = 0|1 @SET-ROUTE-TIME = SECONDS @SHOW-ROUTE = 0|1Parameter descriptions:
Columns
Syntax:
'$LINE' N '$BEZIER' N P1x P1y P1z [ P2x P2y P2z ]
If P1 and P2 are not set, then the points are set linear between the previous and the next point. If P1 is set, then a quadratic bézier curve and if P1 and P2 are set, then a cubic bézier curve is calculated. The settings are copied from the point behind.
Syntax:
'$COPY' ROUTE_ID [FIRST_POINT [LAST_POINT]]
@REVISION = 1234Parameter
@STGI-HEAD-VALUE = 0
But we have a KCL, that knows where the roads are.
Why not set an object to a position above the road.
Then the computer can find a final position by simulating
a free fall until a KCL border is found?
This concept is implemented in Wiimms SZS Tools and called
For this calculation 4 parameters can be set.
@KCL-FALL-WIDTH = 0 # set to a value >0 (e.g. 200) to enable KCL falling @KCL-FALL-PRE-ADD = 0 # add this height or vector before falling @KCL-FALL-POST-ADD = 0 # add this height or vector after success @KCL-FALL-TYPES = -1 # bit field of recognized KCL types
For each point the following algorithm is used. The algorithm use always the current setting of the parameters. So it's allowed to change the parameters only for some points.
If
The main idea of this parameter is to raise the point before falling down. So the initial position can be estimated.
Use the predifined value
The main idea of this parameter to adjust the position by a user defined value, if and only if a collision was found. This can be useful in slopes.
If you want only to adjust a few points,
define
Supported KMP sections:
CNPT,
ENPT,
GOBJ,
ITPT,
JGPT,
KTPT,
MSPT and
POTI.
Additionally the parser functions
KCL Fall Functions | ||
---|---|---|
File Type |
Return Value & Function Name & Parameters |
Description |
* | vector kcl$fall (pt,width[,typemask]) |
If a reference KCL is defined, search the lowest point below 'pt', that can be reached without collision. The point is expanded to a cube with edge length 'width' for the collision tests. If 'typemask' is set, only KCL types with related bit number set are recognized. Use kcl$fallFlag() to get the corespondent KCL flag. |
* | int kcl$fallFlag () |
This functions returns the corespondent KCL flag of the last call of kcl$fall(). The return value is the KCL flag of the colliding triangle, or -1 if no collision was found. |
[ENPT] @KCL_FALL-WIDTH = 200 ...
In the next example only some item boxes are first raised by 500 and then drop until they hit anything in the KCL:
[GOBJ] .... 0 0x65 ... # an itembox definition @KCL-FALL-WIDTH = 200 # enable transformation @KCL-FALL-PRE-ADD = 500 # raise the objects before dropping 0 0x65 ... # an itembox definition 0 0x65 ... # an itembox definition @KCL-FALL-WIDTH = 0 # disable transformation ...
But if you use the option --load-kcl you can directly define a KCL file. It's also possible to disable this feature at all by using option --load-kcl with an empty string as parameter.
The KCL file is loaded into the memory on the first access.