(shouting)

LunaDLL/LunaLUA help thread

The second SMBX collab!
User avatar
Hoeloe
A2XT person
Posts: 1022
Joined: 12 years ago
Pronouns: she/her
Location: Spaaace

Re: LunaDLL help thread

Post by Hoeloe »

Demolition wrote: A. took a while to make
How exactly were they made? Maybe it would be possible to automate some of the production steps in an external application, rather than doing them manually?
Image
Image
Image
Image
Image
Demolition
Posts: 0
Joined: 11 years ago

Re: LunaDLL help thread

Post by Demolition »

For episode one I dragged and dropped each frame of animation one at a time. The mantreol cut-scene took like a billion hours to make. If I do that again for this episode I will definatly look into making a program that could do that for me.

The big problems though are load times and (Something that I forgot to mention earlier) sprite limitations that prevent very large animations from playing on one NPC (The mantreol cut-scene had 14 consecutive NPCs).

Can you think of any way I could maybe remedy these at all?
Image
Image
Kil
Posts: 13
Joined: 15 years ago

Re: LunaDLL help thread

Post by Kil »

It sounds like SMBX has the same problem. It uses gifs right? Well at some point, it has to decode them all into bitmaps (super long loading) so it can copy them to the screen just as we would have to. The solution would be to use some decent graphics library with hardware acceleration but that probably isn't gonna happen ever so long as we're working inside SMBX.
DON'T PM me. Ask your question in the help thread so everyone can be answered.
User avatar
Karatekid5
Welcome to the resort!
Posts: 78
Joined: 14 years ago
Location: Pennsylvania
Contact:

Re: LunaDLL help thread

Post by Karatekid5 »

A few quick questions.

Using LunaDLL, is there a way to modify the hammer bro's throwing arch? I can't find a way to set Y speed of the thrown object for a limited amount of frames (the frames it spawns within, so that the hammer bro doesn't toss its object so high).
Another thing relating to the question above. Is there a way to make a spawned npc destroy its self after a certain number of frames have passed? The player can destroy this npc but I don't want to make it overwhelming (this is the NPC that the hammer bro tosses). This should be possible with LUA but I'm not exactly sure of how to do it.

Finally, is there a way to make a custom LunaDLL event activate a warp/force the player to warp? I want to make a floor that teleports the player, and the floor is long, so I don't want to make a bunch of individual instant warps that cover the expanse.
Yoshi Ambassador!
Image
Kil
Posts: 13
Joined: 15 years ago

Re: LunaDLL help thread

Post by Kil »

Karatekid5 wrote:A few quick questions.

Using LunaDLL, is there a way to modify the hammer bro's throwing arch? I can't find a way to set Y speed of the thrown object for a limited amount of frames (the frames it spawns within, so that the hammer bro doesn't toss its object so high).
Another thing relating to the question above. Is there a way to make a spawned npc destroy its self after a certain number of frames have passed? The player can destroy this npc but I don't want to make it overwhelming (this is the NPC that the hammer bro tosses). This should be possible with LUA but I'm not exactly sure of how to do it.

Finally, is there a way to make a custom LunaDLL event activate a warp/force the player to warp? I want to make a floor that teleports the player, and the floor is long, so I don't want to make a bunch of individual instant warps that cover the expanse.
1) You could do it by writing a bunch of messy but functional conditionals. In Lua you can loop over all the hammer NPCs, check if their Y speed is above a certain amount, and if so lower it to some lower base speed.
2) You could hijack one of the NPC's unused memory fields. If it's a hammer brother, it's probably not using the Hits variable, right? Every frame, you could add 1 to the hits variable and basically turn it into your own custom NPC frame timer. Then when the variable gets to whatever threshold you decide, kill that NPC.

To make a warp, I would suggest just manually setting the player's X and Y and section value to wherever you want to go. LunaDLL doesn't know where the warp data is or what structure it has and probably never will.
DON'T PM me. Ask your question in the help thread so everyone can be answered.
Demolition
Posts: 0
Joined: 11 years ago

Re: LunaDLL help thread

Post by Demolition »

Kil wrote:It sounds like SMBX has the same problem. It uses gifs right? Well at some point, it has to decode them all into bitmaps (super long loading) so it can copy them to the screen just as we would have to. The solution would be to use some decent graphics library with hardware acceleration but that probably isn't gonna happen ever so long as we're working inside SMBX.
About how long would it take if I were to convert a gif to a BMP on the fly? Would it be fast enough to have smooth animation?
Image
Image
Kil
Posts: 13
Joined: 15 years ago

Re: LunaDLL help thread

Post by Kil »

I imagine it would be just like the current system. Smooth animation, massive load time. The bigger problem is, I don't think anyone around is willing to make a custom gif decoder and hook it all up to the lunadll display mechanism. At that point, you might as well go the entire way and make an AVI -> bitmap -> device context decoder since they'd be way better than GIFs.
DON'T PM me. Ask your question in the help thread so everyone can be answered.
Kil
Posts: 13
Joined: 15 years ago

Re: LunaDLL help thread

Post by Kil »

Karatekid5 wrote:A few quick questions.

Using LunaDLL, is there a way to modify the hammer bro's throwing arch? I can't find a way to set Y speed of the thrown object for a limited amount of frames (the frames it spawns within, so that the hammer bro doesn't toss its object so high).
Another thing relating to the question above. Is there a way to make a spawned npc destroy its self after a certain number of frames have passed? The player can destroy this npc but I don't want to make it overwhelming (this is the NPC that the hammer bro tosses). This should be possible with LUA but I'm not exactly sure of how to do it.

Finally, is there a way to make a custom LunaDLL event activate a warp/force the player to warp? I want to make a floor that teleports the player, and the floor is long, so I don't want to make a bunch of individual instant warps that cover the expanse.
Example: This kind of makes hammer bros just vomit the hammers out instead of toss up in an arc

Code: Select all

function onLoop()
  allNPCs = findnpcs(30,player.section)
  for k,v in pairs(allNPCs) do
	if(v.speedY < -1.5) then
		v.speedY = -1.5
	end
  end	
end	
DON'T PM me. Ask your question in the help thread so everyone can be answered.
TiKi
Posts: 709
Joined: 11 years ago

Re: LunaDLL help thread

Post by TiKi »

Is it possible to change how often a Snifit/octopus shoots? Is this some npc memory setting that hasn't been discovered? I was using Darkchao's Dino torch code to make a sniper joe (you know from mega man), and I was switching between npc-58, the black crate (I was changing it so instead of standing on it, you bounce off of it, like a rainbow shell, with npc codes) for the "shielding/invincible" form and the Snifit for the shooting form. Trouble is the shooting state would take a long time to shoot one pellet. So that's why I need this.
Kil
Posts: 13
Joined: 15 years ago

Re: LunaDLL help thread

Post by Kil »

it is some npc memory timer that hasn't been discovered
DON'T PM me. Ask your question in the help thread so everyone can be answered.
User avatar
Hoeloe
A2XT person
Posts: 1022
Joined: 12 years ago
Pronouns: she/her
Location: Spaaace

Re: LunaDLL help thread

Post by Hoeloe »

Demolition wrote:For episode one I dragged and dropped each frame of animation one at a time. The mantreol cut-scene took like a billion hours to make. If I do that again for this episode I will definatly look into making a program that could do that for me.

The big problems though are load times and (Something that I forgot to mention earlier) sprite limitations that prevent very large animations from playing on one NPC (The mantreol cut-scene had 14 consecutive NPCs).

Can you think of any way I could maybe remedy these at all?
I made a tool a while ago designed for compiling sprite sheets, which might help here. It was called SPIN Sprite Sheet Maker. I'll try and dig it up.
Image
Image
Image
Image
Image
Demolition
Posts: 0
Joined: 11 years ago

Re: LunaDLL help thread

Post by Demolition »

Hoeloe wrote:I made a tool a while ago designed for compiling sprite sheets, which might help here. It was called SPIN Sprite Sheet Maker. I'll try and dig it up.
Oh man, that would be great.
Does anyone know the maximum sprite sheet size SMBX will allow?
Image
Image
TiKi
Posts: 709
Joined: 11 years ago

Re: LunaDLL help thread

Post by TiKi »

SMBX reads from a 1000x1000 sheet for the player so I imagine you could fill the whole screen.
User avatar
Hoeloe
A2XT person
Posts: 1022
Joined: 12 years ago
Pronouns: she/her
Location: Spaaace

Re: LunaDLL help thread

Post by Hoeloe »

Demolition wrote:
Hoeloe wrote:I made a tool a while ago designed for compiling sprite sheets, which might help here. It was called SPIN Sprite Sheet Maker. I'll try and dig it up.
Oh man, that would be great.
Does anyone know the maximum sprite sheet size SMBX will allow?
Ah, I found it. I have a feeling I couldn't get it to export .gif files though... Still, it should be faster to build sheets with this and convert them than build them manually.

http://www.vg-resource.com/thread-21239.html
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 »

Kil wrote:Example: This kind of makes hammer bros just vomit the hammers out instead of toss up in an arc

Code: Select all

function onLoop()
  allNPCs = findnpcs(30,player.section)
  for k,v in pairs(allNPCs) do
	if(v.speedY < -1.5) then
		v.speedY = -1.5
	end
  end	
end	
This works perfectly! I modified it a tiny bit to give the thrown object a slight arch, but aside from that its exactly what I wanted!
Yoshi Ambassador!
Image
TiKi
Posts: 709
Joined: 11 years ago

Re: LunaDLL help thread

Post by TiKi »

I wonder; can lua code do the same stuff as lunadll notepad files and vice versa?
Rixithechao
https://www.youtube.com/watch?v=BODxOghVmko
Posts: 1864
Joined: 10 years ago
First name: Mack
https://rixithechao.talkhaus.com/

Re: LunaDLL help thread

Post by Rixithechao »

The main advantage of using Lua over autocode is that your code is much more readable and easier to organize. Not all autocode functions have LunaLua equivalents just yet, but the important functionality like getting and setting Player/NPC/global memory, saving and loading variables, etc. are all there plus a number of functions and variables related to specific memory addresses, like the player gravity, jump/bounce height and earthquake addresses that were discovered recently.

Go check out the LunaLua thread, there's a link to the documentation in the first post.
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)
TiKi
Posts: 709
Joined: 11 years ago

Re: LunaDLL help thread

Post by TiKi »

Code: Select all

//Small
MemAssign,0x00B2C700,36,0,0,0,w
MemAssign,0x00B2C78C,40,0,0,0,w
MemAssign,0x00B2C746,20,0,0,0,w
//Super
MemAssign,0x00B2C70A,36,0,0,0,w
MemAssign,0x00B2C796,40,0,0,0,w
MemAssign,0x00B2C750,20,0,0,0,w
//Fire
MemAssign,0x00B2C714,60,0,0,0,w
MemAssign,0x00B2C7A0,46,0,0,0,w
MemAssign,0x00B2C75A,48,0,0,0,w
I'm trying to make this playable have the correct hitbox (I'm using the standing frames as reference) but
1. The first two forms stand a bit off the ground
2. The Fire form look almost right when you have the powerup animation, but when you get out of the animation, it is in the ground.
test level:
http://speedy.sh/pDh5e/Kirby.zip
(kil I shall fix the 0 active time later)
EDIT: fixed #1 but I'm still having issues with #2
TiKi
Posts: 709
Joined: 11 years ago

Re: LunaDLL help thread

Post by TiKi »

Never mind I got this.
Kil
Posts: 13
Joined: 15 years ago

Re: LunaDLL help thread

Post by Kil »

TiKi wrote: (kil I shall fix the 0 active time later)
But the active time is right. You only need a low active time for commands in a custom section.
DON'T PM me. Ask your question in the help thread so everyone can be answered.
TiKi
Posts: 709
Joined: 11 years ago

Re: LunaDLL help thread

Post by TiKi »

Huh? I thought no section meant it defaulted to #0 aka all sections.
Kil
Posts: 13
Joined: 15 years ago

Re: LunaDLL help thread

Post by Kil »

Yes that's right, and since #0 isn't a custom section it doesn't copy commands out of it, just runs them right there, so you can leave the active time as 0.
DON'T PM me. Ask your question in the help thread so everyone can be answered.
TiKi
Posts: 709
Joined: 11 years ago

Re: LunaDLL help thread

Post by TiKi »

So #101 and above are the only ones who need a positive active time?
User avatar
Holy
Posts: 133
Joined: 13 years ago

Re: LunaDLL help thread

Post by Holy »

Kil wrote:
Holy wrote:Kil, did you say the phanto was built into the PlaceSprite thing? I'm trying this

Code: Select all

#-1
// Load image phanto.bmp into image slot 2 with transparency color FF00DC (pink)
LoadImage,2,0xDC00FF,0,0,0,phanto.bmp

#0
PlaceSprite,5,2,-159540,-160370,0,0
And it'll place the sprite, but nothing happens when you pick up a key.
Your key may be cursed. For some weird SMBX reason, some keys are just weird and don't get detected because their ID is different than a normal key for some reason. If you put down some more keys, and find one that works, take that one and use it, and delete the cursed one.

By the way literally no one has ever used that phanto yet to my knowledge so there may be some issues with it I never noticed and you're basically going to be the first to deal with them.
Hrm, tried this and everything else I could think of, still doesn't work.
Here's the level if you wanna look into it. Phanto and key are on section 3
TiKi
Posts: 709
Joined: 11 years ago

Re: LunaDLL help thread

Post by TiKi »

Heh, the cursed key could be a episode 2 gimmick. You can use a provided key that triggers Phanto or go through a harder route to find a "cursed" key.
Post Reply