i know there is a way to make only specific item for the altar to trigger secret door but i dont know how to make the specific item to work on it
becuse right now every item i put on the altar trigger the secret door
hi need help with altar
Re: hi need help with altar
You need to use a script to check the item on the altar and open the door. Typically this is done by adding an onInsertItem connector from the SurfaceComponent to a function in a script_entity's ScriptComponent that compares the item's name to the desired name (or checks for the desired trait, or whatever other condition you want) and opens the door if they match.
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.
Re: hi need help with altar
Code: Select all
for _,item in YOUR_ALTAR_ID.surface:contents() do
if item.go.ID== 'YOUR_ITEM_ID' then
DoSomething();
end
end
Re: hi need help with altar
very hard for me to understand ur replay can you give me exmple of some random item on altar so then i will understand what i need to do for sure thanks for the help
Re: hi need help with altar
for flask_1,item in altar_2.surface:contents(beach_secret_door_2) do if item.go.altar_2== 'flask_1' then DoSomething(toogle); end
really not understanding how to make it work
really not understanding how to make it work
Re: hi need help with altar
It should be:
All you have to do is put your action commands where the Comment is. Don't change anything else. Although based on your current understanding of applying LUA to Grimrock I would strongly recommend you spend a great many hours going back and forth with the Scripting Reference and your own trial and error:
http://www.grimrock.net/modding/scripting-reference/
You need to put yourself to some gruesome and lengthy scripting practice. I had to do the same thing when I first started.
Code: Select all
for _,item in altar_2.surface:contents() do
if item.go.ID == 'flask_1' then
-- put your action code here
end
end
http://www.grimrock.net/modding/scripting-reference/
You need to put yourself to some gruesome and lengthy scripting practice. I had to do the same thing when I first started.
Re: hi need help with altar
thanks for the help azel but seems like im goin to find another way then and leave the idea of the altars to trigger doors lol
Re: hi need help with altar
hah, good idea. Keep it simple 
