SMB3 Flame Chomp (Custom LunaLua API)

This is the place for discussion and support for LunaLua and related modifications and libraries.

Moderator: Userbase Moderators

Forum rules
Before you make a topic/post, consider the following:
-Is there a topic for this already?
-Is your post on topic/appropriate?
-Are you posting in the right forum/following the forum rules?
Valtteri
Birdo
Birdo
Posts: 2150
Joined: Sun Dec 01, 2013 1:16 pm

SMB3 Flame Chomp (Custom LunaLua API)

Postby Valtteri » Thu Mar 03, 2016 6:15 pm

This is my first LunaLua API. Rednaxela from Talkhaus was a great help. Kevsoft also helped me getting started with LunaLua.

It behaves very closely to SMB3. It chases the player. It has four fireballs and it will shoot each out towards the player. Once it's shot all four, it will explode. It can be killed in all ways except Ice Flower.



To use:
  • Extract the files from the download below to your level folder, create a "lunadll.lua" host file and put the following code in it:

    Code: Select all

    local flameChomp=loadAPI("flamechomp")
    function onStart()
        flameChomp.setSections({0})
    end
  • It replaces the SMB3 brown Paragoomba. You can place it in the editor normally (set it to Chase).
  • To have it spawn automatically throughout the level (like normal), you must create an event called "Flame Chomp" and have it activate at some point in the level. Place an NPC that will activate the event at the point where you want them to begin spawning. Make the event happen automatically at Level Start if you want them to begin spawning immediately.
  • setSections takes a table of numbers that represent the sections you want the Flame Chomp to automatically spawn in. The number must be the section number minus one. The above code only makes them spawn in section 1 for example. To make them spawn in sections 1, 5 and 6 for example, the code would look like this:

    Code: Select all

    local flameChomp=loadAPI("flamechomp")
    function onStart()
        flameChomp.setSections({0,4,5})
    end
Notes:
  • You can use the normal SMB3 Goomba normally despite the Flame Chomp replacing the brown Paragoomba!
http://www.mediafire.com/download/7u9c5x76rhh9r3k/

CopyLeft
Volcano Lotus
Volcano Lotus
Posts: 539
Joined: Mon Feb 10, 2014 2:47 pm

Re: SMB3 Flame Chomp (LunaLua API)

Postby CopyLeft » Thu Mar 03, 2016 6:23 pm

I won't be using this any time soon, but this could work quite well for quite a few levels.
Nicely done!

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

Re: SMB3 Flame Chomp (Custom LunaLua API)

Postby HenryRichard » Thu Mar 03, 2016 7:49 pm

I think you can do Misc.doBombExplosion(x, y, 3) to make an explosion instead of dummying out the SMB3 bob-oms. This is pretty sweet though, I'll definitely be using this.

CraftedPbody
Snifit
Snifit
Posts: 224
Joined: Mon Aug 11, 2014 9:26 am

I just don't know what's going wrong...

Postby CraftedPbody » Thu Mar 03, 2016 9:52 pm

I've been trying to get Valtteri's Flame Chomp working... I can't do it... I've put

Code: Select all

local flameChomp=loadAPI("flamechomp")
function onStart()
    flameChomp.setSections({0})
end
into a lunadll.lua folder. I've Updated my lunalua to the latest Nightly Dev and the latest version. I've even made a change from "loadAPI" to "API.load". I have no idea how to get this working... Any suggestions? I've been getting this error : Image

TLtimelord
Red Yoshi Egg
Red Yoshi Egg
Posts: 2699
Joined: Sat Dec 21, 2013 5:16 pm
Flair: Info under raps

Re: SMB3 Flame Chomp (Custom LunaLua API)

Postby TLtimelord » Thu Mar 03, 2016 10:10 pm

Valtteri you made my day.

You can effin guarantee I'll be using this.

Valtteri
Birdo
Birdo
Posts: 2150
Joined: Sun Dec 01, 2013 1:16 pm

Re: SMB3 Flame Chomp (Custom LunaLua API)

Postby Valtteri » Fri Mar 04, 2016 7:30 am

HenryRichard wrote:I think you can do Misc.doBombExplosion(x, y, 3) to make an explosion instead of dummying out the SMB3 bob-oms. This is pretty sweet though, I'll definitely be using this.
Thanks for pointing this out! I have now edited my code so it will utilize this function instead of spawning an exploding Bob-omb. I updated the download already. Bob-ombs are now compatible with the API!

RudeGuy
Bowser
Bowser
Posts: 4994
Joined: Fri Dec 27, 2013 7:36 am
Flair: local guy

Re: I just don't know what's going wrong...

Postby RudeGuy » Fri Mar 04, 2016 10:21 am

I think the error is that you've put a 0 in setSections. Try putting a number from 1 to 21 there,

Quantumenace
Chain Chomp
Chain Chomp
Posts: 308
Joined: Mon Dec 28, 2015 2:17 am

Re: SMB3 Flame Chomp (Custom LunaLua API)

Postby Quantumenace » Fri Mar 04, 2016 1:21 pm

Nice! I'll have to look at this for pointers for my own NPC APIs. They're working well, but yours look neater somehow.

I think I saw the chomp go off the bottom of the section, which kills it. It's something I had to prevent with my own flying NPC. Just a thought.

CraftedPbody
Snifit
Snifit
Posts: 224
Joined: Mon Aug 11, 2014 9:26 am

Re: I just don't know what's going wrong...

Postby CraftedPbody » Fri Mar 04, 2016 2:34 pm

RudeGuy07 wrote:I think the error is that you've put a 0 in setSections. Try putting a number from 1 to 21 there,
Image

I just tried that and it's still not working... Thanks for trying to help though!

UPDATE: I just put in the new version of Valtteri's Flame Chomp. I got a different error; two different errors actually... A "Divide by zero" error and another error :
Image

Valtteri
Birdo
Birdo
Posts: 2150
Joined: Sun Dec 01, 2013 1:16 pm

Re: SMB3 Flame Chomp (Custom LunaLua API)

Postby Valtteri » Fri Mar 04, 2016 3:51 pm

CraftedPbody wrote:UPDATE: I just put in the new version of Valtteri's Flame Chomp. I got a different error; two different errors actually... A "Divide by zero" error and another error :
Please redownload it. http://www.mediafire.com/download/7u9c5x76rhh9r3k/

CraftedPbody
Snifit
Snifit
Posts: 224
Joined: Mon Aug 11, 2014 9:26 am

Re: SMB3 Flame Chomp (Custom LunaLua API)

Postby CraftedPbody » Fri Mar 04, 2016 4:00 pm

It's working now!

Nat The Porcupine
Monty Mole
Monty Mole
Posts: 123
Joined: Tue Nov 10, 2015 2:55 pm

Re: SMB3 Flame Chomp (Custom LunaLua API)

Postby Nat The Porcupine » Tue Mar 22, 2016 12:50 pm

When I first saw this in action, my jaw literally hit the floor (I was lying on the ground, so...). This has inspired me to bring a few of the enemies from SMB3 to SMBX myself. I actually just finished an API for the Fire Snake this morning. Can't wait to see what you do next ;)

timocomsmbx2345
Foo
Foo
Posts: 853
Joined: Sat Feb 06, 2016 1:44 pm
Contact:

Re: SMB3 Flame Chomp (Custom LunaLua API)

Postby timocomsmbx2345 » Mon Mar 28, 2016 3:24 pm

Wait, if the Flame Chomp replaces the Para-goomba, does that mean it will turn into a goomba when stomped?

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

Re: SMB3 Flame Chomp (Custom LunaLua API)

Postby PixelPest » Mon Mar 28, 2016 3:28 pm

timocomsmbx2345 wrote:Wait, if the Flame Chomp replaces the Para-goomba, does that mean it will turn into a goomba when stomped?
No. It doesn't

timocomsmbx2345
Foo
Foo
Posts: 853
Joined: Sat Feb 06, 2016 1:44 pm
Contact:

Re: SMB3 Flame Chomp (Custom LunaLua API)

Postby timocomsmbx2345 » Thu Mar 31, 2016 9:03 am

One more thing! Where do you get the checkpoint flag?

Valtteri
Birdo
Birdo
Posts: 2150
Joined: Sun Dec 01, 2013 1:16 pm

Re: SMB3 Flame Chomp (Custom LunaLua API)

Postby Valtteri » Thu Mar 31, 2016 9:09 am

timocomsmbx2345 wrote:One more thing! Where do you get the checkpoint flag?
At the moment it only exists in my level which you can download here. http://www.smbxgame.com/forums/v ... 63&t=13399

PlumberGraduate
Fighter Fly
Fighter Fly
Posts: 38
Joined: Sat Jun 14, 2014 11:39 am

Re: SMB3 Flame Chomp (Custom LunaLua API)

Postby PlumberGraduate » Wed Sep 28, 2016 1:33 pm

It just says "'=' expected near 'Â' at line 36" for me. :(

aero
Palom
Palom
Posts: 4787
Joined: Fri Mar 28, 2014 2:51 pm

Re: SMB3 Flame Chomp (Custom LunaLua API)

Postby aero » Wed Sep 28, 2016 2:42 pm

Code: Select all

if(v.part=="head") then
                if((v.ticks>=0 and v.ticks<2) or (v.ticks>=8 and v.ticks<10)) then --frame 1
                    if v.direction==-1 then
                        Graphics.drawImageToSceneWP(flameChomp, v.x, v.y, 0, 32, 32, 32, -5)
                    elseif v.direction==1 then
                        Graphics.drawImageToSceneWP(flameChomp, v.x, v.y, 0, 192, 32, 32, -5)
                    end
                elseif((v.ticks>=2 and v.ticks<4) or (v.ticks>=10 and v.ticks<12)) then --frame 2
                    if v.direction==-1 then
                        Graphics.drawImageToSceneWP(flameChomp, v.x, v.y, 0, 64, 32, 32, -5)
                    elseif v.direction==1 then
                        Graphics.drawImageToSceneWP(flameChomp, v.x, v.y, 0, 224, 32, 32, -5)
                    end
                elseif((v.ticks>=4 and v.ticks<6) or (v.ticks>=12 and v.ticks<14)) then --frame 3
                    if v.direction==-1 then
                        Graphics.drawImageToSceneWP(flameChomp, v.x, v.y, 0, 96, 32, 32, -5)
                    elseif v.direction==1 then
                        Graphics.drawImageToSceneWP(flameChomp, v.x, v.y, 0, 256, 32, 32, -5)
                    end
                elseif((v.ticks>=6 and v.ticks<8) or (v.ticks>=14 and v.ticks<16)) then --frame 4
                    if v.direction==-1 then
                        Graphics.drawImageToSceneWP(flameChomp, v.x, v.y, 0, 128, 32, 32, -5)
                    elseif v.direction==1 then
                        Graphics.drawImageToSceneWP(flameChomp, v.x, v.y, 0, 288, 32, 32, -5)
                    end
                elseif(v.ticks>=16) then --frame 5
                    if v.direction==-1 then
                        Graphics.drawImageToSceneWP(flameChomp, v.x, v.y, 0, 320, 32, 32, -5)
                    elseif v.direction==1 then
                        Graphics.drawImageToSceneWP(flameChomp, v.x, v.y, 0, 352, 32, 32, -5)
                end
end
can be reduced to

Code: Select all

if(v.part=="head") then

	if v.direction==-1 then
                  Graphics.drawImageToSceneWP(flameChomp, v.x, v.y, 0, yourframetimer * 32, 32, 32, -5)
        elseif v.direction==1 then
                  Graphics.drawImageToSceneWP(flameChomp, v.x, v.y, 0, (yourframetimer * 32) * (yourframetimer + 6), 32, 32, -5)
        end
        
end

PlumberGraduate
Fighter Fly
Fighter Fly
Posts: 38
Joined: Sat Jun 14, 2014 11:39 am

Re: SMB3 Flame Chomp (Custom LunaLua API)

Postby PlumberGraduate » Thu Sep 29, 2016 10:25 am

Fixed it, but I don't know how... :lol:

Valtteri
Birdo
Birdo
Posts: 2150
Joined: Sun Dec 01, 2013 1:16 pm

Re: SMB3 Flame Chomp (Custom LunaLua API)

Postby Valtteri » Thu Sep 29, 2016 10:41 am

I suggest you post in the LunaLua help topic about this. The API worked some months ago but LunaLua has updated since and might have rendered this API broken. Usually fixing these issues is a simple procedure.


Return to “LunaLua”

Who is online

Users browsing this forum: Amazon [Bot] and 2 guests

SMWCentralTalkhausMario Fan Games GalaxyKafukaMarioWikiSMBXEquipoEstelari