Making Custom Npc Boss Green Birdo for SMBX2

Post here for help and support regarding LunaLua and SMBX2's libraries and features.

Moderator: Userbase Moderators

Roger Mario
Cheep-Cheep
Cheep-Cheep
Posts: 14
Joined: Sat Jun 20, 2020 10:29 pm

Making Custom Npc Boss Green Birdo for SMBX2

Postby Roger Mario » Sat Jun 20, 2020 10:37 pm

Hello Fellow Coders. I have a question? I'm a beginner to coding, but how would I make a Green Birdo Boss Npc That spits FireBalls. I wanna make a SMBX2 SMB2 Custom Boss Npc Pack? If someone would be kind enough could you help me with the .lua file coding?

Emral
Cute Yoshi Egg
Cute Yoshi Egg
Posts: 9865
Joined: Mon Jan 20, 2014 12:58 pm
Flair: Phoenix

Re: Making Custom Npc Boss Green Birdo for SMBX2

Postby Emral » Sun Jun 21, 2020 2:55 am

Since Birdo is a basegame enemy, you need to reprogram its behaviour from scratch, and then just make it fire a different NPC/fire NPCs differently.
A couple important resources, there:
https://www.youtube.com/watch?v=LsT7ItnnVzY This video goes in depth about how to make an NPC pack. I recommend watching up to like, episode 5 of the lunalua tutorial series for this.
https://wohlsoft.ru/pgewiki/NPC_(class) NPC class code documentation.
https://wohlsoft.ru/pgewiki/SMBX_NPC_AI ... 8ID:_39.29 Documentation of Birdo's behaviour using the variables ai1 thru ai5 from the previous page.
https://github.com/smbx/smbx-legacy-sou ... bas#L11965 This is the SMBX source code for birdo. The variable names are fairly funky, but this is what basically makes the previous page's observation happen. .Special and .Special2 and onwards correspond to ai1-5. The "With npc" clause you can see a few lines below is basically equivalent to our NPC.spawn() function from the 2nd link. That's where the egg is spawned.

Lusho
Blooper
Blooper
Posts: 163
Joined: Wed Dec 25, 2019 11:39 pm
Flair: Intention is what matters
Pronouns: he/him

Re: Making Custom Npc Boss Green Birdo for SMBX2

Postby Lusho » Sun Jun 21, 2020 11:08 am

In theory you could jus Reskin the egg to make it look like a fireball and use the npc config txt to make it hurtful, but having those custom lua bosses would be cool if we wanted different types of birdos in one level

Roger Mario
Cheep-Cheep
Cheep-Cheep
Posts: 14
Joined: Sat Jun 20, 2020 10:29 pm

Re: Making Custom Npc Boss Green Birdo for SMBX2

Postby Roger Mario » Sun Jun 21, 2020 6:01 pm

Enjl wrote:
Sun Jun 21, 2020 2:55 am
Since Birdo is a basegame enemy, you need to reprogram its behaviour from scratch, and then just make it fire a different NPC/fire NPCs differently.
A couple important resources, there:
https://www.youtube.com/watch?v=LsT7ItnnVzY This video goes in depth about how to make an NPC pack. I recommend watching up to like, episode 5 of the lunalua tutorial series for this.
https://wohlsoft.ru/pgewiki/NPC_(class) NPC class code documentation.
https://wohlsoft.ru/pgewiki/SMBX_NPC_AI ... 8ID:_39.29 Documentation of Birdo's behaviour using the variables ai1 thru ai5 from the previous page.
https://github.com/smbx/smbx-legacy-sou ... bas#L11965 This is the SMBX source code for birdo. The variable names are fairly funky, but this is what basically makes the previous page's observation happen. .Special and .Special2 and onwards correspond to ai1-5. The "With npc" clause you can see a few lines below is basically equivalent to our NPC.spawn() function from the 2nd link. That's where the egg is spawned.
Thanks For Replying Enji! So If I watch the tutorial series on LunaLua I should grasp the understanding of how to code the npcs.

Added in 1 hour 4 minutes 7 seconds:
hmm sadly I change my mind Even after watching Enji's tutorial and looking at the websites Im still really really confused and Birdos Source Code is Huge with alot of specials that its hard to tell, what to do. If I dont understand the code I Definetly cant make Green Birdo. Triclyde and Clawgrip would be even more of a nightmare. So All I can do is hope someone makes them someday. cause I tried

Emral
Cute Yoshi Egg
Cute Yoshi Egg
Posts: 9865
Joined: Mon Jan 20, 2014 12:58 pm
Flair: Phoenix

Re: Making Custom Npc Boss Green Birdo for SMBX2

Postby Emral » Mon Jun 22, 2020 12:36 am

Birdo's code is roughly 80 lines long, as it ends at the next "else if type == " conditional. If you want an easier time you can do CJ's suggestion of
- doing an NPC.get-Loop over all Birdos in onTick
- Checking if they're about to shoot an egg (from the ai values)
- Manually NPC.spawning a different NPC
- Resetting the timer

Lusho
Blooper
Blooper
Posts: 163
Joined: Wed Dec 25, 2019 11:39 pm
Flair: Intention is what matters
Pronouns: he/him

Re: Making Custom Npc Boss Green Birdo for SMBX2

Postby Lusho » Mon Jun 22, 2020 12:48 am

Pro tip: don’t check redigits code, it’s horrible, inneficient and hard to read, I prefer to check the original behavior of some npcs in their games or the same smbx and then code it based on them

Roger Mario
Cheep-Cheep
Cheep-Cheep
Posts: 14
Joined: Sat Jun 20, 2020 10:29 pm

Re: Making Custom Npc Boss Green Birdo for SMBX2

Postby Roger Mario » Mon Jun 22, 2020 10:52 pm

Enjl wrote:
Mon Jun 22, 2020 12:36 am
Birdo's code is roughly 80 lines long, as it ends at the next "else if type == " conditional. If you want an easier time you can do CJ's suggestion of
- doing an NPC.get-Loop over all Birdos in onTick
- Checking if they're about to shoot an egg (from the ai values)
- Manually NPC.spawning a different NPC
- Resetting the timer

So Where is Birdo's .lua Enji? because please correct me if i'm wrong cause in theory couldn't I just copy and paste the code in Birdos .lua to an npc-n.lua and then change the npc she shoots to the fireball instead of the egg and just swap out the pink Birdo sprites for green Birdo sprites?

Update: Enji Can You look at this image and tell me is this Birdos Code and if it is where would I put it? and if so how would I go about reprogramming it? I only need her to shoot three fireballs instead on one egg. If you could help I would greatly appreciate it! ^^

Image
Last edited by Roger Mario on Tue Jun 23, 2020 1:21 am, edited 4 times in total.

Hoeloe
Phanto
Phanto
Posts: 1465
Joined: Sat Oct 03, 2015 6:18 pm
Flair: The Codehaus Girl
Pronouns: she/her

Re: Making Custom Npc Boss Green Birdo for SMBX2

Postby Hoeloe » Mon Jun 22, 2020 11:15 pm

Only NPCs with IDs from 293 onwards have .lua files defining their behaviour. A select few below that have .lua files for some extra settings and tweaks, but their core behaviour is hardcoded.

Murphmario
2025 Egg Hunter
2025 Egg Hunter
Posts: 2389
Joined: Fri Dec 20, 2013 7:07 pm
Pronouns: he/him

Re: Making Custom Npc Boss Green Birdo for SMBX2

Postby Murphmario » Tue Jun 23, 2020 12:23 am

I modified the original Birdo to make Green Birdo, but then you can't use the original Birdo at the same time.


Return to “LunaLua Help”

Who is online

Users browsing this forum: No registered users and 3 guests

SMWCentralTalkhausMario Fan Games GalaxyKafukaMarioWikiSMBXEquipoEstelari