Page 1 of 1

Problems with the Floor Object "Door Button"

Posted: Mon Aug 24, 2009 1:56 pm
by Gambit37
The default door button that you place on a doorframe to automatically open a door is a special case FLOOROBJECT.

I wanted to create a version of this that had two states, but you can't give it a separate bitmap for an Alternate state like you can with switches that go on walls.

So I cloned the object and gave the clone the alternate graphic. Then I set the conversion for the "Click 1" tab to convert to the other door button, and vice versa.

This seems to work fine, except it causes a strange side effect: When a monster is in the doorway, the button doesn't change and the door doesn't open/close until the monster is dead or moves out of the way!

Anybody have any idea why this might be the case and if it's fixable, or do you think it's a RTC bug?

Re: Problems with the Floor Object "Door Button"

Posted: Sun Aug 30, 2009 5:57 am
by Trego
It may be due to monster being 'in front' of the button, a similar effect happened when you placed the the Door Button in the wrong order on the tile, with the doorframe and door.

So when you trying to click the button with the monster in the way you are actually clicking the monster.

Re: Problems with the Floor Object "Door Button"

Posted: Sun Aug 30, 2009 2:15 pm
by Gambit37
I don't think that's the problem. I can still click the button as I hear the soundeffect click, so I don't think the monster is "in front" of it. Anyway, I gave up with this idea -- it clearly doesn't work :-)

Re: Problems with the Floor Object "Door Button"

Posted: Mon Dec 31, 2012 4:33 pm
by Igor Poulpupov
Hi guys.

I bump this old thread because I have exactly the same problem whilst building Black Crypt doors: the buttons should have alternate states when you click on them, but doing it with cloned doorbuttons brings these strange problems described by Gambit.

I actually just found a solution (working for Black Crypt-like buttons), but it makes editing harder and generates warnings when compiling the dungeon...
- I cloned a doorbutton and gave it the normal state Black Crypt gfx (state 1). It converts on click into the "doorbutton state 2" and activates a relay.
- Since in BC the alternate gfx of the doorbutton (state 2) only stays for 1 second, this relay swaps the doorbuttons state 2 into doorbuttons state 1 after this delay.
- For the doorbutton state 2, I did not cloned a doorbutton but a basic flooritem: a "crack". Doing this, you avoid the problem described by Gambit. But...
- Doorframes hide basic flooritems: you won't see the doorbutton state 2. :x So I cloned a crack again to make a "fake" doorframe. You actually need 2 fake doorframes: one for North-South oriented doors, one for West-East oriented. For the N-S one, the gfx "front0" only appears if facing North or South, and NULL appears if facing West or East. Since these are not "true" doorframes, you get a warning: "no doorframe for this door".

Code: Select all

ADD		FLOORITEM_DOORBUTTON_BC13	CLONES=(FLOORITEM_DOORBUTTON)				NAME=(DOOR BUTTON BC13)	BITMAPS=(FRONT0:NULL,FRONT1:BITMAP_FLOORITEM_DOORBUTTON_BC13_FRONT1,FRONT2:BITMAP_FLOORITEM_DOORBUTTON_BC13_FRONT2,FRONT3:BITMAP_FLOORITEM_DOORBUTTON_BC13_FRONT3,SIDE0:NULL,SIDE1:NULL,SIDE2:NULL,SIDE3:BITMAP_FLOORITEM_DOORBUTTON_BC13_SIDE3)	CONVERT_CLICK1=(NEW_OBJECT:FLOORITEM_DOORBUTTON_BC13_ALT,ACTION:ACTION_OBJECT_ACTIVATE,ACTION_OBJECT1:WALLITEM_RELAY_DOORBUTTON_BC13,ACTION_OBJECT2:NULL,ACTION_STRENGTH:0)
ADD		WALLITEM_RELAY_DOORBUTTON_BC13	CLONES=(WALLITEM_RELAY)				
ADD		FLOORITEM_DOORBUTTON_BC13_ALT	CLONES=(FLOORITEM_CRACK)				NAME=(DOORBUTTON BC13 ALT)	ICONS=(BITMAP_ICON_FLOORITEM_DOORBUTTON,NULL)	MAP_ICONS=(BITMAP_MAP_ICON_DOOR_BUTTON,BITMAP_MAP_ICON_DOOR_BUTTON)	BITMAPS=(FRONT0:NULL,FRONT1:BITMAP_FLOORITEM_DOORBUTTON_BC13_FRONT1_ALT,FRONT2:BITMAP_FLOORITEM_DOORBUTTON_BC13_FRONT2,FRONT3:BITMAP_FLOORITEM_DOORBUTTON_BC13_FRONT3,SIDE0:NULL,SIDE1:NULL,SIDE2:NULL,SIDE3:BITMAP_FLOORITEM_DOORBUTTON_BC13_SIDE3)	
ADD		FLOORITEM_DOORFRAME_BC13_NS	CLONES=(FLOORITEM_CRACK)				NAME=(DOORFRAME BC13 (NS))	ICONS=(BITMAP_ICON_FLOORITEM_DOORFRAME,NULL)	MAP_ICONS=(BITMAP_MAP_ICON_DOOR_FRAME_BLACK,BITMAP_MAP_ICON_DOOR_FRAME_BLACK)	BITMAPS=(FRONT0:NULL,FRONT1:BITMAP_FLOORITEM_DOORFRAME_BC13_FRONT1,FRONT2:BITMAP_FLOORITEM_DOORFRAME_BC13_FRONT2,FRONT3:BITMAP_FLOORITEM_DOORFRAME_BC13_FRONT3,SIDE0:NULL,SIDE1:NULL,SIDE2:NULL,SIDE3:BITMAP_FLOORITEM_DOORFRAME_BC13_SIDE3)	BITMAPS_NORTH=(FRONT0:BITMAP_FLOORITEM_DOORFRAME_BC13_FRONT0,FRONT1:NULL,FRONT2:NULL,FRONT3:NULL,LEFT0:NULL,LEFT1:NULL,LEFT2:NULL,LEFT3:NULL,RIGHT0:NULL,RIGHT1:NULL,RIGHT2:NULL,RIGHT3:NULL)	BITMAPS_SOUTH=(FRONT0:BITMAP_FLOORITEM_DOORFRAME_BC13_FRONT0,FRONT1:NULL,FRONT2:NULL,FRONT3:NULL,LEFT0:NULL,LEFT1:NULL,LEFT2:NULL,LEFT3:NULL,RIGHT0:NULL,RIGHT1:NULL,RIGHT2:NULL,RIGHT3:NULL)	
ADD		FLOORITEM_DOORFRAME_BC13_WE	CLONES=(FLOORITEM_CRACK)				NAME=(DOORFRAME BC13 (WE))	ICONS=(BITMAP_ICON_FLOORITEM_DOORFRAME,NULL)	MAP_ICONS=(BITMAP_MAP_ICON_DOOR_FRAME_BLACK,BITMAP_MAP_ICON_DOOR_FRAME_BLACK)	BITMAPS=(FRONT0:NULL,FRONT1:BITMAP_FLOORITEM_DOORFRAME_BC13_FRONT1,FRONT2:BITMAP_FLOORITEM_DOORFRAME_BC13_FRONT2,FRONT3:BITMAP_FLOORITEM_DOORFRAME_BC13_FRONT3,SIDE0:NULL,SIDE1:NULL,SIDE2:NULL,SIDE3:BITMAP_FLOORITEM_DOORFRAME_BC13_SIDE3)	BITMAPS_EAST=(FRONT0:BITMAP_FLOORITEM_DOORFRAME_BC13_FRONT0,FRONT1:NULL,FRONT2:NULL,FRONT3:NULL,LEFT0:NULL,LEFT1:NULL,LEFT2:NULL,LEFT3:NULL,RIGHT0:NULL,RIGHT1:NULL,RIGHT2:NULL,RIGHT3:NULL)	BITMAPS_WEST=(FRONT0:BITMAP_FLOORITEM_DOORFRAME_BC13_FRONT0,FRONT1:NULL,FRONT2:NULL,FRONT3:NULL,LEFT0:NULL,LEFT1:NULL,LEFT2:NULL,LEFT3:NULL,RIGHT0:NULL,RIGHT1:NULL,RIGHT2:NULL,RIGHT3:NULL)	

A2200-1	WALLITEM_RELAY_DOORBUTTON_BC13	22	0	0	CENTRE	ACTION=(ACTIVATE)	TARGET=(A2200-2)	OPTIONS=(DELAY:5)
A2200-2	WALLITEM_ACTION			22	0	0	CENTRE	ACTION=(ACTION_SWAP_GLOBAL_FAST,FLOORITEM_DOORBUTTON_BC13_ALT,FLOORITEM_DOORBUTTON_BC13)	STRENGTH=(0)
This actually won't work for the problem described by Gambit: his alternate state should also be a doorbutton... A solution would be to build it as I did and to use it as a lever "toggling" the choosen door... Makes editing even harder than for me... But saying that, it could be a manner to build some riddles :mrgreen:
So... did anybody found another solution to this problem?