Here's another bit of code that I personally have no use for, but maybe someone can find a purpose for. It's actually rather short and simple everything fits under statedef -2.
Anywho, the following code does 2 main things: the first is that it forces the player to palette 1 (aka the default palette) at round's start so you begin with what should be the non-powered palette. The second part is that by hitting z or c in this example, you can switch the character's currently selected palette.
Vars used
Var(24) - This var is used to track of palette value changes.
Var(25) - The var checked for the remappals <- Added to sample
Code (Place under statedef -2)
;Sample color change (Rockman styled)
;Initial varset - start round using pal01/no power selected
[State -2, Startup var]
type = VarSet
trigger1 = roundstate = 0
var(24) = 1
[State -2, Startup var]
type = VarSet
trigger1 = roundstate = 0
var(25) = 1
[State -2, forces vars to match up]
type = varset
trigger1 = 1
var(24) = var(25)
;Moving up and down
[State -2, Add-to-value]
type = VarAdd
triggerall = roundstate = 2
trigger1 = command = "z"
v = 25
value = 1
[State -2, subtract-from-value]
type = VarAdd
triggerall = roundstate = 2
trigger1 = command = "c"
v = 25
value = -1
;Next two varsets allow cycling both ways
[State -2, back to pal 1]
type = varset
triggerall = roundstate = 2
trigger1 = var(25) > 12 ; value of 12 used here assumes all 12 palettes are used. Customize as needed.
var(25) = 1
[State -2, back to pal 12]
type = varset
triggerall = roundstate = 2
trigger1 = var(25) < 1
var(25) = 12 ; value of 12 used here assumes all 12 palettes are used. Customize as needed.
;Changes palette to default at round start
[State -2, instant-change-part1]
type = RemapPal
trigger1 = roundstate = 0
source = 1,1
dest = 1,1
;Changes palette during match based on higher value
[State -2, instant-change-part2]
type = RemapPal
trigger1 = var(24) != var(25)
source = 1,1
dest = 1,var(25)
That's it for this code. As for switching the active weapon for Mega Man inspired characters, it could be done fairly simply by creating states for each weapon type being used and having the command file entries check either the value of var(24) or the current palno value to direct to the correct states or have one set of firing states that generate helpers based on the value of var(24) or palno. Either or should do the trick unless I missed something there. Have a nice weekend, and good .\/. to you all.
Edit: Added Cyanide's adjustment for cycling back and forth at extremes, and now what should be a better fix for timely cycling that still allows for palfx to work.