Page 1 of 1

Counters

Posted: Mon Sep 12, 2005 7:50 pm
by Chaos Awakes
Sorry for all the questions - I've tried to download the definitive editing guide from the thread above but it just says "cannot find server" or "page not found".

Anyway, I have a question regarding counters. Namely, how the flip do I get them to reset?
I have a doorway that opens when four coins are inserted into a coin slot. Every time a coin is inserted, a counter is increased by 1 and when it reaches four the door opens. When the party leaves the room, the door closes again and they need to pay 4 coins to get back in each time. But how do I reset the counter to zero so that it starts counting again when the next coin is inserted? Seems a pretty simple requirement of a counter - I had imagined, logically, that since activating the counter increases it, deactivating it would decrease it. But when I add a line to the counter to deactivate itself the game crashes.

Posted: Mon Sep 12, 2005 7:56 pm
by linflas
you cannot reset counters but for your case, i would make it with a trigger activating 4 relays. each relay deactivates the counter.
BUT this trigger must be active if you have paid 4 coins... and that's a big problem : you cannot activate/deactivate triggers...

Posted: Mon Sep 12, 2005 8:23 pm
by copperman
is there a max times you can return, if so use multiple coin slots and destroy them one at a time and activate a new one as they are used, maybe :D

Posted: Mon Sep 12, 2005 10:20 pm
by Gambit37
Counters count DOWN from the number specified. When they reach zero they perform the action. Any non-zero value performs the opposite. They don't work exactly how you might imagine, and you definitely can't reset them.

Posted: Mon Sep 12, 2005 10:24 pm
by Paul Stevens
Ahhhh! So simple with DSAs.. :wink:

Posted: Mon Sep 12, 2005 10:26 pm
by beowuuf
Lol, stop going off topic and pimping for CSBwin converts on the RTC boards! *shakes head*

Posted: Mon Sep 12, 2005 10:36 pm
by Paul Stevens
stop going off topic and pimping for CSBwin converts
Could not help myself when two simple problems
arose simultaneously. Sorry.

Got it working!

Posted: Tue Sep 13, 2005 7:09 pm
by Chaos Awakes
I worked it out in the end.
I was right - Activating a counter counts up (or down according to what I read here) and deactivating it counts down (or up).

The problem simply seems to be that a counter can't deactivate itself without crashing the engine. I can't think why.

Anyway, the solution was to have the counter activate a relay when it reaches it's count. The relay simply deactivates the counter four times. Works like a dream.

Posted: Tue Sep 13, 2005 8:15 pm
by Gambit37

Posted: Tue Sep 13, 2005 8:22 pm
by beowuuf
I believe you need t take more advantage of multiple relays to smooth out some of the counter functions...haven't played around with this for ages