v1.0: show
extendedRinkas: show
extendedRinkas.lua v1.0 - a love letter to moarrinkas.lua
for the handful of moarrinkas.lua fans out there.
all the rinkas from moarrinkas.lua + some others, ported to custom range npcs.
i take no credit for the moarrinkas' ones, this is merely a way of showing respect to then vs. now
new ones i made:
- growing rinka (grows to a configurable max after it begins moving. has maxscale and scalerate as config variables)
- spookinka (it's a boo, but in rinka fashion)
- hyper rinka (is always relentlessly chasing the player)
- rando rinka (randomizes to any other rinka from this library when it starts moving)
with a guest appearance of MDA's making, sniper rinka (goes to where the player will be, really quickly, instead of where they are currently)
along with those additions, rinka blocks got an overhaul too. they can now have the following set in the editor:
- instantly active (if checked, will shoot as soon as it makes a projectile)
- projectile NPC (which NPC to use a a projectile. can be anything, every npc is supported (but not tested, mileage may vary) )
- spawn delay (ticks between spawning projectiles)
- hold delay (the number of ticks projectiles are stationary)
- shoot speed (the amount of speed npcs are shot at)
as an added bonus, they can now be used like rinky guns if you unbury them (ala The Suck from The Invasion 2)
there are two example/template custom range npcs for a rinka and a rinka block. they can be used as a base for making your own. if you don't want two versions of the basegame ones, don't use them. (the rinka can possibly be used by rando rinka, which artificially increases the chance it turns into a normal rinka fyi)
credits:
MrDoubleA - made sniper rinka's code
Enjl - some advice and rewriting moarrinkas for beta 4
aristocrat - for the original moarrinkas and it's graphics
snoruntpyro - for some logic taken from chucks.lua
Valentine - some code for spookinka lifted from reverse boo
Chilly Bean BAM! - testing

for the handful of moarrinkas.lua fans out there.
all the rinkas from moarrinkas.lua + some others, ported to custom range npcs.
i take no credit for the moarrinkas' ones, this is merely a way of showing respect to then vs. now
new ones i made:
- growing rinka (grows to a configurable max after it begins moving. has maxscale and scalerate as config variables)
- spookinka (it's a boo, but in rinka fashion)
- hyper rinka (is always relentlessly chasing the player)
- rando rinka (randomizes to any other rinka from this library when it starts moving)
with a guest appearance of MDA's making, sniper rinka (goes to where the player will be, really quickly, instead of where they are currently)
along with those additions, rinka blocks got an overhaul too. they can now have the following set in the editor:
- instantly active (if checked, will shoot as soon as it makes a projectile)
- projectile NPC (which NPC to use a a projectile. can be anything, every npc is supported (but not tested, mileage may vary) )
- spawn delay (ticks between spawning projectiles)
- hold delay (the number of ticks projectiles are stationary)
- shoot speed (the amount of speed npcs are shot at)
as an added bonus, they can now be used like rinky guns if you unbury them (ala The Suck from The Invasion 2)
there are two example/template custom range npcs for a rinka and a rinka block. they can be used as a base for making your own. if you don't want two versions of the basegame ones, don't use them. (the rinka can possibly be used by rando rinka, which artificially increases the chance it turns into a normal rinka fyi)
credits:
MrDoubleA - made sniper rinka's code
Enjl - some advice and rewriting moarrinkas for beta 4
aristocrat - for the original moarrinkas and it's graphics
snoruntpyro - for some logic taken from chucks.lua
Valentine - some code for spookinka lifted from reverse boo
Chilly Bean BAM! - testing
gifs: show


usage and documentation: show
simply extract the zip to your destination of choice and it should be working out of the box. for more info on making your own rinkas/using this library, read on.
if you wish to change a config, i recommend you use npc-n.txts
Code: Select all
extendedRinkas.extendedBlockDrawing = bool (true by default) - toggles the moarrinkas extended rinka block graphics. meant to be used outside of npc-n.lua
extendedRinkas.standardDeathFunction(npcobject) -- a basic call to spawn rinka explosions and play the sm explosion sound. can use deatheffect and deathsound in a rinkas config to override that.
extendedRinkas.rinkaSourceHoming(npcobject, speed) -- a near 1:1 remake of the 1.3 homing rinkas perform
extendedRinkas.rinkaAdvancedHoming(npcobject, speed, angleOffset) -- a vector based version that can be offset by an angle. angle is in degrees
extendedRinkas.defaultBlockSpawning(npcobject) -- the function ran by rinka blocks to spawn their projectiles. npcobject here is the parent of the projectile
extendedRinkas.drawNPC(npcobject, args) -- an offshoot of npcutils.drawNPC. solely made to make things render above rinka blocks. only new arg is priorityOverride, a bool for if forced states should change priority
extendedRinkas.animateNPC(npcobject) -- handles the odd animation rinkas and rinka blocks have. not 1:1 but it's serviceable.
extendedRinkas.registerRinka(npc ID, {tickFunction = function, deathFunction = function, initFunction = function, isVanilla = bool, noDeathFunction = bool})
- npc id - the id of the npc to register. used in npc-n.lua, see example rinka for an idea of that
-- only use the ones you need!
- tickFunction - a function to run every tick when the rinka should be running code (when not held, the level isn't frozen, or in a state of some sort). see any of the rinkas for a better picture of that.
- deathFunction - a function to run on the rinkas death, only works if noDeathFunction isn't true
- initFunction - a function to run when the rinka is initializing data. good for if you need to add your own data variables.
- isVanilla - a slight misnomer. prevents most of extendedRinkas functions from touching it. good for more complex rinkas (see spookinka for a better idea)
- noDeathFunction - prevents extendedRinkas from running it's default death code. good for rinkas that might need more flexible death effects
extendedRinkas.registerRinkaBlock() -- uses the same stuff as above
grey shy guy: show
a funky little guy based on an unused SMB2 variant. was my first custom npc so i felt it'd be good to release em into the wild. he's pretty simple so i don't think he'd cause much fuss but who knows?

V1.1: show
powerstarEXT.lua: show
a solution to your power star problems. this library/npc AI file handles adding custom range power stars that fully function in every way:
- adds to the counter
- counts on star locks
- removes star lock icons upon collection in levels
- saves to your save file
- gets around the "one per section, 21 per level" limit via an id system
also comes with some example npcs, as shown in the below showcase gif. (power moon graphic made by me, will potentially be more fleshed out later).
originally i was going to scrap this and create a system separate from the 1.3 star system but i never got around to that and don't want my work going to waste in a dusty folder. please read the documentation. credits to: Rednaxela, Enjl, and snoruntpyro for various bits and bobs.
- adds to the counter
- counts on star locks
- removes star lock icons upon collection in levels
- saves to your save file
- gets around the "one per section, 21 per level" limit via an id system
also comes with some example npcs, as shown in the below showcase gif. (power moon graphic made by me, will potentially be more fleshed out later).
originally i was going to scrap this and create a system separate from the 1.3 star system but i never got around to that and don't want my work going to waste in a dusty folder. please read the documentation. credits to: Rednaxela, Enjl, and snoruntpyro for various bits and bobs.
showcase: show

documentation: show
for things to operate properly, you'll need to load this library in your level/episode luna.lua like so:
from there, you have a few things you can call if you want more functionality from it:
Code: Select all
local powerstarEXT = require("powerstarEXT")
Code: Select all
powerstarEXT.idRangeStart -- the number custom range stars start adding to index wise. default is 1000 as not to erase basegame stars if expanded section counts ever becomes a thing. not much of a reason to touch this, but made it a non-hardcoded var anyways.
powerstarEXT.getStarsCollected(filename) -- returns a table of collected stars from the level specified, otherwise returns a table of all collected stars, basegame and custom range alike. formatted like so "table[index number] = {filename, section/star index} (section number if it's a basegame star, star index if it's a powerstarEXT star, which starts at powerstarEXT.idRangeStart + star index)
powerstarEXT.getStarsCollectedCount(filename) -- returns the number of collected stars from the level specified, otherwise returns the number from the star counter.
powerstarEXT.getStarsTotal(filename) -- returns the number of stars total from a level, basegame and custom range alike. this will open the level file, so may not be performant to use all the time.
powerstarEXT.registerStar(npcID, argument functions) -- registers an npc ID as a powerstarEXT star. meant for use in npc lua files. can also supply startFunction, tickEndFunction, and collectFunction to the argument function table to do things in thier respective areas (i.e. powerstarEXT.registerStar(751, {startFunction=start, tickEndFunction=tick, collectFunction=collect}). check the examples for a better understanding.
here's some documentation on those as well:
- startFunction(npc) -- only argument is the current npc running this code
- tickEndFunction(npc) -- only argument is the current npc running this code
- collectFunction(eventToken, killedNPC, harmType, killingPlayer) -- same arguments as onNPCKill + the player that collected the star
powerstarEXT.isStarCollected(npc/section number, filename) -- returns true or false if the passed npc's star index has been collected in the level with the passed filename. can substitute npc with section number for 1.3 stars
