LunaLua Offical Thread
Re: Presenting: Lunadll for Lua!
I just checked the code kil wrote. So the image is ALWAYS loaded from the custom-folder of the level.
Re: Presenting: Lunadll for Lua!
This is a pain, but if this is the case, then there is something wrong with placeSprite in the API code. I haven't tested it on a loop, but it doesn't seem to work on load.Kevsoft wrote:I just checked the code kil wrote. So the image is ALWAYS loaded from the custom-folder of the level.





-
Darkchaox100
- Posts: 0
- Joined: 8 years ago
Re: Presenting: Lunadll for Lua!
I tried loading & Placing sprites with a api too,doesnt seem to work.
with lunadll.lua it seems to work without any issues though.
with lunadll.lua it seems to work without any issues though.
Re: Presenting: Lunadll for Lua!
I just tested it, for me it works all fine:
in LuaScriptLib/sometestloader.lua
and in lunadll.lua:
in LuaScriptLib/sometestloader.lua
Code: Select all
local sometestloader = {}
function sometestloader.onInitAPI()
registerEvent("sometestloader", "onLoad")
registerEvent("sometestloader", "onLoop")
end
function sometestloader.onLoad()
loadImage("sometest.bmp", 1, 0xFFFFFFFF)
end
function sometestloader.onLoop()
placeSprite(1, 1, 20, 300)
end
return sometestloader
Code: Select all
loader = loadAPI("sometestloader")
Re: Presenting: Lunadll for Lua!
placeSprite in a loop with no duration is inefficient, as it places more sprites each frame (eventually causing the game to slow down). It's much more efficient to call placeSprite once when loading, and that is what doesn't work. I suspect it might be to do with the code that calls the onLoad function, but I'm not sure.
Try this code out:
Try this code out:
Code: Select all
local sometestloader = {}
function sometestloader.onInitAPI()
registerEvent("sometestloader", "onLoad")
end
function sometestloader.onLoad()
loadImage("sometest.bmp", 1, 0xFFFFFFFF)
placeSprite(1, 1, 20, 300)
end





Re: Presenting: Lunadll for Lua!
Works without problems (and yes, in the API file and not in the host file)!
Re: Presenting: Lunadll for Lua!
Interesting. Perhaps there is some difference between your version and the released version that has fixed the issue?Kevsoft wrote:Works without problems (and yes, in the API file and not in the host file)!
EDIT: Hmm. I just tried again, and it worked. My code is exactly the same as it was before, but now it seems to work fine. Interesting.
Would certainly be nice to be able to load from the main path, rather than the level folder, though. It would make global objects (such as the raocoin counter) much easier to load in reliably.
EDIT EDIT: Ah, turns out I was using the wrong lunaworld - it's still not working.
I'll post an update of my Raocoin system when I have this working. I'm not going to change anything in the trigger system, though. You can still use loadAPI to load it in, but you still need to manually check for triggers. The reason for this is that it requires you specify the item IDs of the triggers in question. Given time, I just might be able to work it so that it does it automatically, but at the moment, this is how it will be.





Re: Presenting: Lunadll for Lua!
LunaLua v0.3.3 is out!
Changes:
Example:
(requires a layer "MyLayer" added with some blocks
)
Documentary will be updated soon!
Changes:
Code: Select all
i = 0
run = true
function onLoop()
i = i + 1
local myLayer = findlayer("MyLayer")
if(myLayer)then
printText(myLayer.layerName.str, 30, 200)
if(i % 100 == 1)then
run = not run
end
if(run)then
myLayer.speedX = -1
else
myLayer:stop()
end
end
end
Documentary will be updated soon!
Re: Presenting: Lunadll for Lua!
Going to check if this new version sorts out the placeSprite issue.
EDIT: Aha! I finally fixed it! Turns out, it was an issue with the path of the "init" function being mistyped! Seems to work fine now. Will upload a new version of the raocoin system soon.
New shop library! Now a lot easier to use. Requires only one line in lunaworld to implement the raocoin system!
Raocoin Library
EDIT: Aha! I finally fixed it! Turns out, it was an issue with the path of the "init" function being mistyped! Seems to work fine now. Will upload a new version of the raocoin system soon.
New shop library! Now a lot easier to use. Requires only one line in lunaworld to implement the raocoin system!
Raocoin Library





Re: Presenting: Lunadll for Lua!
Then all is good! :DHoeloe wrote:EDIT: Aha! I finally fixed it! Turns out, it was an issue with the path of the "init" function being mistyped! Seems to work fine now. Will upload a new version of the raocoin system soon.
Btw guys: Do you need to change smbx events at runtime? I just asking if I should implement that.
Re: Presenting: Lunadll for Lua!
What do you mean by "change" SMBX events?Kevsoft wrote:Then all is good! :DHoeloe wrote:EDIT: Aha! I finally fixed it! Turns out, it was an issue with the path of the "init" function being mistyped! Seems to work fine now. Will upload a new version of the raocoin system soon.
Btw guys: Do you need to change smbx events at runtime? I just asking if I should implement that.





Re: Presenting: Lunadll for Lua!
Well, modify the events.
Re: Presenting: Lunadll for Lua!
That's not entirely helpful. Do you mean changing what a specific event does? Changing which event is triggered by an object? There are a number of things that could mean.Kevsoft wrote:Well, modify the events.
For the record, of those two, the latter would be more useful.





Re: Presenting: Lunadll for Lua!
Or better said: Modifiy the event properties/content... whatever.
Is currently difficult because of the ugly VB6 Strings. Might be possible in the future.Hoeloe wrote:Changing which event is triggered by an object.
Re: Presenting: Lunadll for Lua!
I'm not sure it's really worth it. The ability to trigger Lua from SMBX events means you can essentially do this already, by using two different events and hooking up a condition in Lua. Still, might make things a bit easier, depending on implementation, and having an Event class would be useful in the long run anyway.Kevsoft wrote:Or better said: Modifiy the event properties/content... whatever.





- Oddwrath
- The ghost of talkhaus unlikely
- Posts: 17
- Joined: 8 years ago
- Pronouns: she/her
- Location: Merry Old Europe
Re: Presenting: Lunadll for Lua!
So, I've looked at the section class code and I'm still not sure about one thing: can we do autoscrolling like this yet?
Re: Presenting: Lunadll for Lua!
It better not beOddwrath wrote:So, I've looked at the section class code and I'm still not sure about one thing: can we do autoscrolling like this yet?
Re: Presenting: Lunadll for Lua!
Probably by updating the level boundaries yourself.....
-
Rixithechao
- https://www.youtube.com/watch?v=IwLdM6ejGAM
- Posts: 1608
- Joined: 8 years ago
- First name: Mack
- https://rixithechao.talkhaus.com/
Re: Presenting: Lunadll for Lua!
Oh, man, so close! Everything works except disabling the original NPC messages! Setting NPC.msg.str = "" just replaces the first character with a space.

Which offset points to the NPC.msg VBStr? I could index the pointers, grab a dead end pointer from an NPC without a message and then selectively replace them based on the section number or some other scope condition; in theory, that should disable the default SMBX message functionality... if not, then it might just be controlled by another NPC offset and I'd just have to experiment with the remaining unknowns.

Which offset points to the NPC.msg VBStr? I could index the pointers, grab a dead end pointer from an NPC without a message and then selectively replace them based on the section number or some other scope condition; in theory, that should disable the default SMBX message functionality... if not, then it might just be controlled by another NPC offset and I'd just have to experiment with the remaining unknowns.
Delightful Adventure Enhanced is out now!

There's an official ASMT Discord server! Check it out to follow and/or contribute to A2XT Episode 2's development! thread, invite link
(Entry requires verification, either with a connected Youtube/Twitter/Twitch/etc account or manually by the server staff.)
Itch.io (albums and eventually games), Youtube (dofur pass and I guess other videos)

There's an official ASMT Discord server! Check it out to follow and/or contribute to A2XT Episode 2's development! thread, invite link
(Entry requires verification, either with a connected Youtube/Twitter/Twitch/etc account or manually by the server staff.)
Itch.io (albums and eventually games), Youtube (dofur pass and I guess other videos)
Re: Presenting: Lunadll for Lua!
Quick question: how does playSFX work? I'm trying to use it to add more sound effects to my level, but it's just playing the Windows alert noise, not my sound file.





Re: Presenting: Lunadll for Lua!
Awesome, didn't know that was a thing!Kevsoft wrote:1.) "player.UKeyState" is what your looking for. -1 if it is pressed, 0 if it is not pressed
Is there a way to "tighten" the block collision? Basically I'm tryin to do this bouncy ball thing:
and you can bounce up the walls because it still thinks you're colliding with the tops of the wall blocks.
Here's the current code for this btw in case there's a hilariously easier way to do it I didn't think of
Re: Presenting: Lunadll for Lua!
uff... I currently don't know a "easier" way. I might add a secondary function where you can add you offsets to the collision check.
-
Rixithechao
- https://www.youtube.com/watch?v=IwLdM6ejGAM
- Posts: 1608
- Joined: 8 years ago
- First name: Mack
- https://rixithechao.talkhaus.com/
Re: Presenting: Lunadll for Lua!
The block collision stuff is kinda finnicky, I tried to set up some stuff with it and Demo kept falling through the ground. Best to manipulate layers instead of blocks... unless you're doing something like a yellow devil battle (someone should get on that asap plz kthx).
Regarding playSFX, it may be the import path.
Regarding playSFX, it may be the import path.
Delightful Adventure Enhanced is out now!

There's an official ASMT Discord server! Check it out to follow and/or contribute to A2XT Episode 2's development! thread, invite link
(Entry requires verification, either with a connected Youtube/Twitter/Twitch/etc account or manually by the server staff.)
Itch.io (albums and eventually games), Youtube (dofur pass and I guess other videos)

There's an official ASMT Discord server! Check it out to follow and/or contribute to A2XT Episode 2's development! thread, invite link
(Entry requires verification, either with a connected Youtube/Twitter/Twitch/etc account or manually by the server staff.)
Itch.io (albums and eventually games), Youtube (dofur pass and I guess other videos)
Re: Presenting: Lunadll for Lua!
Is there a way to access and set the absolute position of a layer? I'm trying to create a series of looping events. Doing so in SMBX is difficult because the floating point values get truncated too early, meaning it drifts over time. Doing so in Lua seems to also drift off, but more severely, and only under certain circumstances (such as changing sections).
Oh, I also fixed playSFX - it only supports .wav files, not .mp3. Worth adding that to the documentation.
Oh, I also fixed playSFX - it only supports .wav files, not .mp3. Worth adding that to the documentation.





Re: Presenting: Lunadll for Lua!
Layers in SMBX don't have positions. They only move their objects by the speed, nothing else.
