Share and discuss custom LunaLua code and content packs for SMBX2.
|
|
|
|
-
MrDoubleA
- Flurry
- Posts: 388
- Joined: Mon Aug 20, 2018 7:02 am
- Flair: How much munchers?
Postby MrDoubleA » Sun Mar 20, 2022 6:48 pm
Hey! Made this over a few days. Adds two sizeables (called controllers and blockers) that let you control the camera/screen itself, including targetting NPC's, zooming in/out, and cropping the screen. Its controls are also available as options in the library itself if you don't want to use the controllers.
(As mentioned in the controller extra settings, certain things like NPC's with custom rendering won't work properly with zooming out. If you want to fix this, you can use some of the "register draw" functions mentioned near the top of the lua file, but I may add more compatibility for NPC's over time.)
(Note: these sizeables are invisible in-game and are only shown here for demonstration/testing.)
Note about Handycam: show
This library should be partially compatible with handycam.lua, but if you have some zoom with it by default and want to use this library, you should change code like this:
Code: Select all local handycam = require("handycam")
handycam[1].zoom = 1.5
To:
Code: Select all local customCamera = require("customCamera")
customCamera.defaultZoom = 1.5
Download!
|
|
|
|
|
|
|
|
|
-
FutureNyanCat
- Eerie
- Posts: 734
- Joined: Fri Dec 20, 2013 8:39 pm
- Flair: Species: Felis robotus
- Pronouns: He/Him
-
Contact:
Postby FutureNyanCat » Sun Mar 20, 2022 7:34 pm
Ayo it's finally out. I might get around to using this for cutscenes with the layer-event system.
|
|
|
|
|
|
|
|
|
-
Mal8rk
- Snifit
- Posts: 215
- Joined: Mon Oct 25, 2021 11:04 pm
- Flair: English Speaking Spanish Speaker
- Pronouns: He/Him
-
Contact:
Postby Mal8rk » Sun Mar 20, 2022 9:35 pm
This is hella awesome!
but an example level would be a nice touch
|
|
|
|
|
|
|
|
|
-
AirShip
- Panser
- Posts: 1081
- Joined: Wed Jan 01, 2014 1:30 am
- Flair: The Flying Ghost
-
Contact:
Postby AirShip » Sun Mar 20, 2022 11:54 pm
Awesome work MrDoubleA, one more must-necessary lua for my collection, good job!
|
|
|
|
|
|
|
|
|
-
LooKiCH
- Tweeter
- Posts: 159
- Joined: Tue Jun 13, 2017 11:28 am
- Pronouns: he/him
-
Contact:
Postby LooKiCH » Mon Mar 21, 2022 2:08 am
I hope there is no bug with item box
|
|
|
|
|
|
|
|
|
-
Master of Disaster
- Swooper
- Posts: 54
- Joined: Sun Nov 28, 2021 9:29 am
- Flair: Average Koopa Fan
- Pronouns: he/him
Postby Master of Disaster » Mon Mar 21, 2022 11:26 am
I noticed some small things with this pack:
First, the controller areas have a bottom collision. Thus it isn't possible to jump into a camera control area from below
Second, the reserve item Box doesn't release its content at the right spot when camera offset (X and/or Y) is active. Although this doesn't have to be changed as it is a minor gripe that doesn't affect gameplay in a bad way.
The bottom collision though should get adressed though.
Really liking this system so far, it gives the builder much more agency and works extremely fluently, good job!
|
|
|
|
|
|
|
|
|
-
MrDoubleA
- Flurry
- Posts: 388
- Joined: Mon Aug 20, 2018 7:02 am
- Flair: How much munchers?
Postby MrDoubleA » Tue Mar 22, 2022 5:29 pm
Small update. Change log:
- The camera will now be properly reset after going through a pipe to the same section that you're already in.
- For drawScene (i.e., zooming out), fixed sizeable rendering.
- For drawScene, BGO's will no longer render while hidden.
- For drawScene, added special support for the launch barrel NPC's.
Also, not a change, but I just want to point out that customCamera.drawScene can just be used outside of any actual camera stuff, if you find that useful for your own code.
|
|
|
|
|
|
|
|
|
-
JamesR624
- Spiny
- Posts: 29
- Joined: Wed Aug 09, 2017 4:24 pm
Postby JamesR624 » Fri Jun 10, 2022 10:09 am
This is really awesome!
however, I did notice that this doesn't seem to have any support for player 2.
I sadly have noticed that nearly ALL scripts on this site like shaders or camera functions, never seem to take into account 2 players. How come? It's a core mechanic of the game.
|
|
|
|
|
|
|
|
|
-
deice
- Volcano Lotus
- Posts: 581
- Joined: Fri Jul 23, 2021 7:35 am
Postby deice » Fri Jun 10, 2022 10:28 am
JamesR624 wrote: ↑Fri Jun 10, 2022 10:09 am
I sadly have noticed that nearly ALL scripts on this site like shaders or camera functions, never seem to take into account 2 players. How come? It's a core mechanic of the game.
there's probably a lot of things that contribute to this, but to name a few:
- scripts that account for more than one player are harder to code and much harder to test
- a lot of recent episodes don't allow for two players (iirc even the default launcher template has two player mode disabled) so scripts that people make for their episodes and then publish are less likely to do so, and there's less of a target audience
- very very few people use two player mode, so even if the script is meant to work with two players, it's unlikely that someone will notice when it doesn't
there's probably other things too, but these are the first few that come to mind.
|
|
|
|
|
|
|
|
|
-
JamesR624
- Spiny
- Posts: 29
- Joined: Wed Aug 09, 2017 4:24 pm
Postby JamesR624 » Fri Jun 10, 2022 10:54 am
Ahh, thank you for the clarifaction.
Well, I'll admit that 2 player co-op does also make it harder to make levels that account for all that.
I realize that this may be slightly off topic but I have been searching and cannot seem to find this. I was curious if there was a way to have the character switch between Mario & Luigi upon death? I was hoping to make a '2-player mode', that is just swapping out the two players each death instead of co-op. This would make level making easier but also make it so all shaders and scripts can work fine without needing to take into account the co-op, as you said.
My first place to look was the scripting for the player blocks and just have that trigger upon death but I cannot seem to find a way to do that so I was just curious if I am missing something.
|
|
|
|
|
|
|
|
|
-
deice
- Volcano Lotus
- Posts: 581
- Joined: Fri Jul 23, 2021 7:35 am
Postby deice » Fri Jun 10, 2022 12:36 pm
JamesR624 wrote: ↑Fri Jun 10, 2022 10:54 am
I realize that this may be slightly off topic but I have been searching and cannot seem to find this. I was curious if there was a way to have the character switch between Mario & Luigi upon death?
i've sent you a pm so as to avoid clogging the thread up with off-topic discussion.
|
|
|
|
|
|
|
|
|
-
FutureNyanCat
- Eerie
- Posts: 734
- Joined: Fri Dec 20, 2013 8:39 pm
- Flair: Species: Felis robotus
- Pronouns: He/Him
-
Contact:
Postby FutureNyanCat » Fri Nov 11, 2022 2:14 am
Finally convinced myself to use this to showcase some setups in case they go off-screen. Very useful camera controls!
|
|
|
|
|
|
|
|
|
-
Pixelated_Perfection
- Fighter Fly
- Posts: 40
- Joined: Fri Feb 25, 2022 1:23 pm
- Pronouns: Any/All
Postby Pixelated_Perfection » Wed Jan 11, 2023 6:54 pm
I know this is a bit late but I recently found that using darkness and lighting combined with this script has a funny little result.
(Ignore how blocky everything looks zoomed out thats from retroResolution)
Im not sure what to do about this but maybe thats something to look into for future updates to the script?
|
|
|
|
|
|
|
|
|
-
MrDoubleA
- Flurry
- Posts: 388
- Joined: Mon Aug 20, 2018 7:02 am
- Flair: How much munchers?
Postby MrDoubleA » Sun Jan 29, 2023 12:59 pm
Pixelated_Perfection wrote: ↑Wed Jan 11, 2023 6:54 pm
I know this is a bit late but I recently found that using darkness and lighting combined with this script has a funny little result.
(Ignore how blocky everything looks zoomed out thats from retroResolution)
Im not sure what to do about this but maybe thats something to look into for future updates to the script?
This unfortunately isn't really fixable (or would be harder to fix than it's worth). Zooming out requires re-rendering the level, which excludes any darkness.
|
|
|
|
|
|
|
|
|
-
Pixelated_Perfection
- Fighter Fly
- Posts: 40
- Joined: Fri Feb 25, 2022 1:23 pm
- Pronouns: Any/All
Postby Pixelated_Perfection » Sun Jan 29, 2023 2:11 pm
MrDoubleA wrote: ↑Sun Jan 29, 2023 12:59 pm
Pixelated_Perfection wrote: ↑Wed Jan 11, 2023 6:54 pm
I know this is a bit late but I recently found that using darkness and lighting combined with this script has a funny little result.
(Ignore how blocky everything looks zoomed out thats from retroResolution)
Im not sure what to do about this but maybe thats something to look into for future updates to the script?
This unfortunately isn't really fixable (or would be harder to fix than it's worth). Zooming out requires re-rendering the level, which excludes any darkness.
ah, makes sense, well i had to ask, thanks for the response!
|
|
|
|
|
|
|
|
|
-
Just_Thomas
- Spike
- Posts: 296
- Joined: Sat Dec 16, 2023 3:32 am
- Pronouns: he/him
Postby Just_Thomas » Wed May 08, 2024 5:37 am
block-998.lua: 15: attempt to call field 'setBlockSettings' (a table value)
What am I doing wrong here, I tested around and I just don`t get it.
Edit: This simply sucks.
There is definitely something in this little bit of code here that causes this problem. So, as like in case of the The error message seemed somehow familiar to me.
If you exclude the commented lines, it is not that much.
Code: Select all Defines.player_grabSideEnabled = false
Defines.player_grabTopEnabled = false
Defines.player_grabShellEnabled = false
--https://www.smbxgame.com/forums/viewtopic.php?t=29121
--True SMB1 Playables (Version 2.0 - LUIGI UPDATE)
--by: Nate-O
function onStart()
Player.setCostume(CHARACTER_MARIO, "SMB1-Mario")
Player.setCostume(CHARACTER_LUIGI, "SMB1-Luigi")
end
function onTick()
player.keys.dropItem = false
player.keys.altJump = false
--Code by deIce
--https://www.smbxgame.com/forums/posting.php?mode=quote&p=399575
--NPC always moves right after spawning
for _, v in NPC.iterate() do
if(v:mem(0x138, FIELD_WORD) == 1 and v:mem(0x13C, FIELD_DFLOAT) == 0) then
v.direction = DIR_RIGHT
end
end
end
--https://www.smbxgame.com/forums/viewtopic.php?p=399480
--heartsForAll (v3.1.0.5) - Applies Heart System to Box Users
--by: AppleTheTomato
local pc = require("heartsForAll")
--https://www.smbxgame.com/forums/viewtopic.php?t=26835
--[NPC Pack / Library] Extended Koopas (v1.1.1) - More and more accurate koopas!
--by: MrDoubleA
local extendedKoopas = require("extendedKoopas")
--https://www.smbxgame.com/forums/viewtopic.php?t=28655
--Auto-loading next level after winning • levellist.lua
--by: LooKiCH
-- in {} paste the filenames of your levels in ascending order
-- BOTH MAP.LUA AND LUNA.LUA MUST HAVE THE SAME LEVEL LIST VALUE!
--require("levellist").levels = {"template_normalLevel.lvlx","template_underground.lvlx","template_normalLevel2.lvlx"}
--https://www.smbxgame.com/forums/viewtopic.php?t=25750
--warpTransition.lua (v1.1.3) - Spruce up your warps!
--by: MrDoubleA
local warpTransition = require("warpTransition")
warpTransition.levelStartTransition = warpTransition.TRANSITION_MOSAIC
--https://www.smbxgame.com/forums/viewtopic.php?p=399891#p390017
--Re: warpTransition.lua (v1.1.3) - Spruce up your warps!
--by: Marioman2007
Master of Disaster wrote: ↑Mon May 06, 2024 1:49 pm
Just_Thomas wrote: ↑Sun May 05, 2024 11:03 am
PS: By the way, I have this ugly bug here.
This bug happens if I already copy the files into my main project folder. They just have to be there to cause the bug, not even used or anything.
The really strange thing about that is, in the "safe area" (I sometimes test them seperate for several reasons) it does NOT happen at all.
I hope your block doesn't interfere with anything else.
Huh, what is your block-906? And also, it would also probably help to find out which npc/block of the pack specifically causes the issues.
Because tbh I have no idea what part of my npcs/roulette block is so menacing that it kills other custom blocks by it's sole existence
|
|
|
|
|
|
|
|
|
-
Marioman2007
- Lakitu
- Posts: 496
- Joined: Tue Aug 25, 2020 3:19 am
- Flair: Dr. Bones
- Pronouns: He/Him
Postby Marioman2007 » Thu May 09, 2024 12:58 am
That error is caused by the warp transition modifier.
In the block's lua file, change "blockManager.setBlockSettings = ({" to "blockManager.setBlockSettings({"
|
|
|
|
|
|
|
|
|
-
Just_Thomas
- Spike
- Posts: 296
- Joined: Sat Dec 16, 2023 3:32 am
- Pronouns: he/him
Postby Just_Thomas » Thu May 09, 2024 3:50 am
Marioman2007 wrote: ↑Thu May 09, 2024 12:58 am
That error is caused by the warp transition modifier.
In the block's lua file, change "blockManager.setBlockSettings = ({" to "blockManager.setBlockSettings({"
Great, while I had somehow suspected this “block” as the culprit in the meantime, I never ever would have thought of just removing an equal sign.
Thank you for that. I am glad I can leave this useful block of yours in my project.
Added in 5 hours 47 minutes 57 seconds:
The camera blocker has default settings and does not seem to work from below.
It might the roughly the same what Master of Disaster already mentioned.
Also is there something I can do to prevent the "default settings reset" when the player dies/falls in a pit?
Alternative:
https://ibb.co/vdSTs3T
https://ibb.co/HHzjgm9
|
|
|
|
|
Return to “LunaLua”
Users browsing this forum: Barkrowler [Bot] and 1 guest
|