Share and discuss custom LunaLua code and content packs for SMBX2.
Moderator: Userbase Moderators
|
|
|
|
-
TLtimelord
- Red Yoshi Egg

- Posts: 2699
- Joined: Sat Dec 21, 2013 5:16 pm
- Flair: Info under raps
Postby TLtimelord » Wed Apr 08, 2020 11:30 pm
I downloaded the SMBX2 beta 4 installer (the "local" option) earlier today. In PGE the program freezes for about 5-10 seconds every time I select something to be placed down in the editor. This makes the editor virtually impossible for me to use.
Do you know what could be causing this issue?
|
|
|
|
|
|
|
|
|
-
Wohlstand
- Chargin' Chuck

- Posts: 2008
- Joined: Tue Feb 11, 2014 4:44 pm
- Flair: [ˈvoːlˌʃtant], 狐エンジニア
- Pronouns: he/him
-
Contact:
Postby Wohlstand » Thu Apr 09, 2020 7:55 am
TLtimelord wrote: ↑Wed Apr 08, 2020 11:30 pm
I downloaded the SMBX2 beta 4 installer (the "local" option) earlier today. In PGE the program freezes for about 5-10 seconds every time I select something to be placed down in the editor. This makes the editor virtually impossible for me to use.
Do you know what could be causing this issue?
This bug has been fixed weeks ago, you need to run an update of PGE toolchain:
- open a `data/PGE` folder
- run "update-pge.cmd" script
- a black console window will pop-up, follow instructions are described in it.
however, a quick workaround: save your level file, this bug appears when you use untitled/scratch levels (new-made files which was never saved on a disk).
|
|
|
|
|
|
|
|
|
-
mcnakahr
- Bob-Omb

- Posts: 21
- Joined: Wed Dec 18, 2019 2:02 pm
Postby mcnakahr » Thu Apr 09, 2020 6:11 pm
DrMekar wrote: ↑Wed Apr 08, 2020 7:43 pm
mcnakahr wrote: ↑Wed Apr 08, 2020 6:54 pm
 Potential bug found in Beta 4 Patch 1!
What is it? The "If Layer is Empty" trigger doesn't always work.
Why is it important? For some people who use the classic event system, this issue makes it impossible for chained events to work that rely on this trigger.
What could be causing it? I've observed sometimes one or two npcs get despawned while off-screen. When this occurs the game still thinks they are on the layer when they have been despawned making them not anywhere. and forcing the "If Layer is Empty" trigger to always be false.
To reproduce: (Not 100% reproducible all the time but this happens 75% of the time)
Resize a section so it has to scroll to show the whole area.
Create an event to use, have it do anything you wish.
Create a layer to put enemy npcs on. (For this purpose it's called enemy)
Place npc(s) on layers enemy spacing them apart so some of the enemy npcs can move off screen.
Set each npc's "If Layer is Empty" trigger to trigger the event you created.
Play Test the level and kill the npc enemies, letting a few off screen for a couple seconds to despawn.
Note: The odd despawning seems to happen if an enemy npc is off-screen for 2 seconds or more and the "If Layer is Empty" trigger is ignored completely if the npc changes to another npc on death (ex. Variations of Chargin' Chucks, para-koopas, Rex, etc.)
(Edited for clarification.)
That Bug already was in 1.3. Used to happen alot with Snifits.
So if it was in 1.3 would there be chance it would be fixed at all? I'm not that great at luna lua or lua in general.
|
|
|
|
|
|
|
|
|
-
Hoeloe
- Phanto

- Posts: 1465
- Joined: Sat Oct 03, 2015 6:18 pm
- Flair: The Codehaus Girl
- Pronouns: she/her
Postby Hoeloe » Thu Apr 09, 2020 7:50 pm
Unlikely bugs with the event system will be fixed in the near future. We're more likely to just overhaul it at some point. If you want to try and learn some Lua, there are plenty of resources to help, including the Codehaus Discord server.
|
|
|
|
|
|
|
|
|
-
TheDJ19
- Koopa

- Posts: 19
- Joined: Tue Mar 17, 2020 6:21 pm
- Flair: Work hard. Play hard.
Postby TheDJ19 » Fri Apr 10, 2020 2:36 pm
DrMekar wrote: ↑Wed Apr 08, 2020 7:43 pm
mcnakahr wrote: ↑Wed Apr 08, 2020 6:54 pm
 Potential bug found in Beta 4 Patch 1!
What is it? The "If Layer is Empty" trigger doesn't always work.
Why is it important? For some people who use the classic event system, this issue makes it impossible for chained events to work that rely on this trigger.
What could be causing it? I've observed sometimes one or two npcs get despawned while off-screen. When this occurs the game still thinks they are on the layer when they have been despawned making them not anywhere. and forcing the "If Layer is Empty" trigger to always be false.
To reproduce: (Not 100% reproducible all the time but this happens 75% of the time)
Resize a section so it has to scroll to show the whole area.
Create an event to use, have it do anything you wish.
Create a layer to put enemy npcs on. (For this purpose it's called enemy)
Place npc(s) on layers enemy spacing them apart so some of the enemy npcs can move off screen.
Set each npc's "If Layer is Empty" trigger to trigger the event you created.
Play Test the level and kill the npc enemies, letting a few off screen for a couple seconds to despawn.
Note: The odd despawning seems to happen if an enemy npc is off-screen for 2 seconds or more and the "If Layer is Empty" trigger is ignored completely if the npc changes to another npc on death (ex. Variations of Chargin' Chucks, para-koopas, Rex, etc.)
(Edited for clarification.)
That Bug already was in 1.3. Used to happen alot with Snifits.
I do agree with that.
|
|
|
|
|
|
|
|
|
-
mcnakahr
- Bob-Omb

- Posts: 21
- Joined: Wed Dec 18, 2019 2:02 pm
Postby mcnakahr » Fri Apr 10, 2020 5:46 pm
I doubt I'll be able to figure out how to use lua to workaround that bug in the event system so the project I was working on is dead. Hours/days wasted.
|
|
|
|
|
|
|
|
|
-
Hoeloe
- Phanto

- Posts: 1465
- Joined: Sat Oct 03, 2015 6:18 pm
- Flair: The Codehaus Girl
- Pronouns: she/her
Postby Hoeloe » Fri Apr 10, 2020 10:29 pm
mcnakahr wrote: ↑Fri Apr 10, 2020 5:46 pm
I doubt I'll be able to figure out how to use lua to workaround that bug in the event system so the project I was working on is dead. Hours/days wasted.
I mean, it's really not hard to learn, especially if you're willing to let someone walk you through it. This is a lack of effort on your part, nothing else.
|
|
|
|
|
|
|
|
|
-
Emral
- Cute Yoshi Egg

- Posts: 9887
- Joined: Mon Jan 20, 2014 12:58 pm
- Flair: Phoenix
Postby Emral » Sat Apr 11, 2020 3:35 am
I believe this 'layer is empty' thing is only relevant in the case of one-time spawned NPCs that are spawned into a one-screen section, with the NPC becoming permanently inaccessible once leaving the screen. Worth noting for this case is that
1) The NPC isn't dead, but is waiting for its spawn position to scroll back onscreen so it can be respawned. This knowledge makes this a non-issue in setups two or more screens wide/tall, since any location can be moved off- and on-screen to respawn an enemy.
2) This can be effortlessly prevented by placing walls at the edge of the screen to prevent crucial enemies from becoming unreachable.
3) This can ALSO be prevented by executing a short lua script that finds and kills these enemies if they are despawned. The procedure being to, every frame, loop over all enemies of IDs you wanna check in the current section, and see if their despawnTimer field is <= 0 and their layer is what you expect, and then kill them.
Code: Select all local IDs = {LIST, OF, IDs, SEPARATED, BY, COMMA}
local myLayerName = "name of the layer the NPCs will be on, in quotation marks"
function onTick()
for k,v in ipairs(NPC.get(IDs, player.section)) do
if v.layerName = myLayerName and (not v.layerObj.isHidden) and v.despawnTimer <= 0 then
v:kill()
end
end
end
All that aside, I'm surprised this is something to cancel a project over, since enemy gauntlets aren't exactly the most common design trope to my knowledge, and if these solutions don't work for you it's always possible to simply design the level differently to provide a similar challenge without risking the game's despawn rules getting in the way.
|
|
|
|
|
|
|
|
|
-
mcnakahr
- Bob-Omb

- Posts: 21
- Joined: Wed Dec 18, 2019 2:02 pm
Postby mcnakahr » Sat Apr 11, 2020 2:59 pm
Enjl wrote: ↑Sat Apr 11, 2020 3:35 am
I believe this 'layer is empty' thing is only relevant in the case of one-time spawned NPCs that are spawned into a one-screen section, with the NPC becoming permanently inaccessible once leaving the screen. Worth noting for this case is that
1) The NPC isn't dead, but is waiting for its spawn position to scroll back onscreen so it can be respawned. This knowledge makes this a non-issue in setups two or more screens wide/tall, since any location can be moved off- and on-screen to respawn an enemy.
2) This can be effortlessly prevented by placing walls at the edge of the screen to prevent crucial enemies from becoming unreachable.
3) This can ALSO be prevented by executing a short lua script that finds and kills these enemies if they are despawned. The procedure being to, every frame, loop over all enemies of IDs you wanna check in the current section, and see if their despawnTimer field is <= 0 and their layer is what you expect, and then kill them.
Code: Select all local IDs = {LIST, OF, IDs, SEPARATED, BY, COMMA}
local myLayerName = "name of the layer the NPCs will be on, in quotation marks"
function onTick()
for k,v in ipairs(NPC.get(IDs, player.section)) do
if v.layerName = myLayerName and (not v.layerObj.isHidden) and v.despawnTimer <= 0 then
v:kill()
end
end
end
All that aside, I'm surprised this is something to cancel a project over, since enemy gauntlets aren't exactly the most common design trope to my knowledge, and if these solutions don't work for you it's always possible to simply design the level differently to provide a similar challenge without risking the game's despawn rules getting in the way.
I've tried both one and two... this spartically happens with one and with two it would only shrink the playing field up if I used walls.
This may be considered off topic but this is what I was trying to do but due to the bug I can't:
Towards the end of the level I designed I wanted a boss rush of sorts. The player enters a door and goes to a section that is scrollable with four walls.
The only way to spawn an exit is to defeat each enemy wave. Each enemy wave is consisting of a type of enemy.
The battle begins after a short dialog with the real boss which is controlled through triggered events.
First wave is of 12 goombas of different types, some try to attack the player while others simply move about. The bug occurs when some random few of them go off screen for a bit. They do not always respawn when the screen scrolls to the their position when this happens, I'm telling the truth man. When they don't respawn the player can't finish the wave out thus making them eventually stuck in an empty room.
The second wave was supposed to be koopas but the layer is empty trigger is ignored because the koopas change into other npcs when hit with the exception of the beached variety. (I've tested this with a once screen area).
I can't use the kill on despawn script you provided because that defeats the purpose of the challenge if the player just has to wait until most of the enemies walk off screen.
Edit: I don't understand why you are calling a bug part of a despawn rule. Plus your first and second points are not always true because there is indeed a bug.
|
|
|
|
|
|
|
|
|
-
Emral
- Cute Yoshi Egg

- Posts: 9887
- Joined: Mon Jan 20, 2014 12:58 pm
- Flair: Phoenix
Postby Emral » Sat Apr 11, 2020 3:07 pm
mcnakahr wrote: ↑Sat Apr 11, 2020 2:59 pm
I can't use the kill on despawn script you provided because that defeats the purpose of the challenge if the player just has to wait until most of the enemies walk off screen.
Then you need some kind of wall. I'm not sure what kind of compromise could even be feasible. Either all of them have to be fought (they cannot go offscreen) or some of them despawn naturally (kill on despawn) or you catch their despawn and teleport them back in (potentially irritating to the player, so probably not desirable).
I don't doubt anything you said earlier, but I think for this situation it's still good to have a full understanding on how SMBX's respawn mechanics work in the first place. I have compiled the details in the spoiler below:
1) An enemy spawns as soon as it comes onscreen after being hidden. A hidden state can imply hidden layer, or despawnTimer being -1.
2) despawnTimer is a field counting down from 180 to -1 for as long as an enemy is offscreen. Once it hits 0, the enemy despawns, causing it to move back to its spawn position and become invisible.
3) While despawnTimer is 0, the NPC will check if its original spawn location (not the position it despawned at, but the one where it appears in the editor) is currently onscreen. As soon as that's no longer the case, the despawnTimer will decrement to -1, allowing the NPC to respawn.
With that in mind, what I suspect you have is a scenario in which the arena is between 1 and 2 screens wide/tall, causing not every place on screen to be able to go fully offscreen to allow NPCs to respawn. The simplest fix that doesn't involve lua is to make the arena either bigger or smaller. The simples fix with lua is probably to put a spawnzone over the arena and wall off the edges: viewtopic.php?f=101&t=23984
Put the library into your level folder and put the following line in luna.lua to turn your SMB3 blue block sizeable into a spawn zone:
local spawnzones = require("spawnzones")
If you want another sizeable to be the spawnzone instead, you can change the ID by appending the line:
spawnzones.block = DESIRED_ID
Where DESIRED_ID is the numeric ID of the sizeable you wish to use instead.
Then just draaaag the sizeable to encompass the entire arena in the editor, and make sure enemies can't leave it.
|
|
|
|
|
|
|
|
|
-
mcnakahr
- Bob-Omb

- Posts: 21
- Joined: Wed Dec 18, 2019 2:02 pm
Postby mcnakahr » Sat Apr 11, 2020 4:27 pm
I can try shrinking the area. The only reason I had it big was to give the player room to move around but I can see about reducing the area down. Thank you for explaining the spawning system.
Edit: Reducing the area size to one screen made the sequence a tiny bit harder but I was able to make it through on a playtest with no death. Thanks for the helpful workaround and for helping me understand it wasn't really a bug.
|
|
|
|
|
|
|
|
|
-
SPEEDIE
- Flurry

- Posts: 180
- Joined: Sat Nov 03, 2018 6:22 pm
- Flair: u fucking wot
- Pronouns: he/him
-
Contact:
Postby SPEEDIE » Sun Apr 12, 2020 9:09 pm
Could not find anywhere better for this to go.
Maybe remove the .md file with the macOS tutorial.
Wine no longer works as of macOS 10.15 Catalina because Apple decided to drop support for 32-bit, which I am kind of okay with, because we need to transition to 64 bit.
|
|
|
|
|
|
|
|
|
-
Chanceux2
- Volcano Lotus

- Posts: 576
- Joined: Mon Dec 16, 2019 3:39 pm
- Flair: People don't care about my threads! :(
-
Contact:
Postby Chanceux2 » Sun Apr 12, 2020 11:12 pm
TheDJ19 wrote: ↑Fri Apr 10, 2020 2:36 pm
DrMekar wrote: ↑Wed Apr 08, 2020 7:43 pm
mcnakahr wrote: ↑Wed Apr 08, 2020 6:54 pm
 Potential bug found in Beta 4 Patch 1!
What is it? The "If Layer is Empty" trigger doesn't always work.
Why is it important? For some people who use the classic event system, this issue makes it impossible for chained events to work that rely on this trigger.
What could be causing it? I've observed sometimes one or two npcs get despawned while off-screen. When this occurs the game still thinks they are on the layer when they have been despawned making them not anywhere. and forcing the "If Layer is Empty" trigger to always be false.
To reproduce: (Not 100% reproducible all the time but this happens 75% of the time)
Resize a section so it has to scroll to show the whole area.
Create an event to use, have it do anything you wish.
Create a layer to put enemy npcs on. (For this purpose it's called enemy)
Place npc(s) on layers enemy spacing them apart so some of the enemy npcs can move off screen.
Set each npc's "If Layer is Empty" trigger to trigger the event you created.
Play Test the level and kill the npc enemies, letting a few off screen for a couple seconds to despawn.
Note: The odd despawning seems to happen if an enemy npc is off-screen for 2 seconds or more and the "If Layer is Empty" trigger is ignored completely if the npc changes to another npc on death (ex. Variations of Chargin' Chucks, para-koopas, Rex, etc.)
(Edited for clarification.)
That Bug already was in 1.3. Used to happen alot with Snifits.
I do agree with that.
Anyways, 1.3 is the vanilla version of SMBX and was last updated 2011. (or 2014) It doesn't update anymore so bugs like that won't be fixed there
Hoeloe wrote: ↑Fri Apr 10, 2020 10:29 pm
mcnakahr wrote: ↑Fri Apr 10, 2020 5:46 pm
I doubt I'll be able to figure out how to use lua to workaround that bug in the event system so the project I was working on is dead. Hours/days wasted.
I mean, it's really not hard to learn, especially if you're willing to let someone walk you through it. This is a lack of effort on your part, nothing else.
I wanted to learn lua. On the internet, they say lua should be easy to learn
|
|
|
|
|
|
|
|
|
-
Cedur
- Link

- Posts: 7073
- Joined: Tue Jun 28, 2016 10:14 am
- Flair: I'm gone, for chess and minesweeper
- Pronouns: he/him
Postby Cedur » Mon Apr 13, 2020 4:57 am
Chanceux2 wrote:Anyways, 1.3 is the vanilla version of SMBX and was last updated 2011. (or 2014) It doesn't update anymore so bugs like that won't be fixed there 
SMBX2 is capable of fixing 1.3 bugs, like "mushroom in lava crashes game".
|
|
|
|
|
|
|
|
|
-
Wiimeiser
- Snifit

- Posts: 215
- Joined: Mon Jun 24, 2019 4:36 am
- Flair: What?
Postby Wiimeiser » Tue Apr 14, 2020 7:51 am
Cedur wrote: ↑Mon Apr 13, 2020 4:57 am
"mushroom in lava crashes game".
...How did something like that even slip by? How does that even work?
SPEEDIE wrote:
Maybe remove the .md file with the macOS tutorial.
Wine no longer works as of macOS 10.15 Catalina because Apple decided to drop support for 32-bit, which I am kind of okay with, because we need to transition to 64 bit.
Yeah, I did hear about that on Simtropolis...
|
|
|
|
|
|
|
|
|
-
Emral
- Cute Yoshi Egg

- Posts: 9887
- Joined: Mon Jan 20, 2014 12:58 pm
- Flair: Phoenix
Postby Emral » Tue Apr 14, 2020 8:09 am
Wiimeiser wrote: ↑Tue Apr 14, 2020 7:51 am
Cedur wrote: ↑Mon Apr 13, 2020 4:57 am
"mushroom in lava crashes game".
...How did something like that even slip by? How does that even work?
We also fixed veggie-in-lava crash, venus-fire-trap-emerging-from-pipe crash and most recently 'standing on sizeable that passes through ground will kill you' and 'spinjumping on enemies in front of player blocks kills you' glitches.
|
|
|
|
|
|
|
|
|
-
Chanceux2
- Volcano Lotus

- Posts: 576
- Joined: Mon Dec 16, 2019 3:39 pm
- Flair: People don't care about my threads! :(
-
Contact:
Postby Chanceux2 » Tue Apr 14, 2020 10:43 am
Enjl wrote: ↑Tue Apr 14, 2020 8:09 am
Wiimeiser wrote: ↑Tue Apr 14, 2020 7:51 am
Cedur wrote: ↑Mon Apr 13, 2020 4:57 am
"mushroom in lava crashes game".
...How did something like that even slip by? How does that even work?
We also fixed veggie-in-lava crash, venus-fire-trap-emerging-from-pipe crash and most recently 'standing on sizeable that passes through ground will kill you' and 'spinjumping on enemies in front of player blocks kills you' glitches.
Because of all these bug fixes switching to beta 4 is a need. Actually a want but its more useful and more organized than the legacy editor and Vanilla SMBX. They probably also fixed the pipe warping with Piranha Plant crashes game.
|
|
|
|
|
|
|
|
|
-
BabyWeegee
- Buster Beetle

- Posts: 94
- Joined: Wed Jan 22, 2014 9:08 pm
Postby BabyWeegee » Tue Apr 14, 2020 2:08 pm
I've encountered a bug where if I enter a pipe on the overworld, it immediately warps me back, like so:
Is this a known glitch? I haven't seen anyone talk about this. It's happened in multiple episodes and to my friend on a different download of the game.
|
|
|
|
|
|
|
|
|
-
rednaxela
- Koopa

- Posts: 15
- Joined: Sat Dec 05, 2015 7:06 pm
Postby rednaxela » Tue Apr 14, 2020 2:21 pm
BabyWeegee wrote: ↑Tue Apr 14, 2020 2:08 pm
I've encountered a bug where if I enter a pipe on the overworld, it immediately warps me back, like so:
Is this a known glitch? I haven't seen anyone talk about this. It's happened in multiple episodes and to my friend on a different download of the game.
I saw this reported elsewhere some time ago and got it fixed for the next patch.
In short, that bug that only affects controllers not keyboard, caused by an accidental 1-frame delay of controller input. In SMBX (even 1.3) holding the button will cause going back and forth between pipes over and over, but the accidental 1-frame controller input delay in beta 4 (which is an extended very long frame with the teleport delay) causes it to appear held and causes teleportation back. In any case, this should be fixed in the upcoming patch that should be pretty soon hopefully. In the meantime, a workaround is to use keyboard for triggering the overworld pipe.
|
|
|
|
|
|
|
|
|
-
BabyWeegee
- Buster Beetle

- Posts: 94
- Joined: Wed Jan 22, 2014 9:08 pm
Postby BabyWeegee » Tue Apr 14, 2020 4:16 pm
rednaxela wrote: ↑Tue Apr 14, 2020 2:21 pm
BabyWeegee wrote: ↑Tue Apr 14, 2020 2:08 pm
I've encountered a bug where if I enter a pipe on the overworld, it immediately warps me back, like so:
Is this a known glitch? I haven't seen anyone talk about this. It's happened in multiple episodes and to my friend on a different download of the game.
I saw this reported elsewhere some time ago and got it fixed for the next patch.
In short, that bug that only affects controllers not keyboard, caused by an accidental 1-frame delay of controller input. In SMBX (even 1.3) holding the button will cause going back and forth between pipes over and over, but the accidental 1-frame controller input delay in beta 4 (which is an extended very long frame with the teleport delay) causes it to appear held and causes teleportation back. In any case, this should be fixed in the upcoming patch that should be pretty soon hopefully. In the meantime, a workaround is to use keyboard for triggering the overworld pipe.
Strange, I never experienced it in 1.3. Thanks for your help!
|
|
|
|
|
Return to “LunaLua”
Users browsing this forum: No registered users and 2 guests
|