(shouting)

LunaDLL/LunaLUA help thread

The second SMBX collab!
User avatar
Kevsoft
LunaLua Master Developer
Posts: 83
Joined: 9 years ago

Re: LunaDLL help thread

Post by Kevsoft »

Even better:

Code: Select all

function onLoop()
  if(player.holdingNPC)then
    printText(tostring(player.holdingNPC.id), 270, 250)
  end
end
Kil
Posts: 13
Joined: 15 years ago

Re: LunaDLL help thread

Post by Kil »

Kevsoft wrote:Even better:

Code: Select all

function onLoop()
  if(player.holdingNPC)then
    printText(tostring(player.holdingNPC.id), 270, 250)
  end
end

Ah, didn't know those were hooked up to lua yet, and that should work although I haven't tested it myself
DON'T PM me. Ask your question in the help thread so everyone can be answered.
Darkchaox100
Posts: 0
Joined: 9 years ago

Re: LunaDLL help thread

Post by Darkchaox100 »

Is there a way to check the ammount of frames you're in a section? I want to make a autoscrolling section and need the correct frames ammount for the timer to stop it again.
Kil
Posts: 13
Joined: 15 years ago

Re: LunaDLL help thread

Post by Kil »

Lunadll always loops once per frame, so you can just have something increment a variable and display it on screen
DON'T PM me. Ask your question in the help thread so everyone can be answered.
User avatar
Hoeloe
A2XT person
Posts: 1016
Joined: 12 years ago
Pronouns: she/her
Location: Spaaace

Re: LunaDLL help thread

Post by Hoeloe »

Kil wrote:Lunadll always loops once per frame, so you can just have something increment a variable and display it on screen
Just to be sure, does it play nicely with frameskip?
Image
Image
Image
Image
Image
Darkchaox100
Posts: 0
Joined: 9 years ago

Re: LunaDLL help thread

Post by Darkchaox100 »

Hoeloe wrote:
Kil wrote:Lunadll always loops once per frame, so you can just have something increment a variable and display it on screen
Just to be sure, does it play nicely with frameskip?
Thats something i would like to know too.
Kil
Posts: 13
Joined: 15 years ago

Re: LunaDLL help thread

Post by Kil »

No idea. It depends on if SMBX runs its RunGame() function during frameskip (which contains the main lunadll hook), which I don't know, but probably? It might be different if you enable or disable frameskip. Maybe you could engineer an extremely laggy level and see what happens.
DON'T PM me. Ask your question in the help thread so everyone can be answered.
User avatar
Oddwrath
The ghost of talkhaus unlikely
Posts: 95
Joined: 9 years ago
Pronouns: she/her
Location: Merry Old Europe

Re: LunaDLL help thread

Post by Oddwrath »

What is the default player x and y speed in LunaLua?
Also, I asked this before, but didn't get an answer: how do I use playSFX([string] soundfile) and can it be used to play custom sfx from the level folder?
:lesbian_pride: my avatar is from that obake game made in 2001 that you cannot play anymore unless you run it through a virtual machine and apply a locale patch
User avatar
Kevsoft
LunaLua Master Developer
Posts: 83
Joined: 9 years ago

Re: LunaDLL help thread

Post by Kevsoft »

Oddwrath wrote: Also, I asked this before, but didn't get an answer: how do I use playSFX([string] soundfile) and can it be used to play custom sfx from the level folder?
Yes! It's the same as Autocode handle it.
Put you sound file in the custom folder and call:

Code: Select all

playSFX("your_sound_file.mp3")
Oddwrath wrote:What is the default player x and y speed in LunaLua?
What do you mean with "default"? You might wanna just print out your current speed as text.
Kil
Posts: 13
Joined: 15 years ago

Re: LunaDLL help thread

Post by Kil »

Max speed in smbx is -6 or +6, if that's what you mean
DON'T PM me. Ask your question in the help thread so everyone can be answered.
User avatar
Oddwrath
The ghost of talkhaus unlikely
Posts: 95
Joined: 9 years ago
Pronouns: she/her
Location: Merry Old Europe

Re: LunaDLL help thread

Post by Oddwrath »

Kevsoft wrote: Yes! It's the same as Autocode handle it.
Put you sound file in the custom folder and call:

Code: Select all

playSFX("your_sound_file.mp3")
For some reason this refused to work before. Or maybe just doesn't accept soundfiles from the default sound folder.
Kevsoft wrote: What do you mean with "default"? You might wanna just print out your current speed as text.
Let's say I want to make the player slower as the time goes on. I guess I would create a timer, make several ifs that do a thing, when the timer reaches certain points. It's just that I don't know what to do with speedX and speedY.
Edit: I think I've got it. Just divide both speedX and speedY by 1.something.
Edit2: Nevermind that bit about speedY. Apparently jumpheight is what makes the player jump lower.
:lesbian_pride: my avatar is from that obake game made in 2001 that you cannot play anymore unless you run it through a virtual machine and apply a locale patch
TiKi
Posts: 709
Joined: 11 years ago

Re: LunaDLL help thread

Post by TiKi »

Is it fair to suggest someone use lunadll to make a gimmick work better (such as global variables instead of stars) when that majorly improves or makes possible a gimmick (like a switch palace)? Cause it's bugging me out how people still suggest SMW stars these days as global stuff
LukasSMBX
Posts: 0
Joined: 10 years ago

Re: LunaDLL help thread

Post by LukasSMBX »

Is it possible to make a boss hp bar? that really goes down when hitting a boom boom for example?
Rixithechao
https://www.youtube.com/watch?v=BODxOghVmko
Posts: 1812
Joined: 10 years ago
First name: Mack
https://rixithechao.talkhaus.com/

Re: LunaDLL help thread

Post by Rixithechao »

TiKi wrote:Is it fair to suggest someone use lunadll to make a gimmick work better (such as global variables instead of stars) when that majorly improves or makes possible a gimmick (like a switch palace)? Cause it's bugging me out how people still suggest SMW stars these days as global stuff
I'd say so, especially now that LunaDLL has the variable bank and LunaLua makes it much easier to do more complex stuff. But some folks can be pretty resistant to learning how to code, and to be fair it's pretty intimidating when you first start out. We're hoping that expanding LunaLua will encourage folks to try, though. Oddwrath's suggestion earlier to make a conversion guide is a good idea too, that's one of the things that helped me switch from Drag & Drop to GML with GameMaker.
LukasSMBX wrote:Is it possible to make a boss hp bar? that really goes down when hitting a boom boom for example?
We be workin' on these. The cinematX library is being written to help with cutscenes, bosses and other scripted sequences (including HP bars and other types of progress gauges), and Kil's working on custom sprite and GUI frameworks which I will most likely incorporate into cinematX whenever he's done with them. But please be courteous and don't bother him about those, the guy's put up with a lot of stuff from us already.
Delightful Adventure Enhanced is out now!

Image

There's an official ASMT Discord server! Check it out to discuss Demo games and follow their 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)
User avatar
Karatekid5
Welcome to the resort!
Posts: 78
Joined: 14 years ago
Location: Pennsylvania
Contact:

Re: LunaDLL help thread

Post by Karatekid5 »

Is it possible to keep the rolling green spiny egg (NPC-48) from following Mario/Demo? Once it is spawned, I want it to keep going in the direction it was fired at instead of it turning around to chase the player.
Yoshi Ambassador!
Image
TiKi
Posts: 709
Joined: 11 years ago

Re: LunaDLL help thread

Post by TiKi »

You could replace it with like a spiny or sidestepper (crab) with changing npc id. That would be the easiest solution.

Kil: did you see my inquiry sorry to bother you but this is the final piece of the puzzle I hope to the shop code
User avatar
Karatekid5
Welcome to the resort!
Posts: 78
Joined: 14 years ago
Location: Pennsylvania
Contact:

Re: LunaDLL help thread

Post by Karatekid5 »

TiKi wrote:You could replace it with like a spiny or sidestepper (crab) with changing npc id. That would be the easiest solution.
I'd try that, but I want to keep the bounce that the green spiny egg has when it lands.
Yoshi Ambassador!
Image
User avatar
Hoeloe
A2XT person
Posts: 1016
Joined: 12 years ago
Pronouns: she/her
Location: Spaaace

Re: LunaDLL help thread

Post by Hoeloe »

Karatekid5 wrote:
TiKi wrote:You could replace it with like a spiny or sidestepper (crab) with changing npc id. That would be the easiest solution.
I'd try that, but I want to keep the bounce that the green spiny egg has when it lands.
You could change the horizontal speed of the NPC to 0, and control its horizontal movement entirely with LunaDLL.
Image
Image
Image
Image
Image
User avatar
Karatekid5
Welcome to the resort!
Posts: 78
Joined: 14 years ago
Location: Pennsylvania
Contact:

Re: LunaDLL help thread

Post by Karatekid5 »

Hoeloe wrote:You could change the horizontal speed of the NPC to 0, and control its horizontal movement entirely with LunaDLL.
That'd probably be the best idea. Though, how would I have it check which direction it was thrown in?
Yoshi Ambassador!
Image
Darkchaox100
Posts: 0
Joined: 9 years ago

Re: LunaDLL help thread

Post by Darkchaox100 »

Hey Kil,would it be possible with the upcoming GUI frameworks to make transparent Sprites?
Karatekid5 wrote:
Hoeloe wrote:You could change the horizontal speed of the NPC to 0, and control its horizontal movement entirely with LunaDLL.
That'd probably be the best idea. Though, how would I have it check which direction it was thrown in?
IDK if it works,but maybe before you set the hspeed to 0,let lunadll check the hspeed,so you can get the direction.
TiKi
Posts: 709
Joined: 11 years ago

Re: LunaDLL help thread

Post by TiKi »

Kil said he may not use transparency. Apparently if the game lags AT ALL the transparent stuff flickers and could cause seizures.
Darkchaox100
Posts: 0
Joined: 9 years ago

Re: LunaDLL help thread

Post by Darkchaox100 »

Is there a way to place a sprite using lua always at the X/Y Position of Player 1?
Rixithechao
https://www.youtube.com/watch?v=BODxOghVmko
Posts: 1812
Joined: 10 years ago
First name: Mack
https://rixithechao.talkhaus.com/

Re: LunaDLL help thread

Post by Rixithechao »

Not yet, you'll have to use an NPC for the time being.
Delightful Adventure Enhanced is out now!

Image

There's an official ASMT Discord server! Check it out to discuss Demo games and follow their 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)
User avatar
Hoeloe
A2XT person
Posts: 1016
Joined: 12 years ago
Pronouns: she/her
Location: Spaaace

Re: LunaDLL help thread

Post by Hoeloe »

Rockythechao wrote:Not yet, you'll have to use an NPC for the time being.
I'm not sure that's true. PlaceSprite has a setting to place in world coordinates (it's under the "sprite type" argument, but I can't remember the number). If you set the duration to 2, this should allow you to place sprites at the player's location.
Image
Image
Image
Image
Image
Darkchaox100
Posts: 0
Joined: 9 years ago

Re: LunaDLL help thread

Post by Darkchaox100 »

Yeah its placeSprite (2,...)
Thank you.
Post Reply