Page 1 of 1

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

Posted: Tue Aug 14, 2018 11:03 pm
by hacheipe399
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)


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

Posted: Wed Aug 15, 2018 12:49 am
by HenryRichard
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.

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

Posted: Wed Aug 15, 2018 10:51 am
by hacheipe399
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.

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

Posted: Wed Aug 15, 2018 7:21 pm
by PersonNamedUser
Nice job on making these, going to download it later

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

Posted: Sat Aug 18, 2018 10:46 am
by Mr Boboo
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.

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

Posted: Sun Aug 19, 2018 11:02 am
by Radiance
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

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

Posted: Sun Aug 19, 2018 4:13 pm
by hacheipe399
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.

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

Posted: Wed Aug 22, 2018 11:23 pm
by hacheipe399
New version release! The API is completely redone and a video is posted!

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

Posted: Thu Mar 07, 2019 10:36 pm
by That Anarchy Dude
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?

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

Posted: Fri Mar 08, 2019 1:08 pm
by PixelPest
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?

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

Posted: Fri Mar 08, 2019 1:19 pm
by Eri7
Is this API or library as i had a conversation with a friend about it and he says that its library, is that true?

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

Posted: Fri Mar 08, 2019 1:23 pm
by PixelPest
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

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

Posted: Sun Mar 10, 2019 2:57 pm
by hacheipe399
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.

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

Posted: Sun Mar 10, 2019 4:06 pm
by Eri7
Thanks Pixelpest for the answer, i am planning to use this for something to pay homage to the level "The Suck".