From Custom Mario Kart
Jump to navigation Jump to search

How open will this be?

You've mentioned creating our own distributions with this somewhere down the line, but would that be using a set of pre-made editing tools or are we going to get access to full-on modding of StaticR.rel with C? If so, that would be great for some more unique mods. Seeky (talk) 19:07, 23 February 2019 (UTC)

As I said in the article, I currently don't plan to release the source code for the modifications or the build system, that means, modding the LE-CODE will be limited to configuration of the LE-CODE with Wiimms tools. Modding the game with C is in theory possible for everyone though - you can write C code and compile it to cheatcode form, as seen in this example: - and if anyone makes cool mods that I think are useful, I might add them to the LE-CODE. -- Leseratte (talk) 19:27, 24 February 2019 (UTC)
Didn't know about cheat code compiling, thanks. Seeky (talk) 19:29, 24 February 2019 (UTC)

More than 200 tracks?

Shut than mean , in future there comes a distrubtion with 300 or 400 tracks? That`s crazy. ;)))--Snake (talk) 11:34, 24 March 2019 (UTC)

Read this for details: LE-CODE Test Distributions -- Wiimm (talk) 13:07, 24 March 2019 (UTC)


First off Leseratte, thank you so much for making this!

I got some suggestions for LE Code, and they include some of the codes in MKW Hack Pack:

  • No Bullet Bill icon (basically, you can get an item while you're in a bullet bill).
  • Rotating triple bananas (like in Mario Kart 8).

Also, some other suggestions for things not in MKW Hack Pack:

  • 150cc online only (Engine class probability modifier, I'm guessing, might have this included).
  • Data corruption patch (for when people complete a time trial and/or grand prix, or sometimes when people try to go online and receive a message stating it's corrupted in some way, I'm also guessing this might also be covered already in your code, this is a very serious issue with MKW Hack Pack).
  • Some kind of support for time trials on a limited amount of tracks (not sure how that would work though).
  • Not losing VR when you disconnect (no big deal if this can't happen, but to some people it might matter).
  • Fix random picking glitch in friend rooms (again, not sure if LE Code already has that already).
  • The ability to choose from all cups in online regionals (in my case, Hack Pack Worldwides). I intend to have all tracks still be custom tracks in the next update, no regular tracks.
  • Not sure if the crash handler covers this, but, in the event of a freeze bug, it should redirect the user back to the Wii Menu. Also, not sure if this is possible, but patching freeze bugs that occur when someone crosses the finish line or just completes a lap of a track, this is reported to me a lot and I don't have any solutions to preventing this permanently.

I also have some custom track variant ideas for MKW Hack Pack:

  • Concord Town
  • Paradize Canyon
  • The Nether
  • Lava Road
  • Yoshi Mountain

Not sure what the limit is (4 variants of a track I think).

Thanks in advance for your consideration of this message. I know it's lengthy, but I really appreciate the work you put into all this, keep up the good work! Huili (talk) 02:50, 28 March 2019 (UTC)

Hello Huili, thanks for your suggestions
  • "No Bullet Bill" and "rotating bananas" isn't included in the LE-CODE but because that can be done using a simple cheat code it's not very high on my to-do list (just use the cheat code instead)
  • 150cc engine only can be done with the engine class probability mod, by just setting 100cc and Mirror to 0%.
  • Data corruption patch - I have already asked Bean for his patch to stop custom GPs from ruining the save game and as soon as I get that I'll definitely add it to the LE-CODE
for Time Trials, I haven't found a way to completely stop times (including fastest lap) from saving, so the current solution is to forbid TTs on custom track althogether
If I, at some point, find a way to prevent time saving, TTs on custom tracks will be made available again, but without time saving at all. That only works properly in CTGP because the game and the channel work together and would be pretty hard to do in LE-CODE.
  • "Not losing VR when disconnect" I don't think that that is a good idea because it might lead to people just rage-quitting if they are about to lose VR ... I'll think about it
  • Random glitch in friend rooms is fixed. Picking random selects the Nintendo-Random ("???") and doesn't trigger a client-side randomizer like in CTGP.
  • "Picking all cups in regionals" is possible as well, and has been for quite some time (by recompiling the old ct-code) like in Wiimms MKW Fun.
  • Automatically redirecting an user back to the Wii menu on crash is something I definitely won't add, because I want the user to be able to look at the exception and make a photo of it and send it to me so I can fix it. It should appear during development only and if it happens for a normal user then that is a bug I'd like to have fixed and not just ignored. I might be able to make the game quit to Wii Menu when pressing a certain button on the crash handler; I can look into that at some point
  • There is no limit on track variants. If you wanted, you could have 100 tracks with 20 variants each, or even more.
Leseratte (talk) 07:15, 28 March 2019 (UTC)
About patching finish line freeze bugs (I missed that):We've had that happen once or twice in MKW-Fun as well, and it was caused by Riivolution, not a bad track / bug. I don't think the LE-CODE can fix this properly. -- Leseratte (talk) 07:16, 28 March 2019 (UTC)
For the finish line freeze bug, it's usually not even Riivolution's fault, it's usually the user's SD Card/USB drive's fault. FancyDoesCustomTracks (talk) 02:32, 29 March 2019 (UTC)

Will CTGP ever change from CT-CODE to the LE-CODE?

I'm just curious, I know it'll be a while until this happens (if it does), but when will/if CTGP move from it? I guess this could go on the CTGP talk page, but I felt I might as well bring it up here. I assume Mr Bean has no plans as of right now, but it's got to happen eventually, right? Fab4GameZ (talk) 00:00, 9 July 2019 (UTC)

Bean currently doesn't plan to transition from ct-code to LE-CODE. But the ct-code in 1.03 is already very different from the old 1.02 one anyways. But Bean was open to potentially add some of the LE-CODE features to CTGP. -- Leseratte (talk) 03:33, 9 July 2019 (UTC)

Ok good to know, thanks! Fab4GameZ (talk) 22:03, 9 July 2019 (UTC)

music slots

Can you check if this works on LE Code or can be used on LE code?? Creating Additional Music Slots (sombeone do this for CT CODE) ~~--Unsigned comment by Warwick92xD (talk).

It probably does, but only with 8-bit music slots. In the past there was no need to have 16-bit music IDs as the original game only uses 8 bits. Also, in the future, please put questions like this onto the talk page (here) and not onto the article page itself. -- Leseratte (talk) 06:49, 22 July 2019 (UTC)

Item Rain (Riivolution)

I see on Item Rain gameplay on Riivolution-based packs (MKW Hack Pack etc.) there are a few glitches known in the past (also with CT-CODE) there are about 3 bugs I have found:

  • Freezes on a custom track that has had a certain object modified or KCL bugs.
  • Invisibility frame glitch - when items don’t hit their targets even when players drive through them.
  • Polygon explosions - for example: when you’re racing, it glitches and you get weird shape-looking colours on the screen with yellow flashes and a coloured line from the bottom left to the top right.

Would LE-CODE be able to patch those 3 Item Rain bugs that occur in Riivolution-based packs in a future LE-CODE build? Even if the Item Rain code was used as a Cheat Code. Octanevinny (talk) 08:54, 5 April 2020 (UTC)

Until now, we didn't thought about item rain support in LE-CODE. The only exception are the extended presence flags that cover item rain. -- Wiimm (talk) 09:01, 5 April 2020 (UTC)

Implementing game modes into CT distributions

I just heard that CuberHax and Ιυιgι are having trouble with implementing game modes into Cuberluigi CT Pack, is there solutions that could help them implement game modes into the game for them to work? (like 200kmh, item rain. etc.) and where do the game modes have to be implemented into for them to work on Riivolution based CT distributions? Octanevinny (talk) 00:22, 12 April 2020 (UTC)

Common files

I changed the behavior of Mdush when player hitting to fire spinning like some fiery obstacles instead of using KCL for my own track, and put the binary files into sub-directory like ./Common/ of SZS file and ./files/Race/Common/%N/ of ISO or WBFS. But they are not properly work, and the game has crashed. Can I have some solution for this issue? -- Rz (talk) 11:28, 6 May 2020 (UTC)

Please give me the SZS file for analysis -- Wiimm (talk) 16:59, 6 May 2020 (UTC)
Here it is Google Drive -- Rz (talk) 03:51, 7 May 2020 (UTC)
The track crashes always, with or without special files. I analyzed the 3 special files and they seems to be ok. In another test I added the mdush.kcl, but it doesn't help.
@Leseratte: Crash is always at 807bdc80 (PAL).
Wiimm (talk) 22:27, 8 May 2020 (UTC)
That crash is related to course.kcl loading, so it's possible that that file is broken. -- Leseratte (talk) 09:06, 9 May 2020 (UTC)
Wrong, the crash is related to M_obj_jump being declared in the KMP but not being in the track files. I added them and the track loaded fine.
Tock (talk) 15:39, 9 May 2020 (UTC)
Then a question to myself: Why ignore my tools the missed files. And the answer: When I analyzed all object years ago, I found never any related file for M_obj_jump. It's only used in competitions, that I never had analyzed. -- Wiimm (talk) 20:20, 9 May 2020 (UTC)
Damn... i thought that i correctly changed the object id from M_obj_jump to Mdush. And uhh... i guess i should have asked about this at first here, but please let me know, is it really possible to change the P4 of some objects has KCL to 1 thru 3 in ObjFlow.bin? I've exactly tried with Mdush once again, but the result has nothing changed. Here's the SZS file: [1] -- Rz (talk) 04:35, 10 May 2020 (UTC)
I have not got that to work either. Why not use any tree with srt0 animations and collision?
Tock (talk) 10:20, 10 May 2020 (UTC)
because i wanted to put normal and LE-CODE version into a szs, and i thought srt0 doesn't work for some objects included trees as i remember. i'm sorry to ask a silly question, everyone. -- Rz (talk) 11:05, 10 May 2020 (UTC)
For this, the extended presence flags were implemented: You can select which objects are available in standard or lecode mode. -- Wiimm (talk) 18:28, 10 May 2020 (UTC)
Oh, i quite forgot that. Thank you! -- Rz (talk) 10:48, 11 May 2020 (UTC)

Possible Alphabetical Option

Hello, I am wondering if LE-Code will ever support an option to order the tracks in alphabetical form.
Optllizer (talk) 7:44, 31 May 2020 (UTC)

Ordering the tracks is definitely not a task for the LE-CODE executor. It's more a task for a preprocessor if creating the definition file. And here »wctct create list --order-by BMG_FILE SOURCE -d DEST ...« can help. -- Wiimm (talk) 00:00, 1 June 2020 (UTC)
Its giving me the "No more track slots" error. I have a python script that makes the ctcode.txt alphabetical, but the flaw with this is, when I change one track, the order of the tracks shift, causing the names to be wrong. So if i replaced for example (Volcanic Pipeward) and put (Infernal Pipeyard), it would shift the tracks. So the track files names won't line up with the bmg names. Since LE Code renames all the tracks for me, and I dont want someone to redownload 200+ tracks just because I updated 1 track.
Optllizer (talk) 00:09, 1 June 2020 (UTC)
1) add --lecode to enable le-code support. 2) »wctct --lecode create bmg ...« creates a bmg from the 5th parameter. This BMG can be used as base to patch the message files. -- Wiimm (talk) 00:17, 1 June 2020 (UTC)
What does this do exactly. I did it and when doing the wlect patch lecode-usa.bin -od new/lecode-usa.bin --le-define ctcode.txt --track-dir optpack/tracks --move-tracks optpack/dir --custom-tt command it doesnt move all my tracks from the folder.
Optllizer (talk) 01:02, 1 June 2020 (UTC)
lecode-usa.bin is copied and patched and stored as new/lecode-usa.bin. Then it searches the files defined by param 4 in of ctcode.txt in directory optpack/dir and move them (not copy!) to directory optpack/tracks. Option --custom-tt enables the custom time trials. Destination directories must exists before. -- Wiimm (talk)
My bad for my awful wording. I already know what that does. Im talking about the the wctct create bmg and wctct create list command. That is the one i am confused about. Im not fully sure what these commands will help me with. Sorry for the misunderstanding. —Optllizer (talk) 13:26, 1 June 2020 (UTC)
The ct-code parser is able, to distribute the tracks to the slots and to reorder it by --order-by. So the sense of »wctct create bmg ...« is to have a BMG file with a well ordered list of track names. I use this feature in my distributions. -- Wiimm (talk) 22:51, 1 June 2020 (UTC)
When I do the command and i try to create the BMG, It doesn't show all the tracks only like 180. I did wctct create list --le-code --order-by ABC.bmg ctcode.txt -d abc.txt then with the created file i did wctct bmg --le-code --long abc.txt >tracks.bmg.txt which only gave me few of the tracks and they were out of order —Optllizer (talk) 01:20, 2 June 2020 (UTC)
Use same options and source files for the "bmg" command (not abc.txt, but ctcode.txt and --order-by. -- Wiimm (talk) 11:37, 2 June 2020 (UTC)
This is what I did step by step. First I created a list with the normal ctcode and created a abc.txt(this is the ctcode but in Alphabetical)wctct create list --le-code --order-by abc/ABC.bmg abc/ctcode.txt -d abc.txt ABC.bmg is not in alphebetical it is the bmg i made from ctcode.txt. In ABC.txt it is a ctcode file but in alphabetical form. Then i created the bmg wctct bmg --le-code --order-by abc/abc.bmg abc/ctcode.txt --long >abc/tracks.txt the tracks.txt is not in alphbetical so i replaced ctcode.txt with abc.txt and it has the same issue as earlier only show some tracks and they are completely out of order. —Optllizer (talk) 14:02, 2 June 2020 (UTC)

Crashes and bugs with LE-CODE distributions

Hi, I've been working on my custom track distribution with LE-CODE (amazing how you can get more than 300+ tracks and battle arenas working again), everything seemed to be pretty fine until I've noticed that the game bugs terribly when you choose "Random" or "In Order" in both VS Race and Battle modes (the game starts to pick the wrong courses). Also the game crashes for some reason every time you win the Banana and Lightning cups in Grand Prix. This is a weird case that only happens with these 2 cups in specific. I thought i was doing something wrong but then i tested the same in Wiimms Mario Kart Fun 2020-06 and the same problems are there too. Are these problems possible to fix? i would appreciate your answer thank you. -FJRoyet

For battle/random we found the bug. I'll fix and test it next weekend. We haven't proofed the Banana/Ligtnig issue yet, but with old lecode versions it worked. -- Wiimm (talk) 19:53, 27 August 2020 (UTC)

Picking Heavy Mii Crashes Friend Rooms bug

Me and Brawlboxgaming have experience a bug with LE-Code v20, v22 and v24 where picking a heavy mii can cause the entire room to crash. At first we thought it was something to do with picking baby luigi then the heavy mii but then we discovered it just happens by picking any heavy mii. Clip can be found here. -- Bladestorm227 (talk) 12:42, 18 October 2020 (UTC)

Other suggestions

I think it would be necessary to put down some suggestions that I think could be great additions to LE-CODE:

  • Item Rain support - The latest build doesn't support Item Rain. Item Rain has quite a following, and it's sad that LE-CODE does not have plans to support it yet.
  • Custom music slot support - Custom music slots are usable in CT-CODE, but LE-CODE defaults to the Mario Circuit music slot when trying to use unsupported music slots. LE-CODE also switches to the Mario Circuit music slot when trying to use Luigi Circuit or Galaxy Colosseum music slots, which are usable slots in CT-CODE. If Galaxy Colosseum truly needs final lap music, maybe at the final lap the game would just play the normal Galaxy Colosseum BRSTM but at a faster speed/higher hz.
  • Setting to automatically sort tracks in alphabetical order - Having tracks in alphabetical order helps to make tracks easier to find, but the disadvantage is having to move around track slots when replacing a track. Having a setting to make the game automatically do this would be an amazing feature. Maybe this can be done by arranging the slots correctly when patching the lecode-XXX.bin file and when creating the track BMG text. The setting would have to be in the track definition file for it to work this way.
  • Update the exception handler to give an option to go back to the Wii Menu - This one is less needed because we already have a code to sort of do this, but giving an option to go to the Wii Menu instead of forcing it to go would be better for debugging.

CuberHax (talk) 22:49, 19 November 2020 (UTC)

For the custom music slot thing, try adding an "!" after the music slot. I can't 100% confirm it works, but it works when setting up extra track slots on previously unavailable ones. Trainiax/SwampyGator (talk) 23:05, 19 November 2020 (UTC)
For Item Rain, I have seen it hasn't been able to work properly for CuberHax and me, when played in-game, the game froze at the start of the first race when it was played on Cuberluigi CT Pack (currently outdated pack) last month. CuberHax thought it was caused by LE-CODE, but I instead thought it was something different considering that freeze has never happened on vX MKW Hack Pack before when I played Item Rain on it even though it now also uses LE-CODE.
The only difference I found to what was causing the game mode to not work properly on Cuberluigi CT Pack is when I looked inside the vX MKW Hack Pack and Cuberluigi CT Pack folders, it is the lecode-XXX.bin's folder location. for vX MKW Hack Pack the "lecode-XXX.bin" file is in the same folder with the "main.dol" and "StaticR.rel" files, while for Cuberluigi CT Pack the lecode-XXX.bin file is not in the same folder with the "main.dol" and "StaticR.rel" files. so this might be the reason why the gamemode wasn't able to work properly, because with the lecode-XXX.bin file not being in the same folder with the "main.dol" and "StaticR.rel" files, the game and code data would not be read properly in-game.
I know that CuberHax would have liked Item Rain in CTGP Revolution Classic and Project Nitro. The idea I have found to have Item Rain to work properly is all the files lecode-XXX.bin, StaticR.rel and Main.dol have to be in the same folder. for example, files/rel/lecode-XXX.bin (Inside the same folder with StaticR.rel and Main.dol). The preview of the file locations are here -- Octanevinny (talk) 07:59, 22 November 2020 (UTC)
I think it's highly unlikely that the location of the lecode-XXX.bin on the SD card has any impact. All that's important is that the game is able to find that file at /rel/lecode-XXX.bin. How it ends up there is a task for either the ISO patcher or the Riivolution XML.
As for the music slots, there's nothing in the LE-CODE that prevents higher or custom music slots from working. People have used that before.
Sorting tracks in any way is not something I'll implement into the LE-CODE. That is something that can either be added to wlect (if Wiimm wants to do that) or into your own wrapper scripts you're using to create your distribution.
-- Leseratte (talk) 09:25, 22 November 2020 (UTC)
I guess there's another thing I would like to mention. There should be a track flag that defines a new track and the beginning of a random group. For example if I want a track with both day and night versions to be randomly picked but I also want the track to be picked by the Random: New Tracks option, then I could use this new track flag for it.
Also, I am still not sure how Luigi Circuit and Galaxy Colosseum music slots could be used in LE-CODE. If they are usable at all. --CuberHax (talk) 02:53, 29 November 2020 (UTC)
Track Flags: "0x03" - Header & New, "0x05" - Sub-track & New
Luigi Circuit should be available with "117" and Galaxy Colosseum with "201". You may need "!" after the music slot for it to work. Trainiax/SwampyGator (talk) 03:39, 29 November 2020 (UTC)

Multiplayer Freezes

On my custom track distribution, Nitro CT Pack, I have been getting reports that Multiplayer doesn't work at all on any track. It's using the latest version of LE-CODE (build 26), and Speedometer is on. I'm wondering if it has something to do with the Speedometer, or if it's a bug in build 26 of LE-CODE. Besides those two factors, the lpar and XMLs are set up pretty much the same way as in Cuberluigi CT Pack, and Multiplayer worked fine there. Note that Cuberluigi CT Pack was on build 18 at the time of testing Multiplayer on there. For this reason, I can't tell if it's an issue on my behalf. Here's the uncompiled lpar code if it helps. --HackStarz (talk) 22:00, 12 January 2020 (UTC)

Multiplayer just doesn't work on any distribution, I tried everything and yet nothing. GuidedByVoices (talk) 20:07, 16 February 2021 (UTC)

New speedometer

What was the point of replacing the old speedometer instead of keeping it as an option? I'm sure many people would prefer the CT-CODE speedometer over stebler's speedometer. --HackStarz (talk) 23:20, 8 April 2021 (UTC)

Speedometer color

I hope the speedometer's color would be customizable in the future build. -- Rz (talk) 04:42, 8 August 2021 (UTC)

LAN Mode

First of all: Awesome work on LE-CODE! This post is a combination of a suggestion and a question. I've been trying to make a lan mode work for MKWii. Using this tutorial ( I'm able to launch an ISO (with Custom tracks) through brainslug. Furthermore, I use the LECODE Loader cheatcode (, as i do not launch the game using MKWII's own main.dol (brainslugs boot.dol instead), so patching it wont help. However, somehow this does not work. It does work using the regular main.dol (not patched to load le-code) and the cheatcode.

So my question: Can someone help me with this?

My suggestion: Please include a LAN mode in LE-code :) --Unsigned comment by Dirtyfrikandel (talk).