Page 50 of 59

Re: LunaDLL/LunLUA help thread

Posted: 14 Sep 2015, 00:49
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

Re: LunaDLL/LunLUA help thread

Posted: 14 Sep 2015, 15:19
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.

Re: LunaDLL/LunLUA help thread

Posted: 14 Sep 2015, 15:20
by SAJewers
Awesomne. Thanks.

Re: LunaDLL/LunLUA help thread

Posted: 30 Sep 2015, 09:51
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.

Re: LunaDLL/LunLUA help thread

Posted: 30 Sep 2015, 11:12
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.

Re: LunaDLL/LunLUA help thread

Posted: 03 Oct 2015, 23:06
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?

Re: LunaDLL/LunLUA help thread

Posted: 04 Oct 2015, 08:17
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)

Re: LunaDLL/LunLUA help thread

Posted: 04 Oct 2015, 12:16
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.

Re: LunaDLL/LunLUA help thread

Posted: 04 Oct 2015, 20:22
by Hoeloe
I made a thing. I blame SAJewers.

Image

Re: LunaDLL/LunLUA help thread

Posted: 04 Oct 2015, 21:06
by WestonSmith
I understand most of it, but what in the dickens does the magic bar represent?

Re: LunaDLL/LunLUA help thread

Posted: 04 Oct 2015, 21:14
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...

Re: LunaDLL/LunLUA help thread

Posted: 04 Oct 2015, 21:52
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.

Re: LunaDLL/LunLUA help thread

Posted: 04 Oct 2015, 23:57
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.

Re: LunaDLL/LunLUA help thread

Posted: 05 Oct 2015, 05:32
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?

Re: LunaDLL/LunLUA help thread

Posted: 05 Oct 2015, 13:24
by SAJewers
I'm thinking Soldier Blade Stage 1.


Re: LunaDLL/LunLUA help thread

Posted: 06 Oct 2015, 18:25
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"

Re: LunaDLL/LunLUA help thread

Posted: 07 Oct 2015, 18:57
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?

Re: LunaDLL/LunLUA help thread

Posted: 08 Oct 2015, 01:47
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?

Re: LunaDLL/LunLUA help thread

Posted: 08 Oct 2015, 15:30
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.

Re: LunaDLL/LunaLUA help thread

Posted: 11 Oct 2015, 07:18
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.

Re: LunaDLL/LunLUA help thread

Posted: 11 Oct 2015, 07:59
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

Re: LunaDLL/LunaLUA help thread

Posted: 11 Oct 2015, 12:22
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

Re: LunaDLL/LunLUA help thread

Posted: 11 Oct 2015, 12:41
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.

Re: LunaDLL/LunLUA help thread

Posted: 14 Oct 2015, 02:13
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.

Re: LunaDLL/LunaLUA help thread

Posted: 19 Oct 2015, 12:24
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.