Custom Secret Door in script

Talk about creating Grimrock 1 levels and mods here. Warning: forum contains spoilers!
Post Reply
User avatar
Damonya
Posts: 134
Joined: Thu Feb 28, 2013 1:16 pm
Location: France
Contact:

Custom Secret Door in script

Post 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.
Last edited by Damonya on Thu Mar 07, 2013 1:54 pm, edited 1 time in total.
Orwak - MOD - Beta version 1.0
User avatar
Neikun
Posts: 2457
Joined: Thu Sep 13, 2012 1:06 pm
Location: New Brunswick, Canada
Contact:

Re: Custom Secret Door in script

Post 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.
"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
  • Message me to join in!
User avatar
Damonya
Posts: 134
Joined: Thu Feb 28, 2013 1:16 pm
Location: France
Contact:

Re: Custom Secret Door in script

Post 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. :?
Orwak - MOD - Beta version 1.0
User avatar
Komag
Posts: 3658
Joined: Sat Jul 28, 2012 4:55 pm
Location: Boston, USA

Re: Custom Secret Door in script

Post 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!
Finished Dungeons - complete mods to play
User avatar
Althewise
Posts: 2
Joined: Sat Apr 13, 2013 2:42 pm

Re: Custom Secret Door in script

Post 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
Post Reply