YesNoOk
avatar

Mega Man styled color swapping (1.0 specific) (Read 15223 times)

Started by Rolento, March 12, 2010, 11:44:50 pm
Share this topic:
Mega Man styled color swapping (1.0 specific)
#1  March 12, 2010, 11:44:50 pm
  • ***
  • Figuring things out, one sprite at a time.
    • irwt.iammanyninjas.com
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)
Code:
;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.
Last Edit: August 06, 2010, 01:12:14 am by Rolento
Re: Mega Man styled color swapping (1.0 specific)
#2  March 12, 2010, 11:52:48 pm
  • ******
  • Legendary XIII
  • I am the eye of the storm to come!
    • New Zealand
    • network.mugenguild.com/cyanide/
Quick addition to this that people would find handy would be to have going up or down at the max values rolls it over.

type = varset
trigger1 = var(24) > 12
v = 24
value = 1

and vice versa, so you don't need to press z/c 11 times to get to the other end of the palettes. Kirby was cyclical when changing morphs. This is about the same thing.


In M.U.G.E.N there is no magic button

They say a little knowledge is a dangerous thing, but it's not one half so bad as a lot of ignorance.
Re: Mega Man styled color swapping (1.0 specific)
#3  March 13, 2010, 12:24:42 am
  • ***
  • Figuring things out, one sprite at a time.
    • irwt.iammanyninjas.com
Ah, nice catch. Do need to make some minor adjustments to the code above, which I'll do now.
Re: Mega Man styled color swapping (1.0 specific)
#4  March 15, 2010, 10:30:07 pm
  • *****
  • IG @tanooki_ninja
    • Puerto Rico
    • maxbeta.webs.com/mugen.htm
Ok, this is surely up my alley since I am currently working on an MVC styled "Complete Change" Ryu.

My question I guess would be if this code could basically change his palette once I activate his Akuma or Ken switch modes.

Thanks again for your awesome codes and tips Rolento...I'm also making use of the SFIV focus attack code atm.  ;)
"We need other people in order to create the circumstances for the learning that we are here to generate" RIP Adam Yauch aka MCA
www.instagram.com/tanooki_ninja
Re: Mega Man styled color swapping (1.0 specific)
#5  March 16, 2010, 01:26:06 am
  • ***
  • Figuring things out, one sprite at a time.
    • irwt.iammanyninjas.com
That sort of change still works on the same basic principle of changing the active palette based on the variable at the time, which in your case is the variable that decides which mode and move set Ryu is currently using. You may need to edit things a bit in your case to make contingencies for mirror matches, but the changes needed wouldn't really be that hard.
Re: Mega Man styled color swapping (1.0 specific)
#6  March 16, 2010, 07:54:54 am
  • ******
  • Legendary XIII
  • I am the eye of the storm to come!
    • New Zealand
    • network.mugenguild.com/cyanide/
Using the ryu thing, You'd have to set up a 3 set of palettes for each mode.

Pal1 would give you the source dest stuff of

1,1
2,1
3,1

Pal2 would be

1,2
2,2
3,2

And so on. You would absolutely have to use sffv2 for this though.


In M.U.G.E.N there is no magic button

They say a little knowledge is a dangerous thing, but it's not one half so bad as a lot of ignorance.
Re: Mega Man styled color swapping (1.0 specific)
#7  March 17, 2010, 12:27:58 am
  • ***
  • +1 to whoever added Godzilla to the main index.
Using the ryu thing, You'd have to set up a 3 set of palettes for each mode.

var(24)%3 would also work, and could be SFFv1. Three being the number of modes. It also helps if the number is a factor of your total number of palletes.

You couldn't go higher than 3 modes each with 4 unique palletes (one for each player in a simul mirror match).
If you did need to have more than 3 modes with 4 palletes, you would need to use SFFv2.
i think we should call it an "engine" so we don't look like total idiots because otherwise we'd be arguing about a "game" and that would be somehow "dumber" than arguing about an "engine" on the "internet" for countless hours

Iced said:
I for one, do not enjoy round corners!  :bigcry:
But they hurt much less when we accidentally hit them!  :S
Last Edit: March 17, 2010, 12:34:28 am by MirageAtoli
Re: Mega Man styled color swapping (1.0 specific)
#8  March 17, 2010, 02:09:19 pm
  • *****
  • IG @tanooki_ninja
    • Puerto Rico
    • maxbeta.webs.com/mugen.htm
Ok, I'm kind of getting some of the suggestions here as I'm pretty new to the whole character coding deal. Here's something I've given some thought to, and please feel free to correct me if I'm wrong so I can learn more.

Let's say I make each palette grid having three different sets of Ryu sprites in mind;

One for good ol' Normal Ryu, His Evil/Gouki Pose Alternate, and his Ken Alternate.

Although, the question here would be if its possible to code Basic Motion sets for his Akuma/Ken sets, like Jump, Walk, Crouch and all their respective attacks.

You guys follow what I'm saying? ...and more importantly, can it be done this way?

Thanks again.
"We need other people in order to create the circumstances for the learning that we are here to generate" RIP Adam Yauch aka MCA
www.instagram.com/tanooki_ninja
Re: Mega Man styled color swapping (1.0 specific)
#9  March 18, 2010, 03:51:54 am
  • ******
  • Legendary XIII
  • I am the eye of the storm to come!
    • New Zealand
    • network.mugenguild.com/cyanide/
You don't need to. Once you have told it to remappal, it will be Ryu with different colours. You can use a variable to change the moves he can use. I don't think becoming ken/akuma changes the way he walks jumps or stands.


In M.U.G.E.N there is no magic button

They say a little knowledge is a dangerous thing, but it's not one half so bad as a lot of ignorance.
Re: Mega Man styled color swapping (1.0 specific)
#10  March 18, 2010, 04:01:16 am
  • ***
  • Figuring things out, one sprite at a time.
    • irwt.iammanyninjas.com
Cyanide: Actually, it does change his standing frames when in Gouki mode and Ken mode has more bouncing to the left and right than Ryu's normal stance.

Anyway, Cyanide is right that all you need to do is apply the default Ryu palette to those frames, and remappal will take care of the rest by changing the colors to their appropriate versions depending on the mode selected.

vyn

Re: Mega Man styled color swapping (1.0 specific)
#11  March 18, 2010, 04:14:00 am
  • ****
    • Mexico
    • armandojc3@gmail.com
Nice, are true transformations possible now??? as in changing the required sprites so goku doesnt turn black haired when thrown anymore??
Re: Mega Man styled color swapping (1.0 specific)
#12  March 18, 2010, 04:27:16 am
  • ******
  • Legendary XIII
  • I am the eye of the storm to come!
    • New Zealand
    • network.mugenguild.com/cyanide/
Well, the STYLE would change, but you could keep it yellow. Cleverness with how the sprite looked in normal mode could make the transformation version look normal no matter what.


In M.U.G.E.N there is no magic button

They say a little knowledge is a dangerous thing, but it's not one half so bad as a lot of ignorance.

vyn

Re: Mega Man styled color swapping (1.0 specific)
#13  March 18, 2010, 04:32:50 am
  • ****
    • Mexico
    • armandojc3@gmail.com
I meant more like the 5000s required sprites, is there a code around them now or is it still impossible? not quite talking bout this code but 1.0
Re: Mega Man styled color swapping (1.0 specific)
#14  March 18, 2010, 07:53:58 am
  • ******
  • Legendary XIII
  • I am the eye of the storm to come!
    • New Zealand
    • network.mugenguild.com/cyanide/
Yes, i know that. I'm saying if you used remappal it wouldn't go back to black (you could make the hitsprites look enough like the ssj hair style that it would work)

But that's DBZ specific, in general custom states are still a problem.


In M.U.G.E.N there is no magic button

They say a little knowledge is a dangerous thing, but it's not one half so bad as a lot of ignorance.

vyn

Re: Mega Man styled color swapping (1.0 specific)
#15  March 18, 2010, 04:56:34 pm
  • ****
    • Mexico
    • armandojc3@gmail.com
Ah ok, my bad for not asking in general, tnx mate
Re: Mega Man styled color swapping (1.0 specific)
#16  April 01, 2010, 09:31:04 pm
  • ***
  • I have no idea what I'm doing.
    • UK
This intrigues me. I'll copy this code down, in case I want it for something.  ;)

I wonder - could this be used to create a character whose special moves change depending on the palette? Like Chameleon from Mortal Kombat, for instance?
Re: Mega Man styled color swapping (1.0 specific)
#17  April 02, 2010, 01:58:00 am
  • ******
  • Legendary XIII
  • I am the eye of the storm to come!
    • New Zealand
    • network.mugenguild.com/cyanide/
It's still just a variable. Use it for whatever you like.


In M.U.G.E.N there is no magic button

They say a little knowledge is a dangerous thing, but it's not one half so bad as a lot of ignorance.

vyn

Re: Mega Man styled color swapping (1.0 specific)
#18  April 02, 2010, 03:50:21 am
  • ****
    • Mexico
    • armandojc3@gmail.com
You make these codes for the fun of it or are they part of abandoned projects, just curious mate.
Re: Mega Man styled color swapping (1.0 specific)
#19  April 02, 2010, 04:34:20 am
  • ***
  • Figuring things out, one sprite at a time.
    • irwt.iammanyninjas.com
This bit of code resulted from a combination of talking to Shoshingo and having nothing better to do for a few minutes. Figured it wouldn't be too hard to do something like this, and it wasn't.

vyn

Re: Mega Man styled color swapping (1.0 specific)
#20  April 02, 2010, 04:37:40 am
  • ****
    • Mexico
    • armandojc3@gmail.com
So sort of to see if stuff is posible?, good reason as any i guess.
Re: Mega Man styled color swapping (1.0 specific)
#21  April 02, 2010, 04:40:52 am
  • ***
  • Figuring things out, one sprite at a time.
    • irwt.iammanyninjas.com
That's pretty much it. If I can use the code later, great. If not, not much time lost working on it.
Re: Mega Man styled color swapping (1.0 specific)
#22  August 04, 2010, 09:07:02 pm
  • **
  • Injustice 2 Clan : Mugen Roach
  • God Bless The Coffin They Carry Me Off In
    • Brazil
    • mugenroach.webs.com
really nice... based in your code I made my Leona changes her pallete just like KOF2002
but I'm having some problems with the remappal code..here are them:  :'(
1° - my leona has 2k2 mode (exploding the power-bar) her palfx doesn't work right (only blinks when she's hitting the enemy)
2° - when Leone is getting hit by fire the palfx doesn'twork either ...

so..please help me I made a lot of things but nothing worked..


here's a piece of the code...
Quote

;Changes palette during match to normal
[State -3, instant-change-part2]
type = RemapPal
triggerall = var(40)=0 && palno=1
trigger1 = roundstate = 2
source = 1,1
dest = 1,1

;Changes palette during match to orochi
[State -3, instant-change-part2]
type = RemapPal
triggerall = var(40)=1 && palno=1
trigger1 = roundstate = 2
source = 1,1
dest = 1,7

;-------------


here's the problem happening ...  :-\

Bea

Re: Mega Man styled color swapping (1.0 specific)
#23  August 05, 2010, 12:10:07 am
  • *****
  • MUGEN Grandma
    • Brazil
    • www.smeenet.org
That happens because your triggers are making it so that the remappal sctrl runs every tick, reseting Leona's pal to the chosen one, and overriding the palfx effects that were applied over her palette before it's changed by the remappal.
Princess Adora: "My friend saw She-Ra take her dress off in the shower. She said she has an 8 pack. She said She-Ra is shredded."

SF2NES is dead. Long live SF2NES.
Re: Mega Man styled color swapping (1.0 specific)
#24  August 05, 2010, 01:24:51 am
  • ***
  • Figuring things out, one sprite at a time.
    • irwt.iammanyninjas.com
Roach: Looks like you stumbled on a minor oversight in the original code: as Beatrice pointed out, the trigger as it was made it so that it ran on every tick. In the sample code, a minor change to the remappal sctrl used during roundstate 2 (adding "time = 1" to the trigger present) appeared to root out this specific error. Some more modification appears to be needed to maintain the ability to quickly switch through palettes though for the codes original purpose, as I just realized this change also makes it so that it only switches at the beginning of a new state...
Re: Mega Man styled color swapping (1.0 specific)
#25  August 05, 2010, 08:08:37 am
  • ******
  • Legendary XIII
  • I am the eye of the storm to come!
    • New Zealand
    • network.mugenguild.com/cyanide/
The remappal sctrl need only trigger once. Do it in the transformation state only. It'll work from that point on.

I did this in Lee Rekka for his Power/Speed modes and it causes no issues at all.


In M.U.G.E.N there is no magic button

They say a little knowledge is a dangerous thing, but it's not one half so bad as a lot of ignorance.
Re: Mega Man styled color swapping (1.0 specific)
#26  August 05, 2010, 03:32:23 pm
  • **
  • Injustice 2 Clan : Mugen Roach
  • God Bless The Coffin They Carry Me Off In
    • Brazil
    • mugenroach.webs.com
oh... thanks you all!
i got it!

now the code is just like that:

Quote

[State -2, instant-change-normal]
type = varset
trigger1 = var(40)= 0 ;var of orochi mode unactive
trigger1 = roundstate >= 0
v = 24
value = ifelse(palno=1,1,ifelse(palno=2,2,ifelse(palno=3,3,ifelse(palno=4,4,ifelse(palno=5,5,ifelse(palno=6,6,
ifelse(palno=7,1,ifelse(palno=8,2,ifelse(palno=9,3,ifelse(palno=10,4,ifelse(palno=11,5,6)))))))))))

[State -2, instant-change-ex]
type = varset
trigger1 = var(40)= 1 ;var of orochi mode active
trigger1 = roundstate >= 0
v = 24
value = ifelse(palno=1,7,ifelse(palno=2,8,ifelse(palno=3,9,ifelse(palno=4,10,ifelse(palno=5,11,ifelse(palno=6,12,
ifelse(palno=7,7,ifelse(palno=8,8,ifelse(palno=9,9,ifelse(palno=10,10,ifelse(palno=11,11,12)))))))))))

[State -2, remappal];you have to put it in the changing state too
type = RemapPal
trigger1 = var(24) && time <= 1
source = 1,1
dest = 1,var(24)


"my code" allow you have orochi Leona choosen up to palno 6... (it's sth normal)
but is there an way to  datain the bug of the both have the same pallete?
for example : leona's palno = 1 when is in orochi mode is palno = 7 and vice-versa with all the rest ones ... so when the palno 1 and 7 with orochi's var (un)actived are the same.

the problem happening!  :P ...



 (me and my problems of to be a mugen maker) --;
Re: Mega Man styled color swapping (1.0 specific)
#27  August 05, 2010, 05:42:47 pm
  • ***
  • Figuring things out, one sprite at a time.
    • irwt.iammanyninjas.com
Based on what I could understand of your post, you are asking what to do in the case if Leona starts in palettes 7-12, in which she is already using her Orochi colors and thus any transformation would be less obvious as there is no drastic color change taking place. The easiest solution to this problem I can think of is probably making it so that if you start in palettes 7-12, you start as Orochi Leona by default. All that really requires is an additional varset that changes your var(40) to 1 if the active palette during roundstate=0 is greater than 6. Should do the trick.
Re: Mega Man styled color swapping (1.0 specific)
#28  August 06, 2010, 12:28:20 am
  • **
  • Injustice 2 Clan : Mugen Roach
  • God Bless The Coffin They Carry Me Off In
    • Brazil
    • mugenroach.webs.com
i used this code
...using it out of turns mode works right ...
Quote

[State -2, instant-change-ex]
type = varadd
triggerall = teammode != turns
trigger1 = teamside = 2 &&  enemy, name = "Leona"
trigger1 = enemy, palno != palno
v = 24
value = ifelse(palno=12,-5,ifelse(palno=6,-5,1))


but when is in the turns mode the problem continues after round 1 ...  :P ??? >:(
Re: Mega Man styled color swapping (1.0 specific)
#29  August 06, 2010, 01:07:45 am
  • ***
  • Figuring things out, one sprite at a time.
    • irwt.iammanyninjas.com
The way I'm looking at it right now, you've probably really overcomplicated things for the mode change. Cyanide gave you the right idea; for Leona, you only really needed one remappal sctrl to be present in the mode change state and you'd probably be fine on that part. Only other thing that comes to mind is setting up so the var that keeps track of whether or not Leona is supposed to be in Orochi mode doesn't reset inbetween rounds and you are good to go.
Re: Mega Man styled color swapping (1.0 specific)
#30  August 06, 2010, 08:06:12 am
  • ******
  • Legendary XIII
  • I am the eye of the storm to come!
    • New Zealand
    • network.mugenguild.com/cyanide/
If she starts in orochi palette for 7-12, why not have the transformation put her in the normal palette?

And yes, you are overcomplicating it. In your transformation state, that's the one you get into by going UDUDUD+KK add a single remappal controller

[State ReMapPal]
type = remappal
trigger1 = Use the trigger for when she actually changes
source = 1,1
dest = 1,palno+6

If you want to get fancy and have her go backwards if she's already in orochi mode, add

trigger1 = palno = [1,6] to the above piece of code and add a second remappal with

trigger1 = palno = [7,12]
dest = 1,palno-6

You need to use a variable if you want the change to persist into round 2 but it's still essentially the same stuff, You just need to overwrite state 5900 and tell it more accurately what to do.


In M.U.G.E.N there is no magic button

They say a little knowledge is a dangerous thing, but it's not one half so bad as a lot of ignorance.
Re: Mega Man styled color swapping (1.0 specific)
#31  August 06, 2010, 09:34:54 pm
  • **
  • Injustice 2 Clan : Mugen Roach
  • God Bless The Coffin They Carry Me Off In
    • Brazil
    • mugenroach.webs.com
i overcomplicated it ... but I can't find another way even with your helps ....
I'm still trying to make it works correctly the way I want to...
I have a lots of doubts yet about remapal ...
thanks a lot for your helps!
I have so many doubts that it becomes difficult to me to post here about it ...
when I got it working out of turns mode first, I'll post here the code ...
maybe in this way all of you shall understand what I want to make.
c ya! ;)