[NPC Pack] Npcstacks

Share and discuss custom LunaLua code and content packs for SMBX2.
Emral
Cute Yoshi Egg
Cute Yoshi Egg
Posts: 9737
Joined: Mon Jan 20, 2014 12:58 pm
Flair: Phoenix

[NPC Pack] Npcstacks

Postby Emral » Mon Sep 14, 2020 3:02 pm

I forgot if anyone already made these, but watching YUMP2 made me wanna give them a shot of my own.

https://drive.google.com/file/d/1HcrATe ... sp=sharing

Image

HOW TO USE:
- Extract these files in the zip into your level or episode folder, renaming the NPC files where necessary
- In the extra settings of the stack NPC you specify the properties of the stack. They are in JSON format.
Image

As you can see, JSON is a pain to write. It's not meant to be written, after all, so it makes sense to be that way. Thus, I recommend using an external tool to type your JSON and have it be formatted for you. I use https://beta5.objgen.com/json/local/design for this job. Here's what that looks like:
Image
WARNING: WHEN USING JSON LIKE THIS YOU NEED TO MAKE SURE THAT NUMBERS ON THE RIGHTHANDSIDE OF A COLON ARE NOT IN QUOTATION MARKS. USING THE SITE ABOVE YOU WILL NEED TO REMOVE THEM MANUALLY, BUT IT'S STILL EASIER THAN MAKING SURE ALL OF THE SYNTAX IS CORRECT

Once you have pasted the JSON data into the text field, your NPC is ready to go!

JSON FIELDS (recursive as part of the "child" field):
- id (required) the ID of the NPC at this level
- ai1 (optional) the starting ai1 value of the NPC. For some NPCs this is the "contained ID" field.
- ai2 (optional) the starting ai2 value of the NPC. Used by certain NPCs in the editor like firebars.
- settings (optional) a table containing extra settings data for the NPC. For applying fields in this table, I recommend having the extra settings files for the IDs you're adding to the stack available to cross-reference the internal variable name.
- child (optional) a table that contains a table that may contain any of the fields listed here. If present, the code will try to spawn a child NPC of the given specifications. See the images for instance.

Specifications:
- The root NPC's friendly, direction and layer flags are carried over to all child NPCs
- Stacks break only directly at a destroyed NPC
- NPC ID change is not destruction and will maintain the stack

Enjoy!

Jumper
Monty Mole
Monty Mole
Posts: 130
Joined: Tue Feb 02, 2016 9:32 pm

Re: [NPC Pack] Npcstacks

Postby Jumper » Tue Sep 15, 2020 1:32 am

Nice, though I'm wondering if this is better to use than MDA's Stackable NPCs?
(In no offense to either parties involved)

PdizzleParker
Ripper II
Ripper II
Posts: 322
Joined: Fri Aug 10, 2018 11:26 am
Flair: doin your mom
Pronouns: they/them
Contact:

Re: [NPC Pack] Npcstacks

Postby PdizzleParker » Thu Sep 17, 2020 6:31 pm

I think somebody made this a while ago, but it was only for goombas or something. Anyway, nice work! Is there any chance for this to be added to vanilla SMBX2?


Return to “LunaLua”

Who is online

Users browsing this forum: Petal [Bot] and 0 guests

SMWCentralTalkhausMario Fan Games GalaxyKafukaMarioWikiSMBXEquipoEstelari