(shouting)

LunaDLL/LunaLUA help thread

The second SMBX collab!
User avatar
Holy
Posts: 133
Joined: 12 years ago

Re: LunaDLL/LunaLUA help thread

Post by Holy »

Wohlstand wrote:stuff
Thanks for the help! Yeah, I had to fidget around with it before I got it like I wanted it.
User avatar
7NameSam
hey
Posts: 248
Joined: 9 years ago
Pronouns: they/them

Re: LunaDLL/LunaLUA help thread

Post by 7NameSam »

Rockythechao wrote:Ah, sorry, I forgot to update the documentation. The former implementation wouldn't work no matter what I tried so in the latest version sections are based on index instead of value; as long as sections[2] is a non-nil value it'll work. iirc the proper syntax is {2:1}.
I don't understand the explanation, how do I make the value of sections[2] non-nil?
Rixithechao
https://www.youtube.com/watch?v=BODxOghVmko
Posts: 1812
Joined: 10 years ago
First name: Mack
https://rixithechao.talkhaus.com/

Re: LunaDLL/LunaLUA help thread

Post by Rixithechao »

Code: Select all

sections={2:1, 3:5, 4:99999}
Should make the layer appear in sections 2, 3 and 4. Undefined indexes in lua tables return nil, so as long as the index is assigned any value besides nil it'll count.

That said, it's clear now that index-based is relatively unintuitive and suddenly changing the argument's syntax long after it's been firmly established was a mistake on my part, documented or not. So I'm going to try to get value-based sections working for 1.3.3 along with a variable to toggle back to index-based.
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
7NameSam
hey
Posts: 248
Joined: 9 years ago
Pronouns: they/them

Re: LunaDLL/LunaLUA help thread

Post by 7NameSam »

Rockythechao wrote:

Code: Select all

sections={2:1, 3:5, 4:99999}
Should make the layer appear in sections 2, 3 and 4. Undefined indexes in lua tables return nil, so as long as the index is assigned any value besides nil it'll count.

That said, it's clear now that index-based is relatively unintuitive and suddenly changing the argument's syntax long after it's been firmly established was a mistake on my part, documented or not. So I'm going to try to get value-based sections working for 1.3.3 along with a variable to toggle back to index-based.
will this method not work with version 1.1 of ParalX? if that's the case then I guess I'm straight out of luck then because the latest version straight up doesn't draw the foreground and background layers when I tried it with the latest version of the luna files on the A2XT onedrive.
Rixithechao
https://www.youtube.com/watch?v=BODxOghVmko
Posts: 1812
Joined: 10 years ago
First name: Mack
https://rixithechao.talkhaus.com/

Re: LunaDLL/LunaLUA help thread

Post by Rixithechao »

The sections feature has been stubbornly broken up until 1.3.2; every time I thought I fixed it the blasted thing ended up still not working for someone.

Once the 1.3.3 update is ready I'll copy it over to onedrive. In the meantime, you can work around it by leaving the sections undefined and just setting the layer's visibility (LayerName.visible) based on the current section. Apologies for the trouble.
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
7NameSam
hey
Posts: 248
Joined: 9 years ago
Pronouns: they/them

Re: LunaDLL/LunaLUA help thread

Post by 7NameSam »

Rockythechao wrote:The sections feature has been stubbornly broken up until 1.3.2; every time I thought I fixed it the blasted thing ended up still not working for someone.

Once the 1.3.3 update is ready I'll copy it over to onedrive. In the meantime, you can work around it by leaving the sections undefined and just setting the layer's visibility (LayerName.visible) based on the current section. Apologies for the trouble.
but the layers only show up in section 1?
Rixithechao
https://www.youtube.com/watch?v=BODxOghVmko
Posts: 1812
Joined: 10 years ago
First name: Mack
https://rixithechao.talkhaus.com/

Re: LunaDLL/LunaLUA help thread

Post by Rixithechao »

So long story short, they're probably not showing up in 1.1 due to messed up positioning math. I'm doing what I can to fix everything but I can't say how long it'll take, and frustrating life circumstances are eating into the time I have to work on fixing it. As if that wasn't enough, I accidentally overwrote the live copy with the development copy so now the current version of paralX is broken, and I'm risking losing access to my computer by writing this post for reasons I can't get into now.

I'm terribly, terribly sorry for the trouble :(
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
Holy
Posts: 133
Joined: 12 years ago

Re: LunaDLL/LunaLUA help thread

Post by Holy »

Yoyoyoyoyoyo, how do I send the player to a coordinate in another section? I can't figure it out.
User avatar
Karatekid5
Welcome to the resort!
Posts: 78
Joined: 14 years ago
Location: Pennsylvania
Contact:

Re: LunaDLL/LunaLUA help thread

Post by Karatekid5 »

Is it possible to time LunaLUA code to the beat of background music? I had a small gimmick idea for a factory level that would have specific things activate at specific times in a song, similar to SMWCP2's Musical Mechanisms.
Yoshi Ambassador!
Image
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 »

Karatekid5 wrote:Is it possible to time LunaLUA code to the beat of background music? I had a small gimmick idea for a factory level that would have specific things activate at specific times in a song, similar to SMWCP2's Musical Mechanisms.
Function Audio.MusicClock() Returns the time starts from begin of the current music track playback (in seconds [double type, so, decimals allowed]). The time resets to 0 when music track was changed.
User avatar
WestonSmith
Bunny
Posts: 188
Joined: 11 years ago

Re: LunaDLL/LunaLUA help thread

Post by WestonSmith »

Just gonna ask some blanket questions:

(1) I know there is a blue shoe filter in A2XT Episode 2... but is there a code for filtering out all mounts at the start of a level?
(2) I know there's also a Raocoin tracker in Episode 2. However, it seems to be giving me hassle whenever I try to add it to my own code. Is there a wiki page on this (I can't seem to find one).

If anyone simply has links to the wiki page that answers these, I'd take them. I'm having trouble finding anything meaningful on them.
User avatar
Hoeloe
A2XT person
Posts: 1016
Joined: 12 years ago
Pronouns: she/her
Location: Spaaace

Re: LunaDLL/LunaLUA help thread

Post by Hoeloe »

WestonSmith wrote: (2) I know there's also a Raocoin tracker in Episode 2. However, it seems to be giving me hassle whenever I try to add it to my own code. Is there a wiki page on this (I can't seem to find one).
The raocoin tracker is a custom built thing for Episode 2. It's a bit complex and relies on some very specific stuff.
Image
Image
Image
Image
Image
User avatar
WestonSmith
Bunny
Posts: 188
Joined: 11 years ago

Re: LunaDLL/LunaLUA help thread

Post by WestonSmith »

Derns. Thanks all the same.
User avatar
Karatekid5
Welcome to the resort!
Posts: 78
Joined: 14 years ago
Location: Pennsylvania
Contact:

Re: LunaDLL/LunaLUA help thread

Post by Karatekid5 »

Is it possible to slow down the frame speed of an animated background? I want the walls of the background to change colors, like at a party, but I want to do it without hurting people's eyes.
Yoshi Ambassador!
Image
User avatar
Ittababy
Posts: 13
Joined: 10 years ago

Re: LunaDLL/LunaLUA help thread

Post by Ittababy »

Is there or can there be a database of lunalua codes? Like maybe a section of one of the wiki's being where everyone logs in helpful things. I ask because I know that what I want is already solved somewhere, but I forget how to do it. (wind) Wouldn't it be nice if we could share all this stuff in a nice organized way? ...Or do we already do that? :?:
A very shy ghost.
S1eth
Posts: 291
Joined: 9 years ago

Re: LunaDLL/LunaLUA help thread

Post by S1eth »

I am having trouble with the Graphics.glDraw function and I believe that the function is bugged when using "sceneCoords = true".

Specifically, when I draw with sceneCoords, the image is drawn one pixel too far up, and one pixel too far left.

Test: I have an image with width = 96 and height = 32.
I want to draw this image in the top left corner of my screen.
These two functions should be identical?

Code: Select all

    --scene coords
    Graphics.glDraw{
      texture = testImg,
      vertexCoords = translate(vtxTest, Camera.get()[1].x+48, Camera.get()[1].y+16),
      textureCoords = texTest,
      sceneCoords = true,
      priority = -15.0
    };
    
    --screen coords
    Graphics.glDraw{
      texture = testImg,
      vertexCoords = translate(vtxTest, 48, 16),
      textureCoords = texTest,
      priority = -15.0
    };
The first function is off by one pixel along both the x and y axis.
I have to add +1 to x and y.

translate(vtxTest, Camera.get()[1].x+48+1, Camera.get()[1].y+16+1),

If I apply transformations such as rotation, or flipping horizonally/vertically, there are more problems.

Gifs of the tests:

normal
Image

rotate by 180°
Image

flip horizontally
Image
Image
User avatar
Leet
Well, hello, Smith ( ´-`)ノ
Posts: 3025
Joined: 11 years ago
First name: Chie Arale
Pronouns: she/her
Location: Harman's Room
https://leet.talkhaus.com/

Re: LunaDLL/LunaLUA help thread

Post by Leet »

installed lunalua on a vanilla smebex for the first time and for some reason the game keeps freezing up when entering or beating a level? :s not every time and sometimes the game comes back but
Well it is a decent hack but sometime its just too repetitif there no level that actually pop in your face and your like oh yeah that level they all ressemble themselves and just monster along the way.
Blood Ghoul wrote:Sometimes it seems my blood spurts out in gobs, as if it were a fountain's pulsing sobs. I clearly hear it mutter as it goes yet cannot find the wound from which it flows. Before I met you, baby, I didn't know what I was missing.
User avatar
ztarwuff
What the heck is a flair and why am I being asked to write one for my profile?
Posts: 550
Joined: 10 years ago
Location: Within 2 miles of the Imperial Crypt of Napoleon III

Re: LunaDLL/LunaLUA help thread

Post by ztarwuff »

Does anybody know if there's a way of making all the enemies invincible? I'm trying to use NPC8 as one of those spike traps that shoot out of the floor like in the movies, except I don't want the player or shells to kill the npc.

Also, if there's a way to get NPC8 to ignore priority, that'd also be great, but for now I'd settle for invincible npc.
Post Reply