snifit.lua - Snifit Behavior Modification API

Share and discuss custom LunaLua code and content packs for SMBX2.
User avatar
Shy Guy
Shy Guy
Posts: 7
Joined: Tue Jul 03, 2018 11:01 pm
Current Project: SMBX: Alien Invasion
Chat Username: ☆Random★

snifit.lua - Snifit Behavior Modification API

Postby RandomMcSomethin » Sat Jul 07, 2018 10:35 pm

A.K.A. The API that nobody asked for, but the API that I uploaded anyway, because Randoms don't care what people think of snifit APIs

This library allows you to modify the properties of snifits, such as projectiles, behavior, etc.

Spoiler: show
Using the API is rather simple. To get started, simply download the API to your computer, put it in your level folder, and include the API in your lunadll.lua file with this line of code placed at the head of the file:

Code: Select all

local snifit = API.load("snifit");
Out of the box, the API adds in two new behaviours for snifits (these affect the red snifits by default). You can implement these into your snifits by putting them in different layers. Naming a layer "Jump" or "Jump3" will cause all snifits within that layer to have their behavior modified according to the layer.
"Okay, that's great and all," you may say, "but what about other snifits?" To answer your question, there is a function included within the API that goes as so:

Code: Select all

snifit.configureSnifits{snifitType, projectile}; 
snifitType can be modified to affect which snifits are affected by this behavior: 1 corresponds to red snifits, 2 corresponds to blue ones, and 3 is for grays. In addition, you can set projectile to an ID of any NPC in the game, from 1-up mushrooms to more snifits to banzai bills (At the moment, the API does not compensate for NPC width and set the X position accordingly, so large projectiles will most likely end up being behind snifits. This may be fixed in time.)
That's all there is to it! Sorry if it looks intimidating, my explanations can be rather wordy at times.
Spoiler: show
Due to the way this API is coded, there are some limitations that I will attempt to fix for future updates:
  • Only one type of snifit can have modified behavior in a level.
  • You can give custom projectiles to as many snifit types as you want, but only one projectile type can be used across all of them.
  • Gray snifits are not garunteed to work properly as they have not been thoroughly tested yet.
This is my first SMBX API, so feel free to give all feedback and constructive criticism.
Video Demonstration:
Spoiler: show
Spoiler: show
I believe and I accept Jesus Christ as my Lord and Savior. If you do, put this in your signature.

This is a block of text that can be added to posts you make. There is a 999 character limit.

User avatar
Posts: 40
Joined: Fri Apr 06, 2018 10:47 pm
Current Project: I can't tell you just yet, but let's just say it's pretty funkatronic...
Chat Username: Smibbix

Re: snifit.lua - Snifit Behavior Modification API

Postby Smibbix » Mon Jul 23, 2018 12:21 am

Quite interesting! This will probably be pretty useful for me, since I usually only use one type of snifit in my levels.
cat planet cat planet cat planet!!!

I Support:
Spoiler: show

Haha, wrong forum.
Great Quotes:
Spoiler: show
Pop Yoshi Bros wrote: These used other people levels withouth their permission? I don't know if it's wrong if the big heads of the forums make it
Enjl wrote:
Sun Jul 15, 2018 8:27 am
The only palette people care about is the SMB3 palette.
smbx GaMERDoG wrote:
Thu Jul 12, 2018 1:30 am
These tomatoes weren't debugged properly!
Horikawa Otane wrote: Image

Return to “LunaLua”

Who is online

Users browsing this forum: No registered users and 52 guests