Instakill party whens step on floor_trigger

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!
User avatar
KhellQc
Posts: 25
Joined: Sat Nov 15, 2014 11:15 pm

Instakill party whens step on floor_trigger

Post by KhellQc »

Hey guys, I have no clue how to do that. I just want the 4 party member to die when stepping somewhere. that it.... cant figure it ... I searched forums and they give me returns me an error argument 6 stating it needs numbers.... wtv can you hel
User avatar
cromcrom
Posts: 549
Joined: Tue Sep 11, 2012 7:16 am
Location: Chateauroux in a socialist s#!$*&% formerly known as "France"

Re: Instakill party whens step on floor_trigger

Post by cromcrom »

Try this function, that you can connect to a floortrigger:

Code: Select all

function killparty()
for i=1,4 do
party.party:getChampion(i):setHealth(0)
end
end
A trip of a thousand leagues starts with a step.
User avatar
KhellQc
Posts: 25
Joined: Sat Nov 15, 2014 11:15 pm

Re: Instakill party whens step on floor_trigger

Post by KhellQc »

Nothing happening, and if you meant


for i=1,4 do I tried to fix it to <id> but still not working

Well it kills them but they still walk as deads.. does give the game over msg and try to end game
GoldenShadowGS
Posts: 168
Joined: Thu Oct 30, 2014 1:56 am

Re: Instakill party whens step on floor_trigger

Post by GoldenShadowGS »

Did you try in the editor or the actual game?
User avatar
KhellQc
Posts: 25
Joined: Sat Nov 15, 2014 11:15 pm

Re: Instakill party whens step on floor_trigger

Post by KhellQc »

just did and it puts them as dead, like skeleton but I can still walk around
minmay
Posts: 2790
Joined: Mon Sep 23, 2013 2:24 am

Re: Instakill party whens step on floor_trigger

Post by minmay »

You should use Champion:damage() instead of Champion:setHealth().
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.
User avatar
KhellQc
Posts: 25
Joined: Sat Nov 15, 2014 11:15 pm

Re: Instakill party whens step on floor_trigger

Post by KhellQc »

bad argument num,ber 2 string expected got nil

function killparty()
for i=1,4 do
party.party:getChampion(i):damage(9999)
end
end
User avatar
sps999
Posts: 44
Joined: Sun Oct 26, 2014 11:16 pm

Re: Instakill party whens step on floor_trigger

Post by sps999 »

I think this video might help. In the video Skuggs covers how to use scripts to interact with the dungeon.

Watch it here: https://www.youtube.com/watch?v=dxonfso ... Nc&index=6

And it might help to watch the previous videos in the series too if you are still lost. The series is a pretty good introduction to the editor.
User avatar
KhellQc
Posts: 25
Joined: Sat Nov 15, 2014 11:15 pm

Re: Instakill party whens step on floor_trigger

Post by KhellQc »

sure will do Thank you
minmay
Posts: 2790
Joined: Mon Sep 23, 2013 2:24 am

Re: Instakill party whens step on floor_trigger

Post by minmay »

KhellQc wrote:bad argument num,ber 2 string expected got nil

function killparty()
for i=1,4 do
party.party:getChampion(i):damage(9999)
end
end
http://www.grimrock.net/modding/scripti ... /#Champion
Champion:damage(dmg, damageType)
You need to include a damage type, like "party.party:getChampion(i):damage(9999,"physical")".
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.
Post Reply