Regen/hunger/"game over" questions (WAS Altering Playr Coold

Talk about creating Grimrock 1 levels and mods here. Warning: forum contains spoilers!
User avatar
ZeroAlligator
Posts: 5
Joined: Sun Nov 04, 2012 8:46 am

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

Post 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
User avatar
Xanathar
Posts: 629
Joined: Sun Apr 15, 2012 10:19 am
Location: Torino, Italy
Contact:

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

Post 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,
}

Waking Violet (Steam, PS4, PSVita, Switch) : http://www.wakingviolet.com

The Sunset Gate [MOD]: viewtopic.php?f=14&t=5563

My preciousss: http://www.moonsharp.org
Post Reply