Counters

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. You may Image to help finance the hosting costs of this forum.
Post Reply
Chaos Awakes
Artisan
Posts: 187
Joined: Sat Jan 22, 2005 2:50 pm
Location: Ipswich, UK

Counters

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

Post 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...
User avatar
copperman
Um Master
Posts: 476
Joined: Thu Aug 29, 2002 12:49 pm
Location: UK

Post 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
Don't be scene or herd!
User avatar
Gambit37
Should eat more pies
Posts: 13769
Joined: Wed May 31, 2000 1:57 pm
Location: Location, Location
Contact:

Post 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.
User avatar
Paul Stevens
CSBwin Guru
Posts: 4322
Joined: Sun Apr 08, 2001 6:00 pm
Location: Madison, Wisconsin, USA

Post by Paul Stevens »

Ahhhh! So simple with DSAs.. :wink:
User avatar
beowuuf
Archmastiff
Posts: 20686
Joined: Sat Sep 16, 2000 2:00 pm
Location: Basingstoke, UK

Post by beowuuf »

Lol, stop going off topic and pimping for CSBwin converts on the RTC boards! *shakes head*
User avatar
Paul Stevens
CSBwin Guru
Posts: 4322
Joined: Sun Apr 08, 2001 6:00 pm
Location: Madison, Wisconsin, USA

Post by Paul Stevens »

stop going off topic and pimping for CSBwin converts
Could not help myself when two simple problems
arose simultaneously. Sorry.
Chaos Awakes
Artisan
Posts: 187
Joined: Sat Jan 22, 2005 2:50 pm
Location: Ipswich, UK

Got it working!

Post 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.
User avatar
Gambit37
Should eat more pies
Posts: 13769
Joined: Wed May 31, 2000 1:57 pm
Location: Location, Location
Contact:

Post by Gambit37 »

User avatar
beowuuf
Archmastiff
Posts: 20686
Joined: Sat Sep 16, 2000 2:00 pm
Location: Basingstoke, UK

Post 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
Post Reply