Page 1 of 1

switching switches

Posted: Sun Aug 20, 2006 8:52 pm
by THOM
I have the following problem in my custom dungeon:

I made a switch which should change the bitmap of itself and activate a relay.
I did it like that:

Code: Select all

ref010322-1	WALLITEM_COG#1			3	22	1	NORTH		OPBY=(HAND_EMPTY)	ACTION=(ACTIVATE)	TARGET=(ref010122-1)	OPTIONS=(DELAY:1,SOUND:SOUND_STEP_DEMON_THORN)
ref010322-2	WALLITEM_COG#2			3	22	1	NORTH		STATE=(INVISIBLE)	OPBY=(HAND_EMPTY)	ACTION=(ACTIVATE)	TARGET=(ref010122-1)	OPTIONS=(DELAY:1,SOUND:SOUND_STEP_DEMON_THORN)
ref010122-1	WALLITEM_RELAY			1	22	1	CENTRE	ACTION=(TOGGLE)	TARGET=(ref010322-1,ref010322-2,ref010222-2,ref010222-3)
the result is, that I get the sound, but the bitmap is not changed but stays. Because of the delay I have a 1/6sec were the wall is blank! But at the end there is bitmap cog#1 and not #2 on the wall.
Funny thing is: ref010222-2,ref010222-3 are two different bitmaps which should be exchanged by the relay, too. And they do!!

Any ideas???

THOM :?:

Posted: Sun Aug 20, 2006 9:06 pm
by beowuuf
Is there a reason you aren't using a clone of a switch with an alternate state of a switch?

The only thought would be the relay is acting in part of a chain, and so the original switch doens't like to disabled?

Posted: Sun Aug 20, 2006 9:18 pm
by beowuuf

Code: Select all

beo0103-1	WALLITEM_AMALGAM			1	3	0	WEST		OPBY=(HAND)	ACTION=(ACTIVATE)	TARGET=(beo0103-3)	OPTIONS=(DELAY:1,SOUND:NULL)
beo0103-2	WALLITEM_AMALGAM_BURNT		1	3	0	WEST		STATE=(INVISIBLE)	OPBY=(HAND)	ACTION=(ACTIVATE)	TARGET=(beo0103-3)	OPTIONS=(DELAY:1,SOUND:NULL)
beo0103-3	WALLITEM_RELAY			1	3	0	CENTRE	ACTION=(TOGGLE)	TARGET=(beo0103-1,beo0103-2)
This worked as you'd want, so not sure what the problem is... the only problem I had was not being able to have a zero delay to have it swap. Perhaps the item you cloned? An item with an altered state wants to toggle to its altered state, not toggle it's visbility/invisibility instead?

Posted: Sun Aug 20, 2006 9:52 pm
by THOM
and how to know if there is a alternate state?

Posted: Sun Aug 20, 2006 9:55 pm
by beowuuf
You've played the game, so you know which items toggle - sconces, green/blue gem switches, the big letterbox switch, red cross switch...

Posted: Sun Aug 20, 2006 10:02 pm
by THOM
ah :!:

Posted: Sun Aug 20, 2006 10:16 pm
by beowuuf
Does toggle do that then?

Posted: Sun Aug 20, 2006 10:40 pm
by THOM
I think I have found out, that all Items, which have a bitmap defined under BITMAPS/ BITMAP_FRONT_ALT (you can find that if you clone an item)- have an alternate state. for eg. the demonface has, too.

makes it much more difficult to get an wallitem which is toggable ...

Posted: Sun Aug 20, 2006 10:45 pm
by beowuuf
small switch, tiny switch, amalgams, fountains I guess

But yes, you do have to be careful which you clone, as there are some interesting inherented properties

Posted: Sat Aug 26, 2006 6:28 pm
by George Gilbert
Actually, there are no inherrited hidden properties for switches.

The engine determines if an object is a switch purely if the main and alt bitmaps for the object are different...

Posted: Mon Aug 28, 2006 12:26 am
by THOM
AH!!!

And that means different and not that BITMAP_ALT can be NULL !!!

simple but important difference!!!

Thanx