(shouting)

LunaDLL/LunaLUA help thread

The second SMBX collab!
User avatar
FrozenQuills
hehe haha 2024
Posts: 843
Joined: 9 years ago
Location: my skull

Re: LunaDLL/LunaLUA help thread

Post by FrozenQuills »

Is there any way to disable the Grinder's (npc-179) tick sound?
Also is there a way to draw an image like a background object (like it goes behind blocks)?
Also this is likely unrelated to lua but what npcs are considered "background npcs" like in this image, and can those be configured?
Image
Image
avatar by crayonchewer!
Image
Image
Image
SMBX Tileset Compiler and Separator
The boss entry that made me eat a shoe.

5th place counter: 5
(SMBX Forums CC11, SMBX Forums CC12, Endgame Madness Contest, SMWC Kaizo Contest 2016, SMWC 24hr Contest 2018)
User avatar
Kevsoft
LunaLua Master Developer
Posts: 83
Joined: 9 years ago

Re: LunaDLL/LunaLUA help thread

Post by Kevsoft »

FrozenQuills wrote:Is there any way to disable the Grinder's (npc-179) tick sound?
Maybe throught sounds.ini and replace it with an slient sound? If you need the sound otherwise, then I need to find something else.
FrozenQuills wrote:Also is there a way to draw an image like a background object (like it goes behind blocks)?
Nope, Render Priority is currently on active for custom images and custom text.
FrozenQuills wrote:Also this is likely unrelated to lua but what npcs are considered "background npcs" like in this image, and can those be configured?
Can't say a lot about this but maybe this link helps futher: http://engine.wohlnet.ru/pgewiki/SMBX64 ... cters_list
User avatar
FrozenQuills
hehe haha 2024
Posts: 843
Joined: 9 years ago
Location: my skull

Re: LunaDLL/LunaLUA help thread

Post by FrozenQuills »

Ah I see.
Thanks though, replacing the tick sound with silence worked!
Image
Image
avatar by crayonchewer!
Image
Image
Image
SMBX Tileset Compiler and Separator
The boss entry that made me eat a shoe.

5th place counter: 5
(SMBX Forums CC11, SMBX Forums CC12, Endgame Madness Contest, SMWC Kaizo Contest 2016, SMWC 24hr Contest 2018)
User avatar
SAJewers
ASMBXT Level Wrangler/A2XT Project Coordinator /AAT Level Designer
Posts: 4199
Joined: 11 years ago
Location: Nova Scotia

Re: LunaDLL/LunaLUA help thread

Post by SAJewers »

Code: Select all

for  k,v in pairs(NPC.get(38, -1))  do
		if (v.ai1 == 0) then
			v.ai1 = 1
		end
	end
Any idea why this doesn't work/seem to do anything?
ImageImageImageImageImage | Image | Image
Sharenite | RetroAchievements | NameMC | IGDB
User avatar
Kevsoft
LunaLua Master Developer
Posts: 83
Joined: 9 years ago

Re: LunaDLL/LunaLUA help thread

Post by Kevsoft »

SAJewers wrote:

Code: Select all

for  k,v in pairs(NPC.get(38, -1))  do
		if (v.ai1 == 0) then
			v.ai1 = 1
		end
	end
Any idea why this doesn't work/seem to do anything?
Seems like this ai-field gets overwritten...
User avatar
Karatekid5
Welcome to the resort!
Posts: 78
Joined: 14 years ago
Location: Pennsylvania
Contact:

Re: LunaDLL/LunaLUA help thread

Post by Karatekid5 »

Kevsoft wrote:Try with:

Code: Select all

local overlay = Graphics.loadImage(Misc.resolveFile("HUB/Olimar.png"));

function onLoop()
   if (player.x > -119306 and player.x < -119262 and player.y > -119974 and player.y <-119682) then
      Text.print("Olimaaaaaar",12,12)
      Graphics.placeSprite(1, overlay, 100, 100)
   end
end
I tried out that code, SMBX crashed with the same exception code (0xc0000005).
Yoshi Ambassador!
Image
WasabiJellyfish
Posts: 117
Joined: 9 years ago

Re: LunaDLL/LunaLUA help thread

Post by WasabiJellyfish »

Karatekid5 wrote:
Kevsoft wrote:Try with:

Code: Select all

local overlay = Graphics.loadImage(Misc.resolveFile("HUB/Olimar.png"));

function onLoop()
   if (player.x > -119306 and player.x < -119262 and player.y > -119974 and player.y <-119682) then
      Text.print("Olimaaaaaar",12,12)
      Graphics.placeSprite(1, overlay, 100, 100)
   end
end
I tried out that code, SMBX crashed with the same exception code (0xc0000005).
Is the image actually called HUB/Olimar.png?
User avatar
Karatekid5
Welcome to the resort!
Posts: 78
Joined: 14 years ago
Location: Pennsylvania
Contact:

Re: LunaDLL/LunaLUA help thread

Post by Karatekid5 »

Ah, it was named "olimar.png" instead of "Olimar.png". I didn't realize it was case sensitive ^^; . The code works now, and thank you for helping me out!
Yoshi Ambassador!
Image
momo
Posts: 797
Joined: 10 years ago

Re: LunaDLL/LunaLUA help thread

Post by momo »

how would I go about changing the sounds for my level? I don't want the atmosphere of my level to be ruined by the cheery death tone.
here's mine
User avatar
Kevsoft
LunaLua Master Developer
Posts: 83
Joined: 9 years ago

Re: LunaDLL/LunaLUA help thread

Post by Kevsoft »

You can use sounds.ini in the custom level folder to deactivate it.
See here: http://engine.wohlnet.ru/pgewiki/Game_C ... sounds.ini
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 »

Kevsoft wrote:You can use sounds.ini in the custom level folder to deactivate it.
See here: http://engine.wohlnet.ru/pgewiki/Game_C ... sounds.ini
You also forgot to plug actual SMBX sound-ID List: http://engine.wohlnet.ru/pgewiki/SFX_list_%28SMBX64%29
That will help to declare RIGHT sounds. Example of alone sound declare (Player death sound-ID is 8)

Code: Select all

[sound-8]
name="Playere died"
file="oh-no_i_died.ogg"
User avatar
Holy
Posts: 133
Joined: 12 years ago

Re: LunaDLL/LunaLUA help thread

Post by Holy »

Okay you know how if you type shadowstar/ghostytime the player turns completely black? Is there a way to toggle that blackness on/off without also getting the effects of the cheat?
User avatar
Kevsoft
LunaLua Master Developer
Posts: 83
Joined: 9 years ago

Re: LunaDLL/LunaLUA help thread

Post by Kevsoft »

Not right now... or you have to check the memory fields of the player.
User avatar
Holy
Posts: 133
Joined: 12 years ago

Re: LunaDLL/LunaLUA help thread

Post by Holy »

Dang. I'll try and see if I can find it in there. I remember I figured something out with this before but I can't find the level, haha.
User avatar
kitikami
Posts: 853
Joined: 10 years ago

Re: LunaDLL/LunaLUA help thread

Post by kitikami »

I believe setting the memory address 00B2C8AA to something higher than 0 turns the player sprite black. I don't know if it has any of the other effects from the cheat, though.
User avatar
Holy
Posts: 133
Joined: 12 years ago

Re: LunaDLL/LunaLUA help thread

Post by Holy »

kitikami wrote:I believe setting the memory address 00B2C8AA to something higher than 0 turns the player sprite black. I don't know if it has any of the other effects from the cheat, though.
It works! And the other effects don't happen, either!
!!!
User avatar
Kevsoft
LunaLua Master Developer
Posts: 83
Joined: 9 years ago

Re: LunaDLL/LunaLUA help thread

Post by Kevsoft »

Holy wrote:
kitikami wrote:I believe setting the memory address 00B2C8AA to something higher than 0 turns the player sprite black. I don't know if it has any of the other effects from the cheat, though.
It works! And the other effects don't happen, either!
!!!
Are you sure? Because when looking at my memory map I see that it directly points to the cheat-value. I might be mistaken.
User avatar
Kevsoft
LunaLua Master Developer
Posts: 83
Joined: 9 years ago

Re: LunaDLL/LunaLUA help thread

Post by Kevsoft »

LunaLua v0.7.2.2 has been released with following changes:
* Extended NPC class
* Bugfix [LunaLua]: Fixed Camera.width and Camera.height
* Bugfix [LunaLua]: Fixed the bug, where the functions Blocks.get and Blocks.getInterseting don't includes the last block.
* Added onNPCKill event
* Block can now be spawned with Block.spawn(...)
User avatar
Holy
Posts: 133
Joined: 12 years ago

Re: LunaDLL/LunaLUA help thread

Post by Holy »

Kevsoft wrote:
Holy wrote:
kitikami wrote:I believe setting the memory address 00B2C8AA to something higher than 0 turns the player sprite black. I don't know if it has any of the other effects from the cheat, though.
It works! And the other effects don't happen, either!
!!!
Are you sure? Because when looking at my memory map I see that it directly points to the cheat-value. I might be mistaken.
Yeah, and if you're constantly setting it to 1 like I am the cheat won't even work. I don't actually know how weird that is, but it seems WEIRD
User avatar
Kevsoft
LunaLua Master Developer
Posts: 83
Joined: 9 years ago

Re: LunaDLL/LunaLUA help thread

Post by Kevsoft »

Holy wrote: Yeah, and if you're constantly setting it to 1 like I am the cheat won't even work. I don't actually know how weird that is, but it seems WEIRD
Try setting it to -1 and see what happens. Because VB6 usally takes "-1" as true and 0 as false. Other values might give unexpected behaviour.
User avatar
Holy
Posts: 133
Joined: 12 years ago

Re: LunaDLL/LunaLUA help thread

Post by Holy »

Yup, -1 is the full cheat. Wonder if weird stuff happens like this anywhere else
User avatar
WestonSmith
Bunny
Posts: 188
Joined: 11 years ago

Re: LunaDLL/LunaLUA help thread

Post by WestonSmith »

Herp da derp time, but when using Lua for autoscroll, how do I stop the autoscroll?

I figure the solution is to set the speed to 0 (the boundaries can remain), but when I try to use OnEvent, it either (A) Set the speed to 0 upon loading the level or (B) Never calls the Event and the autoscroll keeps on going.

I figure it should look something like this (NOTE: StopScroll is the name of the event in the engine itself):

function OnEvent(StopScroll)
if StopScroll == 1 then
speed = 0
end
end


Any help would be much obliged.
User avatar
Kevsoft
LunaLua Master Developer
Posts: 83
Joined: 9 years ago

Re: LunaDLL/LunaLUA help thread

Post by Kevsoft »

WestonSmith wrote:Herp da derp time, but when using Lua for autoscroll, how do I stop the autoscroll?

I figure the solution is to set the speed to 0 (the boundaries can remain), but when I try to use OnEvent, it either (A) Set the speed to 0 upon loading the level or (B) Never calls the Event and the autoscroll keeps on going.

I figure it should look something like this (NOTE: StopScroll is the name of the event in the engine itself):

function OnEvent(StopScroll)
if StopScroll == 1 then
speed = 0
end
end


Any help would be much obliged.
I think you misunderstood the way how onEvent works.
So first things first: All events are case-sensitive.

Code: Select all

OnEvent
to

Code: Select all

onEvent
The next issue is the parameter. The parameter is a string which contains the event name. So in your case this would be "StopScroll":

Code: Select all

function onEvent(eventName)
  if(eventName == "StopScroll")then
    -- do stuff here
  end
end
That's not the full solution, but this should fix the issue with not having your code beeing called.
User avatar
WestonSmith
Bunny
Posts: 188
Joined: 11 years ago

Re: LunaDLL/LunaLUA help thread

Post by WestonSmith »

Thanks Kev, solved my problem.
Mikkofier
What about Ron magic?
Posts: 699
Joined: 11 years ago
First name: Mikko J. Fuzzygrumbles
Pronouns: he/him/his
Location: Lots of miles from Vietnam
Contact:

Re: LunaDLL/LunaLUA help thread

Post by Mikkofier »

How does one change the amount of hits that it takes to kill a 'boss' npc?
Many people need desperately to receive this message: I feel and think much as you do, care about many of the things you care about, although most people do not care about them. You are not alone.
-Kurt Vonnegut
Context-free Supper Mario Broth Roulette! NOTE: Potential Jumpscare warning!
Image
Avatar source (for most of them).
Image
Post Reply