Page 3 of 5

Re: Who want's CLICKABLE doors ?

Posted: Sat Nov 08, 2014 2:30 pm
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:

Re: Who want's CLICKABLE doors ?

Posted: Sat Nov 08, 2014 3:03 pm
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,
}

Re: Who want's CLICKABLE doors ?

Posted: Sat Nov 08, 2014 3:06 pm
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 )

Re: Who want's CLICKABLE doors ?

Posted: Sat Nov 08, 2014 3:18 pm
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

Re: Who want's CLICKABLE doors ?

Posted: Sat Nov 08, 2014 3:21 pm
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

Re: Who want's CLICKABLE doors ?

Posted: Sat Nov 08, 2014 3:36 pm
by Mysterious
Umm ok imma sorry man :oops: .

Re: Who want's CLICKABLE doors ?

Posted: Sun Nov 09, 2014 12:49 am
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 !

Re: Who wants Clickable/Unlockable doors ?

Posted: Fri Nov 14, 2014 11:35 am
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.

Re: Who wants Clickable/Unlockable doors ?

Posted: Fri Nov 14, 2014 11:50 am
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 ;)

Re: Who wants Clickable/Unlockable doors ?

Posted: Fri Nov 14, 2014 12:01 pm
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