News:

MFG's Character of the Month: October 2026 Nominations

Main Menu

Coding understanding

Started by cake-kun, March 01, 2018, 12:39:22 AM

Previous topic - Next topic

cake-kun

Basically i'm currently looking at others peoples code to understand how remap pal works in transformations like if i would want ken to turn into violent ken and have a pallet switch when he transforms  recently i found this code in a character which makes him switch pallets on transformation but it only works for certain  frames i guess what i'm asking is if i'm someone would explain how this code works it would be helpful its only for learning purposes thank you. [State 0, VarSet]
type = VarSet
trigger1 = cond((root,anim=[20000,29999])&&root,var(1)=0,(root,anim!=[20000,29999]),1)
v = 32
value = cond(root,var(28)=1,40,cond((root,anim=[20000,29999])&&root,var(1)!=0, (0+cond(root,var(1)>=1&root,var(1)<3,20000,cond(root,var(1)>=3,20010,0))) , (0+cond(root,var(1)>=1&root,var(1)<3,10,cond(root,var(1)=3,30,cond(root,var(1)=4,20,0))))))
ignorehitpause = 1

altoiddealer

Well that isn't the RemapPal controller :)

The RemapPal controller probably has triggers including Var(32) - and other triggers which may be interfering with your goal.

Most players default palette is 1,1
Custom pals are usually 1,2   1,3   etc

So in the RemapPal, this would change the players palette from 1,1 to 1,2:
trigger1 = 1
source = 1,1
dest = 1,2


When RemapPal is triggered, the change is permanent until the round ends, OR another RemapPal is triggered.  It doesn't need to be constantly triggered to maintain the effect.

However it does need to be reapplied each round.  State 5950 (round initialization state) is usually a good spot for RemapPal.


Maybe someone else can help dissect those complicated triggers going on in that Var, but that's the core explanation.