Good and bad levers

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
linflas
My other avatar is gay
Posts: 2445
Joined: Tue Nov 04, 2003 9:58 pm
Location: Lille, France
Contact:

Good and bad levers

Post by linflas »

Here's a little problem asked by pm from a new member called RAF68. I had a quick look at the RTC editor but couldn't manage to make it work fine for all possibilities. Maybe i need more training :?

A room, 5 levers, a closed door. 3 levers are the good ones, 2 are bad. The door will never open and will close each time one of the 2 levers is activated.
"The only way out is another way in." Try Sukumvit's Labyrinth II
User avatar
Gambit37
Should eat more pies
Posts: 13715
Joined: Wed May 31, 2000 1:57 pm
Location: Location, Location
Contact:

Re: Good and bad levers

Post by Gambit37 »

My brain hurts today and I can't think straight, but I reckon this is easily solvable using a counter.
User avatar
Jan
Mighty Pirate
Posts: 2760
Joined: Tue Sep 23, 2008 4:55 pm
Location: Scumm Bar, Czech Republic

Re: Good and bad levers

Post by Jan »

linflas wrote:The door will never open.
:?: Heh? I don't see the point of a closed door that would never open. Or do I understand it correctly? Probably not. Man, it's so hot here, my brain is melting - or what was left of it.
Finally playing and immensely enjoying the awesome Thimbleweed Park-a-reno!
User avatar
beowuuf
Archmastiff
Posts: 20687
Joined: Sat Sep 16, 2000 2:00 pm
Location: Basingstoke, UK

Re: Good and bad levers

Post by beowuuf »

I think the second part is saying the problem?

It sounds like you need the three good levers going to a 3 counter. The two bad levers should also go to this counter, but with a reversed activation so they will increase the counter if pressed.
Was unable to (permenantly) kill off ian_scho (Haynuus), Ameena, oh_brother (Westian), money (Falkor), raixel (Petal) and Lord_Bones (Aurek) in the DM D&D game Time's Champions!

CONGRATULATIONS TO THOSE WHO MADE THE GAME WHAT IT WAS - GREAT!
User avatar
Jan
Mighty Pirate
Posts: 2760
Joined: Tue Sep 23, 2008 4:55 pm
Location: Scumm Bar, Czech Republic

Re: Good and bad levers

Post by Jan »

Ah, sorry, I see, you're right. As usually.
Finally playing and immensely enjoying the awesome Thimbleweed Park-a-reno!
User avatar
beowuuf
Archmastiff
Posts: 20687
Joined: Sat Sep 16, 2000 2:00 pm
Location: Basingstoke, UK

Re: Good and bad levers

Post by beowuuf »

The greatest trick the devil ever pulled was convincing the world he did not exist, the second was that he was always right :)
Was unable to (permenantly) kill off ian_scho (Haynuus), Ameena, oh_brother (Westian), money (Falkor), raixel (Petal) and Lord_Bones (Aurek) in the DM D&D game Time's Champions!

CONGRATULATIONS TO THOSE WHO MADE THE GAME WHAT IT WAS - GREAT!
User avatar
linflas
My other avatar is gay
Posts: 2445
Joined: Tue Nov 04, 2003 9:58 pm
Location: Lille, France
Contact:

Re: Good and bad levers

Post by linflas »

beowuuf wrote:It sounds like you need the three good levers going to a 3 counter. The two bad levers should also go to this counter, but with a reversed activation so they will increase the counter if pressed.
Thanks beo but i've already did this and it doesn't work exactly as i meant.
Levers have two states, let's say UP and DOWN. at the init, they are all UP.
if the good levers activate the counter and the bad deactivate it, the counter value can be all messed up if you switch more than one time any lever.
which means that you can only TOGGLE (yes i shout like RAF68 ;)) counter(s).
"The only way out is another way in." Try Sukumvit's Labyrinth II
User avatar
beowuuf
Archmastiff
Posts: 20687
Joined: Sat Sep 16, 2000 2:00 pm
Location: Basingstoke, UK

Re: Good and bad levers

Post by beowuuf »

Ah, darn, that rings a bell. Then can't you wash the bad toggle messages through additional counters and so that the decativation/activation messages occur with the toggles. Have a counter at 0 and a counter at 1 that each bad lever must go through?
Was unable to (permenantly) kill off ian_scho (Haynuus), Ameena, oh_brother (Westian), money (Falkor), raixel (Petal) and Lord_Bones (Aurek) in the DM D&D game Time's Champions!

CONGRATULATIONS TO THOSE WHO MADE THE GAME WHAT IT WAS - GREAT!
User avatar
linflas
My other avatar is gay
Posts: 2445
Joined: Tue Nov 04, 2003 9:58 pm
Location: Lille, France
Contact:

Re: Good and bad levers

Post by linflas »

hmmm... i am not using them the way you expect i think...
here's the actual code (you can make a new dungeon and paste this to replace the layout and items sections). The 2 first levers are bad, the 3 further are good. It seems that the condition i put on the relay is not even working !

Code: Select all

/******************************************************************************/
/* Layout                                                                     */
/******************************************************************************/
[Layout]

; Level 0
WALLSET......=(WALLSET_DEFAULT)
LIGHT_AMBIENT=(100)
LIGHT_MINIMUM=(5)
LIGHT_MAXIMUM=(1000)
OFFSET.......=(0,0)
SIZE.........=(7,6)
ITEM_PREFIX..=(ref00)
DESCRIPTION..=()
1000000
1000000
1111111
0001000
0001000
0001000

/******************************************************************************/
/* Items                                                                      */
/******************************************************************************/
[Items]

; Level 0
ref000305-1	WALLITEM_RELAY			3	0	0	CENTRE	CONDITION=(VALUE:ref000104-1,EQUAL_TO,NUMBER:0)	ACTION=(DEACTIVATE)	TARGET=(ref000203-1)
ref000205-1	WALLITEM_COUNTER			1	1	0	CENTRE	COUNT=(0)	ACTION=(ACTIVATE)	TARGET=(ref000305-1)
ref000204-2	WALLITEM_COUNTER			2	1	0	CENTRE	COUNT=(0)	ACTION=(ACTIVATE)	TARGET=(ref000305-1)
ref000003-1	WALLITEM_SWITCH_LEVER		1	3	0	NORTH		OPBY=(HAND)	ACTION=(TOGGLE)	TARGET=(ref000204-3,ref000205-1)
ref000003-2	WALLITEM_SWITCH_LEVER		2	3	0	NORTH		OPBY=(HAND)	ACTION=(TOGGLE)	TARGET=(ref000204-1,ref000204-2)
ref000203-1	DOOR_PORTCULLIS			3	3	0			STATE=(CLOSED)
ref000203-2	FLOORITEM_DOORFRAME		3	3	0
ref000103-1	WALLITEM_SWITCH_LEVER		4	3	0	NORTH		OPBY=(HAND)	ACTION=(TOGGLE)	TARGET=(ref000104-1)
ref000303-1	WALLITEM_SWITCH_LEVER		5	3	0	NORTH		OPBY=(HAND)	ACTION=(TOGGLE)	TARGET=(ref000104-1)
ref000403-1	WALLITEM_SWITCH_LEVER		6	3	0	NORTH		OPBY=(HAND)	ACTION=(TOGGLE)	TARGET=(ref000104-1)
ref000204-3	WALLITEM_COUNTER			1	4	0	CENTRE	COUNT=(1)	ACTION=(ACTIVATE)	TARGET=(ref000203-1)
ref000204-1	WALLITEM_COUNTER			2	4	0	CENTRE	COUNT=(1)	ACTION=(ACTIVATE)	TARGET=(ref000203-1)
ref000104-1	WALLITEM_COUNTER			5	4	0	CENTRE	COUNT=(3)	ACTION=(DEACTIVATE)	TARGET=(ref000203-1)
"The only way out is another way in." Try Sukumvit's Labyrinth II
User avatar
Gambit37
Should eat more pies
Posts: 13715
Joined: Wed May 31, 2000 1:57 pm
Location: Location, Location
Contact:

Re: Good and bad levers

Post by Gambit37 »

I didn't check your code, but had some ideas about how to do it, might be too complex though?

1) Setup 2 counters, "A" starts at 3, and "B" starts at 2 -- counters should do nothing (no activates, etc), they are just to store these values
2) Create the 3 good levers to toggle counter A
3) Create the 2 bad levers to toggle counter B
4) create 5 more levers on the same tiles as the existing levers. These levers should activate 2 relays, X and Y
5) Relay X should have a conditional check on the value of counter A. If it's 0, send a Deactivate to the door (opens it)
5) Relay Y should have a conditional check on the value of counter B. If it's NOT 2, send an Activate to the door (closes it)

This works in principle, but the problem is with sending two signals to the door at the same time -- which message "wins" so to speak? Maybe if there's a 1 tick delay on the Activate to close the door, that might work? The door will then always close if counter B is not zero, ie, any of the bad levers have been switched down.

I'm not the most logical person in the world and I've probably made some big mistake with this or made it too complex. Forgive me if this is all wrong!
User avatar
linflas
My other avatar is gay
Posts: 2445
Joined: Tue Nov 04, 2003 9:58 pm
Location: Lille, France
Contact:

Re: Good and bad levers

Post by linflas »

well, that's the point : your relays depend on the value of the counters, but it seems that conditions with counters don't work (or i am not using relays properly)..
your solution seems more complex than mine, theorically.. i'll check it in my example and tell you.
"The only way out is another way in." Try Sukumvit's Labyrinth II
User avatar
linflas
My other avatar is gay
Posts: 2445
Joined: Tue Nov 04, 2003 9:58 pm
Location: Lille, France
Contact:

Re: Good and bad levers

Post by linflas »

and it.... almost worked !
the only little glitch is when you manage to make the door open and decide to switch again one of the good levers : the door remains open.
anyway, problem solved ! thanks everyone :)
"The only way out is another way in." Try Sukumvit's Labyrinth II
User avatar
beowuuf
Archmastiff
Posts: 20687
Joined: Sat Sep 16, 2000 2:00 pm
Location: Basingstoke, UK

Re: Good and bad levers

Post by beowuuf »

http://www.dmjump.net/lever.txt

Problem fully solved!
Was unable to (permenantly) kill off ian_scho (Haynuus), Ameena, oh_brother (Westian), money (Falkor), raixel (Petal) and Lord_Bones (Aurek) in the DM D&D game Time's Champions!

CONGRATULATIONS TO THOSE WHO MADE THE GAME WHAT IT WAS - GREAT!
User avatar
beowuuf
Archmastiff
Posts: 20687
Joined: Sat Sep 16, 2000 2:00 pm
Location: Basingstoke, UK

Re: Good and bad levers

Post by beowuuf »

I know I was a little slow, but the above also means that the door opens and closes if the right/wrong levers are pressed again

Now, I'm embarrassed to say I don't know why this is working! Though I can guess.

My understanding is that a counter in a non-zero state (even negative) acts one way (either toggles back, or nothing). A counter in a zero state acts another way. Now, I do recall GG saying something about that if you had an open on 0, then a close would be reinforced on any other state. I had thought that I mis remembered.

However, all I have done is wash the bad levers through a counter already at zero set to give an open signal. I had a different counter, set to 1, to give a close signal, so that when the levelrs were first set down, a close would go off, and when they were brought back up, an open would go off.

However, as all designers can appreciate, I accidentally forgot to have the firstbad lever target the 1 counter. Yet the system worked! Wich pointed to that counter at zero doing both parts for me!

So apparently, if a counter has an open signal on zero, it must reinforce a close when switching out of that state, Which in a way is good, for this problem, but in general I can see that being a problem. Say for someone who just wants say an open on a zero counter, and even if the count is reset to a high number, a close isn't given. For example, wouldn't this cause a shooter, that activates on open or close, to fire when you 'reset' it?
Was unable to (permenantly) kill off ian_scho (Haynuus), Ameena, oh_brother (Westian), money (Falkor), raixel (Petal) and Lord_Bones (Aurek) in the DM D&D game Time's Champions!

CONGRATULATIONS TO THOSE WHO MADE THE GAME WHAT IT WAS - GREAT!
User avatar
Gambit37
Should eat more pies
Posts: 13715
Joined: Wed May 31, 2000 1:57 pm
Location: Location, Location
Contact:

Re: Good and bad levers

Post by Gambit37 »

@Beo: What version of the game/editor did you create this with? It crashes RTC Editor 0.49. -- what's the date/time of your RTCeditor.exe?
User avatar
linflas
My other avatar is gay
Posts: 2445
Joined: Tue Nov 04, 2003 9:58 pm
Location: Lille, France
Contact:

Re: Good and bad levers

Post by linflas »

wooot ! that worked, thanks beo :)
gambit : i had the same crash at first attempt, and converted the file to DOS mode.
"The only way out is another way in." Try Sukumvit's Labyrinth II
User avatar
beowuuf
Archmastiff
Posts: 20687
Joined: Sat Sep 16, 2000 2:00 pm
Location: Basingstoke, UK

Re: Good and bad levers

Post by beowuuf »

The text file has probably got buggered by browsers, if you viewed it then saved. I have RTC 0.49 and the file should still be a normal text file.
Was unable to (permenantly) kill off ian_scho (Haynuus), Ameena, oh_brother (Westian), money (Falkor), raixel (Petal) and Lord_Bones (Aurek) in the DM D&D game Time's Champions!

CONGRATULATIONS TO THOSE WHO MADE THE GAME WHAT IT WAS - GREAT!
User avatar
RAF68
Lo Master
Posts: 408
Joined: Fri Jul 10, 2009 6:13 pm
Location: FRENCH
Contact:

Re: Good and bad levers

Post by RAF68 »

THANK YOU FOR YOUR ASSISTANT ENGRAVED(BURNT) TO YOU I MADE A SUCCESS
User avatar
beowuuf
Archmastiff
Posts: 20687
Joined: Sat Sep 16, 2000 2:00 pm
Location: Basingstoke, UK

Re: Good and bad levers

Post by beowuuf »

Good to hear! :)
Was unable to (permenantly) kill off ian_scho (Haynuus), Ameena, oh_brother (Westian), money (Falkor), raixel (Petal) and Lord_Bones (Aurek) in the DM D&D game Time's Champions!

CONGRATULATIONS TO THOSE WHO MADE THE GAME WHAT IT WAS - GREAT!
Post Reply