Share and discuss custom LunaLua code and content packs for SMBX2.
Moderator: Userbase Moderators
|
|
|
|
-
KateBulka
- Dolphin

- Posts: 1112
- Joined: Tue Apr 15, 2014 8:29 am
- Flair: Bun~
- Pronouns: she/her
Postby KateBulka » Fri May 17, 2019 12:16 pm
So i did this thing in one of my levels, but i've decided that it would be cool to upload it public.
Player can boost up vertically! Also you can press Jump or Altjump button to boost up even more.
It even works with NPCs (well actually it works only with SMB3 Goomba, Grand-Goomba and SMW Spiny, but you can change those stuff in code)
Download link - https://www.dropbox.com/s/w3nv0y08xcl8x ... e.zip?dl=0
Don't forget to credit me though, overall you are allowed to use it and modify it heh.
|
|
|
|
|
|
|
|
|
-
Emral
- Cute Yoshi Egg

- Posts: 9865
- Joined: Mon Jan 20, 2014 12:58 pm
- Flair: Phoenix
Postby Emral » Fri May 17, 2019 1:08 pm
I made these a while ago but I decided to make them as BGOs... NPCs are an interesting choice since they can despawn. I like that NPCs can interact with them. My version doesn't have that. The code seems pretty unoptimized though. Consider using getIntersecting checks and allowing users to customize what NPCs can be lifted.
|
|
|
|
|
|
|
|
|
-
KateBulka
- Dolphin

- Posts: 1112
- Joined: Tue Apr 15, 2014 8:29 am
- Flair: Bun~
- Pronouns: she/her
Postby KateBulka » Fri May 17, 2019 1:35 pm
Enjl: heh i knew that somebody would say that code is unoptimized lol. I will use getIntersecting in the future, thanks! (and i'll try to optimize them as much as it's possible for me) Also wait, i thought you could just modify this line:
Code: Select all for k,v2 in pairs(NPC.get{1,71,285})
"to customize what NPCs can be lifted."?..
|
|
|
|
|
|
|
|
|
-
The Dwarven Digger
- Lakitu

- Posts: 484
- Joined: Sun Oct 30, 2016 11:17 am
- Pronouns: they/them
Postby The Dwarven Digger » Fri May 17, 2019 1:41 pm
Core wrote: ↑Fri May 17, 2019 1:35 pm
Enjl: heh i knew that somebody would say that code is unoptimized lol. I will use getIntersecting in the future, thanks! (and i'll try to optimize them as much as it's possible for me) Also wait, i thought you could just modify this line:
Code: Select all for k,v2 in pairs(NPC.get{1,71,285})
"to customize what NPCs can be lifted."?..
Sure, you could modify that line, but it's better to have that table as a variable which can be modified after loading the library in the lunadll.lua file. That also means you can change the NPC table on a per-level basis and have the NPC pack assets stored in the episode folder.
|
|
|
|
|
|
|
|
|
-
KateBulka
- Dolphin

- Posts: 1112
- Joined: Tue Apr 15, 2014 8:29 am
- Flair: Bun~
- Pronouns: she/her
Postby KateBulka » Fri May 17, 2019 1:44 pm
The Dwarven Digger wrote: ↑Fri May 17, 2019 1:41 pm
Core wrote: ↑Fri May 17, 2019 1:35 pm
Enjl: heh i knew that somebody would say that code is unoptimized lol. I will use getIntersecting in the future, thanks! (and i'll try to optimize them as much as it's possible for me) Also wait, i thought you could just modify this line:
Code: Select all for k,v2 in pairs(NPC.get{1,71,285})
"to customize what NPCs can be lifted."?..
Sure, you could modify that line, but it's better to have that table as a variable which can be modified after loading the library in the lunadll.lua file. That also means you can change the NPC table on a per-level basis and have the NPC pack assets stored in the episode folder.
Hm, kinda fair. I knew about it, but i didn't really wanted to do that because.. i honestly don't know..
Last edited by KateBulka on Fri May 17, 2019 1:49 pm, edited 3 times in total.
|
|
|
|
|
|
|
|
|
-
Emral
- Cute Yoshi Egg

- Posts: 9865
- Joined: Mon Jan 20, 2014 12:58 pm
- Flair: Phoenix
Postby Emral » Fri May 17, 2019 1:46 pm
The Dwarven Digger wrote: ↑Fri May 17, 2019 1:41 pm
Core wrote: ↑Fri May 17, 2019 1:35 pm
Enjl: heh i knew that somebody would say that code is unoptimized lol. I will use getIntersecting in the future, thanks! (and i'll try to optimize them as much as it's possible for me) Also wait, i thought you could just modify this line:
Code: Select all for k,v2 in pairs(NPC.get{1,71,285})
"to customize what NPCs can be lifted."?..
Sure, you could modify that line, but it's better to have that table as a variable which can be modified after loading the library in the lunadll.lua file. That also means you can change the NPC table on a per-level basis and have the NPC pack assets stored in the episode folder.
NPC packs aren't usually loaded in luna.lua at all. Customisation usually comes through NPC config variables. Tables can't be in npc config though so...
I do recommend extracting the values into a table and placing it near the top of the file so that people using the pack don't have to search for the line first. For the people who DO want to load the file, making the table part of the library's namespace would be good: conveyor_wall.scalingNPCs = {}
|
|
|
|
|
|
|
|
|
-
KateBulka
- Dolphin

- Posts: 1112
- Joined: Tue Apr 15, 2014 8:29 am
- Flair: Bun~
- Pronouns: she/her
Postby KateBulka » Fri May 17, 2019 1:47 pm
Enjl wrote: ↑Fri May 17, 2019 1:46 pm
The Dwarven Digger wrote: ↑Fri May 17, 2019 1:41 pm
Core wrote: ↑Fri May 17, 2019 1:35 pm
Enjl: heh i knew that somebody would say that code is unoptimized lol. I will use getIntersecting in the future, thanks! (and i'll try to optimize them as much as it's possible for me) Also wait, i thought you could just modify this line:
Code: Select all for k,v2 in pairs(NPC.get{1,71,285})
"to customize what NPCs can be lifted."?..
Sure, you could modify that line, but it's better to have that table as a variable which can be modified after loading the library in the lunadll.lua file. That also means you can change the NPC table on a per-level basis and have the NPC pack assets stored in the episode folder.
NPC packs aren't usually loaded in luna.lua at all. Customisation usually comes through NPC config variables. Tables can't be in npc config though so...
I do recommend extracting the values into a table and placing it near the top of the file so that people using the pack don't have to search for the line first. For the people who DO want to load the file, making the table part of the library's namespace would be good: conveyor_wall.scalingNPCs = {}
Yeah i agree more with you Enjl. Will take that on note! Thank you. I think i will update this NPC pack soon heh.
|
|
|
|
|
|
|
|
|
-
Hoeloe
- Phanto

- Posts: 1465
- Joined: Sat Oct 03, 2015 6:18 pm
- Flair: The Codehaus Girl
- Pronouns: she/her
Postby Hoeloe » Fri May 17, 2019 5:37 pm
Another point of note is that pairs is orders of magnitude slower than ipairs. If you're just looping over a list, always use ipairs.
|
|
|
|
|
|
|
|
|
-
KateBulka
- Dolphin

- Posts: 1112
- Joined: Tue Apr 15, 2014 8:29 am
- Flair: Bun~
- Pronouns: she/her
Postby KateBulka » Sat May 18, 2019 1:54 am
Hoeloe wrote: ↑Fri May 17, 2019 5:37 pm
Another point of note is that pairs is orders of magnitude slower than ipairs. If you're just looping over a list, always use ipairs.
Ouch, must be my mistake, i'm sorry for that! thanks anyways
|
|
|
|
|
Return to “LunaLua”
|