Damagetile

Talk about anything Legend of Grimrock 1 related here.
Post Reply
trancelistic
Posts: 275
Joined: Sat Jun 16, 2012 5:32 am

Damagetile

Post by trancelistic »

How to make a damgeTile that would kill 3 members of the 4 of my party?

I've tried it with killing a champion manually( and 3 champs) via a script. But I've found no way to restore the HP each char had before killing them with a script.

I mean like: A champ ( or 3) has like 100 hp.. They fall into the pit and it does 88 dmg. SO they don't die. They need to die, all but 1.

I can script this np, 3 will die.. 1 won't.
But how to script a thing. if the script reconizes the parties HP before and after?

Like a script check a champion (x) that the hp = 55. How to restore that? Even if the hp is -999. THe Hp of the champ isn't restored as is was.

Any idea's anyone?:) please. I know it should be possible right?

EDit: like Komags code:

Code: Select all

function resethits()
   -- Bump down hitpoints
    for x = 2, 4, 1 do
       party:getChampion(x):modifyStatCapacity("health",-320)
    end
end
late I could try something like:

Code: Select all

function stealHp()
   for x = 2, 4, 1 do
     party:getChampion(x):modifyStatCapacity("health",120)
     party:getChampion(x):modifyStat("health",120)
   end
end
It works. but It doesn't remembers a champs Health before it died.
-- Because it has -320 hp and gained + 120 so yeah.. still death.
I need to kill a champ who has x value of HP, and that is returned later on after solving a puzzle.

So Any 1 knows how to solve this? U be a pro.
trancelistic
Posts: 275
Joined: Sat Jun 16, 2012 5:32 am

Re: Damagetile

Post by trancelistic »

I'm sorry but I need to know 1 more thing>>>>

I do understandt the: for x = 1,4 normaly.. its 1 to 4 just like for x = 1,9999 ... its 1 to 9999 right? ( x being the value)

what does the "one" do? for x = 1,4 1 <<-- that 1?
User avatar
Dr.Disaster
Posts: 2874
Joined: Wed Aug 15, 2012 11:48 am

Re: Damagetile

Post by Dr.Disaster »

It tells the for loop which step value it should use. The default is 1 so unless you want it to be anything else you can omit it.

for x = 1, 4, 1 results in x being 1, 2, 3 and 4 just like anyone is used to when using for loops
for x = 1, 3, .4 results in x being 1, 1.4, 1.8, 2.2, 2.6 and 3
trancelistic
Posts: 275
Joined: Sat Jun 16, 2012 5:32 am

Re: Damagetile

Post by trancelistic »

Dr.Disaster wrote:It tells the for loop which step value it should use. The default is 1 so unless you want it to be anything else you can omit it.

for x = 1, 4, 1 results in x being 1, 2, 3 and 4 just like anyone is used to when using for loops
for x = 1, 3, .4 results in x being 1, 1.4, 1.8, 2.2, 2.6 and 3

Ah that makes perfect sense. Thanks Dr.Disaster.

Ps: I fixed my problem with a funny workarround. I think people will like it in the MOD.
Post Reply