(shouting)

Help Thread

If you lost something come look for it here
FFR
Posts: 264
Joined: 9 years ago
Pronouns: he/him/his

Re: Help Thread

Post by FFR »

I, uh... I just wanted y'all to say stuff like "wings!" or "rocket boots!", not describe exactly what I'm doing with my level :roll:
User avatar
Pikabread
we're gonna talk about e
Posts: 1212
Joined: 9 years ago
First name: lily
Pronouns: she/her/xe/xem
Location: Oh You Know.

Re: Help Thread

Post by Pikabread »

insert clever apology here
avatar by unaniem
Image
KingTwelveSixteen
? Title Title Title Title ?
Posts: 30
Joined: 14 years ago
Location: USA

Re: Help Thread

Post by KingTwelveSixteen »

FFR wrote:I, uh... I just wanted y'all to say stuff like "wings!" or "rocket boots!", not describe exactly what I'm doing with my level :roll:
Doing that thing where you create little platforms in front of you that you step on to move forwards through the air then they fade away as you move forwards.

repeatedly reversing then reasserting gravity.

Giant catapult.

Air-based hovercar shaped like a flying saucer.

Falling and then missing the ground.

Hot air balloon.

Zeppelin.

Occasionally creating explosions below you.

Use an infinite double-jump cheat.

Swing too high on a swingset before jumping off, like in that one dream you had.

Astral projection.

Ride the wind.

Hang-glider.

Magic~

Run off the edge of a cliff and then not look down, making it so that you never fall.


Is that enough ways?
FFR
Posts: 264
Joined: 9 years ago
Pronouns: he/him/his

Re: Help Thread

Post by FFR »

gave me a few ideas, thanks!
User avatar
Reecer7
Crack is fun and nice and a good time!
Posts: 449
Joined: 8 years ago
Pronouns: he/him/his
https://cro-iba.talkhaus.com/

Re: Help Thread

Post by Reecer7 »

Image
Are one of you SMBX tech wizards able to tell me what the heck is wrong/might be wrong with my perfectly valid .mp3 here that is making the game unable to load it? It's only 1.65MB and I've had music with a higher size work, so I dunno.

edit: I dunno why I didn't want to post the actual details of the mp3 in question, so here it is.
Image
call me reecer6, not reecer7, please! gotta maintain that same internet brand. actually i'm cro-iba now, it's cooler
Image
Image
strange bluebird website (check it out for my art!)
User avatar
Dragon Fogel
Master of Pointlessness
Posts: 1415
Joined: 10 years ago

Re: Help Thread

Post by Dragon Fogel »

Did you move it to a different folder at some point after setting the level to play it? If so, you need to change the file path.

If that's not it, I don't know what the issue is.
Image
Click that banner if you like reading words.
Image
Make levels from unused MAGL X names!
User avatar
Reecer7
Crack is fun and nice and a good time!
Posts: 449
Joined: 8 years ago
Pronouns: he/him/his
https://cro-iba.talkhaus.com/

Re: Help Thread

Post by Reecer7 »

Nope, it's still in the same folder.
I also just tried editing the mp3 a bit by adding another loop to it and it STILL will not accept it.
call me reecer6, not reecer7, please! gotta maintain that same internet brand. actually i'm cro-iba now, it's cooler
Image
Image
strange bluebird website (check it out for my art!)
Shinoda
Posts: 163
Joined: 11 years ago

Re: Help Thread

Post by Shinoda »

ANyone can help or explain why my background does this in SMBX
Image
But looks fine in the PGE editor?
Image
Horikawa Otane wrote:Butt-lamps are -30 points, so =p
ImageImageImage
User avatar
Hoeloe
A2XT person
Posts: 1016
Joined: 12 years ago
Pronouns: she/her
Location: Spaaace

Re: Help Thread

Post by Hoeloe »

Shinoda wrote:ANyone can help or explain why my background does this in SMBX
Image
But looks fine in the PGE editor?
Image
That's usually something that happens if your section is too large. I don't know the details, but there isn't really a way to fix it as far as I'm aware (and my level kind of relies on it anyway).
Image
Image
Image
Image
Image
Shinoda
Posts: 163
Joined: 11 years ago

Re: Help Thread

Post by Shinoda »

Hoeloe wrote: That's usually something that happens if your section is too large. I don't know the details, but there isn't really a way to fix it as far as I'm aware (and my level kind of relies on it anyway).
One screen. Can't be because it's too large.
Horikawa Otane wrote:Butt-lamps are -30 points, so =p
ImageImageImage
S1eth
Posts: 291
Joined: 9 years ago

Re: Help Thread

Post by S1eth »

Try renaming your custom background so you're reaplacing a different background image until it works. Or you could make borders around your background image until it fits the section, then adjust until it is in the right spot.
Image
User avatar
Hoeloe
A2XT person
Posts: 1016
Joined: 12 years ago
Pronouns: she/her
Location: Spaaace

Re: Help Thread

Post by Hoeloe »

Shinoda wrote:
Hoeloe wrote: That's usually something that happens if your section is too large. I don't know the details, but there isn't really a way to fix it as far as I'm aware (and my level kind of relies on it anyway).
One screen. Can't be because it's too large.
Probably to do with the background resolution then. SMBX can be a bit finicky about that.
Image
Image
Image
Image
Image
User avatar
Reecer7
Crack is fun and nice and a good time!
Posts: 449
Joined: 8 years ago
Pronouns: he/him/his
https://cro-iba.talkhaus.com/

Re: Help Thread

Post by Reecer7 »

Oh, I guess I solved my problem. It's just that for whatever reason my Games folder specifically has some really weird permission settings that I haven't been able to get working properly - it can use songs just fine when I moved it to, for example, Documents. It's not a SMBX issue or anything. Sorry! :/
call me reecer6, not reecer7, please! gotta maintain that same internet brand. actually i'm cro-iba now, it's cooler
Image
Image
strange bluebird website (check it out for my art!)
Shinoda
Posts: 163
Joined: 11 years ago

Re: Help Thread

Post by Shinoda »

Hoeloe wrote:
Shinoda wrote:
Hoeloe wrote: That's usually something that happens if your section is too large. I don't know the details, but there isn't really a way to fix it as far as I'm aware (and my level kind of relies on it anyway).
One screen. Can't be because it's too large.
Probably to do with the background resolution then. SMBX can be a bit finicky about that.
I made sure the image had the same resolution as the background it replaces. Are there any GIF settings that I need to make sure to select or something? Photoshop gives me so many GIF options.

Edit: Fixed!... somehow.
Horikawa Otane wrote:Butt-lamps are -30 points, so =p
ImageImageImage
Shinoda
Posts: 163
Joined: 11 years ago

Re: Help Thread

Post by Shinoda »

More noob questions.. or actually question.

I'm trying to get a custom sound effect to play when a Message box is hit. I tried going through the events and picking a sound from the list and saving the custom sound effect in the /levelname/ folder (like custom graohics and such, the file in question is spring.ogg) but it doesn't seem to work with sounds. Any tips on how I could make what I need work?
Horikawa Otane wrote:Butt-lamps are -30 points, so =p
ImageImageImage
User avatar
snoruntpyro
cutest girl 2023
Posts: 884
Joined: 9 years ago
Pronouns: she/her
Contact:

Re: Help Thread

Post by snoruntpyro »

You need to use Lua to play custom sound effects. These two pages will help you with that.
Image
Image
Image
Image
Image
Shinoda
Posts: 163
Joined: 11 years ago

Re: Help Thread

Post by Shinoda »

Pyro wrote:You need to use Lua to play custom sound effects. These two pages will help you with that.
So I gotta learn LUA... I've been dreading this day.

Edit: *checks the page* Eeeerrrmmm... I guess I need a LUA 101 class or something?

---

Edit 2: Okay, I think I got everything down but it doesn't seem to work. Here's what i've done.

Created the blank lunalua.lua in my level folder (/levelname/)
Opened it up with Notepad++
In PGE Editor, made it so when I hit the block, event "PHOtt" starts (As I would with any normal SMBX event)
Put in the following lines in lunalua.lua so my whole file looks like this

Code: Select all

function onEvent(string PHOtt)
    Audio.playSFX("Parliament Hill.ogg");
end
"Parliament Hill.ogg" being the sound file in my level folder.

And nothing. Am I missing some important thing that should be obvious?

---

Edit 3: Figured out the file name should have been "lunadll.lua" and not "lunalua.lua" but now I get this error when I start the level

Image

That's why I dreaded this day.
Horikawa Otane wrote:Butt-lamps are -30 points, so =p
ImageImageImage
User avatar
Alice
Posts: 2367
Joined: 12 years ago
Pronouns: Girl person
Location: Wonderland

Re: Help Thread

Post by Alice »

Shinoda wrote:

Code: Select all

function onEvent(string PHOtt)
    Audio.playSFX("Parliament Hill.ogg");
end
I'm not at all familiar with Lua but after looking up how functions are formatted in the language you might try removing the semicolon at the end of your Audio.playSFX line. All the examples I'm finding for lua functions have nothing on the end of each line.
User avatar
Rednaxela
Maker of Shenanigans
Posts: 897
Joined: 10 years ago
Pronouns: they/them
https://rednaxela.talkhaus.com

Re: Help Thread

Post by Rednaxela »

Shinoda wrote:In PGE Editor, made it so when I hit the block, event "PHOtt" starts (As I would with any normal SMBX event)
Put in the following lines in lunalua.lua so my whole file looks like this

Code: Select all

function onEvent(string PHOtt)
    Audio.playSFX("Parliament Hill.ogg");
end
The correct code for what you want would be

Code: Select all

function onEvent(eventName)
    if (eventName == "PHOtt") then
        Audio.playSFX("Parliament Hill.ogg")
    end
end
This is a mistake I've seen people make when first learning in here countless times it seems.

When you declare a function, what you put in brackets is the variable name that an input to the function will be put into.

For the onEvent function, the value that input to it (called a function argument) is the event's name. As such, you should name the variable something like "eventName" usually, though it can be anything you want.

After putting the event name into a variable by declaring the function properly, you then need to check if it's the event you want to trigger on, so use an if statement to compare eventName to the one you're looking for.

Alice wrote:I'm not at all familiar with Lua but after looking up how functions are formatted in the language you might try removing the semicolon at the end of your Audio.playSFX line. All the examples I'm finding for lua functions have nothing on the end of each line.
In Lua, you can use a semicolon to separate multiple statements on one line. You can also put them on the end of each line if you want your code to look more like C/C++ code, but it's sort of pointless, as the end of a line will end the statement unless you're in the middle of braces or similar, but it's harmless. The semicolon wouldn't cause problems.
User avatar
Alice
Posts: 2367
Joined: 12 years ago
Pronouns: Girl person
Location: Wonderland

Re: Help Thread

Post by Alice »

Rednaxela wrote:
Alice wrote:I'm not at all familiar with Lua but after looking up how functions are formatted in the language you might try removing the semicolon at the end of your Audio.playSFX line. All the examples I'm finding for lua functions have nothing on the end of each line.
In Lua, you can use a semicolon to separate multiple statements on one line. You can also put them on the end of each line if you want your code to look more like C/C++ code, but it's sort of pointless, as the end of a line will end the statement unless you're in the middle of braces or similar, but it's harmless. The semicolon wouldn't cause problems.
Ah, alright. I'm most familiar with php where the semicolon on each line is a requirement and will in fact utterly break your code if you forget it. Also not used to the function format not being inside curly brackets either which is a bit confusing to me. Also since I'm not familiar with the language I managed to completely overlook the actual problem in his code anyways when it would have been obvious if it was formatted like I'm used to, lol.
User avatar
Hoeloe
A2XT person
Posts: 1016
Joined: 12 years ago
Pronouns: she/her
Location: Spaaace

Re: Help Thread

Post by Hoeloe »

Rednaxela wrote: This is a mistake I've seen people make when first learning in here countless times it seems.
Also worth pointing out that you don't need to add the type of an argument to a function. The error actually appeared because you wrote "string PHOtt" (string is the type of the argument) instead of just "PHOtt". Languages like C and Java require that you state the type of any variables you declare, but Lua doesn't. Had you not put "string" in there, then the code would still not work (because of the problem that Rednaxella stated), but it also wouldn't throw an error in your face.
Image
Image
Image
Image
Image
Shinoda
Posts: 163
Joined: 11 years ago

Re: Help Thread

Post by Shinoda »

Alice wrote:
Rednaxela wrote:
Hoeloe wrote:
Success! Now to get the volume of my OGG right and repeat that for all the other "Hills of Canada" in the hopes of educating all of you! Thanks!
Horikawa Otane wrote:Butt-lamps are -30 points, so =p
ImageImageImage
User avatar
KayhemMaus
I keep breaking my face on SMBX
Posts: 325
Joined: 11 years ago
First name: KM
Pronouns: they/them/their
Location: England

Re: Help Thread

Post by KayhemMaus »

So, I'm trying to effectively make a fight with Big Boo with scrolling grab blocks that go up the screen so there's a sensation of falling.

I got scroll to work fine earlier in the level but these blocks aren't budging at all and I'm not sure what I'm doing wrong. They're all in the correct layer for scroll, I tested all directions, but nada, not moving.
nyoro~n n~yoron

I love it
User avatar
Mata Hari
Posts: 2522
Joined: 14 years ago
https://matahari.talkhaus.com/

Re: Help Thread

Post by Mata Hari »

Does playtesting in the PGE editor... actually work?
User avatar
Dragon Fogel
Master of Pointlessness
Posts: 1415
Joined: 10 years ago

Re: Help Thread

Post by Dragon Fogel »

Not yet. Right now it's just an editor but the actual game engine is very, very incomplete so you have to test in regular SMBX.

If you have both open and make changes in PGE, make sure you don't save before testing in SMBX. Otherwise it'll just save the version that's open in SMBX, without the changes you made. If you don't save, though, then it loads the .lvl file that's been modified with changes from PGE.

Yeah, this is kind of silly, hopefully one day PGE will be at a point where you can just test in it. But that day has not yet arrived.
Image
Click that banner if you like reading words.
Image
Make levels from unused MAGL X names!
Post Reply