Page 1 of 1

Custom Secret Door in script

Posted: Thu Mar 07, 2013 12:05 pm
by Damonya
I wanted to make a secret door with texture of: dungeon_catacomb_empty and the similar other. But it is too difficult. I searched in the forum, but nothing. So I have found an other solution. I give you so that you can correct me. There may be more simple, but I have not found.

1. First install Grimrock Model Toolkit and download the Asset Pack.
2. Open GMT and the dungeon_secret_door.model
3. Go to Model Nodes: Node 2 :Gates
4. Changes the 0,01 in Matrix to 0
5. Save your file as : invisible_wall.model in your mod_assets/models folder
6. In objects.lua:
SpoilerShow

Code: Select all

cloneObject{
	name = "invisible_wall",
	baseObject = "dungeon_secret_door",
	model = "mod_assets/models/invisible_wall.fbx",
}
That's all! And now you have an invisible secret door. That's fun!

Open the editor and place the dungeon_catacomb_empty and your invisible_wall at the same place
Now you have a dungeon catacomb (or what you want) secret door.

But to open the secret door you must through script.
Connect a wall_button to a function script_entity.

1.The simplest

- connect the wall button to your invisible_wall : open
- connect the wall button to this function
SpoilerShow

Code: Select all

function wallsecret()
dungeon_catacomb_empty:destroy()
end
Here you have the sound of the secret_door opening but not the animation
And you probably need to add a counter because the function can not destroy execute if the object does not exist (if you press the button repeatedly).

So:

2. A little more difficult

- set a counter
- connect the wall button to this function:
SpoilerShow

Code: Select all

function wallesecret()
if counter:getValue() == 0 then
dungeon_catacomb_empty:destroy()
invisible_wall:destroy()
spawn("dungeon_secret_door", L, X, Y, facing,"secret_door_catacomb")
secret_door_catacomb:open()
counter:setValue(1)
end
end
PS : for "L,X,Y,facing" see the function spawn.

Now you have a custom secret wall with the sound and the animation. You can put monster in your secret place, they can't come if the invisible_wall is not open or destroy.

It's not perfect but better than nothing. If you have any suggestions and improvements: Thanks.

Re: Custom Secret Door in script

Posted: Thu Mar 07, 2013 1:53 pm
by Neikun
Oh, you can shorten this whole thing up by opening the model you want in the gmt, and renaming a node as gate.
So for the catacombs, the node you want to rename is Mesh.

Then you save it and define it as a secret door.

Re: Custom Secret Door in script

Posted: Thu Mar 07, 2013 2:06 pm
by Damonya
Oh my god, I'm shit for nothing. :o

Thanks Neikun, it's really better. :)

Well at least, you know how to make an invisible wall. :?

Re: Custom Secret Door in script

Posted: Thu Mar 07, 2013 2:13 pm
by Komag
Even if some of your effort ends up "wasted" it's okay because of how much you learned in the process. This has happened to me many times!

Re: Custom Secret Door in script

Posted: Mon Apr 15, 2013 4:28 pm
by Althewise
Thanks topikmaker, try to do the same and did't know about nods it is work with out it, but throw a worning all the time