Page 1 of 1

swapper trap

PostPosted: Wed Apr 13, 2011 5:07 pm
by CCX
Might be more a gameplay question than editor, but anyhow:

For multiplayer levels with 2 groups (colors) it's pretty obvious what the swapper trap would do (swap to the one and only other group). Less clear to me is what happens with 3+ groups. Does it (pseudo)randomly select a group to switch the clone to, or is there some rules around it?

Re: swapper trap

PostPosted: Wed Apr 13, 2011 6:47 pm
by rt
It will swap to the next active group on the map. The group order is:
blue
green
red
grey
white
yellow
orange
purple

So if the map has blue, red, and yellow groups then when the red clone walks into a swap trap a yellow clone will come out.

Re: swapper trap

PostPosted: Sun May 08, 2011 5:03 am
by CCX
I'm foreseeing possible need in the future to build my own custom swap trap out of other contraptions, to have better control over the color changes (eg. level may have non-playable mini-AI-controlled groups that shouldn't be subject to swapping, since it can't be done in a fair manner). It's not too hard to make it work, and I'm even able to get it to look pretty close to the swap trap, but I need some help replicating the varying tint.

I think I might be able to replicate it with 3 overlapping background contraptions of identical graphics, with red, green and blue tint, and then use modifytraps to vary the alphas of each to continually change the distribution of the 3 primary colors. It'll take a bit of experimentation though to make it look right, so it'd help a lot if you can simply give out the formula the game currently uses to continually vary the tint on the swap trap.

Re: swapper trap

PostPosted: Tue May 10, 2011 2:44 pm
by rt
CCX wrote:it'd help a lot if you can simply give out the formula the game currently uses to continually vary the tint on the swap trap.


Sure, the swap trap cycles through all 8 group colors changing each color channel independently to gradually match the next color. Here are the RGB for the group colors:

Code: Select all
byte swap_tint[8][3] = { {0,0,252},{0,252,0},{252,0,0},{0,0,0}, {252,252,252},{252,252,0},{252,128,0},{128,0,252} };


When a clone is swapped the swap trap changes to that color right away, and then continues the cycle.