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

wszst xexport

Command XEXPORT is a short cut for EXTRACT --decode --export. It extract all sub files of SZS, U8, LTA, PACK, BRRES, BREFF, BREFT and RARC archives and decodes all supported files with enabled export mode. The default destination is '%P/%N.d/'. Wildcards and pipe characters are parsed.

Contents

1.   Syntax

wszst XEXPORT [source]...

2.   Options

Options
Option Param Description
--no-wildcards Disable wildcard parsing and use each filename exactly as specified.
--in-order Process the input files in order of the command line and don't delete duplicates.
-i --ignore Ignore non existing source files without warning.
-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 Update only existing files and don't create new files. 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.
--basedir directory Extract only files from archives, that are below the DIRECTORY. Leading points and slashes and trailing slahes are removed from the parameter. --bdir is short cut for --basedir.
-R --recurse [=level] If a extracted file is a known and supported archive, than extract it recursively until the entered level is reached. Level 0 (=NONE) deactivates this. If --recurse is used without parameter, then UNLIMITED is assumed.

-R does'nt accept a parameter and is a short cut for --recurse=unlimited.

-e --ext For BRRES archives only: If a file is extracted, add a handy file extension like '.mdl' to the file name. If set twice and a textual file magic is available, use the file magic in lower case instead like '.mdl0'.
--decode If a extracted file is known and can be decoded, do it. --dec is a short cut.
--mipmaps If reading a source, scan for mipmaps and load them too. For PNG files, files named NAME.mm#.EXT with #=1.. are searched. This is the default. --mm is a short cut.
--no-mipmaps If reading a source, ignore mipmaps. This disables not the creation of mipmaps (see -n-mipmaps). --no-mm is a short cut.
--fast-mipmaps If resizing an image, use the old fast resize algorithm (default until v1.64a) instead of the new smart one. Both algorithms differ only, when creating a mipmap for images with odd width or odd height. The old algorithm is faster (factor 2-4) than the default algorithm, but the new algorithm creates better resized images. --fast-mm is a short cut.
--cmpr-default rgb1[,rgb2] Define 2 colors for the case, that all 16 pixels of a CMPR block are transparent. The default is to calculate an average color of all transparent pixels. Before v2.04 white was used.

2 RGB values (hex values with 6 digits each) are expected as parameter. If optional RGB2 is missed, a copy of RGB1 is used. As first step, both colors are converted to RGB565 colors C1 and C2 and sorted, so that C1<C2 (mandatory for CMPR). If C1 and C2 are identical, the least significant bit of green is cleared for C1 and set for C2.

Use parameter '0' to force black, '-1' to force white, or '-' to reset to auto calculation.

--cut Cut different non archive files into smaller peaces (logical units like headers, groups, sections) or list these peaces as single sub files for a more detailed analysis. Supported file types are BMG, BREFT-IMG, KMP, PAT, TEX, TPL, BRRES sub files and more.
-a --all Extract and decode all known and supported files recursively. This is a short cut for --recurse --decode --mipmaps. If entered twice, option --cut is included too.
-H --no-header Suppress the syntax information section in decoded text files.
-B --brief Suppress information lines in decoded text files. This includes syntax information (--no-header). If set twice, the output of unneeded sections is also suppressed.
--delta Print only modified records or sections on text output. Supported file formats until now: GEOHIT, ITEMSLOT, KMG and OBJFLOW. If set twice, limit output to modified records (only relevant for ITEMSLOT).
--diff On text output, print only differences from original files. It's a short cut for --no-header --brief --brief --delta --delta. Additional, the output is limited to data sections.
-X --export Enable the export mode and create small and machine readable text files for easy post processing. The option works similar like -HBB for KMP and like -HBl1 for BMG text files.
-P --no-param Disable parameter support in decoded KMP text files.
-N --no-check Do not make plausibility checks for KCL and KMP files.
--raw Extract BRRES sub file in raw mode and do not adjust string pointers and other offsets.
-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. It'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 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 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 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 vector) 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. It'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 processing all points, but only, if the macros are defined. For END, variable $I is set to the number of processed 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, TINY-0 ... TINY-7, CONV-FACEUP, WEAK-WALLS, 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.

--tri-area EXPR Define the minimal area size of KCL triangles. The intention is to ignore triangles that are generally to small. EXPR is a floating point number or expression. Triangles are invalidated if their area size is smaller than EXPR. The test is executed after reading files, after transformations, and after calculating normals and lengths. Values between 0.01 and 4.0 are recommended. The careful value 1.0 is used as default. Value 0 disables this filter functionality.
--tri-height EXPR Define the minimal height of KCL triangles. The intention is to ignore deformed triangles (very slim, but long). EXPR is a floating point number or expression. Triangles are invalidated if at least 1 of the 3 heights is smaller than EXPR. The test is executed after reading files, after transformations, and after calculating normals and lengths. Values between 0.01 and 2.0 are recommended. The careful value 1.0 is used as default. Value 0 disables this filter functionality.

--tri-ht is an alternative name for the option.

--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, MASK-PFLAGS, RM-LECODE, PURGE-GOBJ, FULL-DEFOBJ, DUMP-CLASS, DUMP-ONEWAY, DUMP-ALL, 1LAP .. 9LAPS, MAX-LAPS, RM-EMPTY, TINY-0 .. TINY-7, 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.

--ktpt2 vector Insert or replace a second KTPT. Use VECTOR as new position. VECTOR is either X,Z or X,Y,Z or an expression. Set Y to 0 for an automatic defined height.

If the first 4 characters of VECTOR are 'AUTO' (ignoring case), then the position is calculated automatically and set to the recommendation of command wkmpt KTPT.

The tool looks for the nearest lap counter (CKPT with mode 0) and adjust the KTPT: The direction of the lap counter is copied and the KTPT is moved to the lap counter line using the new direction.

LE-CODE uses the second KTPT to draw the finish line at another place away from the start position.

--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.

--repair-xpflags file Load a KMP file and use it to repair the settings of the extended presence flags, if they are destroyed by another KMP tool. --repxpf is a short cut for this option.
--mdl list Set global options for MDL processing. To enable MDL patching, use option --patch-files and 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-files 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 NONE 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.

--lt-clear Clear LEX sections TEST and DEV1 and remove them and course.lex if empty. This option is executed before all other --lt-* options.
--lt-online mode Set LEX:TEST parameter OFFLINE-ONLINE to this MODE. MODE is one of AUTO (default), NEVER or ALWAYS. Only track.szs files are modified. If needed, file course.lex and section TEST are created or removed if empty.
--lt-n-players offline,online Set LEX:TEST parameters N-OFFLINE and N-ONLINE to these integer values. Only track.szs files are modified. If needed, file course.lex and section TEST are created or removed if empty.
--lt-cond-bit bitnum Set LEX:TEST parameter COND-BIT to this integer value. Use -1 to deactivate this COND-BIT. Only track.szs files are modified. If needed, file course.lex and section TEST are created or removed if empty.
--lt-game-mode mode Set LEX:TEST parameter GAME-MODE to this MODE. MODE is one of AUTO (default), BALLOON, COIN, VERSUS or ITEMRAIN. Only track.szs files are modified. If needed, file course.lex and section TEST are created or removed if empty.
--lt-engine mode Set LEX:TEST parameter ENGINE to this MODE. MODE is one of AUTO (default), BATTLE, 50CC, 100CC, 150CC, 200CC, 150M or 200M. Only track.szs files are modified. If needed, file course.lex and section TEST are created or removed if empty.
--lt-random index Force a random scenario, if INDEX is between 1 and 8. Value 0 enables auto selection and -1 disables this option. Only track.szs files are modified. If needed, file course.lex and section TEST are created or removed if empty.
--lex-purge Delete LEX sections without any impact. Delete sub-file course.lex if it no longer contains a section. This option is executed after all --lt-* and --lex-* options.
--lex-features Calculate LEX setion FEAT (features) by analysing the track file. If no features found, delete the section and the possibly empty sub-file course.lex. If features found, then insert the section or update an existing section. If necessary, the sub-file course.lex is created. This option is executed after all --lt-* options and after --lex-purge.

CTGP uses the FEAT section to manage ghosts.

--lex-rm-features Remove LEX setion FEAT (features) if exists and the possibly empty sub-file course.lex. This option is ignored if --lex-features is set. It is executed after all --lt-* options and after --lex-purge.
--patch-bmg mode[cond][=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. Modes with text parameter are FORMAT, REGEXP and RM-REGEXP. Standalone modes are ID, ID-ALL, UNICODE, RM-ESCAPES, RM-CUPS, CT-COPY, CT-FORCE-COPY, CT-FILL, LE-COPY, LE-FORCE-COPY, LE-FILL, X-COPY, X-FORCE-COPY and X-FILL. Unique abbreviations are allowed.

The optional condition COND is either '?MID' or '!MID'. In case of '?MID', the patch is only applied if the message id MID already exists. In case of '!MID', the patch is only applied if the message id MID does not exists.

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

--macro-bmg file Load a BMG file and add the messages to the macro library; already existing entries are replaced. The macro library is accessed by escape sequence \m{MID} as fallback, if the active file has not already defined the message MID by itself.
--filter-bmg list If this option is set, the BMG messages are filtered by this list. Only enabled messages are exported to the output 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, IDENT (=ID), PARAM, CUPS, TRACKS, ARENAS, CHAT, CTCODE (=CT), CTUPS, CTTRACKS, CTARENAS, CTREFS, LECODE (=LE), LEUPS, LETRACKS, LEARENAS, LEREFS, XCODE (=X), XUPS, XTRACKS, XARENAS, XREFS, ALLCODE, ALLUPS, ALLTRACKS, ALLARENAS, ALLREFS, GENERIC or ALL. If an element is preceded by a minus sign, it is removed from the filter list (disabled).

With v2.01a, this option was renamed from --msg to the more meaningful name --filter-bmg. The old name is still available.

--le-menu Patch language independent SZS files from directory .../Scene/UI/ to change the menu as required by LE-CODE to be able to select tracks from more than 8 cups.
--9laps Patch RACE*.szs files from directory .../Scene/UI/ to support 9 laps. It is based on https://wiki.tockdom.com/wiki/Lap_Texture_Fix v1.03.
--ui-source dir This option affects options --le-menu and --9laps. If subfiles are to be exchanged in UI files, the files are first searched for in the specified directory. The internal files are only used if the file was not found.
--title-screen dir Specify a directory from which to search and replace title screens. Title screens only appear in the file 'Title.szs' and there in the sub-directory './title/timg/'. If the replacement file is not found, then search file 'title1.szs' to patch standard files or file 'title2.szs' to patch bokeboke files.
--cup-icons image Load given image, convert it to TPLx.CMPR and add the result as sub-files 'button/timg/ct_icons.tpl' and as 'control/timg/ct_icons.tpl' to files 'Channel.szs', 'MenuMulti.szs' and 'MenuSingle.szs'. Both sub-files are always linked, so that storage space is saved. The usual size for each single icon is 128x128.