prevnext   » SZS: Wiimms SZS Toolset » wszst: Wiimms SZS Tool » wszst patch

wszst patch

Patch an U8 archive, compressed or not: Load the archive, apply all patching and transforming options and store the file again. Compressed sources are compressed again. The destination is only written if any data changed.

Contents

1.   Syntax

wszst PATCH [source]...

2.   Options

Options
Option Param Description
-d --dest path Define a destination path (directory/file). The destination - means: write to standard output.

The path may contain escape sequences: %Q is replaced by the fully qualified source name. %P and %F are replaced by the source path or by the filename. %N and %E are replaced by source filename without extension or by the source extension. Finally, %T is replaced by the default extension of the destination format.

A '?' direct behind '%' in %E and %T conversions avoid that the same extension is used twice in row.

-D --DEST path Like --dest, but create the directory path automatically.
-E --esc char Define an alternative escape character for destination files. The default is '%'. For Windows batch files it is a good choice to set '-E$'.
-p --preserve Preserve file times (atime+mtime) while converting or copying files.
-u --update Create only files that do not exist. Already existing files are ignored without warning. If set, --overwrite and --remove-dest are ignored.
-o --overwrite Overwrite already existing files without warning and ignore option --number.
--number If a file already exist, append a number directly before the file extension to make the filename unique. If other numbered files already exist (ignoring case), use the maximum existing index+1. --num is a short cut.
-r --remove-dest Remove already existing files before creating it. If set, --overwrite is ignored. --rm-dest is a short cut.
--remove-src Remove the source file after successful operation. --rm-src is a short cut.
--u8 Create an U8 archive, if possible. If the source is a WU8 archive, convert it to an U8 archive. This is the default if the setup file 'wszst-setup.txt' has no other definition. The default compression mode is set to Yaz0 (see --yaz0).
--wu8 Create a WU8 archive, if possible. If the source is an U8 archive, convert it to a WU8 archive.
--yaz0 If creating a compressed file, force Yaz0 compression. Yaz0 compression is the default, if no compression method is defined by option or setup file.
--yaz1 If creating a compressed file, force Yaz1 compression. The difference to Yaz0 is only the magic, which is set to 'Yaz1'.
--bz If creating a compressed file, force BZ compression (a BZIP2 variant).
--szs Short cut for »--u8 --yaz0«: Create an U8 archive, if possible, and set the compression method to Yaz0.
--wbz Short cut for »--wu8 --bz«: Create a WU8 archive, if possible, and set the compression method to BZ.
-i --ignore Ignore non existing source files without warning.
-C --compr level Define a compression level between 0..9: 0 (or NOCHUNKS) disables finding chunks, 1 (or FAST) set the fastest real compression and 9 (or BEST) set the best (=default) compression. The special value UNCOMPRESSED acts like option --no-compress.

Because of many repeated data, the best bz-compression mode varies. Therefor the levels TRY2..TRY5 (or short T2..T5) are defined to find the best compression mode with testing the first N modes of 9, 1, 8, 2, 5. TRY2 is used for normalizing. For non bz-compression, TRY* are the same as BEST.

Option --norm takes precedence over --compr and sets the compression level to TRY2 (BEST).

-n --norm The uncompressed data will be normalized. See command NORMALIZE for more details.
--align-u8 size Define an align value for the sub files in U8 archives. The value must be a power of 2 and the default value is 32 (0x20) This value is only relevant if creating or normalizing U8 archives.
--align-pack size Define an align value for the sub files in PACK archives. The value must be a power of 2 and the default value is 32 (0x20) This value is only relevant if creating or normalizing OACK archives.
--align-brres size Define an align value for the sub files in BRRES archives. The value must be a power of 2 and the default value is 4 This value is only relevant if creating or normalizing BRRES archives.
--align-breff size Define an align value for the sub files in BREFF archives. The value must be a power of 2 and the default value is 4 This value is only relevant if creating or normalizing BREFF archives.
--align-breft size Define an align value for the sub files in BREFT archives. The value must be a power of 2 and the default value is 0x20 This value is only relevant if creating or normalizing BREFT archives.
--align size Define an align value for the sub files in all archives. This is a short cut for »--align-u8=size --align-pack=size --align-brres=size --align-breff=size --align-breft=size«.
--pt-dir [=mode] Set one of the `point directory' modes REMOVE (=0), FORCE (=1) or AUTO (default). If --pt-dir is used without parameter, then FORCE is assumed.

This option is only relevant if creating an U8 archive. It decides, if a special directory with name '.' will be added as base for all other files.

--rm-aiparam Remove the directory AIParam and all files from the archive. This option has only impact, if creating a new archive or normalizing an existing archive. --rmai is a short cut.
--auto-add Analyze the KMP (if exist) and add missing BRRES, BREFF, BREFT, BRASD and KCL files automatically, if the tool can find the files in any sub directory named 'auto-add'. This sub directory is searched in all directories of 'SEARCH_PATH'; use command »wszst AUTOADD« to view them. Command »wszst AUTOADD« may also create an auto-add database. --aadd is a short cut.
--fast Short cut for --compr=fast: Set the fastest real compression. It also overrides compression rates set by --norm or --compr.
-c --const list Define constant values, that are used by the internal encoders and by the numeric options as predefined global variables. This option allows a conditional encoding of text files. It can be used multiple times for multiple definitions.

The Parameter is a comma separated list of terms and a term is 'name=expression'. The expression is calculated by the text parser.

--scale vector[@origin] Transform the data: Scale all coordinates and size values by 'vector' relative to the point 'origin'. If the origin is not set, 0,0,0 is used instead.

Negative values mirror the coordinates. Each parameter is either a vector expression or a comma separated expression list of coordinates ('x,z' or 'x,y,z').

Transformations are calculated in the order SCALE, SHIFT, ROTATE, TRANSLATE.

--shift vector Transform the data: Add 'vector' to all coordinates. Is's simlar to --translate, but the addition is done before rotation. The parameter is either a vector expression or a comma separated expression list of coordinates ('x,z' or 'x,y,z').

Transformations are calculated in the order SCALE, SHIFT, ROTATE, TRANSLATE.

--xss x1old,x1new,x2old,x2new --xss (x-scale-shift) calculates the X values of --scale and --shift, so that the old values are transformed to the new values. The parameters are numbers or expression.
--yss y1old,y1new,y2old,y2new --yss (y-scale-shift) calculates the Y values of --scale and --shift, so that the old values are transformed to the new values. The parameters are numbers or expression.
--zss z1old,z1new,z2old,z2new --zss (z-scale-shift) calculates the Z values of --scale and --shift, so that the old values are transformed to the new values. The parameters are numbers or expression.
--rot degree[@origin] Transform the data: Rotate all coordinates and rotation values by the angle 'degree' (is a vecotr) around the 3 axes. All 3 axes goes through the point 'origin'. If the origin is not set, 0,0,0 is used instead.

Each parameter is either a vector expression or a comma separated expression list of coordinates ('x,y,z').

Option --rot is an alternative for --xrot, --yrot and --zrot to define all 3 rotations in one step. Transformations are calculated in the order SCALE, SHIFT, X-ROTATE, Y-ROTATE, Z-ROTATE, TRANSLATE.

--xrot degree[@origin] Transform the data: Rotate all coordinates and rotation values by the angle 'degree' around the x-axis, that goes through the point 'origin'. If the origin is not set, 0,0,0 is used instead.

Each parameter is either a vector expression or a comma separated expression list of coordinates ('y,z' or 'x,y,z').

Transformations are calculated in the order SCALE, SHIFT, X-ROTATE, Y-ROTATE, Z-ROTATE, TRANSLATE.

--yrot degree[@origin] Transform the data: Rotate all coordinates and rotation values by the angle 'degree' around the x-axis, that goes through the point 'origin'. If the origin is not set, 0,0,0 is used instead. This is a horizontal counterclockwise rotation and the old option name --hrot can also used.

Each parameter is either a vector expression or a comma separated expression list of coordinates ('x,z' or 'x,y,z').

Transformations are calculated in the order SCALE, SHIFT, X-ROTATE, Y-ROTATE, Z-ROTATE, TRANSLATE.

--zrot degree[@origin] Transform the data: Rotate all coordinates and rotation values by the angle 'degree' around the z-axis, that goes through the point 'origin'. If the origin is not set, 0,0,0 is used instead.

Each parameter is either a vector expression or a comma separated expression list of coordinates ('x,y' or 'x,y,z').

Transformations are calculated in the order SCALE, SHIFT, X-ROTATE, Y-ROTATE, Z-ROTATE, TRANSLATE.

--ypos pos This option defines an Y position for KMP/CKPT transformations. It has only impact to X and Z rotations (Options --xrot and --zrot). If not set, the mean y of the active rotation origins are used.
--translate vector Transform the data: Add 'vector' to all coordinates. Is's simlar to --shift, but the addition is done after rotation. The parameter is either a vector expression or a comma separated expression list of coordinates ('x,z' or 'x,y,z'). --trans is a short cut.

Transformations are calculated in the order SCALE, SHIFT, ROTATE, TRANSLATE.

--null Create a neutral transformation without affecting the coordinates. The only influence is, that the dependent values (like maximum) are re-calculated as if a transformation has taken place.
--next Close the current transformation step with all scaling, shifting, rotation and translation options and open a new step with cleared options. On transformation each step is logical done one by one. In real, one total transformation matrix is calculated and used for fast transformations.

If option --next is used, the ability for modifying the scale and rotation vectors (not the positions) of different KMP sections is nearly always lost. A warning is printed if this occurs.

--ascale factor@dir Transform the data and do an axis scale: Close the current transformation step like --next and scale the data by 'factor' into the direction given by the vector 'dir'. Store the resulting matrix as single transformation step and open a new one.

This kind of transformation is EXPERIMENTAL!

--arot degree[@pos1]@pos2 Transform the data and do an axis rotation: Close the current transformation step like --next and rotate the data by 'degree' around the axis defined by the 2 points. If 'pos1' is not set, use 0,0,0 instead. Store the resulting matrix as single transformation step and open a new one.

This kind of transformation is EXPERIMENTAL!

--tform-script script Load the script and execute it by the text parser.

Then for each coordinate (2D and 3D), call the macro TRANSFORM after all other transformations. Call it without parameters and set variable $I with a zero based index of all vertices, variable $D to the dimension (2 or 3) and the variable $P to the vector of the current vertex. If the macro returns a vector, it is the new position.

For each file, macro BEGIN is called at the beginning and END after proccessing all points, but only, if the macros are defined. For END, variable $I is set to the number of proccessed vertices in the current file.

Before each macro call, the private and local variables are cleared and only global parameters are permanent. The zero based index is cleared for each new source. The parameters of the macro calls are defined in the local name space.

--rm-gobj objlist Remove objects from the KMP section GOBJ. Therefor a comma separated object list with single values like 'a' or ranges like 'a:b' is expected. 'a' and 'b' are numbers, object names (prefixed by 'o$') or any other parser expressions.
--slot keyword Patch a track file to run at the specified slot. KMP and KCL may be modified. BRRES files may be added to or removed from SZS. The main keywords are DAISY, DESERT, SHERBET, SHYGUY, STANDARD and MOST. Slot numbers (except '42' and '4.2') and different other track names are also accepted. For some conversions, the auto-add library is needed.
--load-kcl file Load a KCL or OBJ file for reference issues.
--kcl list Set global options for KCL processing. Parameter 'list' is a comma separated list of keywords. A minus sign before a keyword disables a setting. Each occurrence of the option will only change entered settings and all other settings are untouched.

Keyword DEFAULT resets the default settings and CLEAR disables all. Keywords SMALL, MEDIUM and CHARY select the default parameters for the octree creation. The other allowed keywords are: FAST, NEW, CENTER, ROUND, NORMALS, MTL, WIIMM, TRIANGLES, OUT-SWAP, G, USEMTL, CLIP, IN-SWAP, AUTO, HEX4, HEX23, HEX, DROP-UNUSED, DROP-FIXED, DROP-INVALID, DROP, RM-FACEDOWN, RM-FACEUP, FIX-ALL, CONV-FACEUP, SORT, INPLACE, SILENT and LOG.

--kcl-flag joblist Modify the KCL flag of KCL files. A comma separated job list in the format 'srclist=dest' is expected. 'srclist' is a plus sign separated list with single values like <val>, T<type> and <val>/<mask> or ranges like <val>:<val>, T<type>:<type> and <val>:<val>/<mask>. '<val>' is a complete KCL flag in the range of 0..0xffff. '<type>' are only the base types in the range of 0..0x1f. If <mask> is present, it marks the relevant bits. For the T<type> variant, the mask is set to 0x1f.

All KCL flags of the source list are assigned to the new value 'dest', but only the set bits of '<mask>' are modified. A later definition overrides the previous one.

--kcl-script script After reading a KCL source file and executing all transformations, the text file 'script' is executed by the internal text parser. The script should use the parser functions tri$*() to read and modify the triangle positions and flags, or to add or remove complete triangles.

If this option is used multiple times, each script is executed in the entered order.

--kmp list Set global options for KMP processing. Parameter 'list' is a comma separated list of keywords. A minus sign before a keyword disables a setting. Each occurrence of the option will only change entered settings and all other settings are untouched.

Keyword DEFAULT resets the default settings and CLEAR disables all. The other allowed keywords are: FORCE, NEW, RM-SPCITEM, LEFT, RIGHT, WIDE, NARROW, FIX-CKPH, FIX-ENPH, FIX-ITPH, FIX-PH, FIX-CKNEXT, FIX-CKJGPT, FIX-CK, FIX-ALL, 1LAP, 2LAPS ... 9LAPS, INPLACE, SILENT and LOG.

--speed-mod factor The speed modifier is a user extensions to change the basic speed of all vehicles. The speed factor itself is stored into KMP/STGI section of a track.

If --speed-mod is set to a value >0.0, then the last 2 bytes of the STGI section are patched. The value 0.0 reset these 2 bytes and deactivates the speed modifier.

--tform-kmp list Select KMP sections and objects for a transformation. --tkmp is a short cut. The option expects a comma separated list of keywords. Non ambiguous of keywords are allowed and minus signs within keywords are optional (e.g. GOBJS). A minus sign before a keyword disables transformation of the related section or object.

Sections are selected by the KMP section names AREA, CAME, CKPT, CNPT, ENPT, GOBJ, ITPT, JGPT, KTPT, MSPT and POTI.

Objects are selected by the keywords AREA-POSITION, AREA-ROTATE, AREA-SCALE, CAME-POSITION, CKPT-POSITION, CNPT-POSITION, CNPT-ROTATE, ENPT-POSITION, ENPT-SCALE, GOBJ-POSITION, GOBJ-ROTATE, GOBJ-SCALE, ITPT-POSITION, ITPT-SCALE, JGPT-POSITION, JGPT-ROTATE, KTPT-POSITION, KTPT-ROTATE, MSPT-POSITION, MSPT-ROTATE and POTI-POSITION.

The keywords NONE and ALL (default) complete the field.

--mdl list Set global options for MDL processing. To enable MDL patching, use option --patch-file to select BRRES files for patching.

Parameter 'list' is a comma separated list of keywords. A minus sign before a keyword disables a setting. Each occurrence of the option will only change entered settings and all other settings are untouched.

A MDL transformation (controlled by the transformation options) is only done, if at least one of the keywords VECTOR or VERTEX is set.

Keyword DEFAULT resets the default settings (VERTEX) and CLEAR disables all. The other allowed keywords are: VECTOR, MATRIX, VERTEX, PARENT, CHILD and LOG.

--minimap Fix the minimap position in the same way as »wszst MINIMAP --auto«. All other minimap related options are ignored for the minimap processing.
--pat list Set global options for PAT processing. Parameter 'list' is a comma separated list of keywords. A minus sign before a keyword disables a setting. Each occurrence of the option will only change entered settings and all other settings are untouched.

Keyword DEFAULT resets the default settings and CLEAR disables all. The other allowed keywords are: AUTO, SIMPLE, COMPLEX, BOTH, SILENT and LOG.

--patch-file list Define, which kind of KMP, KCL and BRRES/MDL files are objects for patching. --pfile is a short cut.

Parameter 'list' is a comma separated list of keywords. A minus sign before a keyword disables a setting. Each occurrence of the option will only change entered settings and all other settings are untouched.

Keyword DEFAULT resets the default settings (TRACK,LOG) and CLEAR disables all. The other allowed keywords are: KMP, KCL, OTHER-KCL, ALL-KCL, MODEL, MAP, VRCORN, OTHER-BRRES, ALL-BRRES, TRACK (=KMP,KCL,MODEL,MAP,VRCORN), ALL, LOG and LOG-ALL.

--patch-bmg mode[=param] This option specifies a BMG patch mode. Some of the modes need a parameter or a file name of a BMG patch file (raw or text BMG), both separated by an equal sign. Modes with required file names are PRINT, REPLACE, INSERT, OVERWRITE, DELETE, MASK, EQUAL and NOTEQUAL. A mode with text parameter is FORMAT. Standalone modes are ID, ID-ALL, UNICODE, RM-ESCAPES, RM-CUPS, CT-COPY, CT-FORCE-COPY and CT-FILL. Unique abbreviations are allowed.

If this option is used multiple times, all patch files will be processed in the entered order.

--msg list If this option is set, the BMG messages are filtered by this list. Only enabled messages are exported to the ouput BMG file (binary or text).

The parameter is a list of message ids (short MID, 'Txx' or 'Uxx' or Mxx' or hex number) or message ranges (MID:MID) or one of the keywords NONE, PARAM, CUPS, TRACKS, ARENAS, CHAT, CTCODE, CTTRACKS or ALL. If an element is preceeded by a minus sign, it is removed from the filter list (disabled).

3.   Description

The patch command allow to modify U8, WU8, SZS, WBZ, BBRES and MDL files. A modification is only done, if at least one patching or transformation option is specified, that can be used with the file.

A transformation is logically done in the following steps:

  1. Scaling set by options --scale, --xss, --yss or --zss.
  2. Shifting set by options --shift, »--xss, {--yss« or --zss.
  3. Rotation around the x-axis set by options --xrot or --rot.
  4. Rotation around the y-axis set by options --yrot or --rot.
  5. Rotation around the z-axis set by options --zrot or --rot.
  6. Translation set by option --translate.
Internally all options are converted into scaling, rotating and translation vectors (a model used by MDL and KMP) and then into a translation matrix. The matrix is used for a fast transformations of vertices (3d vectors), and the 3 vectors to change the vectors of objects.

4.   Transformation Options

Use the command »wszst TEST« to play with these options and their parameters. The command will produce a list, that reflects the option values.

The transformation is calculated in the following logical order: --scale, --shift, --xrot, --yrot, --zrot and --translate.

--shift and --translate are similar and simple vector adding transformations. Only the executions order (before and after the rotations) are different. All transformations with exception of --shift and the origins are used in the MDL files. All transformation options can be normalized to a scaling, a rotation and a translation vector and to a transformation matrix following the MDL standards. Try command »wszst MATRIX« for tests.

4.1   --patch-file list

Define, which kind of KMP, KCL and BRRES/MDL files are objects for patching. --pfile is a short cut. Parameter 'list' is a comma separated list of keywords. A minus sign before a keyword disables a setting. Each occurrence of the option will only change entered settings and all other settings are untouched. Keyword DEFAULT resets the default settings (TRACK,LOG) and CLEAR disables all. The other allowed keywords are: KMP, KCL, OTHER-KCL, ALL-KCL, MODEL, MAP, VRCORN, OTHER-BRRES, ALL-BRRES, TRACK (=KMP,KCL,MODEL,MAP,VRCORN), ALL, LOG and LOG-ALL.
This option selects the file types, that should be patched.

Keywords for option --patch-file (--pfile)
keyword Description
CLEAR This keyword clears (disables) all other keywords.
DEFAULT This keyword resets all keywords to their default status: TRACK and LOG are set, all others are cleared.
KMP Patch all position, size and rotation values of KMP file course.kmp. KMP is set by default.
KCL Patch all position values of KCL file course.kcl. New normals and a new octree are caluclated. KCL is set by default.
OTHER-KCL
OTHERKCL
Patch all position values of KCL files excluding course.kcl. New normals and a new octree are caluclated.
ALL-KCL
ALLKCL
Patch all KCL files. This parameter is a short cut for 'KCL,OTHER-KCL'.
MODEL Patch the MDL of BRRES files course_model.brres and course_d_model.brres. Option »--mdl list« decides the kind of patching. MODEL is set by default.
MAP
MINIMAP
Patch the MDL of BRRES file map_model.brres. Option »--mdl list« decides the kind of patching. MAP is set by default.
VRCORN Patch the MDL of BRRES file vrcorn_model.brres. Option »--mdl list« decides the kind of patching. Since version v1.24, VRCORN is set by default.
OTHER-BRRES
OTHERBRRES
Patch the MDL of all BRRES files except course_model.brres, course_d_model.brres, map_model.brres and vrcorn_model.brres. Option »--mdl list« decides the kind of patching.
ALL-BRRES
ALLBRRES
Patch all BRRES files. This parameter is a short cut for 'MODEL,MAP,VRCORN,OTHER-BRRES'.
TRACK Patch the 5 main track files. This parameter is a short cut for 'KMP,KCL,MODEL,MAP,VRCORN' (without VRCORN before v1.24).
ALL All file types are subject of patching. This parameter is a short cut for 'KMP,ALL-KCL,ALL-BRRES'.
LOG This is a debugging keyword. If set, the tools create a trace log about the main patching actions. LOG is set by default.
LOG-ALL
LOGALL
This debugging keyword enables LOG of the options -patch-file (this) --kcl, --kmp and --mdl.

4.2   --scale vector[@origin]

Transform the data: Scale all coordinates and size values by 'vector' relative to the point 'origin'. If the origin is not set, 0,0,0 is used instead. Negative values mirror the coordinates. Each parameter is either a vector expression or a comma separated expression list of coordinates ('x,z' or 'x,y,z'). Transformations are calculated in the order SCALE, SHIFT, ROTATE, TRANSLATE.
This options scales positions and sizes.

The first parameter (before the '@') expects either a scaling factor for an equally scaling of the object or a vector to scale each of the 3 directions with different factors. A factor of 1.0 is the neutral value (no scaling).

Default is to scale around the position 0,0,0. With the second parameter (vector behind the '@') it is possible, to use another point as scaling base.

4.3   --shift vector

Transform the data: Add 'vector' to all coordinates. Is's simlar to --translate, but the addition is done before rotation. The parameter is either a vector expression or a comma separated expression list of coordinates ('x,z' or 'x,y,z'). Transformations are calculated in the order SCALE, SHIFT, ROTATE, TRANSLATE.
The shift values are simply added to positions before the rotations. A vector is expected. If the parameter is only a scalar, it is used for all 3 dimensions. The summand 0.0 is the neutral value (no shifiting).

4.4   --xss x1old,x1new,x2old,x2new

--xss (x-scale-shift) calculates the X values of --scale and --shift, so that the old values are transformed to the new values. The parameters are numbers or expression.
This option is another interface to set scaling and shifting. It uses the X values of 2 example points with an old and a new value to calculate the X componentes of options --scale and --shift.

4.5   --yss y1old,y1new,y2old,y2new

--yss (y-scale-shift) calculates the Y values of --scale and --shift, so that the old values are transformed to the new values. The parameters are numbers or expression.
This option is another interface to set scaling and shifting. It uses the Y values of 2 example points with an old and a new value to calculate the Y componentes of options --scale and --shift.

4.6   --zss z1old,z1new,z2old,z2new

--zss (z-scale-shift) calculates the Z values of --scale and --shift, so that the old values are transformed to the new values. The parameters are numbers or expression.
This option is another interface to set scaling and shifting. It uses the Z values of 2 example points with an old and a new value to calculate the Z componentes of options --scale and --shift.

4.7   --rot degree[@origin]

Transform the data: Rotate all coordinates and rotation values by the angle 'degree' (is a vecotr) around the 3 axes. All 3 axes goes through the point 'origin'. If the origin is not set, 0,0,0 is used instead. Each parameter is either a vector expression or a comma separated expression list of coordinates ('x,y,z'). Option --rot is an alternative for --xrot, --yrot and --zrot to define all 3 rotations in one step. Transformations are calculated in the order SCALE, SHIFT, X-ROTATE, Y-ROTATE, Z-ROTATE, TRANSLATE.
The first parameter (before the '@') expects a vector with 3 angles in degree, one for each axis. If you enter only one scalar, the value is used for all 3 axes. A value of 0.0 is the neutral value (no rotation).

Default is to rotate around axes the goes throght the position 0,0,0. With the second parameter (vector behind the '@') it is possible, to use another point as rotation base.

It also possible to enter the rotation values separated for each axis with different origins by using --xrot, --yrot and --zrot.

4.8   --xrot degree[@origin]

Transform the data: Rotate all coordinates and rotation values by the angle 'degree' around the x-axis, that goes through the point 'origin'. If the origin is not set, 0,0,0 is used instead. Each parameter is either a vector expression or a comma separated expression list of coordinates ('y,z' or 'x,y,z'). Transformations are calculated in the order SCALE, SHIFT, X-ROTATE, Y-ROTATE, Z-ROTATE, TRANSLATE.
This option defines the X rotation in degrees around the x-axis of point origin.

4.9   --yrot degree[@origin]

Transform the data: Rotate all coordinates and rotation values by the angle 'degree' around the x-axis, that goes through the point 'origin'. If the origin is not set, 0,0,0 is used instead. This is a horizontal counterclockwise rotation and the old option name --hrot can also used. Each parameter is either a vector expression or a comma separated expression list of coordinates ('x,z' or 'x,y,z'). Transformations are calculated in the order SCALE, SHIFT, X-ROTATE, Y-ROTATE, Z-ROTATE, TRANSLATE.
This option defines the Y rotation in degrees around the y-axis of point origin.

4.10   --zrot degree[@origin]

Transform the data: Rotate all coordinates and rotation values by the angle 'degree' around the z-axis, that goes through the point 'origin'. If the origin is not set, 0,0,0 is used instead. Each parameter is either a vector expression or a comma separated expression list of coordinates ('x,y' or 'x,y,z'). Transformations are calculated in the order SCALE, SHIFT, X-ROTATE, Y-ROTATE, Z-ROTATE, TRANSLATE.
This option defines the Z rotation in degrees around the z-axis of point origin.

4.11   --ypos pos

This option defines an Y position for KMP/CKPT transformations. It has only impact to X and Z rotations (Options --xrot and --zrot). If not set, the mean y of the active rotation origins are used.
The KMP section CKPT uses only 2 dimensional points to define the check point lines. But for X and Z rotation a height (Y position) is needed.

The default is to use the mean y value of the origins defined by the active --xrot and --zrot options. This option overrides the default with the entered value.

4.12   --translate vector

Transform the data: Add 'vector' to all coordinates. Is's simlar to --shift, but the addition is done after rotation. The parameter is either a vector expression or a comma separated expression list of coordinates ('x,z' or 'x,y,z'). --trans is a short cut. Transformations are calculated in the order SCALE, SHIFT, ROTATE, TRANSLATE.
The translate values are simply added to positions after the rotations. A vector is expected. If the parameter is only a scalar, it is used for all 3 dimensions. The summand 0.0 is the neutral value (no translation).

Tracks can for example raised or lowered by using the parameter 0,Y,0 with any Y value.

4.13   --next

Close the current transformation step with all scaling, shifting, rotation and translation options and open a new step with cleared options. On transformation each step is logical done one by one. In real, one total transformation matrix is calculated and used for fast transformations. If option --next is used, the ability for modifying the scale and rotation vectors (not the positions) of different KMP sections is nearly always lost. A warning is printed if this occurs.
The current transformation model is hard to manage, if you want to do several independent transformation steps, because you must mathematically combine them to the input model of the options. Some things are impossible to specify. For example scaling: If you want to scale only in one direction, it's only possible for the 3 axes, but it is impossible for other directions.

Option --next allows and separates up to 10 independent transformation steps. The option closes the current transformation step with all scaling, shifting, rotation and translation options and opens a new step with cleared options. On transformation each step is logical done one by one. In real, one final transformation matrix is calculated by multiplying the single step matrices and used for fast transformations.

Back to our scaling example above. If you want to scale your track horizontal by factor 2 into the direction between x- and z-axis (z-axis rotated by 45 degrees around the y-axis), use the following options:

 --yrot 45 --step --scale 2,1,1 --step --yrot -45
It rotates the axis, that should be scaled, by 45 degree showing into x-direction, scales the x-axis and rotates it back. The second --step is not really necessary, because scaling is done before rotation.

4.13.1   Some Issues

There are some problems using multiple transformation steps:

Some KMP sections (AREA, CAME and GOBJ) have scaling and rotation vectors. If using a simple transformation, these vectors are modified by multiplying the entered scale or adding the entered the rotation. But if using a complex transformation with multiple steps, these operation can't be done and scale and rotation vectors keep unchanged. A warning message is printed if this occurs. Position vectors are handled correct in any circumstance.

A similar problem exists for MDL transformations. For complex transformations it is impossible to modify the vectors of MDL bones. If the user decided to use the VECTOR patching mode (using option »--mdl VECTOR«), the transformation mode is switched back to the default VERTEX mode for a full transformation support. A warning message is printed if this occurs.

4.14   --ascale factor@dir

Transform the data and do an axis scale: Close the current transformation step like --next and scale the data by 'factor' into the direction given by the vector 'dir'. Store the resulting matrix as single transformation step and open a new one. This kind of transformation is EXPERIMENTAL!
This option allows stretching the track into a direction specified by a vector. It uses the --next option implicitly. So the issues with KMP scaling and rotation vectors are valid.

4.15   --arot degree[pos1]pos2

Transform the data and do an axis rotation: Close the current transformation step like --next and rotate the data by 'degree' around the axis defined by the 2 points. If 'pos1' is not set, use 0,0,0 instead. Store the resulting matrix as single transformation step and open a new one. This kind of transformation is EXPERIMENTAL!
This option allows a rotation of the track around an axis defined by 2 points. It uses the --next option implicitly. So the issues with KMP scaling and rotation vectors are valid.

4.16   --mdl list

Set global options for MDL processing. To enable MDL patching, use option --patch-file to select BRRES files for patching. Parameter 'list' is a comma separated list of keywords. A minus sign before a keyword disables a setting. Each occurrence of the option will only change entered settings and all other settings are untouched. A MDL transformation (controlled by the transformation options) is only done, if at least one of the keywords VECTOR or VERTEX is set. Keyword DEFAULT resets the default settings (VERTEX) and CLEAR disables all. The other allowed keywords are: VECTOR, MATRIX, VERTEX, PARENT, CHILD and LOG.
The option --mdl sets MDL patching modes and methods.

Some MDL concepts

Keywords for option --mdl
keyword Description
CLEAR This keyword clears (disables) all other keywords.
DEFAULT This keyword resets all keywords to their default status: Only VERTEX is set, all others are cleared.
PARENT
PARENT-NODE
PARENTNODE
CHILD
CHILD-NODES
CHILDNODES
If PARENT-NODE is set, only the parent node is modified. If CHILD-NODES is set, all child nodes are modified. If both or none is set, all nodes are modified.

It seems, that only modifications of the parent node has any impact to the track visualisation. The impact of child modes are unsure. So it's save to set PARENT-NODE.

This option has only impact, if at least one of the methods VECTOR or MATRIX is set. See MDL concepts above.

ALL-NODES
ALLNODES
Modify all nodes. This parameter is a short cut for 'PARENT-NODE,CHILD-NODES'.
VECTOR If this keyword is set, the vectors of each MDL section #1 are modified: Scaling is muliplied and rotation and translations are added to the existing values.

For complex transformations the tools will automatically activate VERTEX mode. See --next for details.

MATRIX The matrices (transformation matrix and its inverse) of MDL section #1 (bones) are calculated based on the vectors (scale, rotate, translate) of the same bone. No patching is done here.
VERTEX The vertex lists of all MDL sections #2 are transformed. If the vectors of the very first parent node of all MDL sections #1 defines a valid transformation, the transformation is done with respect to these vectors.

VERTEX is set by default and the recommended patching method, because it is the only method which supports complex transformations.

LOG This is a debugging keyword. If set, the tools create a trace log about the main MDL actions.

4.17   --tform-script script

Load the script and execute it by the text parser. Then for each coordinate (2D and 3D), call the macro TRANSFORM after all other transformations. Call it without parameters and set variable $I with a zero based index of all vertices, variable $D to the dimension (2 or 3) and the variable $P to the vector of the current vertex. If the macro returns a vector, it is the new position. For each file, macro BEGIN is called at the beginning and END after proccessing all points, but only, if the macros are defined. For END, variable $I is set to the number of proccessed vertices in the current file. Before each macro call, the private and local variables are cleared and only global parameters are permanent. The zero based index is cleared for each new source. The parameters of the macro calls are defined in the local name space.
This option allow script controlled transformations. Be careful with non linear transformations, because holes may arise.

4.18   --minimap

Fix the minimap position in the same way as »wszst MINIMAP --auto«. All other minimap related options are ignored for the minimap processing.
If set, the tool analyze all vertex lists of the minimap MDL. It computes the minimal and maximal values of all 3 axis. These computed values are used to setup the both sections named posLD and posRU to setup a perfect minimap position.

Therefor the scaling and rotation vectors are reset and the translation vectors are defined using the minimal and maximal values. Last not least, the transformation matrix and its inverse are calculated.

The results are generally very good. There are only issues, if the MDL contains unused or bad placed vertices.

5.   Miscellaneous Options

5.1   --auto-add

Analyze the KMP (if exist) and add missing BRRES, BREFF, BREFT, BRASD and KCL files automatically, if the tool can find the files in any sub directory named 'auto-add'. This sub directory is searched in all directories of 'SEARCH_PATH'; use command »wszst AUTOADD« to view them. Command »wszst AUTOADD« may also create an auto-add database. --aadd is a short cut.
If option --auto-add is set and a SZS track file is created, copied or patched, then all missed files are searched in the Autoadd Archive and added to the track file. Therefor the KMP file is scanned for global objects. wszst have an internal database and knows, which sub files are needed for which global object.

5.2   --slot keyword

Patch a track file to run at the specified slot. KMP and KCL may be modified. BRRES files may be added to or removed from SZS. The main keywords are DAISY, DESERT, SHERBET, SHYGUY, STANDARD and MOST. Slot numbers (except '42' and '4.2') and different other track names are also accepted. For some conversions, the auto-add library is needed.
These option will modify SZS, KMP and KCL. Unwanted files and objects will be removed, and missed files and objects will be added. The Auto Add feature is used for adding files.

Keywords for option --slot
keyword Description
NONE Disable this option and do nothing:
DAISY
3.1
31
DESERT
7.1
71
Change a track file to run at slot 3.1 (Daisy Circuit) and at slot 7.1 (DS Desert Hills):
  • Exchange KCL flag 0x70 (fall down with ice effect) by 0x30 (water effect).
  • Remove file ice.brres from SZS and object ice from KMP.
  • Remove files HeyhoShipGBA.brres and HeyhoBallGBA.brres from SZS and objects HeyhoShipGBA and HeyhoBallGBA from KMP.
SHERBET
6.1
61
Change a track file to run at slot 6.1 (N64 Sherbet Land):
  • Remove files sunDS.brres and pylon01.brres from SZS and objects sunDS and pylon01 from KMP.
  • Remove files HeyhoShipGBA.brres and HeyhoBallGBA.brres from SZS and objects HeyhoShipGBA and HeyhoBallGBA from KMP.
  • Exchange KCL flag 0x30 (fall down with water effect) by 0x70 (ice effect).
  • Add, if missed, file ice.brres to SZS and object ice to KMP.
SHYGUY
6.2
62
Change a track file to run at slot 6.2 (GBA Shy Guy Beach):
  • Exchange KCL flag 0x70 (fall down with ice effect) by 0x30 (water effect).
  • Remove file ice.brres from SZS and object ice from KMP.
  • Remove files sunDS.brres and pylon01.brres from SZS and objects sunDS and pylon01 from KMP.
  • Add, if missed, file HeyhoShipGBA.brres to SZS and object HeyhoShipGBA including a route to KMP.
STANDARD
STD
<slot_no>
Change a track file to run at all standard slots (all except 4.2, 6.1 and 6.2):
  • Exchange KCL flag 0x70 (fall down with ice effect) by 0x30 (water effect).
  • Remove file ice.brres from SZS and object ice from KMP.
  • Remove files sunDS.brres and pylon01.brres from SZS and objects sunDS and pylon01 from KMP.
  • Remove files HeyhoShipGBA.brres and HeyhoBallGBA.brres from SZS and objects HeyhoShipGBA and HeyhoBallGBA from KMP.
A slot number in the format c.t (cup.track) or ct is also accepted, except of 3.1, 4.2, 6.1, 6.2 and 7.1.
MOST Change a track file to run at as many slots as possible (all slots except 4.2 and 6.2):
  • Exchange KCL flag 0x70 (fall down with ice effect) by 0x30 (water effect).
  • Remove object ice from KMP.
  • Remove files sunDS.brres and pylon01.brres from SZS and objects sunDS and pylon01 from KMP.
  • Remove files HeyhoShipGBA.brres and HeyhoBallGBA.brres from SZS and objects HeyhoShipGBA and HeyhoBallGBA from KMP.
  • Add, if missed, file ice.brres to SZS.