Page 1 of 1

Testing which item is in an alcove

Posted: Sun Mar 29, 2009 9:53 am
by Remma12
Hi,

Is it possible to have a relay test which item is placed into an alcove?
What i'm trying to do is have an alcove that, if you place a gem into it, and hit a switch next door the gem changes into a key.
Now I can get this to work just fine by making the alcove a switch that's activated by a gem. The problem is that it needs to accept a blue gem, a red gem, a green gem.
It works perfectly with just one alcove, say accepting a red gem however if I put in multiple alcoves on top of each other the mechanic seems to get a little glitchy, it still works but sometimes you have to pick up and put the item down again a couple times for it to fire which is a little inelegant!
Another option might be to temporarily teleport an item placed into the alcove away, have it land on a stack of floor triggers that test for the different items then teleport it back and proceed from there.
However I'm kinda hoping that i've missed something obvious that'll make life a lil easier

Re: Testing which item is in an alcove

Posted: Sun Mar 29, 2009 10:39 am
by beowuuf
Relays inspect the triggering action, so in theory if you have an alcove that simply triggers by any object, you can have this target three relays, each one looking for the activating object to be one of the three gems.

Re: Testing which item is in an alcove

Posted: Sun Mar 29, 2009 10:52 am
by beowuuf
Hmm, a quick play around I can't make it work - It's been a while!

Re: Testing which item is in an alcove

Posted: Sun Mar 29, 2009 1:15 pm
by Remma12
Thanks for trying though =)

Re: Testing which item is in an alcove

Posted: Fri May 08, 2009 8:41 pm
by Lord_BoNes
I've done something similar in my dungeon using different screamer slices, have multiple triggers on the alcove tile (create them on the floor tile, and cut and paste, ignore the warning) target them all to a relay that targets two other relays, one that deactives ALL the triggers, the other that activates the desired effect.

To swap the gem into a key, then I suggest you use multiple WALLITEM_ACTIONs with ACTION_SWAP_TILE, for "object 1" put in one of your gems, for "object 2" put in your key. Then just change the "object 1" for each gem, trigger each of the WALLITEM_ACTIONs using the second relay above.

This solution will only work once, if you want a key per gem multiple times, then just don't use the relay that deactivates the triggers. If you want one per gem type, then just use "disable self" for each of your triggers.

I hope that this solves your troubles.