Need help with lua? - LunaLua General Help

Post here for help and support regarding LunaLua and SMBX2's libraries and features.
User avatar
Julia Pseudo
Posts: 5569
Joined: Wed Jan 08, 2014 12:04 am
Flair: gay gaymer girl
Pronouns: She/her

Re: Need help with lua? - LunaLua General Help

Postby Julia Pseudo » Tue Jul 06, 2021 2:21 pm

th360 wrote:
Tue Jul 06, 2021 1:57 pm
Hello! I'm trying to make a goombrat and a para-goombrat (like, npcs 1 and 244 but cliffturn), and i don't want to overwrite another sprite. Where are the .lua files for the npcs 1 and 244? Or it is completely hardcoded?
NPCs that existed in SMBX 1.3 don't have Lua files, as SMBX wasn't built in Lua when the original creator Redigit was working on it.

I am not experienced with LunaLua, so there may be a better way to do this, but the solution to this I know about means you have to overwrite other enemies. I would recommend simply replacing the Super Mario Land 2 goombas (npc-242 and npc-243, also SMBX 1.3 NPCs) with your goombrats and applying cliffturn=1 to them. Assuming this is an episode-wide thing you're implementing, you can simply overwrite npc-1 and npc-244 with the Mario Land 2 goombas on a per-level basis if you need them again for some reason.
its ya girl pseudo and im back
check out my youtube channel

"sterydy Behemoth expiable novae iconically night owl ticklish turbocharger bactrian riveting . Solidus quits frothy managua scrimper shadowy enthusiastically rearrangement curviness matronliness pinyin piroshki gradual hysterically locker room versed . Horrendous unicorn transnational parka lasso very forbiddingly laborsaving cochabamba hair-raising floozy philter transnational ."
- a spam account, 2016


User avatar
MrDoubleA
Spike
Spike
Posts: 267
Joined: Mon Aug 20, 2018 7:02 am
Pronouns: he/him
Contact:

Re: Need help with lua? - LunaLua General Help

Postby MrDoubleA » Tue Jul 06, 2021 9:43 pm

th360 wrote:
Tue Jul 06, 2021 1:57 pm
Hello! I'm trying to make a goombrat and a para-goombrat (like, npcs 1 and 244 but cliffturn), and i don't want to overwrite another sprite. Where are the .lua files for the npcs 1 and 244? Or it is completely hardcoded?
It's hardcoded. NPC's of IDs 292 and below are from 1.3 and as such aren't made with lua. You can find their behaviour in the source code's modNPC.bas, but honestly it may likely be easier to just do it from scratch.
Hi. I make some stuff.
(MrDoubleA#3124 on Discord)

MrDoubleA's NPC Pack
rooms.lua - Quick respawn & Celeste-styled rooms
Extended Koopas

Image diagonal!

I support: show
Image
Image


Image

th360
Goomba
Goomba
Posts: 3
Joined: Tue Jul 06, 2021 1:41 pm
Pronouns: he/him

Re: Need help with lua? - LunaLua General Help

Postby th360 » Fri Jul 09, 2021 11:19 am

Hello again. I already did my sprite of the goombrat, but i'm having some problems on the para-goombrat. How to transform the para-goombrat npc into the goombrat npc when it's stomped?

User avatar
SuperAlex
Fighter Fly
Fighter Fly
Posts: 43
Joined: Mon Nov 02, 2020 3:02 pm
Contact:

Re: NPC Extra settings General Help.

Postby SuperAlex » Wed Jul 21, 2021 7:22 pm

Hello please, I need a percent of helpful tools.
I have a simple problem while I created a custom clouddrop with Extra Settings like the travelling distance "ranger" but appears a red screen while took the npc. I put the data right.
In lunalua (clouddrop2.0) and npc.json, they can verify it and I do not know if it is wrong or at least I need it at one level to put any credit.

Image
I believe and I accept Jesus Christ as my Lord and Savior. If you do, put this in your signature.
Image
Image
Image
Image

User avatar
Hoeloe
Boomerang Bro
Boomerang Bro
Posts: 1381
Joined: Sat Oct 03, 2015 6:18 pm
Flair: The Codehaus Girl
Pronouns: she/her

Re: Need help with lua? - LunaLua General Help

Postby Hoeloe » Wed Jul 21, 2021 8:40 pm

A red block means a parsing error in the .json file. In this case, you have a trailing comma on the line that reads "value-max": 50,

th360
Goomba
Goomba
Posts: 3
Joined: Tue Jul 06, 2021 1:41 pm
Pronouns: he/him

Re: Need help with lua? - LunaLua General Help

Postby th360 » Thu Jul 22, 2021 8:58 am

Hello. How to make a npc transform into another?

Enjl
Cute Yoshi Egg
Cute Yoshi Egg
Posts: 9198
Joined: Mon Jan 20, 2014 12:58 pm
Flair: Orphion Egamalenitar Osmos IV, Esq.

Re: Need help with lua? - LunaLua General Help

Postby Enjl » Thu Jul 22, 2021 11:45 am

th360 wrote:
Thu Jul 22, 2021 8:58 am
Hello. How to make a npc transform into another?
If you have a reference to the NPC you want to transform, you use the npc:transform method on it:
https://docs.codehaus.moe/#/reference/n ... ce-methods
Ideas are useless if you can't make them real.
Image

All my assets from packs and episodes are free to use for non-Novaverse levels and projects, as long as proper credit is given.

Mirror of all my content and collaborations on IPFS: QmZKzVJAsD6dE2tTHEb58XEmsNLzrW2MVsTtW7HWLAAcCC

wyldstrykr
Shy Guy
Shy Guy
Posts: 8
Joined: Mon May 31, 2021 11:20 pm

Re: Need help with lua? - LunaLua General Help

Postby wyldstrykr » Fri Jul 23, 2021 3:02 am

how to make a red rectangle of varying sizes?? like 1 blocks by 10 blocks and 2 blocks by 5 blocks?? do i need 2 images for that?

User avatar
cato
Lakitu
Lakitu
Posts: 456
Joined: Thu Aug 24, 2017 3:06 am
Flair: Creative, opinionated, but poor expression
Contact:

Re: Need help with lua? - LunaLua General Help

Postby cato » Fri Jul 23, 2021 4:43 am

Correct me if I am wrong.

But

Code: Select all

local Room = Section(0)

function onStart()
Room.effects.screenEffects = SEFFECT_WAVY
Room.effects.weather = WEATHER_RAIN
end
only changes the weather in the section. The value of weather is an integer while the value of the screenEffects is nil. Either the SMBX2 documentation is inaccurate or changing the screenEffects are more complex than just 1 line of code.
Freedom, Human Rights, Fairness, Democracy, Rule of Law, Righteousness, Courageness, Human Nature, Conscience, Goodwill, Ethics, Beliefs, Hope.

User avatar
Hoeloe
Boomerang Bro
Boomerang Bro
Posts: 1381
Joined: Sat Oct 03, 2015 6:18 pm
Flair: The Codehaus Girl
Pronouns: she/her

Re: Need help with lua? - LunaLua General Help

Postby Hoeloe » Fri Jul 23, 2021 1:03 pm

cato wrote:
Fri Jul 23, 2021 4:43 am
The value of weather is an integer while the value of the screenEffects is nil.
That's because the variable is "screenEffect" not "screenEffects".

User avatar
cato
Lakitu
Lakitu
Posts: 456
Joined: Thu Aug 24, 2017 3:06 am
Flair: Creative, opinionated, but poor expression
Contact:

Re: Need help with lua? - LunaLua General Help

Postby cato » Fri Jul 23, 2021 1:08 pm

Hoeloe wrote:
Fri Jul 23, 2021 1:03 pm
cato wrote:
Fri Jul 23, 2021 4:43 am
The value of weather is an integer while the value of the screenEffects is nil.
That's because the variable is "screenEffect" not "screenEffects".
I guess the variable on the SMBX2 doc is wrong then.
Freedom, Human Rights, Fairness, Democracy, Rule of Law, Righteousness, Courageness, Human Nature, Conscience, Goodwill, Ethics, Beliefs, Hope.

User avatar
TheGameyFireBro105
Volcano Lotus
Volcano Lotus
Posts: 597
Joined: Thu Jan 09, 2020 6:09 pm
Flair: Good at remakes

Re: Need help with lua? - LunaLua General Help

Postby TheGameyFireBro105 » Fri Jul 23, 2021 9:35 pm

I'm trying to make this but in SMBX2
Image
What makes a Chuck type enemy play this animation, then become a Chargin' Chuck

Image

I'm specifically looking to apply that property to a SMB3 Hammer Bro.
I love these episodes; Go and support:
Image
Image
Image
Image


Return to “LunaLua Help”

Who is online

Users browsing this forum: No registered users and 2 guests