Page 1 of 1

Bony Beetle Frames Problem

Posted: Sun Feb 23, 2020 11:41 am
by marquise
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.

Re: Bony Beetle Frames Problem

Posted: Sun Feb 23, 2020 12:09 pm
by Emral
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

Re: Bony Beetle Frames Problem

Posted: Sun Feb 23, 2020 12:56 pm
by marquise
Yep done that and after doing that the walk animation looks fine in the editor, it's only in game that it messes up.