## Binary Trigger Systems

By
URJazz

~~~Binary Trigger Systems~~~

—————Binary—————

To understand BTS’s you must first understand Binary. If you already understand Binary please skip ahead to the next section, otherwise continue on. Binary is simply a way to express numbers using only a sequence of 0’s and 1’s. Here is an example of a binary number:

Binary: 010 Decimal: 2

To be able to translate binary to decimal you need to look at where the 1’s are placed in the sequence. Each position is worth a specific amount, and you simply add together the values.

128 64 32 16 8 4 2 1
0 0 0 0 0 0 1 0

That’s simply 2 in binary.

128 64 32 16 8 4 2 1
0 0 1 0 0 0 0 0

That’s simply 32 in binary.

128 64 32 16 8 4 2 1
0 0 0 0 0 0 1 1

That means 2 + 1, so it means 3.

128 64 32 16 8 4 2 1
0 0 0 0 1 1 0 1

That means 8 + 4 + 1 = 13.

But what if you want an even larger binary number? (Larger than 128 + 64 + 32 + 16 + 8 + 4 + 2 + 1). Well then you add another position to the sequence on the left side and it will be worth the previous position multiplied by 2. So the next position would be worth 256 (128 × 2 = 256). Then the next position will be 512 (256 × 2 = 512). Binary’s just that simple. If you didn’t understand that try re-reading it and messing around with the calculator on windows (Switch it to scientific mode and then try typing in numbers in Decimal mode, and then switching to Binary mode). If you’re still having troubles with binary you can e-mail me at relling_07@hotmail.com for more help (or add me to MSN.)

—————The System—————

Now onto the actual system! Basically we implement Binary into triggers by using a sequence of triggers instead of positions. So lets say we want to have a system that needs to warp a player to specific areas, and we want this system to be like a bus system. So we want it so that the player jumps into 1 tube and by doing so it will take them to whichever place they chose. So first, lets make up some places to take people to: Bank, Hotel, Post Office, and Gas Station (I know, why would you want to go to them in JJ2, but just stick with me here). So we’ll use the binary trigger system for this. We’ll call the Bank 1, Hotel 2, Post Office 3, and Gas Station 4. So far this is what we have:

Decimal Binary
Bank 1 001
Hotel 2 010
Post Office 3 011
Gas Station 4 100

So how can we use triggers and binary to make this system? Well it’s easy. We’ll use triggers as positions like this: position 4 will be trigger 1, position 2 will be trigger 2, position 1 will be trigger 3.

8 4(trigger 1) 2(trigger 2) 1(trigger 3)
0 0 0 0

So this means if trigger 1 is on, trigger 2 is off, and trigger 3 is off then it’d take you to the gas station.

Trigger1 (4) Trigger2 (2) Trigger3 (1) Decimal Where
On Off Off 4 Gas Station
Off On On 3 Post Office
Off On Off 2 Hotel
Off Off On 1 Bank

As you can see we have 4 places, which would normally take 4 triggers, but here it only took 3. If you can’t tell, the more places it could take you, the more triggers you save. If you wanted 250 places to go, which would take 250 triggers, using the binary system you would only need 8 triggers, thus saving you 242 triggers, which is a lot.

### blurredd on July 28, 2004 06:00

Nice article, but it could use a few pictures showing exactly how to implement it in a level. Also, I suggest using a font like Courier New and <PRE> for the binary examples so it’s easier to read.

### PHT on July 29, 2004 06:00

I don’t even understand the first part :) Could you please explain first what you can do with that system stuff thing? Thanks :D

### Violet CLM on July 29, 2004 06:00

Mmmm. Very nice. I agree with Blur, though, it does seem somewhat lacking in “how do I use this fabulous system”.

### blurredd on April 15, 2007 07:14

Maybe someone should bug URJazz to update this…

### Sfaizst on August 22, 2009 12:45

Its possible with 2 Triggers too, we have 2 Bits with a 0 and a 1
T1 T2
0 0 —> Gas Station
0 1 —> Post Office
1 0 —> Hotel
1 1 —> Bank

Example LvL:
ftp://jj2.ath.cx/SfaTS.j2l

### TheKax on September 22, 2010 19:16

@Sfaist: Your FTP requires a login, which you haven\‘t described to us…

The system is nice. But to think about it: using 8 triggers to represent 250 locations would lead into a one heck of tube/trigger system to be implemented to the level… Probably taking up tons of tiles. And levelmaker\‘s time. A ready example to copypaste to your own level wuold be neat.