Alive Weapons v2. Unearth new allies! Customizable shooting NPCs.

Share and discuss custom LunaLua code and content packs for SMBX2.

Moderator: Userbase Moderators

hacheipe399
Swooper
Swooper
Posts: 64
Joined: Mon Feb 10, 2014 12:29 pm

Alive Weapons v2. Unearth new allies! Customizable shooting NPCs.

Postby hacheipe399 » Tue Aug 14, 2018 11:03 pm

Hi Everyone! This is my API and I want to share it with you, guys!

First of all a little story: Do you remember your first time playing "The Suck" in The Invasion 2? Did you get amazed by the fact that you can use Hammer Bros as weapons? "Why aren't other enemies usable?" you asked to yourself. Well, I came here to solve that matter.

The API aliveweapons.lua aims to make most projectile-thrower NPCs into real guns for fighting into levels! They do in the same way as hammer bros do! Just bury an enemy, unearth it and voila! The version 2 of the API is released with these improvements:

New! You can customize the shooting behavior of the NPCs covered by this API! with the brand new function overhaulWeapon(). With this you can change projectile, firing rate and bullet speed! Look at the documentarion for a detailed explanation.
New! You can make your own weapon! That's right! makeCustomWeapon() lets you make any NPC throw any object, at the frequency, speed and position you want! If you get tired of it, then use resetCustomWeapon() to revert changes. With this tool you can make something like a SMB2-styled Veggie thrower!
New! 2-player mode support! Now you can be a menace 2 society with your friend! Be careful, don't kill your partner!
New! Complete overwrite of the API from scratch. Now it's more optimized and less glitchy.

Here is a video!


This time I did a complete rewrite of the API. The video uses the version 2! Now NPCs have animations when throw projectiles! In the video isn't shown, but the biggest enemies as Wart, SMB1 and SMB3 Bowser make the player do a heavy stomp in the ground when the player carries them. Be careful when jumping! If you don't like it, you can turn it off in your code.
GIF Demos: show
Image
Image
Image
Image
Image
Image
Even statues can be used as guns!
Image
SMB1 Bowser is OP as f$kk
Image
Ludwig von Koopa does a funny jumping animation when player jumps.

To make this API usable, paste my two files into your level's folder, make a lunadll.lua and write this line:

Code: Select all

local aliveweapons = API.load("aliveweapons")
Also I included functions to activate/deactivate certain/all NPCs shooting behavior. These are:

Code: Select all

aliveweapons.disableWeapon("npcname")
aliveweapons.enableWeapon("npcname") --DON'T FORGET THE QUOTATION MARKS
Just copy these functions into your onStart() event and write the name of the NPC into the brackets. Simple as that. They can be used within onLoadSection#() event too, so you can activate/deactivate behaviors as your player progresses in the level.
Important: enableWeapon() isn't needed if you didn't use any disableWeapon() before. Every NPC behavior is enabled by default. You can see the legal strings and the brand new customizing functions such as overhaulWeapon(), stompEffectActivated() and makeCustomWeapon() in the Documentation text included in the compressed file.

CHANGELOG V2:
  • Mouser added! Be careful as the bombs don't explode instantly!
  • Weapon customization added!
  • Custom weapon creation!
  • 2 player support!
  • Player stomp effect when carrying big NPCs like Wart!
  • Fixed player hurting with its own weapon.
  • Fixed projectiles killing coins and powerups.
If you have any suggestion or issue to report, tell me in this thread.

-Requires pnpc, colliders and expandedDefines.

DOWLOAD IT NOW!


Initial release (outdated - kept just to compare)

Last edited by hacheipe399 on Wed Aug 22, 2018 11:22 pm, edited 1 time in total.

HenryRichard
Reznor
Reznor
Posts: 2843
Joined: Mon Dec 23, 2013 12:09 pm
Flair: Is this where I type my password?
Contact:

Re: Alive Weapons. Unearth new allies![LunaLua API]

Postby HenryRichard » Wed Aug 15, 2018 12:49 am

I like it! I always thought more enemies should have this behavior, and it's neat to see it all implemented.

Side note: SMBX2 will eventually have snifits that behave like this.

hacheipe399
Swooper
Swooper
Posts: 64
Joined: Mon Feb 10, 2014 12:29 pm

Re: Alive Weapons. Unearth new allies![LunaLua API]

Postby hacheipe399 » Wed Aug 15, 2018 10:51 am

HenryRichard wrote:
Wed Aug 15, 2018 12:49 am
I like it! I always thought more enemies should have this behavior, and it's neat to see it all implemented.

Side note: SMBX2 will eventually have snifits that behave like this.
Thanks!
I think I heard something of that somewhere. Btw I have this to fight with snifts. I'll do a video demo soon.

PersonNamedUser
Reznor
Reznor
Posts: 2882
Joined: Fri Feb 27, 2015 8:07 pm

Re: Alive Weapons. Unearth new allies![LunaLua API]

Postby PersonNamedUser » Wed Aug 15, 2018 7:21 pm

Nice job on making these, going to download it later

Mr Boboo
Spike
Spike
Posts: 267
Joined: Sat Jan 04, 2014 8:43 am
Flair: The Wicked Pissah

Re: Alive Weapons. Unearth new allies![LunaLua API]

Postby Mr Boboo » Sat Aug 18, 2018 10:46 am

Wow, this is awesome! I think this could have a lot of creative uses. I especially like the Snifit and Bowser statue. I'll most likely be using this!

If there's anything I'd recommend, it's to make it a little easier to customize the firing rate, so you can design a level around something that fires slowly or fires at lightspeed. That would make the API far more versatile imho.

Radiance
2025 Egg Hunter
2025 Egg Hunter
Posts: 1350
Joined: Thu Dec 10, 2015 7:53 am
Pronouns: he/him

Re: Alive Weapons. Unearth new allies![LunaLua API]

Postby Radiance » Sun Aug 19, 2018 11:02 am

This API made me want to remake The Suck.

Added in 1 minute 10 seconds:
I also tried to customize the NPC spawned by the Hammer Bros and the player's bomb, fireball, and iceball work. The player's boomerang glitches tho

hacheipe399
Swooper
Swooper
Posts: 64
Joined: Mon Feb 10, 2014 12:29 pm

Re: Alive Weapons. Unearth new allies![LunaLua API]

Postby hacheipe399 » Sun Aug 19, 2018 4:13 pm

Radiance wrote:
Sun Aug 19, 2018 11:03 am
This API made me want to remake The Suck.
My video demonstration will consist in a little twist to The Suck.
Radiance wrote: I also tried to customize the NPC spawned by the Hammer Bros and the player's bomb, fireball, and iceball work. The player's boomerang glitches tho
Most projs do glitches for the Hammer Bros. I think it's sort of low-level issue of the game.

hacheipe399
Swooper
Swooper
Posts: 64
Joined: Mon Feb 10, 2014 12:29 pm

Re: Alive Weapons v2. Unearth new allies! Customizable shooting NPCs.

Postby hacheipe399 » Wed Aug 22, 2018 11:23 pm

New version release! The API is completely redone and a video is posted!

That Anarchy Dude
Goomba
Goomba
Posts: 3
Joined: Sun Feb 24, 2019 6:04 am

Re: Alive Weapons v2. Unearth new allies! Customizable shooting NPCs.

Postby That Anarchy Dude » Thu Mar 07, 2019 10:36 pm

Okay, I downloaded & unzipped your files into my worlds folder.
I loaded up the demo level, and none of the NPC's are doing anything when I hold them except the Hammer Bros.
What am I missing here?

PixelPest
Link
Link
Posts: 7111
Joined: Sun Jul 12, 2015 5:38 pm
Flair: Tamer of Boom Booms
Contact:

Re: Alive Weapons v2. Unearth new allies! Customizable shooting NPCs.

Postby PixelPest » Fri Mar 08, 2019 1:08 pm

That Anarchy Dude wrote:
Thu Mar 07, 2019 10:36 pm
Okay, I downloaded & unzipped your files into my worlds folder.
I loaded up the demo level, and none of the NPC's are doing anything when I hold them except the Hammer Bros.
What am I missing here?
You you using 1.3?

Eri7
Banned
Posts: 1770
Joined: Sat Jan 28, 2017 4:48 pm
Flair: Good Foundation allows for strong Execution
Contact:

Re: Alive Weapons v2. Unearth new allies! Customizable shooting NPCs.

Postby Eri7 » Fri Mar 08, 2019 1:19 pm

Is this API or library as i had a conversation with a friend about it and he says that its library, is that true?

PixelPest
Link
Link
Posts: 7111
Joined: Sun Jul 12, 2015 5:38 pm
Flair: Tamer of Boom Booms
Contact:

Re: Alive Weapons v2. Unearth new allies! Customizable shooting NPCs.

Postby PixelPest » Fri Mar 08, 2019 1:23 pm

Eri7 wrote:
Fri Mar 08, 2019 1:19 pm
Is this API or library as i had a conversation with a friend about it and he says that its library, is that true?
LunaLua is the API. LunaLua modules, such as this, are termed libraries

hacheipe399
Swooper
Swooper
Posts: 64
Joined: Mon Feb 10, 2014 12:29 pm

Re: Alive Weapons v2. Unearth new allies! Customizable shooting NPCs.

Postby hacheipe399 » Sun Mar 10, 2019 2:57 pm

That Anarchy Dude wrote:
Thu Mar 07, 2019 10:36 pm
Okay, I downloaded & unzipped your files into my worlds folder.
I loaded up the demo level, and none of the NPC's are doing anything when I hold them except the Hammer Bros.
What am I missing here?
Did you load the API?

Code: Select all

local aliveweapons = API.load("aliveweapons")
That line alone should make your enemies throw their projs.
Also, I plan to do a bugfix release of this API, so stay tuned.

Eri7
Banned
Posts: 1770
Joined: Sat Jan 28, 2017 4:48 pm
Flair: Good Foundation allows for strong Execution
Contact:

Re: Alive Weapons v2. Unearth new allies! Customizable shooting NPCs.

Postby Eri7 » Sun Mar 10, 2019 4:06 pm

Thanks Pixelpest for the answer, i am planning to use this for something to pay homage to the level "The Suck".


Return to “LunaLua”

Who is online

Users browsing this forum: No registered users and 1 guest

SMWCentralTalkhausMario Fan Games GalaxyKafukaMarioWikiSMBXEquipoEstelari