Page 1 of 1
Making Custom Npc Boss Green Birdo for SMBX2
Posted: Sat Jun 20, 2020 10:37 pm
by Roger Mario
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?
Re: Making Custom Npc Boss Green Birdo for SMBX2
Posted: Sun Jun 21, 2020 2:55 am
by Emral
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.
Re: Making Custom Npc Boss Green Birdo for SMBX2
Posted: Sun Jun 21, 2020 11:08 am
by Lusho
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
Re: Making Custom Npc Boss Green Birdo for SMBX2
Posted: Sun Jun 21, 2020 6:01 pm
by Roger Mario
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
Re: Making Custom Npc Boss Green Birdo for SMBX2
Posted: Mon Jun 22, 2020 12:36 am
by Emral
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
Re: Making Custom Npc Boss Green Birdo for SMBX2
Posted: Mon Jun 22, 2020 12:48 am
by Lusho
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
Re: Making Custom Npc Boss Green Birdo for SMBX2
Posted: Mon Jun 22, 2020 10:52 pm
by Roger Mario
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! ^^

Re: Making Custom Npc Boss Green Birdo for SMBX2
Posted: Mon Jun 22, 2020 11:15 pm
by Hoeloe
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.
Re: Making Custom Npc Boss Green Birdo for SMBX2
Posted: Tue Jun 23, 2020 12:23 am
by Murphmario
I modified the original Birdo to make Green Birdo, but then you can't use the original Birdo at the same time.