warpTransition.lua (v1.1.3) - Spruce up your warps!
Posted: Tue May 19, 2020 4:05 pm
Forums for SMBX
https://www.supermariobrosx.org/forums/
https://www.supermariobrosx.org/forums/viewtopic.php?t=25750

Looks like you don't have the patch 2 hotfix.SpoonyBardOL wrote: ↑Wed May 20, 2020 5:50 amI'm getting this error when I start a level using it:
There's no other lua code running in this level, or the episode folder, outside of loading the warpTransition lua. Is there anything else I should be doing, or some documentation I'm missing?
No, it doesn’t add any more settings to warps (since that’s seemingly not really possible at the moment). All the settings are at the bottom of the lua file.MegaDood wrote: ↑Wed May 20, 2020 9:21 amThis looks really good!
But I'm having a bit of trouble using it, I'm confused.
Should any options appear in the Warps and Doors tab? The level loads with Mario with a circle effect (The one which extends outwards, I don't know the name) but other than that Im not sure on how to use it.
There aren't any errors that display either, but I would appreciate any help.
Step 1: Open the lua file.FireSeraphim wrote: ↑Thu May 21, 2020 10:31 amThere's a serious lack of step by step documentation on how to use it, like can we get an example level for this?
Well, you can change the current warp types at any time. So an example script for something to change the warp type for a certain warp would just be:SpoonyBardOL wrote: ↑Thu May 21, 2020 9:53 amFor a future update, would it be possible to add a blacklist? Like if you want to use it for a level but there's just one warp that goes from one end of a section to the other that you just don't want to pan?
Code: Select all
local warpTransition = require("warpTransition")
function onTick()
local currentWarp = player:mem(0x15E,FIELD_WORD)
if currentWarp == yourWarpsIndexHere then -- If the player is using a certain warp
warpTransition.sameSectionTransition = warpTransition.TRANSITION_NONE -- Set the same-section transition to 'none'
else -- If not using that warp
warpTransition.sameSectionTransition = warpTransition.TRANSITION_PAN -- Set the same-section transition to 'pan'
end
end
What part is difficult to understand? What is your goal?JulianSteve_18 wrote: ↑Sat May 23, 2020 1:50 amI did not understand how to use it. Could you do each of the effects in separate files?
I want to use only one single effect on one level, and another effect on another level. How do I do it? I know you gave an example, but I didn't understand it. If you could do each effect separately I would appreciate it.Enjl wrote: ↑Sat May 23, 2020 2:44 amWhat part is difficult to understand? What is your goal?JulianSteve_18 wrote: ↑Sat May 23, 2020 1:50 amI did not understand how to use it. Could you do each of the effects in separate files?
The transition types are defined at the top of the lua file. The variables to set are defined at the bottom. So you can use those for example like how MrDoubleA said:JulianSteve_18 wrote: ↑Sat May 23, 2020 12:06 pmAdded in 53 seconds:I want to use only one single effect on one level, and another effect on another level. How do I do it? I know you gave an example, but I didn't understand it. If you could do each effect separately I would appreciate it.Enjl wrote: ↑Sat May 23, 2020 2:44 amWhat part is difficult to understand? What is your goal?JulianSteve_18 wrote: ↑Sat May 23, 2020 1:50 amI did not understand how to use it. Could you do each of the effects in separate files?
Excuse my ignorance, but I still don't understand. I use Google translator to translate words from English to Spanish, and that is why your explanation is not understood. And since I don't know English, this is the reason why I don't understand the warptransition file.Enjl wrote: ↑Sat May 23, 2020 12:14 pmThe transition types are defined at the top of the lua file. The variables to set are defined at the bottom. So you can use those for example like how MrDoubleA said:JulianSteve_18 wrote: ↑Sat May 23, 2020 12:06 pmAdded in 53 seconds:I want to use only one single effect on one level, and another effect on another level. How do I do it? I know you gave an example, but I didn't understand it. If you could do each effect separately I would appreciate it.
warpTransition.sameSectionTransition = warpTransition.TRANSITION_NONE
In order to get different effects in different levels, drop the warpTransition.lua file into your episode folder, and then make a luna.lua file in each level's level folder. In those files you can set the variables to different things depending on which level's luna.lua you're editing. That's the simplest way to do it, without requiring a large amount of knowledge in lua. Does this make sense to you? If not, please let me know which part I should elaborate on.
Code: Select all
local warpTransition = require("warpTransition")
function onTick()
local currentWarp = player:mem(0x15E,FIELD_WORD)
if currentWarp == yourWarpsIndexHere then -- If the player is using a certain warp
warpTransition.sameSectionTransition = warpTransition.TRANSITION_NONE -- Set the same-section transition to 'none'
else -- If not using that warp
warpTransition.sameSectionTransition = warpTransition.TRANSITION_PAN -- Set the same-section transition to 'pan'
end
end