Testing which item is in an alcove

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
Remma12
Novice
Posts: 21
Joined: Tue Mar 17, 2009 7:44 am

Testing which item is in an alcove

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

Re: Testing which item is in an alcove

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

Re: Testing which item is in an alcove

Post by beowuuf »

Hmm, a quick play around I can't make it work - It's been a while!
Remma12
Novice
Posts: 21
Joined: Tue Mar 17, 2009 7:44 am

Re: Testing which item is in an alcove

Post by Remma12 »

Thanks for trying though =)
User avatar
Lord_BoNes
Jack of all trades
Posts: 1064
Joined: Mon Dec 01, 2008 12:36 pm
Location: Ararat, Australia.

Re: Testing which item is in an alcove

Post 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.
 
Image

1 death is a tragedy,
10,000,000 deaths is a statistic.
- Joseph Stalin

Check out my Return to Chaos dungeon launcher
And my Dungeon Master Clone
Post Reply