Page 2 of 2

Re: Regen/hunger/"game over" questions (WAS Altering Playr C

Posted: Sun Nov 18, 2012 8:36 pm
by ZeroAlligator
I worked on this a little bit today (stopping the Game Over game freeze) and wasn't able to get anywhere. I put this into a .01 timer with interesting but useless results:
SpoilerShow
function checkHealth()
local champion
local true_hp
local DeathCount

DeathCount = 0
for i = 1, 4 do
champion = party:getChampion(i)
if champion:isAlive() == false then
DeathCount = DeathCount +1
end
end
if DeathCount == 4 then
party:heal()
end
end
Everyone is healed when everyone dies but the game remains frozen. I also tried healing a champion to full health upon death and then removing them from the party until everyone is healed or everyone dies... Unfortunately once a champion is disabled (removed from the party) they cease to exist and count as dead... same game over freeze.

Near as I can think, the way to get around this is to have one of your champions be a donkey/chest/wagon champion with infinite health or super fast regeneration health. When everyone else dies, call your party:heal() and teleport script. Donkey can't die so game can't end. Not a horrible solution, but not ideal I know.

-Mark

Re: Regen/hunger/"game over" questions (WAS Altering Playr C

Posted: Sun Nov 18, 2012 9:49 pm
by Xanathar
Have you tried something like this?

Code: Select all


cloneObject{
	name = "party",
	baseObject = "party",

	onDie = function(deadchamp)
		local DeathCount = 0
		for i = 1, 4 do
			champion = party:getChampion(i)
			if ((not champion:isAlive()) and (champion ~= deadchamp)) then
				DeathCount = DeathCount +1
			end
		end
		
		if (DeathCount == 3) then
			party:heal()
			return false
		end
	end,
}