(shouting)

LunaDLL/LunaLUA help thread

The second SMBX collab!
User avatar
SAJewers
ASMBXT Level Wrangler/A2XT Project Coordinator /AAT Level Designer
Posts: 4218
Joined: 12 years ago
Location: Nova Scotia

Re: LunaDLL/LunLUA help thread

Post by SAJewers »

SAJewers wrote:
Rednaxela wrote:
SAJewers wrote:Is there a way to fix "A World 1 Level" From Episode 1 by disallowing the player from entering the pause menu?
1) I've given it a try disabling the pause menu but no real luck thus far. I'll look further into it some time. Worst case, I'll have to modify LunaDLL to add some extra functionality for control of allowing/disallowing pausing, since my initial attempt of blocking the control input failed.
2) How does disallowing the player from entering the pause menu help "A World 1 Level" from Ep 1? I don't recall that level or what's wrong with it.
SAJewers wrote:EDIT: Also, Is it possible to have no P-Switch music, like in ASMT/A2MT?
I'm unaware of what was done in ASMT/A2MT for no P-Switch music (was it just have no music file or a silent music file?), but any reason the same can't be done?

I'm now however thinking that in the next few days I may look into adding a "p-switch settings" thing to LunaLua, so various things about p-switches could be set from Lua, which would be via the lunaworld.lua file for making something episode-wide. Might think about making it so in addition to silent or not, maybe allowing the duration to be changed by Lua code (not super relevant to A2XT stuff at the episode level but maybe some level creators would find it handy)
the P-switch thingy in ASMT was an ASM patch that replaced the P-switch music with a ticking sound effect that played over the level music. Here's an example from raocow's ASMT LP, or a TAS of that level if you don't want commentary. I can easily grab that sound effect.

EDIT: If it's any use to you, here's the ASMT resources pack, which includes the ASM patch for the ticking p-switch (\patches\ticking.asm)

As for "A World 1 Level", the main part the level uses events that sync up with the music. Pausing the game causes the events to stop until you unpause, which causes the music and the events to desync.
And, said Sound Effect: http://www.mediafire.com/listen/onfiavc ... icking.wav
ImageImageImageImageImage | Image | Image
Sharenite | RetroAchievements | NameMC | IGDB
User avatar
Rednaxela
Maker of Shenanigans
Posts: 897
Joined: 10 years ago
Pronouns: they/them
https://rednaxela.talkhaus.com

Re: LunaDLL/LunLUA help thread

Post by Rednaxela »

SAJewers wrote:And, said Sound Effect: http://www.mediafire.com/listen/onfiavc ... icking.wav
Sounds good. I've found the parts of the SMBX ASM that I need to add hooks to, and within the next week I expect to have things set up so that some Lua code placed in lunaworld.lua can apply such a modified p-switch behavior with that sound effect and leaving the music running.
User avatar
SAJewers
ASMBXT Level Wrangler/A2XT Project Coordinator /AAT Level Designer
Posts: 4218
Joined: 12 years ago
Location: Nova Scotia

Re: LunaDLL/LunLUA help thread

Post by SAJewers »

Awesomne. Thanks.
ImageImageImageImageImage | Image | Image
Sharenite | RetroAchievements | NameMC | IGDB
User avatar
Alice
Posts: 2367
Joined: 12 years ago
Pronouns: Girl person
Location: Wonderland

Re: LunaDLL/LunLUA help thread

Post by Alice »

I have a question for you LunaLua guys. I've been rewatching Super Talking Time Bros. 2 recently and yesterday got to this episode which features a level with screen wrap where raocow ends up getting hit in a really cheap way by a rex wrapping around that he couldn't have possibly seen coming. My question is this: How feasible would it be using LunaLua to make it so instead of wrapping around the way it does the camera just kept scrolling around so it was completely seamless? I'd assume this would be fairly difficult, if even possible, but it seems like it could actually make for some interesting level construction so I thought I'd ask.
User avatar
Hoeloe
A2XT person
Posts: 1022
Joined: 12 years ago
Pronouns: she/her
Location: Spaaace

Re: LunaDLL/LunLUA help thread

Post by Hoeloe »

Alice wrote:I have a question for you LunaLua guys. I've been rewatching Super Talking Time Bros. 2 recently and yesterday got to this episode which features a level with screen wrap where raocow ends up getting hit in a really cheap way by a rex wrapping around that he couldn't have possibly seen coming. My question is this: How feasible would it be using LunaLua to make it so instead of wrapping around the way it does the camera just kept scrolling around so it was completely seamless? I'd assume this would be fairly difficult, if even possible, but it seems like it could actually make for some interesting level construction so I thought I'd ask.
The way I'd do it is have a copy of the first screen's worth of level at the end, and when you pass the centre of that screen, set the player's X coordinate to the respective position on the left. The downside to this is of course that enemies won't carry over in the wrap, but other than using the same trick for them, there's not much you can do about that.
Image
Image
Image
Image
Image
User avatar
SAJewers
ASMBXT Level Wrangler/A2XT Project Coordinator /AAT Level Designer
Posts: 4218
Joined: 12 years ago
Location: Nova Scotia

Re: LunaDLL/LunLUA help thread

Post by SAJewers »

I'm looking at the Audio function stuff.

I got a music partially working, but it looks like Audio.MusicTitleTag only grabs the Track name, and not the Artist Name of Album title. Is there something for those values, or is that not implemented?

EDIT: Also, how to I replicate Autocode's "print string for only a certain amount of time"? Would that be just setting a var, use an eventu timer to change that var, then use an if/then to display the text if var == true?

EDIT2: Second Question:

Code: Select all

function onInputUpdate()
	if (player.pauseKeyPressing and player.dropItemKeyPressing) then

		player.pauseKeyPressing = false
		player.dropItemKeyPressing = false
		Level.exit()
	end
end
While that does kick me out of the level, back to the OW, the OW pause menu shows up. Is there a way for that not to happen. I figure using Global Memory to set 0x00B250E2 might work, but I can't figure out the syntax.[/s]NVM FIGURED IT OUT

EDIT3:

Code: Select all

function onInputUpdate()
	if (player.dropItemKeyPressing and player.pauseKeyPressing) then
		Level.exit()
		mem(0x00B250E2,FIELD_FLOAT,0)
		player.dropItemKeyPressing = false
		player.pauseKeyPressing = false
	end
	if (player.pauseKeyPressing) then
		Text.print("RUN2",60,400)

	end
	if (player.dropItemKeyPressing) then
		Text.print("SELECT",80,400)
	end
end
This works, but the OW stays black, and the level continues until I either let go of select first, or press another button. An ideas?
ImageImageImageImageImage | Image | Image
Sharenite | RetroAchievements | NameMC | IGDB
User avatar
Wohlstand
Moondust and TheXTech developer
Posts: 186
Joined: 10 years ago
First name: Vitaly
Pronouns: he/him/his
Location: Moscow, Russia

Re: LunaDLL/LunLUA help thread

Post by Wohlstand »

SAJewers wrote: I got a music partially working, but it looks like Audio.MusicTitleTag only grabs the Track name, and not the Artist Name of Album title. Is there something for those values, or is that not implemented?
I though to implement artist/album title printing too, but we with Kevin are though than it is not so important. But I'l implement that on "SDL mixer X" side.
P.S> Yea, we with Kevin are calling forked version of SDL2_mixer as "SDL Mixer X" which has different functional set and additional API additions.

Sources are here:
https://github.com/Wohlhabend-Networks/ ... r_modified
to build it, you need a qmake (you need to install Qt 5 and MinGW)
User avatar
SAJewers
ASMBXT Level Wrangler/A2XT Project Coordinator /AAT Level Designer
Posts: 4218
Joined: 12 years ago
Location: Nova Scotia

Re: LunaDLL/LunLUA help thread

Post by SAJewers »

Ah, ok. Yeah, it's probably only useful for A2Xt, so I can understand why.
SAJewers wrote:
EDIT3:

Code: Select all

function onInputUpdate()
	if (player.dropItemKeyPressing and player.pauseKeyPressing) then
		Level.exit()
		mem(0x00B250E2,FIELD_FLOAT,0)
		player.dropItemKeyPressing = false
		player.pauseKeyPressing = false
	end
	if (player.pauseKeyPressing) then
		Text.print("RUN2",60,400)

	end
	if (player.dropItemKeyPressing) then
		Text.print("SELECT",80,400)
	end
end
This works, but the OW stays black, and the level continues until I either let go of select first, or press another button. An ideas?
Still looking for help on this one.
ImageImageImageImageImage | Image | Image
Sharenite | RetroAchievements | NameMC | IGDB
User avatar
Hoeloe
A2XT person
Posts: 1022
Joined: 12 years ago
Pronouns: she/her
Location: Spaaace

Re: LunaDLL/LunLUA help thread

Post by Hoeloe »

I made a thing. I blame SAJewers.

Image
Image
Image
Image
Image
Image
User avatar
WestonSmith
Bunny
Posts: 191
Joined: 11 years ago

Re: LunaDLL/LunLUA help thread

Post by WestonSmith »

I understand most of it, but what in the dickens does the magic bar represent?
User avatar
SAJewers
ASMBXT Level Wrangler/A2XT Project Coordinator /AAT Level Designer
Posts: 4218
Joined: 12 years ago
Location: Nova Scotia

Re: LunaDLL/LunLUA help thread

Post by SAJewers »

I think that seals the fact that we should have a "crazy gimmick levels" world with that, My Shooter level that I need to work on (preferably with help), Willhart's Demo's Fluffy Dream level...
ImageImageImageImageImage | Image | Image
Sharenite | RetroAchievements | NameMC | IGDB
User avatar
Hoeloe
A2XT person
Posts: 1022
Joined: 12 years ago
Pronouns: she/her
Location: Spaaace

Re: LunaDLL/LunLUA help thread

Post by Hoeloe »

WestonSmith wrote:I understand most of it, but what in the dickens does the magic bar represent?
Magic bar has two purposes. It shows you how much fairy you have left, and how much statue you have left, depending on which one you're using.
Image
Image
Image
Image
Image
User avatar
WestonSmith
Bunny
Posts: 191
Joined: 11 years ago

Re: LunaDLL/LunLUA help thread

Post by WestonSmith »

SAJewers wrote:I think that seals the fact that we should have a "crazy gimmick levels" world with that, My Shooter level that I need to work on (preferably with help), Willhart's Demo's Fluffy Dream level...
Alternative thoughts;

(1) A secret gimmick level per world that has zero bearing on plot or world theme
(2) A gimmick level per world that thematically matches and is either the last or pre-last level of each world
(3) Or, yeah, just a total gimmick world

Also, a visual representation of fairy form would be super neat. Nice touch.
WasabiJellyfish
Posts: 117
Joined: 9 years ago

Re: LunaDLL/LunLUA help thread

Post by WasabiJellyfish »

SAJewers wrote:My Shooter level that I need to work on (preferably with help)
*cough* I may have been messing with some of your base code for that to make it smoother *cough*
What exactly do you want it to be, stylewise?
User avatar
SAJewers
ASMBXT Level Wrangler/A2XT Project Coordinator /AAT Level Designer
Posts: 4218
Joined: 12 years ago
Location: Nova Scotia

Re: LunaDLL/LunLUA help thread

Post by SAJewers »

I'm thinking Soldier Blade Stage 1.

ImageImageImageImageImage | Image | Image
Sharenite | RetroAchievements | NameMC | IGDB
User avatar
romajiQuadhash
typos "raocow" as "roacow" (and I TAS)
Posts: 12
Joined: 9 years ago
First name: Romaji Quadhash
Pronouns: ke/keh/ker
Location: ""Canada""

Re: LunaDLL/LunLUA help thread

Post by romajiQuadhash »

WestonSmith wrote:
SAJewers wrote:I think that seals the fact that we should have a "crazy gimmick levels" world with that, My Shooter level that I need to work on (preferably with help), Willhart's Demo's Fluffy Dream level...
Alternative thoughts;

(1) A secret gimmick level per world that has zero bearing on plot or world theme
(2) A gimmick level per world that thematically matches and is either the last or pre-last level of each world
(3) Or, yeah, just a total gimmick world

Also, a visual representation of fairy form would be super neat. Nice touch.
Or
(4) Gimmick levels are randomly thrown in, and with an intro added to "make them fit in"
This is a sig
User avatar
SAJewers
ASMBXT Level Wrangler/A2XT Project Coordinator /AAT Level Designer
Posts: 4218
Joined: 12 years ago
Location: Nova Scotia

Re: LunaDLL/LunLUA help thread

Post by SAJewers »

Am I right in saying that there''s currently no way to grab leek information from a save?

I'm talking like the "0/1" indicator or whatever in a HUB. There's no way currently to grab that info and put it in a variable, correct?
ImageImageImageImageImage | Image | Image
Sharenite | RetroAchievements | NameMC | IGDB
User avatar
7NameSam
hey
Posts: 248
Joined: 9 years ago
Pronouns: they/them

Re: LunaDLL/LunLUA help thread

Post by 7NameSam »

What version of smbx makes it so it can play the .ogg music files?
also, how do I spawn an NPC with velocity?
Last edited by 7NameSam 8 years ago, edited 1 time in total.
User avatar
Voltgloss
Ask, and you shall be given. Think, and you shall find.
Posts: 1147
Joined: 10 years ago
Pronouns: he/him/his
Location: exploring the world, now with friends

Re: LunaDLL/LunLUA help thread

Post by Voltgloss »

SAJewers wrote:I think that seals the fact that we should have a "crazy gimmick levels" world with that, My Shooter level that I need to work on (preferably with help), Willhart's Demo's Fluffy Dream level...
Kitikami's Touhou level would fit here as well.
Image
Image
Image
Kil
Posts: 13
Joined: 15 years ago

Re: LunaDLL/LunaLUA help thread

Post by Kil »

I fixed a typo in the title. I think luna devs like kevsoft should get mod status of this board so they can do maintenance stuff.
DON'T PM me. Ask your question in the help thread so everyone can be answered.
User avatar
Rednaxela
Maker of Shenanigans
Posts: 897
Joined: 10 years ago
Pronouns: they/them
https://rednaxela.talkhaus.com

Re: LunaDLL/LunLUA help thread

Post by Rednaxela »

SAJewers wrote:Am I right in saying that there''s currently no way to grab leek information from a save?
I'm talking like the "0/1" indicator or whatever in a HUB. There's no way currently to grab that info and put it in a variable, correct?
So far as I'm aware anyway, the way of doing this is not currently known no.
7NameSam wrote:What version of smbx makes it so it can play the .ogg music files?
also, how do I spawn an NPC with velocity?
Any version with a LunaDLL/LunaLua version from 2015 should allow .oog music files to work :)

To spawn an NPC with velocity, something like this example:

Code: Select all

-- Spawn a goomba 70px above the player
local myNewNPC = NPC.spawn(1, player.x, player.y - 70, player.section)

-- Give the newly spawned NPC a velocity such that it is traveling upwards when spawned
myNewNPC.speedY = -10
User avatar
Wohlstand
Moondust and TheXTech developer
Posts: 186
Joined: 10 years ago
First name: Vitaly
Pronouns: he/him/his
Location: Moscow, Russia

Re: LunaDLL/LunaLUA help thread

Post by Wohlstand »

Kil wrote:I fixed a typo in the title. I think luna devs like kevsoft should get mod status of this board so they can do maintenance stuff.
Also, links at main post are super-legacy (gamearcheology host is dead), therefore I have collected stuff at me:
http://engine.wohlnet.ru/docs/Collected ... unaDLL.htm
and
http://engine.wohlnet.ru/docs/Collected ... torial.txt
however it legacy now. So, modern stuff is here: http://engine.wohlnet.ru/pgewiki/Category:LunaLua_API
User avatar
SAJewers
ASMBXT Level Wrangler/A2XT Project Coordinator /AAT Level Designer
Posts: 4218
Joined: 12 years ago
Location: Nova Scotia

Re: LunaDLL/LunLUA help thread

Post by SAJewers »

Rednaxela wrote:
SAJewers wrote:Am I right in saying that there''s currently no way to grab leek information from a save?
I'm talking like the "0/1" indicator or whatever in a HUB. There's no way currently to grab that info and put it in a variable, correct?
So far as I'm aware anyway, the way of doing this is not currently known no.
Aww. Oh well.
ImageImageImageImageImage | Image | Image
Sharenite | RetroAchievements | NameMC | IGDB
User avatar
SAJewers
ASMBXT Level Wrangler/A2XT Project Coordinator /AAT Level Designer
Posts: 4218
Joined: 12 years ago
Location: Nova Scotia

Re: LunaDLL/LunLUA help thread

Post by SAJewers »

SAJewers wrote:
EDIT3:

Code: Select all

function onInputUpdate()
	if (player.dropItemKeyPressing and player.pauseKeyPressing) then
		Level.exit()
		mem(0x00B250E2,FIELD_FLOAT,0)
		player.dropItemKeyPressing = false
		player.pauseKeyPressing = false
	end
	if (player.pauseKeyPressing) then
		Text.print("RUN2",60,400)

	end
	if (player.dropItemKeyPressing) then
		Text.print("SELECT",80,400)
	end
end
This works, but I get a blank overworld frame, and the level music continues until I either let go of select first, or press another button. An ideas?
Still getting this issue. Any ideas? Try it in A2XT Ep1 as a lunaworld.lua if you want to see it.
ImageImageImageImageImage | Image | Image
Sharenite | RetroAchievements | NameMC | IGDB
S1eth
Posts: 291
Joined: 9 years ago

Re: LunaDLL/LunaLUA help thread

Post by S1eth »

I have a question about npc index.

I am checking if Mario stands on an NPC using the offset 0x176 which returns the "Index of sprite being stood on".
So, if I have 3 NPCs, it returns a number from 1 to 3.

I wrapped specific NPCs of the player's current section into pNPCs (because I need to keep track of states over multiple ticks).
So, I wonder, how do I check which pNPC this index number corresponds to?
Is this the same as the pNPC's "uid"?
That seemed to work in my limited testing with 3 NPCs in a single section. (but I don't know if that would work if I manually spawned new npcs, or used findnpcs again for a different section.
Image
Post Reply