insta damage square

Ask for help about creating mods and scripts for Grimrock 2 or share your tips, scripts, tools and assets with other modders here. Warning: forum contains spoilers!
bongobeat
Posts: 1076
Joined: Thu May 16, 2013 5:58 pm
Location: France

insta damage square

Post by bongobeat »

Hello,

I want to make some kind of insta damage tile, based on log1 script, that kills the party when jumping in a mine chasm

I tried the script from log1, but that don't work. I got an error message, and only when the trigger plate is on a walking floor (of course)

anyone knows how to re-do the insta damage

log1 script:

Code: Select all

function instadeath()
damageTile(party.level, party.x, party.y, party.facing, 128, "physical", 9001)
hudPrint("You Foolish Adventurers, MWAHAHAHA!!!")
end
anyone knows how to apply the insta damage when the party jump in a mine chasm?
My asset pack: viewtopic.php?f=22&t=9320

Log1 mod : Toorum Manor: viewtopic.php?f=14&t=5505
Scotty
Posts: 69
Joined: Fri Nov 07, 2014 2:59 pm

Re: insta damage square

Post by Scotty »

Something like this should do the trick, connected to a floor trigger.

Code: Select all

function killParty()
  for i = 1, 4, 1 do
   party.party:getChampion(i):damage("physical",1000)
  end
end
bongobeat
Posts: 1076
Joined: Thu May 16, 2013 5:58 pm
Location: France

Re: insta damage square

Post by bongobeat »

thanks for help,
I ve just try, but there is still a error message
bad argument #1 to 'damage (number expected, got string) X
anyway, this can't be triggered while the party is falling
My asset pack: viewtopic.php?f=22&t=9320

Log1 mod : Toorum Manor: viewtopic.php?f=14&t=5505
GoldenShadowGS
Posts: 168
Joined: Thu Oct 30, 2014 1:56 am

Re: insta damage square

Post by GoldenShadowGS »

You could use, party:isFalling()

You could put floor triggers all around the chasm that have "ondeactivate" connect to "delay"
function delay()
delayedCall(self.go.id, 1, "falling")
--adjust the time of the delay by changing 1 to 1.2, 0.8, etc..
end

function falling()
if party.party:isFalling() then
for i = 1, 4, 1 do
party.party:getChampion(i):damage("physical",1000)
end
end
end
Scotty
Posts: 69
Joined: Fri Nov 07, 2014 2:59 pm

Re: insta damage square

Post by Scotty »

Oh, we had damage and damage type backwards by the way, should be:

Code: Select all

party.party:getChampion(i):damage(1000, "physical")
minmay
Posts: 2780
Joined: Mon Sep 23, 2013 2:24 am

Re: insta damage square

Post by minmay »

You just need to change your damageTile to account for the fact that Grimrock 2 has elevation, like this:

Code: Select all

function instadeath()
damageTile(party.level, party.x, party.y, party.facing, party.elevation, 128, "physical", 9001)
hudPrint("You Foolish Adventurers, MWAHAHAHA!!!")
end
Grimrock 1 dungeon
Grimrock 2 resources
I no longer answer scripting questions in private messages. Please ask in a forum topic or this Discord server.
bongobeat
Posts: 1076
Joined: Thu May 16, 2013 5:58 pm
Location: France

Re: insta damage square

Post by bongobeat »

thank you all for your help

I finally use the party is falling script with trigger plate, works well!


to minmay:
works well if you put the trigger plate on the same heigth of the hole, but if you put it a under it don't detect the plate while falling.
My asset pack: viewtopic.php?f=22&t=9320

Log1 mod : Toorum Manor: viewtopic.php?f=14&t=5505
MrChoke
Posts: 324
Joined: Sat Oct 25, 2014 7:20 pm

Re: insta damage square

Post by MrChoke »

Question on damageTile. What does the "flags" parameter do? The example above uses 128.
Batty
Posts: 509
Joined: Sun Apr 15, 2012 7:04 pm

Re: insta damage square

Post by Batty »

User avatar
JKos
Posts: 464
Joined: Wed Sep 12, 2012 10:03 pm
Location: Finland
Contact:

Re: insta damage square

Post by JKos »

I just added a usage example of DamageFlags to community docs: https://github.com/JKos/log2doc/wiki/Ob ... amageflags
- LoG Framework 2http://sites.google.com/site/jkoslog2 Define hooks in runtime by entity.name or entity.id + multiple hooks support.
- cloneObject viewtopic.php?f=22&t=8450
Post Reply