What if you wanted to take control of a platform's movement? The movement pattern of a platform is determined by an address that stores the ID of the line it is on, and this value is set every frame, depending on what line the platform is on (set to 0 if not on a line). If the value is 0 and the platform is active, the platform is affected by gravity. You don't want it to be affected by gravity; this makes controlling its movement a hassle. You can't set the platform to not be affected by gravity in its .txt (I tried and it doesn't work). Changing the memory address containing the line ID to 0 every frame doesn't work, either. SMBX just changes it back to 0 and it still falls a bit before Lua switches it back to 71 (the horizontal line).
It would work like this:
Code: Select all
Misc.lockMem(address)
Code: Select all
Misc.lockMem(npc.ai1)
I will put this in the LunaLua wishlist, linked to this page.