switching switches

Questions about how to create your own dungeons and replacement graphics and sounds.

Moderator: George Gilbert

Forum rules
Please read the Forum rules and policies before posting.
Post Reply
User avatar
THOM
Artisan
Posts: 198
Joined: Sat Feb 28, 2004 9:22 pm
Location: Cologne, Germany
Contact:

switching switches

Post 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 :?:
User avatar
beowuuf
Archmastiff
Posts: 20687
Joined: Sat Sep 16, 2000 2:00 pm
Location: Basingstoke, UK

Post 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?
User avatar
beowuuf
Archmastiff
Posts: 20687
Joined: Sat Sep 16, 2000 2:00 pm
Location: Basingstoke, UK

Post 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?
User avatar
THOM
Artisan
Posts: 198
Joined: Sat Feb 28, 2004 9:22 pm
Location: Cologne, Germany
Contact:

Post by THOM »

and how to know if there is a alternate state?
User avatar
beowuuf
Archmastiff
Posts: 20687
Joined: Sat Sep 16, 2000 2:00 pm
Location: Basingstoke, UK

Post 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...
User avatar
THOM
Artisan
Posts: 198
Joined: Sat Feb 28, 2004 9:22 pm
Location: Cologne, Germany
Contact:

Post by THOM »

ah :!:
User avatar
beowuuf
Archmastiff
Posts: 20687
Joined: Sat Sep 16, 2000 2:00 pm
Location: Basingstoke, UK

Post by beowuuf »

Does toggle do that then?
User avatar
THOM
Artisan
Posts: 198
Joined: Sat Feb 28, 2004 9:22 pm
Location: Cologne, Germany
Contact:

Post 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 ...
User avatar
beowuuf
Archmastiff
Posts: 20687
Joined: Sat Sep 16, 2000 2:00 pm
Location: Basingstoke, UK

Post 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
User avatar
George Gilbert
Dungeon Master
Posts: 3022
Joined: Mon Sep 25, 2000 11:04 am
Location: London, England
Contact:

Post 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...
User avatar
THOM
Artisan
Posts: 198
Joined: Sat Feb 28, 2004 9:22 pm
Location: Cologne, Germany
Contact:

Post by THOM »

AH!!!

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

simple but important difference!!!

Thanx
Post Reply