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?
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:
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:
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.
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 :
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!
RudeGuy07 wrote:I think the error is that you've put a 0 in setSections. Try putting a number from 1 to 21 there,
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 :
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 :
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
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
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.