Post here for help and support regarding LunaLua and SMBX2's libraries and features.
Moderator: Userbase Moderators
|
|
|
|
-
Julia Pseudo
- Luigi

- Posts: 5609
- Joined: Wed Jan 08, 2014 12:04 am
- Flair: gay gaymer girl
- Pronouns: She/her
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.
|
|
|
|
|
|
|
|
|
-
MrDoubleA
- Edward

- Posts: 394
- Joined: Mon Aug 20, 2018 7:02 am
- Flair: How much munchers?
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.
|
|
|
|
|
|
|
|
|
-
th360
- Shy Guy

- Posts: 5
- Joined: Tue Jul 06, 2021 1:41 pm
- Pronouns: he/him
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?
|
|
|
|
|
|
|
|
|
-
SuperAlex
- 2025 Egg Hunter

- Posts: 226
- Joined: Mon Nov 02, 2020 3:02 pm
- Flair: Spriting
- Pronouns: He/Him
-
Contact:
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.

|
|
|
|
|
|
|
|
|
-
Hoeloe
- Phanto

- Posts: 1465
- Joined: Sat Oct 03, 2015 6:18 pm
- Flair: The Codehaus Girl
- Pronouns: she/her
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
- Shy Guy

- Posts: 5
- Joined: Tue Jul 06, 2021 1:41 pm
- Pronouns: he/him
Postby th360 » Thu Jul 22, 2021 8:58 am
Hello. How to make a npc transform into another?
|
|
|
|
|
|
|
|
|
-
wyldstrykr
- Buster Beetle

- Posts: 84
- Joined: Mon May 31, 2021 11:20 pm
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?
|
|
|
|
|
|
|
|
|
-
cato
- Volcano Lotus

- Posts: 564
- Joined: Thu Aug 24, 2017 3:06 am
- Flair: Koishi enjoyer
-
Contact:
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.
|
|
|
|
|
|
|
|
|
-
Hoeloe
- Phanto

- Posts: 1465
- Joined: Sat Oct 03, 2015 6:18 pm
- Flair: The Codehaus Girl
- Pronouns: she/her
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".
|
|
|
|
|
|
|
|
|
-
cato
- Volcano Lotus

- Posts: 564
- Joined: Thu Aug 24, 2017 3:06 am
- Flair: Koishi enjoyer
-
Contact:
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.
|
|
|
|
|
|
|
|
|
-
TheGameyFireBro105
- Eerie

- Posts: 747
- Joined: Thu Jan 09, 2020 6:09 pm
- Flair: Good at remakes
- Pronouns: he/him
Postby TheGameyFireBro105 » Fri Jul 23, 2021 9:35 pm
I'm trying to make this but in SMBX2

What makes a Chuck type enemy play this animation, then become a Chargin' Chuck
I'm specifically looking to apply that property to a SMB3 Hammer Bro.
|
|
|
|
|
|
|
|
|
-
KnownStranger
- Blooper

- Posts: 155
- Joined: Fri Jun 18, 2021 4:36 pm
- Flair: Retired for my own good
Postby KnownStranger » Thu Jul 29, 2021 1:33 pm
What properties must have a custom npc.lua file? I want to know how to make things like put an effect for dead npcs and make collision and movement.
|
|
|
|
|
|
|
|
|
-
th360
- Shy Guy

- Posts: 5
- Joined: Tue Jul 06, 2021 1:41 pm
- Pronouns: he/him
Postby th360 » Thu Jul 29, 2021 3:18 pm
How to transform a npc into the another when it's hurted by a specific hurt type?
|
|
|
|
|
|
|
|
|
-
Hoeloe
- Phanto

- Posts: 1465
- Joined: Sat Oct 03, 2015 6:18 pm
- Flair: The Codehaus Girl
- Pronouns: she/her
Postby Hoeloe » Thu Aug 05, 2021 12:04 pm
Wiimeiser wrote: ↑Thu Aug 05, 2021 5:35 am
So these three packs are giving me a hard time with removing PNPC:
Generally, any time you see "pnpc.wrap(something)" just replace it with "something", for a quick and dirty fix.
For example:
local v = pnpc.wrap(w).speedX
would be replaced with:
local v = w.speedX
|
|
|
|
|
|
|
|
|
-
Wiimeiser
- Snifit

- Posts: 215
- Joined: Mon Jun 24, 2019 4:36 am
- Flair: What?
Postby Wiimeiser » Thu Aug 05, 2021 7:35 pm
Yes, that worked. Thanks!
Now I just need to fix an issue where the SMW Bullet Bill Blaster fires bullets extremely rapidly (it creates a literal wall of whatever it fires)
viewtopic.php?f=101&t=24125
and I'm also having issues with the Celeste Boost Bubble being an invalid image type.
viewtopic.php?f=101&t=26570
Or I could just add water...
EDIT: I fixed the issue with the Bill Blaster by changing
Code: Select all if data.waiter == configuration.timer then
to
so it seems the "Timer" command in local npcSettings doesn't actually do anything.
EDIT4: MegaDood seems to have fixed the carrot.
But I'm stuck trying to figure out why this code is returning an invalid image:
Code: Select all Graphics.drawImageToSceneWP(
bubbleImage,
v.x + 0.5 * v.width - 24,
v.y + 0.5 * v.height - 24,
48 * (4 - v.ai5),
48 * v.animationFrame,
48,
48,
-25
)
|
|
|
|
|
|
|
|
|
-
Hoeloe
- Phanto

- Posts: 1465
- Joined: Sat Oct 03, 2015 6:18 pm
- Flair: The Codehaus Girl
- Pronouns: she/her
Postby Hoeloe » Sat Aug 07, 2021 8:16 am
Wiimeiser wrote: ↑Thu Aug 05, 2021 7:35 pm
so it seems the "Timer" command in local npcSettings doesn't actually do anything.
That suggests either the NPC was set up wrong, or your npc.txt was set up wrong.
As for the invalid image, that just means that "bubbleImage" has tried to load a file that doesn't exist.
|
|
|
|
|
|
|
|
|
-
th360
- Shy Guy

- Posts: 5
- Joined: Tue Jul 06, 2021 1:41 pm
- Pronouns: he/him
Postby th360 » Sun Aug 08, 2021 2:40 pm
How could i make a npc transform into another when it's hurt by a specific hurt type??
|
|
|
|
|
|
|
|
|
-
Wiimeiser
- Snifit

- Posts: 215
- Joined: Mon Jun 24, 2019 4:36 am
- Flair: What?
Postby Wiimeiser » Wed Aug 11, 2021 9:00 am
I'm trying to resolve an issue with the rocket from this pack. The problem is that when I enter the rocket, it turns into a white square. If I comment out this line:
or change it to "false" the rocket instead turns invisible when activated.
"sceneCoords" isn't listed anywhere in the handbook, so I assume the function is deprecated?
Why is the lua breaking for me and only for me? Did I corrupt my game files somehow?
EDIT: Since no amount of editing the draw routine seems to make the "object" draw I've decided to just outright delete the NPC from my game. A shame since it's a cool one, but unfixable issues require full deletion. I'm leaving the graphics as a BGO, though that's about it.
EDIT2: In the event I re-add it, I'll be fixing it up to not show anything while moving a visible player around, and changing the graphics to a can of beans.
Which I have now done.
EDIT3: I think the problem is that my game/editor is corrupt, I have issues with grid snapping/anchoring and the * next to the filename, as well as with saving bookmarks on the world map. Those features just aren't working, suggesting the problem might be a corrupt installation for all I know. The filename "World.bY8hqLY5OLEq.wld.meta" seems abnormal to me...
|
|
|
|
|
Return to “LunaLua Help”
Users browsing this forum: No registered users and 1 guest
|