Page 59 of 59

Re: LunaDLL/LunaLUA help thread

Posted: 17 Apr 2016, 05:44
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.

Re: LunaDLL/LunaLUA help thread

Posted: 17 Apr 2016, 05:53
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?

Re: LunaDLL/LunaLUA help thread

Posted: 17 Apr 2016, 08:05
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.

Re: LunaDLL/LunaLUA help thread

Posted: 17 Apr 2016, 15:18
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.

Re: LunaDLL/LunaLUA help thread

Posted: 17 Apr 2016, 21:18
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.

Re: LunaDLL/LunaLUA help thread

Posted: 17 Apr 2016, 21:32
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?

Re: LunaDLL/LunaLUA help thread

Posted: 18 Apr 2016, 02:39
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 :(

Re: LunaDLL/LunaLUA help thread

Posted: 20 Apr 2016, 01:48
by Holy
Yoyoyoyoyoyo, how do I send the player to a coordinate in another section? I can't figure it out.

Re: LunaDLL/LunaLUA help thread

Posted: 22 Apr 2016, 09:17
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.

Re: LunaDLL/LunaLUA help thread

Posted: 22 Apr 2016, 09:24
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.

Re: LunaDLL/LunaLUA help thread

Posted: 23 Apr 2016, 16:58
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.

Re: LunaDLL/LunaLUA help thread

Posted: 23 Apr 2016, 18:31
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.

Re: LunaDLL/LunaLUA help thread

Posted: 23 Apr 2016, 18:40
by WestonSmith
Derns. Thanks all the same.

Re: LunaDLL/LunaLUA help thread

Posted: 08 May 2016, 04:20
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.

Re: LunaDLL/LunaLUA help thread

Posted: 21 May 2016, 02:47
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? :?:

Re: LunaDLL/LunaLUA help thread

Posted: 23 Jun 2016, 15:03
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

Re: LunaDLL/LunaLUA help thread

Posted: 16 Aug 2016, 18:53
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

Re: LunaDLL/LunaLUA help thread

Posted: 28 Aug 2016, 18:05
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.