Counters
Moderator: George Gilbert
Forum rules
Please read the Forum rules and policies before posting. You may
to help finance the hosting costs of this forum.
Please read the Forum rules and policies before posting. You may

-
- Artisan
- Posts: 187
- Joined: Sat Jan 22, 2005 2:50 pm
- Location: Ipswich, UK
Counters
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.
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.
- Paul Stevens
- CSBwin Guru
- Posts: 4322
- Joined: Sun Apr 08, 2001 6:00 pm
- Location: Madison, Wisconsin, USA
- Paul Stevens
- CSBwin Guru
- Posts: 4322
- Joined: Sun Apr 08, 2001 6:00 pm
- Location: Madison, Wisconsin, USA
-
- Artisan
- Posts: 187
- Joined: Sat Jan 22, 2005 2:50 pm
- Location: Ipswich, UK
Got it working!
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.
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.
- Gambit37
- Should eat more pies
- Posts: 13769
- Joined: Wed May 31, 2000 1:57 pm
- Location: Location, Location
- Contact:
I eat humble pie!
There's more info on counters in these threads:
http://www.dungeon-master.com/forum/vie ... hp?t=20400
http://www.dungeon-master.com/forum/vie ... hp?t=20914
There's more info on counters in these threads:
http://www.dungeon-master.com/forum/vie ... hp?t=20400
http://www.dungeon-master.com/forum/vie ... hp?t=20914