Bony Beetle Frames Problem

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

Moderator: Userbase Moderators

marquise
Shy Guy
Shy Guy
Posts: 5
Joined: Sat Sep 29, 2018 5:20 pm
Flair: Family man

Bony Beetle Frames Problem

Postby marquise » Sun Feb 23, 2020 11:41 am

Hi there.

I've resized the Bony Beetle NPC to be a bit bigger, (Specifically 38px - 38px) but upon doing this the frames mess up in game.

Image

I'm assuming it is because of how the frames are done in the NPC-296.Lua file, perhaps specifically this bit of code:

Code: Select all

function bonybeetle.onStart()
	--calculate frame count based on sheet
	
	frames = Graphics.sprites.npc[npcID].img.height / configFile.gfxheight
	frameMod = {(frames - 8) * 0.5,2,2}
	NPC.config[npcID].frames = frames
	collapseFrames = {
		[-1] = frames - 4,
		[0] = frames - 4,
		[1] = frames - 2
	}
	spikeFrames = {
		[-1] = frames - 8,
		[0] = frames - 8,
		[1] = frames - 6
	}
	
	walkFrames = {
		[-1] = 0,
		[0] = 0,
		[1] = (frames - 8) * 0.5
	}
end
Something to do with the walk frames maybe? To be honest I have no idea what any of this means really so would someone know how to correct this problem?

Thanks.

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

Re: Bony Beetle Frames Problem

Postby Emral » Sun Feb 23, 2020 12:09 pm

The code you posted infers the number of frames from the height of the spritesheet divided by the npc ID's gfxheight property.
Did you use a npc-296.txt file to adjust the NPC's size accordingly? Something like...
height=38
gfxheight=38
width=38
gfxwidth=38

marquise
Shy Guy
Shy Guy
Posts: 5
Joined: Sat Sep 29, 2018 5:20 pm
Flair: Family man

Re: Bony Beetle Frames Problem

Postby marquise » Sun Feb 23, 2020 12:56 pm

Yep done that and after doing that the walk animation looks fine in the editor, it's only in game that it messes up.


Return to “LunaLua Help”

Who is online

Users browsing this forum: No registered users and 34 guests

SMWCentralTalkhausMario Fan Games GalaxyKafukaMarioWikiSMBXEquipoEstelari