DisasterMaster wrote: ↑Sat Mar 09, 2024 3:47 pm
I discovered that this error occurs when you don't start the level in the same section as the boss and then use the editor's function to jump to a checkpoint within the boss' section.
Replace the entire onDrawNPC function in the Fire Necky's lua file with this:
Code: Select all
function sampleNPC.onDrawNPC(v)
if v.despawnTimer <= 0 or v.isHidden or not v.data.initialized then return end
local config = NPC.config[v.id]
local data = v.data
local pivotOffsetX = 0
local pivotOffsetY = 0
local opacity = 1
local priority = 1
if lowPriorityStates[v:mem(0x138,FIELD_WORD)] then
priority = -75
elseif v:mem(0x12C,FIELD_WORD) > 0 then
priority = -30
elseif config.foreground then
priority = -125
end
--Text.print(v.x, 8,8)
--Text.print(data.timer, 8,32)
if v:mem(0x156,FIELD_WORD) > 0 then
opacity = math.sin(lunatime.tick()*math.pi*0.25)*0.1 + 0.9
end
local img = config.headImage
local headHeight = img.height/config.headFrames
Graphics.drawBox{
texture = img,
x = v.x+config.headOffsetX,
y = v.y+config.headOffsetY,
width = -img.width * v.direction,
sourceY = data.headFrame * config.headHeight,
sourceHeight = config.headHeight,
sceneCoords = true,
centered = true,
priority = priority,
rotation = data.rotation,
}
local img = config.mouthImage
local headHeight = img.height/config.headFrames
Graphics.drawBox{
texture = img,
x = v.x+config.headOffsetX,
y = v.y+config.headOffsetY,
width = -img.width * v.direction,
sourceY = data.mouthFrame * config.headHeight,
sourceHeight = config.headHeight,
sceneCoords = true,
centered = true,
priority = priority-45,
rotation = data.rotation,
}
local img = Graphics.sprites.npc[v.id].img
Graphics.drawBox{
texture = img,
x = v.x + v.width/2,
y = v.y + v.height - img.height/2,
width = config.gfxwidth * v.direction,
sourceY = v.animationFrame * config.gfxheight,
sourceHeight = config.gfxheight,
sourceWidth = config.gfxwidth,
sceneCoords = true,
centered = true,
priority = priority,
rotation = data.rotation,
}
data.birdYPos = Sprite{texture = txture}
local plr = npcutils.getNearestPlayer(v)
data.birdYPos.position = vector(v.x, plr.y + 4)
end