Re: Beta 2.1.18
Posted: Mon Dec 15, 2014 8:46 pm
Only anomaly I've noticed is occasionally, the game will simply minimize itself. I am however, able to bring it right back up and continue game play.
That behavior was due to an app that was running in the BG.RMariano wrote:Only anomaly I've noticed is occasionally, the game will simply minimize itself. I am however, able to bring it right back up and continue game play.
2.1.18 is literally 2.1.17 plus one fix regarding misplaced crystals i.e. in the catacombs.Frenchie wrote:Is the full updated fix list placed anywhere in the forum?
This bug was discovered after 2.1.18 went live, so the answer is "No"Frenchie wrote:Does it include the setDoorState() bug that Isaac found mentioned in this forum topic
It's trivial, but it would be better to have it work reliably; it's in the script reference. Either that or remove it from the suggested usable function calls.minmay wrote:setDoorState() is trivial to implement yourself, guys...just change all the door's sounds to silence, give it infinite open/close speed, open/close it, then restore the original values the next frame.
Also, 2.1.18 fixed the GameObject:getPosition() bug, did it not?
Code: Select all
-- a version of setDoorState that...actually works
function safeSetDoorState(gameObject,doorComponentName,state)
local door = gameObject[doorComponentName]
if state == "closed" then
local closeSound, closeVelocity, lockSound = door:getCloseSound(), door:getCloseVelocity(), door:getLockSound()
door:setCloseSound("silence") door:setCloseVelocity(-math.huge) door:setLockSound("silence")
door.go.controller:close()
frameutils.script.callNextFrame(safeSetDoorStateCleanup,{gameObject.id,doorComponentName,state,closeSound,closeVelocity,lockSound})
elseif state == "open" then
local openSound, openVelocity, lockSound = door:getOpenSound(), door:getOpenVelocity(), door:getLockSound()
door:setOpenSound("silence") door:setOpenVelocity(math.huge) door:setLockSound("silence")
door.go.controller:open()
frameutils.script.callNextFrame(safeSetDoorStateCleanup,{gameObject.id,doorComponentName,state,openSound,openVelocity,lockSound})
else
Console.warn("invalid door state ("..state..") in safeSetDoorState for "..gameObject.id.."."..doorComponentName)
end
end
function safeSetDoorStateCleanup(gameObjectId, doorComponentName, state, sound, velocity, lockSound)
local door = findEntity(gameObjectId)[doorComponentName]
door:setLockSound(lockSound)
if state == "closed" then
door:setCloseSound(sound) door:setCloseVelocity(velocity)
elseif state == "open" then
door:setOpenSound(sound) door:setOpenVelocity(velocity)
else
Console.warn("invalid door state ("..state..") in safeSetDoorStateCleanup for "..gameObjectId.."."..doorComponentName)
end
end
Code: Select all
nextFrameFunctions = {}
function onFrame()
for _,nff in ipairs(nextFrameFunctions) do
local arg = nff.arg
-- CANNOT be shortened to
-- nff.hook(type(arg) == "table" and unpack(arg) or arg)
-- due to and/or only evaluating to the first value in the table.
if type(arg) == "table" then
nff.hook(unpack(arg))
else
nff.hook(arg)
end
end
nextFrameFunctions = {}
end
-- Call function func next frame with arguments in table args (or just args as
-- one argument, if it is not a table). They are called
-- in the same order that callNextFrame is called.
function callNextFrame(func,args)
table.insert(nextFrameFunctions,{hook=func,arg=args})
end
Code: Select all
{ -- This will trigger once every frame.
class = "Timer",
name = "frame_timer",
timerInterval = 0.001,
onActivate = function(self)
frameutils.script.onFrame()
end,
},