Skip to content

Fixing Lua Mods from 0.6.x to 1.0

ShadowMario edited this page Oct 2, 2024 · 1 revision

Introduction

Since 0.7, a LOT of things have been changed on the Source code structure, which ends up breaking many older mods due to nomenclature, this caused a lot of controversy but it's undeniably for the best, as the Source Code is much better organized right now.

With these small changes, you might be able to fix your issues:


getPropertyFromClass

  • Change getPropertyFromClass('ClientPrefs', 'variableNameHere') to getPropertyFromClass('backend.ClientPrefs', 'data.variableNameHere')

setPropertyFromClass

  • Change setPropertyFromClass('ClientPrefs', 'variableNameHere', value) to setPropertyFromClass('backend.ClientPrefs', 'data.variableNameHere', value)

If you're trying to fix Game Over character/sounds breaking, change the class to substates.GameOverSubstate or add the Game Over Character through the Chart Editor (Data tab)


camFollowPos

  • camFollowPos has been removed, instead, use setCameraScroll(x, y), and getCameraScrollX()/getCameraScrollY()

Note Splash Data

  • All Note Splash variables got replaced from notes, check out the new ones:
  1. noteSplashData.disabled, setting to true won't spawn a note splash
  2. noteSplashData.texture, you can for example, force it to use Diamond note splashes by setting it to noteSplashes/noteSplashes-diamond
  3. noteSplashData.useGlobalShader, setting to true will make your custom note use default note splash colors
  4. noteSplashData.r, default value is -1, you're supposed to put a color hex value in this
  5. noteSplashData.g, default value is -1, you're supposed to put a color hex value in this
  6. noteSplashData.b, default value is -1, you're supposed to put a color hex value in this
  7. noteSplashData.a, default value is 0.6

Adding a Version Checker

Don't forget, you can also do version checking through if stringStartsWith(version, '0.6') to make your mod compatible with both versions.