Page 1 of 1
[NPC Pack] Celeste Conveyor Walls
Posted: Fri May 17, 2019 12:16 pm
by KateBulka
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.
Re: [NPC Pack] Celeste Conveyor Walls
Posted: Fri May 17, 2019 1:08 pm
by Emral
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.
Re: [NPC Pack] Celeste Conveyor Walls
Posted: Fri May 17, 2019 1:35 pm
by KateBulka
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."?..
Re: [NPC Pack] Celeste Conveyor Walls
Posted: Fri May 17, 2019 1:41 pm
by The Dwarven Digger
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.
Re: [NPC Pack] Celeste Conveyor Walls
Posted: Fri May 17, 2019 1:44 pm
by KateBulka
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..
Re: [NPC Pack] Celeste Conveyor Walls
Posted: Fri May 17, 2019 1:46 pm
by Emral
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 = {}
Re: [NPC Pack] Celeste Conveyor Walls
Posted: Fri May 17, 2019 1:47 pm
by KateBulka
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.
Re: [NPC Pack] Celeste Conveyor Walls
Posted: Fri May 17, 2019 5:37 pm
by Hoeloe
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.
Re: [NPC Pack] Celeste Conveyor Walls
Posted: Sat May 18, 2019 1:54 am
by KateBulka
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