HELP: i need a script for a monster/party interaction.
HELP: i need a script for a monster/party interaction.
I need a script were if Tentacles1 or 2 or 3 or 4 kills a party member then open the IronDoor.
Some one can help me?
Some one can help me?
If we do not end the war, the war will end us.
-
- Posts: 15
- Joined: Thu Sep 20, 2012 9:37 am
Re: HELP: i need a script for a monster/party interaction.
I don't think it's possible to know the entity which causes a death of a champion.
This said, I think you can do your script with the following technic :
entity_1 is an instance of your monster
onDie : use a hook which does this : if a party member died, look for the four adjacents tiles (party.x and party.y), and look for the location of entity_1 (entity_1.x, entity.y) : if the entity is present, ironDoor:open()
Will it be good for your need? I can try to write you the needed scripts if you want (but I'm at work now so I won't be able to test it at the moment! )
This said, I think you can do your script with the following technic :
entity_1 is an instance of your monster
onDie : use a hook which does this : if a party member died, look for the four adjacents tiles (party.x and party.y), and look for the location of entity_1 (entity_1.x, entity.y) : if the entity is present, ironDoor:open()
Will it be good for your need? I can try to write you the needed scripts if you want (but I'm at work now so I won't be able to test it at the moment! )
[MOD] Black Crypt 2012 - http://steamcommunity.com/sharedfiles/f ... earchtext=
[THD] Black Crypt Mod - viewtopic.php?f=14&t=3263
[THD] Black Crypt Mod - viewtopic.php?f=14&t=3263
Re: HELP: i need a script for a monster/party interaction.
I will be glad if you can write it. Do it when you can, i'm ending the dungeon on this week end and i need to try it before publishing the beta of the full mod.zapibranigan wrote:I don't think it's possible to know the entity which causes a death of a champion.
This said, I think you can do your script with the following technic :
entity_1 is an instance of your monster
onDie : use a hook which does this : if a party member died, look for the four adjacents tiles (party.x and party.y), and look for the location of entity_1 (entity_1.x, entity.y) : if the entity is present, ironDoor:open()
Will it be good for your need? I can try to write you the needed scripts if you want (but I'm at work now so I won't be able to test it at the moment! )
If we do not end the war, the war will end us.
Re: HELP: i need a script for a monster/party interaction.
That sounds mean D:
"I'm okay with being referred to as a goddess."
Community Model Request Thread
See what I'm working on right now: Neikun's Workshop
Lead Coordinator for Legends of the Northern Realms Project
Community Model Request Thread
See what I'm working on right now: Neikun's Workshop
Lead Coordinator for Legends of the Northern Realms Project
- Message me to join in!
- Montis
- Posts: 340
- Joined: Sun Apr 15, 2012 1:25 am
- Location: Grimrock II 2nd playthrough (hard/oldschool)
Re: HELP: i need a script for a monster/party interaction.
it's could actually be the opposite.Neikun wrote:That sounds mean D:
like "you can do x to open the door, but if someone gets killed, the door opens as well"
I might try to whip up a script this afternoon when I have time.
- Montis
- Posts: 340
- Joined: Sun Apr 15, 2012 1:25 am
- Location: Grimrock II 2nd playthrough (hard/oldschool)
Re: HELP: i need a script for a monster/party interaction.
Done. Can someone try the following?
in file init.lua
script_entity murderMystery
in file init.lua
SpoilerShow
Code: Select all
cloneObject{
name = "party",
baseObject = "party",
onDie = function()
murderMystery.checkWhoDidIt()
end,
}
script_entity murderMystery
SpoilerShow
Code: Select all
-- change the following line to suit your dungeon
suspectedMurderer = "tentacles"
doorToOpen = "mysteryDoor"
-- you shouldn't need to change any of the following lines
function checkWhoDidIt()
local x = ""
local y = ""
for i=1,4 do
if i==1 then
x = party.x+1
elseif i == 3 then
x = party.x-1
else
x = party.x
end
if i==2 then
y = party.y+1
elseif i == 4 then
y = party.y-1
else
y = party.y
end
for j in entitiesAt(party.level, x, y) do
if j.name == suspectedMurderer then
findEntity(doorToOpen):open()
return
end
end
end
end
Last edited by Montis on Sat Sep 22, 2012 11:10 am, edited 1 time in total.
Re: HELP: i need a script for a monster/party interaction.
i like the script name Montis ^_^
in fact... it gave me an idea... a murder mystery mod!
one of your party members killed an innocent snail, following clues you must figure out which room the murder took place in and with which weapon!
in fact... it gave me an idea... a murder mystery mod!
one of your party members killed an innocent snail, following clues you must figure out which room the murder took place in and with which weapon!
Re: HELP: i need a script for a monster/party interaction.
a Grimrock "Clue" game? Interesting!
Finished Dungeons - complete mods to play
Re: HELP: i need a script for a monster/party interaction.
The cript crashed as a party member died and the editor was shut down.
If we do not end the war, the war will end us.
- Montis
- Posts: 340
- Joined: Sun Apr 15, 2012 1:25 am
- Location: Grimrock II 2nd playthrough (hard/oldschool)
Re: HELP: i need a script for a monster/party interaction.
The function was incorrect, but not to the part that it crashed for me. I fiddled around a bit and reproduced the crash: the script_entity name must(!) be the same name as you refer to it in the onDie function. So when you have ondie... murderMystery.checkWhoDidIt(), you must name the script_entity "murderMystery" or the game will crash when trying to call the function.
I corrected the script of the function above, that will work now.
I corrected the script of the function above, that will work now.