darklevel.lua (WIP) V1.1

This is the place for discussion and support for LunaLua and related modifications and libraries.
Forum rules
Before you make a topic/post, consider the following:
-Is there a topic for this already?
-Is your post on topic/appropriate?
-Are you posting in the right forum/following the forum rules?
The Dwarven Digger
Lakitu
Lakitu
Posts: 484
Joined: Sun Oct 30, 2016 11:17 am
Pronouns: they/them

darklevel.lua (WIP) V1.1

Postby The Dwarven Digger » Sun Dec 30, 2018 1:56 pm

I was using the nsmbwalls.lua library for one of my projects and I thought to myself "Maybe I could use something similar to make dark levels?". So, I did just that. I heavily edited and rewrote the nsmbwalls code, did some research, and eventually got it to work. Currently it is quite laggy (for me at least) and the parameters have to be specified inside the library itself, but it does work (mostly).

Features
Spoiler: show
  • Able to specify blocks, NPCs and BGOs as light sources
  • Can customise light circle size separately for players, BGOs, NPCs and blocks
  • 2-player compatible (see known bugs)
Known bugs
Spoiler: show
  • When in splitscreen mode with two players, a light source visible to both players will create graphical glitches
  • NPC light circles only appear once the NPC is onscreen (but remain while NPC is loaded)
How to use
Spoiler: show
  • Load the library using the following statement

    Code: Select all

    local darklevel = API.load("darklevel")
  • Set up the ids of NPCs, blocks and BGOs you want to emit light

    Code: Select all

    darklevel.lightNPCs = {ids}
    darklevel.lightBlocks = {ids}
    darklevel.lightBGOs = {ids}
  • Change the colour and transparency of the darkness effect using RGBA hex code

    Code: Select all

    darklevel.darknessCol = 0xff000080 -- Red semi-transparent effect
I shortened colour to col to keep the Americans happy
Screenshots
Spoiler: show
Image
Image
Image
Download
Click here!

Although I have some experience with coding, this is my first LunaLua library.
Big thanks to Sambo for creating the nsmbwalls.lua library, without it I wouldn't have known where to start.
Last edited by The Dwarven Digger on Sun Jan 06, 2019 2:56 pm, edited 4 times in total.

PixelPest
Raccoon Mario
Raccoon Mario
Posts: 7111
Joined: Sun Jul 12, 2015 5:38 pm
Flair: Tamer of Boom Booms
Contact:

Re: darklevel.lua (WIP)

Postby PixelPest » Sun Dec 30, 2018 2:07 pm

Just an fyi something like this is already part of Beta4:
Image

OlieGamerTV
Spike
Spike
Posts: 273
Joined: Sun Nov 26, 2017 7:23 am

Re: darklevel.lua (WIP)

Postby OlieGamerTV » Sun Dec 30, 2018 2:47 pm

PixelPest wrote:
Sun Dec 30, 2018 2:07 pm
Just an fyi something like this is already part of Beta4:
Image
Holy I really want Beta 4 now! Is it out yet? and if it isn't, someone tell me when its coming out pls!

PixelPest
Raccoon Mario
Raccoon Mario
Posts: 7111
Joined: Sun Jul 12, 2015 5:38 pm
Flair: Tamer of Boom Booms
Contact:

Re: darklevel.lua (WIP)

Postby PixelPest » Sun Dec 30, 2018 2:56 pm

OlieGamerTV wrote:
Sun Dec 30, 2018 2:47 pm
PixelPest wrote:
Sun Dec 30, 2018 2:07 pm
Just an fyi something like this is already part of Beta4:
Image
Holy I really want Beta 4 now! Is it out yet? and if it isn't, someone tell me when its coming out pls!
It's not out yet. The current version is Beta3. There is not a set release date for Beta4.


Also for the issue with NPCs respawning that are not yet visible, you can make use of the NPC.isHidden field

Eri7
Banned
Posts: 1770
Joined: Sat Jan 28, 2017 4:48 pm
Flair: Good Foundation allows for strong Execution
Contact:

Re: darklevel.lua (WIP)

Postby Eri7 » Sun Dec 30, 2018 5:26 pm

Is it possible to change the graphic of the darkness? Like by having a different transparency of the darkness effect or changing its colors?

The Dwarven Digger
Lakitu
Lakitu
Posts: 484
Joined: Sun Oct 30, 2016 11:17 am
Pronouns: they/them

Re: darklevel.lua (WIP)

Postby The Dwarven Digger » Sun Dec 30, 2018 5:44 pm

Eri7 wrote:
Sun Dec 30, 2018 5:26 pm
Is it possible to change the graphic of the darkness? Like by having a different transparency of the darkness effect or changing its colors?
You can change the colours and transparency by editing one draw function. I would like to be able to specify it in either the lunadll/lunaworld file or a text/.ini file that would go with the graphics, but I don't yet know enough about LunaLua to do that.

Quantumenace
Ripper II
Ripper II
Posts: 308
Joined: Mon Dec 28, 2015 2:17 am

Re: darklevel.lua (WIP)

Postby Quantumenace » Sun Dec 30, 2018 8:35 pm

Try pressing F3, what does your lag graph look like? Pressing F3 again will also give you a list of areas that eat the most processor time.

For me, it doesn't really seem to cause lag unless there's a huge amount of light circles on the screen. A lot of things in scripting appear to cause periodic small spikes or fluctuations in the lag graph, which may stall the display of certain frames and make it feel more laggy than it actually is.

xXAndytubeXx
Bit
Bit
Posts: 76
Joined: Wed Aug 16, 2017 5:50 pm
Flair: luigi is numero uno

Re: darklevel.lua (WIP)

Postby xXAndytubeXx » Sun Jan 06, 2019 11:11 am

Looks good, but the only problem is, I dunno if it'll work with 1.4.4. It seems you're using 2.0, but I currently can't get a good download of it.

ElectriKong
Posts: 4650
Joined: Mon Jun 06, 2016 4:32 pm
Flair: I have NO idea what to put here
Pronouns: he/him
Contact:

Re: darklevel.lua (WIP)

Postby ElectriKong » Sun Jan 06, 2019 11:16 am

xXAndytubeXx wrote:
Sun Jan 06, 2019 11:11 am
Looks good, but the only problem is, I dunno if it'll work with 1.4.4. It seems you're using 2.0, but I currently can't get a good download of it.
Won't work with 1.4

Westretroman
Eerie
Eerie
Posts: 704
Joined: Tue Mar 29, 2016 6:50 pm

Re: darklevel.lua (WIP)

Postby Westretroman » Sun Jan 06, 2019 11:32 am

xXAndytubeXx wrote:
Sun Jan 06, 2019 11:11 am
Looks good, but the only problem is, I dunno if it'll work with 1.4.4. It seems you're using 2.0, but I currently can't get a good download of it.
I think the funny fact of the matter is that you mentioned if a 2.0 script could work in 1.4, several times already.

xXAndytubeXx
Bit
Bit
Posts: 76
Joined: Wed Aug 16, 2017 5:50 pm
Flair: luigi is numero uno

Re: darklevel.lua (WIP)

Postby xXAndytubeXx » Sun Jan 06, 2019 5:12 pm

Westretroman wrote:
Sun Jan 06, 2019 11:32 am
I think the funny fact of the matter is that you mentioned if a 2.0 script could work in 1.4, several times already.
Electriking wrote:
Sun Jan 06, 2019 11:16 am
Won't work with 1.4
Looks like we're still arguing if LunaLUA can actually work in 1.4.4. This is stupid. Just stop, it's over, I already got a script working in 1.4.4. Hell, a moderator got into this mess. I feel bad for PixelPest. So let's just drop the argument.

The Dwarven Digger
Lakitu
Lakitu
Posts: 484
Joined: Sun Oct 30, 2016 11:17 am
Pronouns: they/them

Re: darklevel.lua (WIP)

Postby The Dwarven Digger » Sun Jan 06, 2019 5:40 pm

xXAndytubeXx wrote:
Sun Jan 06, 2019 5:12 pm
Westretroman wrote:
Sun Jan 06, 2019 11:32 am
I think the funny fact of the matter is that you mentioned if a 2.0 script could work in 1.4, several times already.
Electriking wrote:
Sun Jan 06, 2019 11:16 am
Won't work with 1.4
Looks like we're still arguing if LunaLUA can actually work in 1.4.4. This is stupid. Just stop, it's over, I already got a script working in 1.4.4. Hell, a moderator got into this mess. I feel bad for PixelPest. So let's just drop the argument.
Yes, this is stupid. You're refusing to acknowledge that lunalua is not compatible with 38-A. How about you copy my file with ZERO CHANGES WHATSOEVER into a test level or something and see if it works then. Heck, go copy over imagic.lua and all the libraries it depends on so that you've got all the lua you could ever need. Come back with proof (screenshots of the unedited code and it working in 38-A). Shouldn't be too hard if it works like you think it does, should it?

Added in 1 minute 40 seconds:
Re: darklevel.lua (WIP) V1.1
Oh, and you're going to need to set it up exactly like it says in the OP, all you need is a lunadll.lua file with the line

Code: Select all

API.load("darklevel")

Eri7
Banned
Posts: 1770
Joined: Sat Jan 28, 2017 4:48 pm
Flair: Good Foundation allows for strong Execution
Contact:

Re: darklevel.lua (WIP) V1.1

Postby Eri7 » Sun Jan 06, 2019 5:48 pm

The Dwarven Digger and xXAndytubeXx, there is no point in making arguments about this, i am here to confirm from my 2 year long experience with 38A that luna lua stuff don't work with 38A. Case closed.

xXAndytubeXx
Bit
Bit
Posts: 76
Joined: Wed Aug 16, 2017 5:50 pm
Flair: luigi is numero uno

Re: darklevel.lua (WIP)

Postby xXAndytubeXx » Sun Jan 06, 2019 5:53 pm

The Dwarven Digger wrote:
Sun Jan 06, 2019 5:42 pm
xXAndytubeXx wrote:
Sun Jan 06, 2019 5:12 pm
Westretroman wrote:
Sun Jan 06, 2019 11:32 am
I think the funny fact of the matter is that you mentioned if a 2.0 script could work in 1.4, several times already.
Electriking wrote:
Sun Jan 06, 2019 11:16 am
Won't work with 1.4
Looks like we're still arguing if LunaLUA can actually work in 1.4.4. This is stupid. Just stop, it's over, I already got a script working in 1.4.4. Hell, a moderator got into this mess. I feel bad for PixelPest. So let's just drop the argument.
Yes, this is stupid. You're refusing to acknowledge that lunalua is not compatible with 38-A. How about you copy my file with ZERO CHANGES WHATSOEVER into a test level or something and see if it works then. Heck, go copy over imagic.lua and all the libraries it depends on so that you've got all the lua you could ever need. Come back with proof (screenshots of the unedited code and it working in 38-A). Shouldn't be too hard if it works like you think it does, should it?

Added in 1 minute 40 seconds:
Re: darklevel.lua (WIP) V1.1
Oh, and you're going to need to set it up exactly like it says in the OP, all you need is a lunadll.lua file with the line

Code: Select all

API.load("darklevel")
If you look at my episode, you can see PixelPests Walljump script being used.

Now, 38-A doesn't have LunaLUA compatibility. But I still can use a few LunaLUA scripts. This is evident in Power Star REVIVAL. So if you just take up at least 30 minutes of your time to look at SMBX - Power Star REVIVAL, you can see the script in use.

And no, I'm not trying to promote my project's demo. I'm just trying to show you that the Walljump script INDEED works with 38-A.

Added in 1 minute 35 seconds:
Re: darklevel.lua (WIP) V1.1
Eri7 wrote:
Sun Jan 06, 2019 5:48 pm
The Dwarven Digger and xXAndytubeXx, there is no point in making arguments about this, i am here to confirm from my 2 year long experience with 38A that luna lua stuff don't work with 38A. Case closed.
I don't want to argue about stupid stuff like this, but I'm trying to make a point. The Walljump script I got works with 38-A. Maybe even this one will work.

And I'm gonna prove it.

Emral
Cute Yoshi Egg
Cute Yoshi Egg
Posts: 9707
Joined: Mon Jan 20, 2014 12:58 pm
Flair: Phoenix

Re: darklevel.lua (WIP)

Postby Emral » Sun Jan 06, 2019 5:55 pm

xXAndytubeXx wrote:
Sun Jan 06, 2019 5:53 pm
And no, I'm not trying to promote my project's demo. I'm just trying to show you that the Walljump script INDEED works with 38-A.
SMBX2 and LunaLua developer here. Teascript-vbs and Lua are entirely different and incompatible languages. There is no further argument. This is a fact. It's likely that you are misunderstanding some intricacies, but please do not expect anything written in lunalua to work in SMBX38A 1.4.4 without major modifications to its syntax and logic (basically, a rewrite of the core concept).

xXAndytubeXx
Bit
Bit
Posts: 76
Joined: Wed Aug 16, 2017 5:50 pm
Flair: luigi is numero uno

Re: darklevel.lua (WIP)

Postby xXAndytubeXx » Sun Jan 06, 2019 6:00 pm

Enjl wrote:
Sun Jan 06, 2019 5:55 pm
xXAndytubeXx wrote:
Sun Jan 06, 2019 5:53 pm
And no, I'm not trying to promote my project's demo. I'm just trying to show you that the Walljump script INDEED works with 38-A.
SMBX2 and LunaLua developer here. Teascript-vbs and Lua are entirely different and incompatible languages. There is no further argument. This is a fact. It's likely that you are misunderstanding some intricacies, but please do not expect anything written in lunalua to work in SMBX38A 1.4.4 without major modifications to its syntax and logic (basically, a rewrite of the core concept).
*insert a massive facepalm here*

Hello, LunaLUA dev. I will provide a video showing you that I'm using the Walljumps LUNALUA script by PixelPest in my episode. I'll be making an unlisted video and I'll send it to you via PM, with proof of AT LEAST the Walljumps script working. It'll be recorded and uploaded soon.

Emral
Cute Yoshi Egg
Cute Yoshi Egg
Posts: 9707
Joined: Mon Jan 20, 2014 12:58 pm
Flair: Phoenix

Re: darklevel.lua (WIP) V1.1

Postby Emral » Sun Jan 06, 2019 6:02 pm

Do you not think that if such a thing were possible, the developers would be aware of it? I should be the one facepalming. Delete PixelPest's script and then run your episode to see that there is no correlation.

xXAndytubeXx
Bit
Bit
Posts: 76
Joined: Wed Aug 16, 2017 5:50 pm
Flair: luigi is numero uno

Re: darklevel.lua (WIP) V1.1

Postby xXAndytubeXx » Sun Jan 06, 2019 6:04 pm

Enjl wrote:
Sun Jan 06, 2019 6:02 pm
Do you not think that if such a thing were possible, the developers would be aware of it? I should be the one facepalming. Delete PixelPest's script and then run your episode to see that there is no correlation.
Before I try such a thing, please keep in mind that there is a pair of special events in my level editor called "Player.WallJump.Enable" and "Player.WallJump.Disable". Try out the script in 1.4.4 and see for yourself.

Added in 2 minutes 26 seconds:
You know, this argument should be moved to it's own post.

PixelPest
Raccoon Mario
Raccoon Mario
Posts: 7111
Joined: Sun Jul 12, 2015 5:38 pm
Flair: Tamer of Boom Booms
Contact:

Re: darklevel.lua (WIP) V1.1

Postby PixelPest » Sun Jan 06, 2019 6:08 pm

xXAndytubeXx wrote:
Sun Jan 06, 2019 6:04 pm
Enjl wrote:
Sun Jan 06, 2019 6:02 pm
Do you not think that if such a thing were possible, the developers would be aware of it? I should be the one facepalming. Delete PixelPest's script and then run your episode to see that there is no correlation.
Before I try such a thing, please keep in mind that there is a pair of special events in my level editor called "Player.WallJump.Enable" and "Player.WallJump.Disable". Try out the script in 1.4.4 and see for yourself.
Please stop derailing this topic since your issues are completely unrelated. As previously mentioned by me and another dev, 38A has absolutely no LunaLua compatibility--you could even ask its developer if he was still around and he would probably not even say no. The special events in 38A access scripts written in Teascript-vb, 38A's scripting language.

If you need to continue this discussion please continue it in your own topic, however please don't as you're clearly failing to even consider that devs are telling you that you're wrong. If you follow what Enjl said, you'll find it does fine. I can guarantee you based on how my script is written that it is not even being loaded or seen by the 38A engine

xXAndytubeXx
Bit
Bit
Posts: 76
Joined: Wed Aug 16, 2017 5:50 pm
Flair: luigi is numero uno

Re: darklevel.lua (WIP) V1.1

Postby xXAndytubeXx » Sun Jan 06, 2019 6:16 pm

PixelPest wrote:
Sun Jan 06, 2019 6:08 pm
xXAndytubeXx wrote:
Sun Jan 06, 2019 6:04 pm
Enjl wrote:
Sun Jan 06, 2019 6:02 pm
Do you not think that if such a thing were possible, the developers would be aware of it? I should be the one facepalming. Delete PixelPest's script and then run your episode to see that there is no correlation.
Before I try such a thing, please keep in mind that there is a pair of special events in my level editor called "Player.WallJump.Enable" and "Player.WallJump.Disable". Try out the script in 1.4.4 and see for yourself.
Please stop derailing this topic since your issues are completely unrelated. As previously mentioned by me and another dev, 38A has absolutely no LunaLua compatibility--you could even ask its developer if he was still around and he would probably not even say no. The special events in 38A access scripts written in Teascript-vb, 38A's scripting language.

If you need to continue this discussion please continue it in your own topic, however please don't as you're clearly failing to even consider that devs are telling you that you're wrong. If you follow what Enjl said, you'll find it does fine. I can guarantee you based on how my script is written that it is not even being loaded or seen by the 38A engine
THE WALLJUMP IS AN OFFICAL FEATURE OF 38-A. I AM NOW CLASSIFIED AS RETARDED. YOU CAN NOW USE THIS THREAD NORMALLY. GOOD DAY.
Last edited by PixelPest on Sun Jan 06, 2019 6:19 pm, edited 1 time in total.
Reason: User has been notified about post


Return to “LunaLua”

Who is online

Users browsing this forum: No registered users and 4 guests

SMWCentralTalkhausMario Fan Games GalaxyKafukaMarioWikiSMBXEquipoEstelari