Page 13 of 14

Re: Beta 2.1.18

Posted: Mon Dec 15, 2014 8:46 pm
by RMariano
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.

Re: Beta 2.1.18

Posted: Wed Dec 17, 2014 12:10 pm
by arcanum
The game does not minimize itself. Its your other sofwaveres running on the background that request an API call to make window open. The game itself asks "i like to go fullscreen". It does not interfere any API calls does by another softwares of yours.

-arc

Re: Beta 2.1.18

Posted: Sat Jan 10, 2015 4:48 pm
by RMariano
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.
That behavior was due to an app that was running in the BG.


Condition corrected and no trubs since......

Re: Beta 2.1.18

Posted: Mon Feb 02, 2015 4:34 pm
by RMariano
still.......

Running 2118 with no trubs.

Re: Beta 2.1.18

Posted: Tue Feb 03, 2015 2:49 am
by Frenchie
Is the full updated fix list placed anywhere in the forum?

Does it include the setDoorState() bug that Isaac found mentioned in this forum topic

Re: Beta 2.1.18

Posted: Thu Feb 05, 2015 3:28 pm
by Dr.Disaster
Frenchie wrote:Is the full updated fix list placed anywhere in the forum?
2.1.18 is literally 2.1.17 plus one fix regarding misplaced crystals i.e. in the catacombs.
Frenchie wrote:Does it include the setDoorState() bug that Isaac found mentioned in this forum topic
This bug was discovered after 2.1.18 went live, so the answer is "No"

Re: Beta 2.1.18

Posted: Thu Feb 05, 2015 7:43 pm
by Isaac
AFAIK [now], the setDoorState() issue is not seen as a bug; (so it may or may not be worked on). The setDoorState() function is apparently only intended to be used internally during level setup at load; (not in user scripts). It would be nice if it did get changed to work smoothly (as it did in LoG); I found it useful.

*A serviceable workaround is to enable/disable the model and door components of the door object.

Re: Beta 2.1.18

Posted: Fri Feb 06, 2015 1:33 am
by minmay
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?

Re: Beta 2.1.18

Posted: Fri Feb 06, 2015 5:00 am
by Isaac
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?
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.

A replacement function that enables/ or disables the model and door [for collision] components seems to work pretty well; though I haven't really tested it, other than to try it a few times.

Re: Beta 2.1.18

Posted: Fri Feb 06, 2015 5:11 am
by minmay
That solution won't work if you want the user to see or interact with the door, or if you want to close the door instead of opening it, or a bunch of other things. Here's a version you can use instead.

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
Put the following in a script entity called frameutils:

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
Add the following component to the definition of "party":

Code: Select all

		{	-- This will trigger once every frame.
			class = "Timer",
			name = "frame_timer",
			timerInterval = 0.001,
			onActivate = function(self)
				frameutils.script.onFrame()
			end,
		},
Then define a sound called "silence" that's just silence.