Hello There,
Is there a simple way to make a script that would do the following:
party steps inside a room (or on a certain tile): dies
and when the party dies, do not go to the game over screen but teleport them full health to another place in the dungeon?
Would this be possible to overide, or is the game over screen thing hard coded?
question on dying and ressurection
Re: question on dying and ressurection
I believe minmay boasted of accomplishing this very thing, as a feature of boss battles in his someday-soon to be released mod. Maybe he'll share it with ya! 
As for insta-death, I believe this has been accomplished and solution sits somewhere in these threads. If I recall, you will need to do tile damage that reduces all party members health to 0
As for insta-death, I believe this has been accomplished and solution sits somewhere in these threads. If I recall, you will need to do tile damage that reduces all party members health to 0
Re: question on dying and ressurection
there is a onpartydie hook I believe so with little scripting this could be possible I think
Re: question on dying and ressurection
Any help to get started minmay
?
Re: question on dying and ressurection
Just use PartyComponent.onDie(). Check if there are no other living champions left, and if so, do your teleport/heal/whatever and return false.
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.
Grimrock 2 resources
I no longer answer scripting questions in private messages. Please ask in a forum topic or this Discord server.
- Zo Kath Ra
- Posts: 944
- Joined: Sat Apr 21, 2012 9:57 am
- Location: Germany
Re: question on dying and ressurection
Put this in your mod's init.lua:
Code: Select all
defineObject{
name = "party",
baseObject = "party",
components = {
{
class = "Party",
onDie = function(self, champion)
local living_champions = 0
for i = 1, 4 do
if (party.party:getChampionByOrdinal(i):isAlive()) then
living_champions = living_champions + 1
end
end
if (living_champions == 0) then
party:setPosition(starting_location_1.x, starting_location_1.y, starting_location_1.facing, starting_location_1.elevation, starting_location_1.level)
party.party:heal()
end
end,
}
}
}
Re: question on dying and ressurection
Thanks alot zo kath ra. One question tho,
what if I want to make it a one time use only ?
say for instance only in a certain area or if a certain counter is at a certain number?
is that possible?
what if I want to make it a one time use only ?
say for instance only in a certain area or if a certain counter is at a certain number?
is that possible?
Re: question on dying and ressurection
You can probably just add to the "IF" statement,
So this:
becomes something like this:
Just modify that to check for whatever value your Counter should be to allow for this circumstance. That should work!
So this:
Code: Select all
if (living_champions == 0) thenCode: Select all
if (living_champions == 0 AND mySpecialDeathCounter.counter:getValue() == 1) then