LE-CODE/Track FAQ

From Custom Mario Kart
Jump to navigation Jump to search

This is a special help page for track editors. It explains how to edit your tracks to use the extensions provided by LE-CODE. A Distribution FAQ exists too.


Cannon Settings (KMP/CNPT)

Issue

There are 3 hard coded cannon types. They have different characteristics. A track can select the type by KMP/CNPT. Changing the characteristics will affect all other tracks with cannons. So the track designer has to live with the predefined characteristics.

Solution

A LEX file is the solution. If such file exists and has a cannon section defined, LE-CODE will use these local characteristics instead of the global characteristics. It is also possible to define more than 3 different characteristics.

Common Files

Issue

All tracks use objects and settings loaded from Common.szs. A modification has impact to all tracks. So modifications are generally forbidden.

Solution

Place private versions of Common files into the sub-directory ./Common/ of the track's SZS.

Supported files until now are:

Finish line (Second KTPT)

Issue

Usually, the start position of a track is placed very near to the finish line (CKPT lap counter). But some tracks use special start positions (starting boxes) far away from the finish line and sometimes with different direction. In this case, the finish line of the minimap is drawn at the wrong place.

Solution

LE-CODE provides a solution for this issue. If a second KTPT at index #1 with player_id -1 is defined, it is used as alternative draw position for the finish line. The point at offset #0 is still used for start position.

If you set up a second KTPT, search the relevant lap counter (section CKPT) and place the KTPT at the check point line. The direction (Y-rotation) of the KTPT is important.

Wiimm edited 15 tracks to insert a second KTPT. If you update such track and don't change the finish line, please copy the second KTPT (leave it unchanged).

Solution using Wiimms SZS Tools

As of v2.03 of Wiimms SZS Tools, command »wkmpt KTPT« analyses the track and prints a recommendation for the second KTPT in 2 formats: as a complete KTPT record, and as option --ktpt2:

Recommendation based on nearest ENPT #32:
  Recommended KTPT record:   1  -82892.672     152.510   50314.219  0  33.52 0  -1 0
  Recommended patch option:     --ktpt2=-82893,50314

The option can be used to insert or replace the second KTPT:

wszst patch --ktpt2=-82893,50314 FILE.szs

Rotation and Y-position (height) are determined automatically. The position is adjusted.

As of v2.05a of Wiimms SZS Tools, both steps of above can be combined into a single command:

wszst patch --ktpt2=auto FILE.szs

Mushroom Car (penguin_m)

Issue

You want to integrate a Mushroom Car for tracks like GCN Mushroom City.

Solution

The solution uses Object penguin_m and is a joint work of Leseratte, KHacker and Tock.

Add 1 or more objects of type penguin_m to KMP/GOBJ and set setting #8 to value 1 (= Mushroom Car support enabled). Don't forget to set up a route and a start point. Usually the route of the other cars are used. Setting #3 can be used to define the item the mushroom car should drop (same as itemDirect).

The track needs the following new and modified files:

  • ./penguin_m.brres
  • ./effect/penguin_m/rk_penguin_m.breff
  • ./effect/penguin_m/rk_penguin_m.breft
  • ./brasd/penguin_m/walk.brasd
  • ./Common/GeoHitTableKart.bin
  • ./Common/GeoHitTableKartObj.bin
  • ./Common/GeoHitTableItem.bin
  • ./Common/ObjFlow.bin

You can get all files from download.wiimm.de (35K, 2019-07-01). See section »Common Files« for the support of Common files.

Woodbox: Respawn height

Issue

Object woodbox respawns after 5 seconds, drops from 5000 units above the origin and drops onto the first face they touch. This is problematic, if an upper floor exists less than 5000 units above. In this case, the woodbox will respawn in the wrong floor. DS Airship Fortress is an example for this.

Solution

Use setting #8. Set it to a value >0 to define an alternative drop height.