Health = 0

Talk about creating Grimrock 1 levels and mods here. Warning: forum contains spoilers!
Post Reply
Maethalion
Posts: 7
Joined: Sat Oct 04, 2014 3:36 am

Health = 0

Post by Maethalion »

I have a script that sets the each champion's health to 0. They "die" but it's not game over.

Is this intentional? I WANT the champions to show 0 health and to have skull portraits. Something comes by and resurrects them (party:heal()) later.
User avatar
SnowyOwl47
Posts: 148
Joined: Fri Sep 12, 2014 10:41 pm

Re: Health = 0

Post by SnowyOwl47 »

For this there is something you'd have to say like... GAME OVER lol but there is a way to do it. Its for some reasons that dungeon makers could use.
And it is not intentional really but thats how they made the game. They were not thinking about us players while doing it.

Now since i've never done this you'd have to ask someone else.
just to make sure you are using something like

Code: Select all

i = 1

for i => 4 then
     party:getChampion(i)damage(1000, fire)
     party:getChampion(i):playDamageSound()
     i = i + 1
end
Or I think this might work,

Code: Select all

party:destroy()
User avatar
SnowyOwl47
Posts: 148
Joined: Fri Sep 12, 2014 10:41 pm

Re: Health = 0

Post by SnowyOwl47 »

Sorry I messed up on something =D

It should be:

Code: Select all

i = 1

for i == 5 do
else
     party:getChampion(i)damage(1000, fire)
     party:getChampion(i):playDamageSound()
     i = i + 1
end
User avatar
JohnWordsworth
Posts: 1397
Joined: Fri Sep 14, 2012 4:19 pm
Location: Devon, United Kingdom
Contact:

Re: Health = 0

Post by JohnWordsworth »

I think you might be looking for...

Code: Select all

for i=1,4 do 
     party:getChampion(i):damage(10000, "physical");
     party:getChampion(i):playDamageSound();
end
Although, I'm not entirely sure of what the OP is asking. If you are looking to just kill all of the players (and end the game) then dealing a hideous amount of damage to them in turn like this will do that.

If you are specifically looking to have each hero show up as having "0" health but still have the game running (as you want a sequence where you play a ghost say) then you might be better off disabling the characters with setEnabled(false). I guess setting health to 0 is 'undefined behaviour' and while it's very unlikely that AH are going to go back and start updating LOG1 with changes to the scripting environment, it might be safer to just disable all 4 characters for that sequence of your dungeon (Although, I'm not 100% that disabling all characters is the best idea either!).
My Grimrock Projects Page with links to the Grimrock Model Toolkit, GrimFBX, Atlas Toolkit, QuickBar, NoteBook and the Oriental Weapons Pack.
User avatar
Dr.Disaster
Posts: 2876
Joined: Wed Aug 15, 2012 11:48 am

Re: Health = 0

Post by Dr.Disaster »

From a gamers experience:
In several plays i sometimes had the occasion that after a hit a character's health was indeed shown as 0 looking at bar or char screen and he/she still alive. So it seems possible. Nevertheless health won't stay at 0 due to a characters usual health regeneration. Of course you can set the disease state to prevent this but that's visible.
Post Reply