Who wants Clickable/Unlockable doors ?

Ask for help about creating mods and scripts for Grimrock 2 or share your tips, scripts, tools and assets with other modders here. Warning: forum contains spoilers!
User avatar
Doridion
Posts: 256
Joined: Tue Jun 10, 2014 9:23 pm

Re: Who want's CLICKABLE doors ?

Post by Doridion »

Blichew wrote:It's like that because clickable area is in fron of the door (probably). When you're on the fother side you simply can't reach clickable area. As it's roughly in the middle you can still reach it before door close.

Did you try adding another clickable component for the other side with adjusted vector/offset?
Yes and no. I've got this case, and just add maxDistance = 1, to the clickable properties. ( This property gives you from how distance you can activate the click function )

Also, my offset ( anchor ) vectors coords are based on the ultimate center of a door ( generaly vec(0,1.3,0) ), but, the size of the box wich be clickable can be changed. I made it "recovering" my custom door, but think that must be "redraw" by including debugDraw = true property to the clickable component.

Don't know if i'm clear enough :geek:
User avatar
Mysterious
Posts: 226
Joined: Wed Nov 06, 2013 8:31 am

Re: Who want's CLICKABLE doors ?

Post by Mysterious »

Hi again lol I have done this (below) and it's still not working. If I put the (debugDraw = true,) in it draws a box around the door. I can open the door from 1 side only, when I pass through the door and close it, then try to open it, it wont open :(

Code: Select all

defineObject{
   name = "my_clickable_door",
   baseObject = "dungeon_door_iron",
   components = {

      {
         class = "Door",
         killPillars = true,
      },
      {
         class = "Clickable",
         maxDistance = 1,
         offset = vec(0,1.3,0),
         size = vec(2.5,2.5,0.3),
		 --debugDraw = true,
         onClick = function(self)
            self.go.door:toggle()
         end
      },
      {
         class = "Controller",
         onOpen = function(self, name)
            self.go.door:open()
         end,
         onClose = function(self)
            self.go.door:close()
         end,
         onToggle = function(self)
            self.go.door:toggle()
         end,
      },
   },
   placement = "wall",
   editorIcon = 124,
}
User avatar
Doridion
Posts: 256
Joined: Tue Jun 10, 2014 9:23 pm

Re: Who want's CLICKABLE doors ?

Post by Doridion »

I'll test it with original LoG2 models and found what's going on.

God, how can i be SO stupid ....... sorry for all (( Didn't give you the sparse = true door propriety :D

You can now throw me tomatoes :D :mrgreen:

( edited my first post )
User avatar
Mysterious
Posts: 226
Joined: Wed Nov 06, 2013 8:31 am

Re: Who want's CLICKABLE doors ?

Post by Mysterious »

Doridion wrote:I'll test it with original LoG2 models and found what's going on.

God, how can i be SO stupid ....... sorry for all (( Didn't give you the sparse = true door propriety :D

You can now throw me tomatoes :D :mrgreen:

( edited my first post )
Ok I added that code. sparse = true, The editor say that invalid component property clickable.sparse I think I did it wrong lol
User avatar
Doridion
Posts: 256
Joined: Tue Jun 10, 2014 9:23 pm

Re: Who want's CLICKABLE doors ?

Post by Doridion »

Mysterious wrote:Ok I added that code. sparse = true, The editor say that invalid component property clickable.sparse I think I did it wrong lol
Mysterious, i said in the "door" class, not in the clickable class ;) Ok, it was not really explicit, i agree, but I slept only 2 hours this night :p Now you know why my hairs have flee between yesterday and this night :D
User avatar
Mysterious
Posts: 226
Joined: Wed Nov 06, 2013 8:31 am

Re: Who want's CLICKABLE doors ?

Post by Mysterious »

Umm ok imma sorry man :oops: .
User avatar
Doridion
Posts: 256
Joined: Tue Jun 10, 2014 9:23 pm

Re: Who want's CLICKABLE doors ?

Post by Doridion »

New update of the definition on the first post, and not the less ;)

Now, more than doors can be clickables, they are .... dynamicaly lockable/unlockables :mrgreen:

I explain how it simply works :
1 - In the editor, just put the door on your map, locking her directly in the door's components like the lock items, place the key somewhere in your map.
2 - Test your party, go taking the key, go in front off the locked door, click on the key, click on the door and ... it's open ;)

I'm already working on dynamicaly locking the unlocked doors by something like common keys or spell. The perfect remake of old dungeons is closer than never !
User avatar
Aisuu
Posts: 61
Joined: Fri Oct 31, 2014 2:07 pm

Re: Who wants Clickable/Unlockable doors ?

Post by Aisuu »

I need something similar to clickable doors.
I want to open the door (not locked), when party move into the tile with closed door.
It should by onMove hook, facing script. But I have no idea how to put it together or if its even possible.
User avatar
Doridion
Posts: 256
Joined: Tue Jun 10, 2014 9:23 pm

Re: Who wants Clickable/Unlockable doors ?

Post by Doridion »

Hmmmm, you can do it without any script or hooks ;)

Just put a door, two hidden_pressplates linked in toogle mode, and it'll do ;)
User avatar
Aisuu
Posts: 61
Joined: Fri Oct 31, 2014 2:07 pm

Re: Who wants Clickable/Unlockable doors ?

Post by Aisuu »

But the door will open as soon as you walk on the tile in front of the door. I dont want that. I want, when party move against the door and then door open. Sorry for my bad explanation, Iam not native english speaker :D
Post Reply