MaGL X2 Discussion - MaGL X2 Lands TOMORROW. GET. HYPE.
- Wolfolotl
- cryptid
- Posts: 726
- Joined: 8 years ago
- First name: ovid
- Pronouns: xe/xem/xyr
- Location: big long pointy teeth
Re: MaGL X2 Discussion. No raocows! NOT the sign up thread!
thinking of doing something other than what I already have with music. anyone know some place with nice ambient music that is also free maybe?
- Willhart
- Stalker, Doxxer, and Sexual Harasser
- Banned
- Posts: 2434
- Joined: 12 years ago
- Location: Finland
Re: MaGL X2 Discussion. No raocows! NOT the sign up thread!
Right clicking on the warp should open "Warps and Doors" window. You can change the warp type there. You can place an instant warp to teleport the player to somewhere else when they touch it. Each warp is one way and needs an entrance and exit. You can set them from the "Main" part of the window.Klaty wrote:And how do I do this? (in Wohl's editor, of course)Hoeloe wrote: You can use "instant" warps for access via a pit. They will warp you when the player enters the space.
You can probably check if the player speed is negative, and in that case set it to 0 or move them to other direction. I'm not sure on how you can disable key commands.Klaty wrote: That's not what I meant. The whole section fits in the whole screen, so it'd be useless even if I did somehow mean that. I meant that as in pressing the Left Arrow Key (or wherever Left is assigned to) doesn't make Mario/Luigi etc. move left. I know there's Level Properties where you can change Physics and disable character movement, but those are grayed out for some reason. (means that clicking them doesn't do anything) What do I do?
- ztarwuff
- What the heck is a flair and why am I being asked to write one for my profile?
- Posts: 550
- Joined: 9 years ago
- Location: Within 2 miles of the Imperial Crypt of Napoleon III
Re: MaGL X2 Discussion. No raocows! NOT the sign up thread!
I believe so. However, what you're asking for is something I don't know how to do. What I normally do is go to one of the below tutorials and search around for code.Klaty wrote:Exactly.ztarwuff wrote:Hoeloe wrote: No, I think Klaty meant not being able to move left at all. Not entirely sure how to do that. Maybe use Luna to disable left movement?
Wait, can you even combine Luna and PGE? And if so, then how? SMBX has so few tutorials...
LunaDLL
- LunaDLL Tutorial
LunaDLL Command Reference
LunaDLL Help Thread (also check the LunaLua Help Thread below)
Below is some code I managed to cobble together from reading the first tutorial.
Code: Select all
#0
// Explanatory note - On pressing up, copy event 1000
OnInput,0,1,1,1000,0,0
#1000
Kill,0,0,0,0,1,0
Code: Select all
OnInput,0,2,1,1,1000,0,0The best thing to do would probably be to use the MemAssign command, but I cannot help you there.
- Klaty
- GUESS WHO
- Posts: 20
- Joined: 8 years ago
- Pronouns: male/neutral
- Location: Finland (stalker)
- Contact:
Re: MaGL X2 Discussion. No raocows! NOT the sign up thread!
There's a button in the toolbar, so no need to rightclick anything. Also, does this mean that if I want a door to lead the player back to where the player came from, I just put a warp there connecting back there? That would make a lot more sense.Willhart wrote: Right click on the warp should open "Warps and Doors" window. You can change the warp type there. You can place an instant warp to teleport the player to somewhere else when they touch it. Each warp is one way and needs an entrance and exit. You can set them from the "Main" part of the window.
Wow, it's such a simple thing (and I even recall seeing it in an episode that raocow might've or might not've played) but so hard to execute. Well, I hope someone finds a way. I have a feeling I have to do something with events...Willhart wrote: You can probably check if the player speed is negative, and in that case set it to 0 or move them to other direction. I'm not sure on how you can disable key commands.
That annoying guy who always misses everything important and doesn't know what's going on most of the time. (also occasionally freaks out about minor things)
- Klaty
- GUESS WHO
- Posts: 20
- Joined: 8 years ago
- Pronouns: male/neutral
- Location: Finland (stalker)
- Contact:
Re: MaGL X2 Discussion. No raocows! NOT the sign up thread!
Alright, I see. Though, where can I get LunaDLL? Or do I need to use LunaLua? (kind of embarrassing to ask that, but basically yeah)ztarwuff wrote: stuff
That annoying guy who always misses everything important and doesn't know what's going on most of the time. (also occasionally freaks out about minor things)
- TaviTurnip
- Reach for the top
- Abministrator
- Posts: 1077
- Joined: 12 years ago
- First name: Rena
- Location: Winter
Re: MaGL X2 Discussion. No raocows! NOT the sign up thread!
I think I get the idea of it, but I don't know the first thing about activating or utilizing LunaDLL :x Let's say in this case that Section 2 is playing a custom song, and I want an event triggered midway into the room to start playing Section 3's custom song. How would I get the event to do this?arabsalmon wrote:I believe that you can only have one custom song per section. You can use LunaDll to change the music by setting the music in an unused section to what you want to change it to, then using
For example, if you already have Custom Music 1 playing in Section 4, you can set the music in Section 8 or something (provided you aren't using the section for anything else) to Custom Music 2 and useCode: Select all
PlayMusic,-,SECTION,-,-,DELAY,-
Code: Select all
PlayMusic,0,8,0,0,1,0
Unless I'm being dumb, the help links in viewtopic.php?f=36&t=14271 this thread don't seem to work, so I can't really suss LunaDLL out myself other than the "create a text file" part, which is where I assume the codes would go.
I regularly stream on Twitch! with other members of the talkhaus. Come watch Monday, Tuesday and Friday at 2PM for blind playthroughs and Pokémon and Touhou and stuff. Come hang out with us!
- Willhart
- Stalker, Doxxer, and Sexual Harasser
- Banned
- Posts: 2434
- Joined: 12 years ago
- Location: Finland
Re: MaGL X2 Discussion. No raocows! NOT the sign up thread!
You can probably use that to trigger a smbx event that makes the player stand still for a moment.ztarwuff wrote:Code: Select all
#0 // Explanatory note - On pressing up, copy event 1000 OnInput,0,1,1,1000,0,0 #1000 Kill,0,0,0,0,1,0
Code: Select all
//section 3
#3
// Explanatory note - On pressing up, trigger event 1000
OnInput,0,1,1,1000,0,0
#1000
//trigger smbx event "Stop"
TriggerSMBXEvent,0,0,0,0,1,Stop
#END
Edit: Here is the Command reference and the tutorial for lunadll.
http://engine.wohlnet.ru/docs/Collected ... torial.txt
http://engine.wohlnet.ru/docs/Collected ... unaref.txt
If you want to use lua you should probably ask here for guidance:
viewtopic.php?f=36&t=14980
- ztarwuff
- What the heck is a flair and why am I being asked to write one for my profile?
- Posts: 550
- Joined: 9 years ago
- Location: Within 2 miles of the Imperial Crypt of Napoleon III
Re: MaGL X2 Discussion. No raocows! NOT the sign up thread!
You don't need to get anything so long as you're using the right devkit:Klaty wrote:Alright, I see. Though, where can I get LunaDLL? Or do I need to use LunaLua? (kind of embarrassing to ask that, but basically yeah)ztarwuff wrote: stuff
MaGL X2 Devkit Download If you're using the latest devkit, all you need to do is create a text file called Lunadll in your level folder and paste the relevant code. Remember, your code should end with #END, so my example was actually very bad.
Re: MaGL X2 Discussion. No raocows! NOT the sign up thread!
This is one of the many reasons I urge people to use LunaLua rather than LunaDLL. LunaDLL is outdated, and difficult to learn and use, while LunaLua is a lot more readable. In this case, all the keys are stored in named constants, rather than values, so you can do something like this:ztarwuff wrote: Unfortunatley, I can't quite remember what number represents left in the OnInput command.
Code: Select all
function onKeyDown(keycode)
if(keycode == KEY_LEFT) then
--Do something
end
endIt's worth mentioning that we currently don't know a way of restricting player input in any satisfactory way. We can restrict all player input using SMBX events (which includes interactivity with cinematX), but this is rarely what people want to do. This goes for SMBX itself and for LunaDLL and LunaLua. However, there are a few things you can do to achieve a similar effect. One suggestion that has been made in this thread is checking the player's speed, and setting it to 0 if the player is moving left. Fortunately, using LunaLua, this is quite easy to do, and is probably good enough for your purposes:
Code: Select all
function onLoop()
if(player.speedX < 0) then --player is moving left
player.speedX = 0; --not any more
end
end
Last edited by Hoeloe 8 years ago, edited 1 time in total.





- Klaty
- GUESS WHO
- Posts: 20
- Joined: 8 years ago
- Pronouns: male/neutral
- Location: Finland (stalker)
- Contact:
Re: MaGL X2 Discussion. No raocows! NOT the sign up thread!
I won't use the Devkit. I had major trouble with that when I started and Horikawa suggested me to not use it, since the PGE engine is good enough.ztarwuff wrote: stuff that doesn't make me feel good
Though I found a simplish tutorial at Wohl's site, and I think killing the player when pressing Left is good enough. (should probably put a NPC to tell that though) I was thinking of the exit being to the left of the player, but since you can't move to the left, you'd have to go into another door that spawns you on a slope that carries you to the left, just in front of the door.
Let's talk about this later, mm'kay? It's almost 11PM here and I'm too tired and can't understand what y'all are talking about.
That annoying guy who always misses everything important and doesn't know what's going on most of the time. (also occasionally freaks out about minor things)
Re: MaGL X2 Discussion. No raocows! NOT the sign up thread!
If you need to use Luna, then you will have to use the devkit, or at least get the LunaLua patch from the Lua thread. What were the issues you were experiencing with it?Klaty wrote:I won't use the Devkit. I had major trouble with that when I started and Horikawa suggested me to not use it, since the PGE engine is good enough.ztarwuff wrote: stuff that doesn't make me feel good





Re: MaGL X2 Discussion. No raocows! NOT the sign up thread!
If you use the devkit that Horikawa has provided, all you have to do is create a file called "lunadll.txt" in your level folder.RenaTurnip wrote: I think I get the idea of it, but I don't know the first thing about activating or utilizing LunaDLLLet's say in this case that Section 2 is playing a custom song, and I want an event triggered midway into the room to start playing Section 3's custom song. How would I get the event to do this?
Unless I'm being dumb, the help links in viewtopic.php?f=36&t=14271 this thread don't seem to work, so I can't really suss LunaDLL out myself other than the "create a text file" part, which is where I assume the codes would go.
A common method of triggering code in LunaDll is making the SMB axe invisible and placing it where the player will run into it. Once they do, the NPC dies, which you can use to your advantage by typing in
Code: Select all
// Run this code in section 2
#2
// If the axe NPC does not exist anywhere in the level, execute custom command 1000
IfNPC,178,2,0,1000,0,once
// Custom command 1000
#1000
// Play music from section 3
PlayMusic,0,3,0,0,1,0
1) Check everywhere in the level for an axe (NPC ID 178). If it can't be found (this is what the 2 means in the command) execute command in #1000. The "once" means this will be triggered one time, then delete itself.
2) When #1000 is executed, play the music that is contained in Section 3 after 1 frame (basically immediately). Note that this command is triggered in Section 2; the result is that the music will change from Section 2's music to Section 3's
This only works if you have only one axe in the entire level, though. If that isn't convenient, there is a command called "TriggerZone" that calls a custom command when you enter a rectangle that you define. You can see how to use it here: http://engine.wohlnet.ru/docs/Collected ... unaref.txt. Just replace the "IfNPC" command with it.
- Willhart
- Stalker, Doxxer, and Sexual Harasser
- Banned
- Posts: 2434
- Joined: 12 years ago
- Location: Finland
Re: MaGL X2 Discussion. No raocows! NOT the sign up thread!
Without lua or lunadll, you can probably still extend the section and use the one-way screen scrolling to prevent access to anything on the left. You will still need the future version of the devkit, if you want to try the complete version of the game yourself later. Good thing that raocow will play it too.Klaty wrote:Let's talk about this later, mm'kay? It's almost 11PM here and I'm too tired and can't understand what y'all are talking about.
Edit: or you can use one way, jump through blocks like clouds or bridges to prevent going back to previous door. The default smbx does not really have other solutions to my knowledge.
Last edited by Willhart 8 years ago, edited 1 time in total.
Re: MaGL X2 Discussion. No raocows! NOT the sign up thread!
So, umm, UHHH, starting my level today.
Poor rejected level names :'(
Oh yeah, one of my songs doesn't start immediately; it begins after a few seconds of silence. Is it a glitch? Something I did wrong, maybe?
Poor rejected level names :'(
Oh yeah, one of my songs doesn't start immediately; it begins after a few seconds of silence. Is it a glitch? Something I did wrong, maybe?
Yo'
Re: MaGL X2 Discussion. No raocows! NOT the sign up thread!
I really, really, really recommend not going into LunaDLL. You're making things hard for yourself if you do. Use LunaLua instead. The code is more readable, easier to manage, more powerful, and generally better in just about every conceivable way.arabsalmon wrote: If you use the devkit that Horikawa has provided, all you have to do is create a file called "lunadll.txt" in your level folder.
Here is the Lua code that should do exactly the same as the LunaDLL code posted before:
Code: Select all
--execute this code when section 2 is loaded
function onLoadSection1()
--get a list of all axes in section 2
local axes = findnpcs(178,1);
--if there are no axes in this section
if(axes == nil or table.getn(axes) == 0) then
--Play music from section 3 (note that in LunaLua, sections are from 0-20, not 1-21)
PlayMusic(2);
end
endI really encourage people to use LunaLua, especially if they're just learning, and to not encourage newcomers to use Autocode over it. Kil has admitted that Autocode was a language he designed in half an hour to make things easy for himself, and was designed to be more like the NPC config files. It wasn't really designed from the user end, but to make the compiler easier to code. Seriously, work with Lua some and you'll start to realise what I mean, and please, if you're new, don't bother learning LunaDLL's Autocode, just jump straight into Lua. Autocode is programming in hard mode.
Last edited by Hoeloe 8 years ago, edited 1 time in total.





- Sorel
- In the shadows
- Posts: 703
- Joined: 9 years ago
- First name: Alexander
- Pronouns: he/him/his
- Location: some place
Re: MaGL X2 Discussion. No raocows! NOT the sign up thread!
Sometimes, when the used MP3 file takes up a lot of space (with that I mean, very much. High end audio quality + pretty long length usually cause this.) the player needs some time to load the MP3 file. Other than that, no idea.
Also Hoeloe, while I do understand that Lua is way easier to use, there is no need to shove it into peoples faces when they rather wanna use LunaDLL. Leave it up to them to decide and see what fits their preferences better.
Also Hoeloe, while I do understand that Lua is way easier to use, there is no need to shove it into peoples faces when they rather wanna use LunaDLL. Leave it up to them to decide and see what fits their preferences better.
Former active member, yearly lurker now.
Re: MaGL X2 Discussion. No raocows! NOT the sign up thread!
It really infuriates me, that's all. I can see why those who are familiar with it would want to keep using it, but encouraging new people to do the same when there is a better option is what gets to me. I'm mostly concerned that we'll miss out on some great stuff because Autocode is way harder to get to grips with, and a lot of people will shy away from doing anything interesting with it. I know I did, and I program in a variety of different languages for a living.FluffiMasta wrote: Also Hoeloe, while I do understand that Lua is way easier to use, there is no need to shove it into peoples faces when they rather wanna use LunaDLL. Leave it up to them to decide and see what fits their preferences better.
If it were something that were about preference, then I wouldn't be pushing like this, I just want to make sure people see that LunaLua is actually objectively better, from a usability and language design standpoint. The only reason you'd really want to keep using Autocode now Lua exists is because if you're already familiar with Autocode, it will take some effort to make the switch, and I get that not everyone is willing to do that when they already have the tools at their disposal.
Last edited by Hoeloe 8 years ago, edited 1 time in total.





Re: MaGL X2 Discussion. No raocows! NOT the sign up thread!
I do agree with you, LunaLua is generally better. I just figured that I would just give the shortcut that autocode provided assuming that changing music was the only thing you were trying to do.Hoeloe wrote: I really, really, really recommend not going into LunaDLL. You're making things hard for yourself if you do. Use LunaLua instead. The code is more readable, easier to manage, more powerful, and generally better in just about every conceivable way.
Here is the Lua code that should do exactly the same as the LunaDLL code posted before:
P.S. -- is the comment marker in Lua, so anything after a -- is not part of the code, but a comment telling you what's going on.Code: Select all
--execute this code when section 2 is loaded function onLoadSection1() --get a list of all axes in section 2 local axes = findnpcs(178,1); --if there are no axes in this section if(axes == nil or table.getn(axes) == 0) then --Play music from section 3 (note that in LunaLua, sections are from 0-20, not 1-21) PlayMusic(2); end end
I really encourage people to use LunaLua, especially if they're just learning, and to not encourage newcomers to use Autocode over it. Kil has admitted that Autocode was a language he designed in half an hour to make things easy for himself, and was designed to be more like the NPC config files. It wasn't really designed from the user end, but to make the compiler easier to code. Seriously, work with Lua some and you'll start to realise what I mean, and please, if you're new, don't bother learning LunaDLL's Autocode, just jump straight into Lua. Autocode is programming in hard mode.
- Willhart
- Stalker, Doxxer, and Sexual Harasser
- Banned
- Posts: 2434
- Joined: 12 years ago
- Location: Finland
Re: MaGL X2 Discussion. No raocows! NOT the sign up thread!
You should really work on better and more complete tutorials then. Navigating a wiki is hell.
Re: MaGL X2 Discussion. No raocows! NOT the sign up thread!
That's a good idea, I may do that when I get a bit of time.Willhart wrote:You should really work on better and more complete tutorials then. Navigating a wiki is hell.
The Wiki is a bit painful, but still easier to navigate than a single text file with a huge list of information.





Re: MaGL X2 Discussion. No raocows! NOT the sign up thread!
Even if autocode somewhat restricts what you can do, I think it's better if you just want to do something quick and dirty rather than have to learn the ins and outs of Lua just for one task. I switched to Lua when I figured I wanted to add more complex stuff.
Re: MaGL X2 Discussion. No raocows! NOT the sign up thread!
I think you need to know about the same level for either. If you're doing something simple, it's a copy and paste job for either, the only problem is, as Willhart has pointed out, there's nothing to copy and paste from with Lua. I'm working on rectifying that now.arabsalmon wrote:Even if autocode somewhat restricts what you can do, I think it's better if you just want to do something quick and dirty rather than have to learn the ins and outs of Lua just for one task. I switched to Lua when I figured I wanted to add more complex stuff.





- Sorel
- In the shadows
- Posts: 703
- Joined: 9 years ago
- First name: Alexander
- Pronouns: he/him/his
- Location: some place
Re: MaGL X2 Discussion. No raocows! NOT the sign up thread!
Well I can see from where youre coming at, but think about this scenario:
You're an IT teacher and you just got a new group of pupils who want to learn programming in general. You got plenty of different languages to choose from, but the 2 best ones are:
A language that is pretty easy to handle, but offers less functions and whatnot.
and
A language that is not as easy for beginners, but has a lot more capability.
What would you choose?
What my teacher did was to choose the beginner language, which is just inconvenient at best (you need to do so many pointless things, like doing a semicolon after every line except for functions, or using curly parantheses for every method, function and If-else structure. It's frustrating as hell sometimes when you forget to do one.) And that would be kinda like our case here: Looking at LunaDLL tutorials, it's actually quite easy to do when you understand what to do exactly, while in Lua, everything requires a bit more thinking instead of copy-pasta everywhere and can take a few more lines of code, but has a lot more capability.
It really depends on what you're used to, in my case it was Lua, but for some it's LunaDLL.
You're an IT teacher and you just got a new group of pupils who want to learn programming in general. You got plenty of different languages to choose from, but the 2 best ones are:
A language that is pretty easy to handle, but offers less functions and whatnot.
and
A language that is not as easy for beginners, but has a lot more capability.
What would you choose?
What my teacher did was to choose the beginner language, which is just inconvenient at best (you need to do so many pointless things, like doing a semicolon after every line except for functions, or using curly parantheses for every method, function and If-else structure. It's frustrating as hell sometimes when you forget to do one.) And that would be kinda like our case here: Looking at LunaDLL tutorials, it's actually quite easy to do when you understand what to do exactly, while in Lua, everything requires a bit more thinking instead of copy-pasta everywhere and can take a few more lines of code, but has a lot more capability.
It really depends on what you're used to, in my case it was Lua, but for some it's LunaDLL.
Former active member, yearly lurker now.
Re: MaGL X2 Discussion. No raocows! NOT the sign up thread!
But that's exactly what I'm trying to get people's heads around! LunaDLL is NOT EASY TO HANDLE. It's painful, awkward, poorly designed, and just not helpful to the user! Sure, if you want to copy and paste something, it works just fine, but so does Lua.FluffiMasta wrote: A language that is pretty easy to handle, but offers less functions and whatnot.
I'm trying to get people to understand that both Autocode and Lua are programming languages, in the same sense, but Autocode is programming in a way that was never designed for humans.





- Willhart
- Stalker, Doxxer, and Sexual Harasser
- Banned
- Posts: 2434
- Joined: 12 years ago
- Location: Finland
Re: MaGL X2 Discussion. No raocows! NOT the sign up thread!
Giving a quick solution is way better than a good one, now that there is only a week to work on a level soon. You have to play with the ideas when they are fresh. I may have spent two days on getting the music fading and some CinematX to work with lua, and it did not really do good for the work flow.Hoeloe wrote:I think you need to know about the same level for either. If you're doing something simple, it's a copy and paste job for either, the only problem is, as Willhart has pointed out, there's nothing to copy and paste from with Lua. I'm working on rectifying that now.arabsalmon wrote:Even if autocode somewhat restricts what you can do, I think it's better if you just want to do something quick and dirty rather than have to learn the ins and outs of Lua just for one task. I switched to Lua when I figured I wanted to add more complex stuff.
Here are links to some websites that offer free music.Wolfolotl wrote:thinking of doing something other than what I already have with music. anyone know some place with nice ambient music that is also free maybe?
http://videogamecaster.com/royalty-free ... and-sounds




