Page 1 of 1

[Done for V0.38] Counter Reset = Toggle plz!?

Posted: Thu Apr 28, 2005 9:09 pm
by L!ghthouse
This is actually a continuation of a post from 3 years ago...
http://www.dungeon-master.com/forum/vie ... et+counter

I would like to see the Toggle command changed for Counters. When you use the toggle command on a counter, it would reset the counter to 0.

Activate = Counter+1
Deactivate = Counter-1
Toggle = Reset Counter to 0

I am creating a shop using RTC. I have approached this from several angles and have descided that the only way to make a shop work 100% is to be able to reset counters to 0. (I could go into specifics of why, but It would take a while to explain)

Could we please have this added to the next version of RTC? PLEASE!?

Posted: Thu Apr 28, 2005 10:20 pm
by Pedro
Toggling of counters is already used in certain situations and changing its behaviour would destroy backward compatibility.

However the counter reset would be a very useful idea but not in this way.

Pedro

Posted: Thu Apr 28, 2005 10:49 pm
by L!ghthouse
Pedro,
Certain situations? I'm not sure what you mean. I thought that Toggling and Activating both did the same thing for counters (Counter+1)? Can you explain plz?

Posted: Thu Apr 28, 2005 11:28 pm
by Pedro
Look at the counter (21,24,5) on standard DM map and connected with it 4 switches. This is a good example.

Another example:
You have one door and two triggers on floor.
Door can be opened only when two triggers get a proper item (e.g. stone).
If you remove the item from one of triggers then door will be closed again.

Toggling of counter is the only method to reach such effect I know.

Posted: Thu Apr 28, 2005 11:47 pm
by Guest
@Pedro - Thanks for the clarification.

Still, there needs to be a way to be able to reset the counter back to 0. Any suggestions?

Posted: Thu Apr 28, 2005 11:50 pm
by L!ghthouse
oops, forgot to login, lol
:lol:

Posted: Fri Apr 29, 2005 12:36 am
by Pedro
Your counter can activate a relay and then relay will deactivate this counter as many times as you want (maximum 8 times, but you can use more relays if necessary).
So, if you have, for example, a counter with count=4, you can set for such relay 4*dectivate the counter. This kind of "reset" can be executed only when counter reaches its value. I have no idea how to reset it if count<>value. It's probably impossible.

Posted: Fri Apr 29, 2005 5:24 pm
by L!ghthouse
The problem is that I need to be able to reset the counter back to "0" no matter what the current count is. Deactivate works for other problems, but not for this one.

Posted: Fri Apr 29, 2005 9:01 pm
by L!ghthouse
How about using the "Release" command as a Counter Reset. If you use the Release command on a counter, the counter resets to "0"...?

Posted: Fri Apr 29, 2005 9:32 pm
by Paul Stevens
In CSBuild/CSBwin (using the original DM/CSB actuators)
a person could do this by setting a couple AND/OR gates
to temporarily reroute the COUNTER output to:

Code: Select all

if non-zero then send decrement message to myself
else remove the temporary re-routing.
I don't know if RTC supports such things.

So it will decrement itself until it is zero and then
put things back to normal.
Of course a DSA would do it so easily that it would be
silly to go to so much trouble.

Posted: Wed Apr 12, 2006 9:18 pm
by linflas
*bumpinator*

Posted: Wed Apr 12, 2006 9:23 pm
by Sophia
Of course this would be unneeded if we had a counter query...

And wouldn't THAT be useful! :D

Anyway, the method Paul S outlined can be duplicated fairly well using RTC mechanics using a second counter, pad and a fireball launcher. :P

Posted: Fri May 05, 2006 2:35 pm
by George Gilbert
Done for V0.38

What I've actually implemented is three new actions COUNTER_SET, COUNTER_INCREMENT and COUNTER_DECREMENT which allow you to set, increment or decrement the value of counters by the value contained in their strength parameter.

Posted: Fri May 05, 2006 2:39 pm
by beowuuf
Ooooooooooooooooooooooooooooh! *bounce*

Posted: Fri May 05, 2006 3:55 pm
by linflas
Halleluyah ! Easy Shops ! Easy shops !

Posted: Fri May 05, 2006 6:00 pm
by Sophia
Wait, you mean my way wasn't easy? :shock: ;)