Page 2 of 2

Re: [SCRIPT] Simple hunger system

Posted: Thu May 28, 2015 10:27 pm
by Isaac
Not off hand, but have you tried this yet? (to inspect it)

Code: Select all

party.party:addConnector("onMove", self.go.id, "foodCounter")
function foodCounter()
	local values = {}
	for x = 1,4 do
		values[x] = tostring(party.party:getChampion(x):getFood())	
	end
	hudPrint(values[2].." | "..values[2].." | "..values[3].." | "..values[4])
end
Food is an activity limit.

**Actually... I'm not exactly clear on why they should receive damage... They should all be able to go for days (perhaps weeks) without food without dieing from it.

Re: [SCRIPT] Simple hunger system

Posted: Thu May 28, 2015 10:50 pm
by AndakRainor
With very moderate damage it could be days or weeks... If I remember correctly, health does not regenerates when starving ? To be realistic, I think dehydration is a more immediate danger than starvation, but this is a little off-topic :) (the dungeon master mod for grimrock 1 had a water system, I never tried that yet but would it be possible to do the same with grimrock 2 ?)

Re: [SCRIPT] Simple hunger system

Posted: Thu May 28, 2015 10:53 pm
by minmay
Food doesn't only change when moving or resting. It's also changed by attacks and spells, and PartyComponent.onAttack doesn't get called for unarmed attacks, so...

Re: [SCRIPT] Simple hunger system

Posted: Thu May 28, 2015 11:02 pm
by Isaac
minmay wrote:Food doesn't only change when moving or resting. It's also changed by attacks and spells, and PartyComponent.onAttack doesn't get called for unarmed attacks, so...
But it would still show up on the next step they make.

Re: [SCRIPT] Simple hunger system

Posted: Thu May 28, 2015 11:05 pm
by AndakRainor
Ok may be a time based system is good enough after all !
Or starving people who don't mind having a punch fight, seems like a not so bad drawback :P

Re: [SCRIPT] Simple hunger system

Posted: Sat May 30, 2015 9:41 am
by Eleven Warrior
Awesome issac bloody awesome bro thxs for the code :) Yeah people can survive without food for roughly 2 weeks depending on body mass if I rem correctly lol. Water on the other hand is less.