User Tag List

Page 1 of 2 1 2 LastLast
Results 1 to 10 of 11

Thread: Palette Swapping.

  1. #1
    No Products Registered

    Join Date
    Jun 2007
    Posts
    323
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Palette Swapping.

    Could someone please walk me through, or possibly make an example of how to change an object's palette?

    What I need exactly is to be able to store the object's default palette at the start of the frame, and then change it during runtime, at any frame or animation.

    I have found out how to change an object's color by using "replace color" and "get RGB at", this changes color perfectly but since it grabs a specific pixel from a specific frame, this won't work if the object is playing a different animation or on a different frame than the one the "get RGB at" coordinates were retreived from. Sorry if that's somewhat confusing, I'm not the best at explaining things :P

    I've been reading around the forums about changing object's colors but I still haven't found a solution :\ thanks for any help.



  2. #2
    No Products Registered

    Join Date
    Jun 2007
    Posts
    323
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Palette Swapping.

    lol After a while of brainstorming I figured it out :P NVM!

  3. #3
    Clicker

    Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleSWF Export ModuleXNA Export ModuleUnicode Add-on
    mobichan's Avatar
    Join Date
    Oct 2007
    Location
    Buffalo, NY
    Posts
    3,310
    Mentioned
    28 Post(s)
    Tagged
    0 Thread(s)

    Re: Palette Swapping.

    Please, can you share how you solved the problem? I've always been curious if there is a simple way of palette swapping in MMF.

  4. #4
    No Products Registered

    Join Date
    Jun 2007
    Posts
    323
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Palette Swapping.

    No problem, it's not the simplest way I don't think, and its not necessarily palette swapping, but it gets the job done exactly how I wanted.

    Anyways what I did is I technically stored the RGB of the SHADE I want to change instead of the color. For example, my character has 3 shades of a color on his armor, but I want to keep his body color the same, so I did this:

    -make a clone of your main object and place it off screen, lets call it "X2", and the main object "X". Also make another object, "XPalette" and give it as many values as there are shades of your character that you want to change, in my case there are 3. You also want to store the default color of your main object at the start of frame, so make 3 more values for this.

    My first 3 values for Xpalette are Light armor, Medium armor, and Dark armor. The next 3 are the same except they have "default" behind them.


    +Start of frame
    -XPalette: Set "Light armor" to RGBat("X2",X,Y)

    *Do the same for medium and dark armor, this retreives the default color related to the named coordinate.*

    After doing this, code the event that will replace your main object's color. For debugging, I used "when user pressesQ" so:

    +Upon pressing Q
    - "X": Replace color "Lightarmor"("XPalette")by RGB(nnn,nnn,nnn)
    - "XPalette": set "Lightarmor" to RGB(same numbers as above)

    To get the original color of "X", you use the exact same code except instead of entering the new RGB, you retreive the "default" values set at the beginning of the frame.

    So basically you retreive the default color of an object at the start by "get RGB at", then save the RGB to values. Then upon input, you replace those values with new ones, and set the default to the new color.

    Yet again, I'm not the best at explaining things so I can just make an example if someone really needs me to O_o Hope this helps!

  5. #5
    Clicker

    Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleSWF Export ModuleXNA Export ModuleUnicode Add-on
    mobichan's Avatar
    Join Date
    Oct 2007
    Location
    Buffalo, NY
    Posts
    3,310
    Mentioned
    28 Post(s)
    Tagged
    0 Thread(s)

    Re: Palette Swapping.

    That makes perfect sense. Thanks. I do wish we could swap palettes (using palette files or something similar) as a native feature of MMF. Maybe in MMF3?

  6. #6
    No Products Registered

    Join Date
    Mar 2007
    Location
    Sydney, Australia
    Posts
    1,369
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Palette Swapping.

    I agree! Palettes would be a great idea and surely wouldnt be that hard?

  7. #7
    Clicker Fusion 2.5 DeveloperFusion 2.5+ DLCSWF Export Module
    N64Mario's Avatar
    Join Date
    Nov 2008
    Location
    USA
    Posts
    1,308
    Mentioned
    15 Post(s)
    Tagged
    0 Thread(s)

    Re: Palette Swapping.

    I also like the idea of loading palette files for a feature in MMF3. It could help in many ways.

  8. #8
    No Products Registered

    Join Date
    Jun 2007
    Posts
    323
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Palette Swapping.

    Hrm..I've run into a problem with this method of swapping colors.

    I created a "charging" effect for my character by rapidly swapping its black outline with different colors. It seems MMF can't handle swapping an objects colors this quickly, thus causing a MAJOR drop in FPS. On my computer I notice no change in FPS but on my friend's computers the slowdown is pretty bad.

    Any suggestions as to getting around this? Not even HWA fixes the slowdown. :\

  9. #9
    Clicker Fusion 2.5 DeveloperFusion 2.5+ DLCSWF Export Module
    N64Mario's Avatar
    Join Date
    Nov 2008
    Location
    USA
    Posts
    1,308
    Mentioned
    15 Post(s)
    Tagged
    0 Thread(s)

    Re: Palette Swapping.

    Yea.... it DOES drop the FPS unfortunately. I don't know why.

    You can try having duplicate copies of the same character, with the only difference being the colors. Although I donno how you would like doing that.

    For my games I have been using RGB Replace, even though it drops the FPS. I just used small, square ([color:#FF0000][_][/color][color:#009900][_][/color][color:#000099][_][/color]) palette objects to pinpoint where the new colors were on the character

  10. #10
    No Products Registered

    Join Date
    Jun 2007
    Posts
    323
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Palette Swapping.

    Meh. I suppose I could use a colored mask and toggle its invisibility (for the charging atleast) but this is a cheap workaround imo, something I'm really trying not to do anymore.

    I would just use pixel shaders in HWA to acheive this effect but this is for a serious project and I don't want to use anything still in beta. O_o

    Why is swapping colors rapidly such a major task for MMF? This charging effect I made involves over 100 objects (with alpha channels) constantly spawning, scaling, and fading, yet not even this causes the FPS to drop. Could it be my code?

Page 1 of 2 1 2 LastLast

Similar Threads

  1. Swapping Objects With One Another...What a Mess.
    By soloman in forum Multimedia Fusion 2 - Technical Support
    Replies: 9
    Last Post: 8th August 2010, 07:52 AM
  2. Sound swapping issues
    By stuckboy in forum Multimedia Fusion 2 - Technical Support
    Replies: 1
    Last Post: 7th February 2007, 12:59 PM
  3. Best way to handle HUGE image swapping?
    By arsdigita in forum Multimedia Fusion 2 - Technical Support
    Replies: 2
    Last Post: 22nd September 2006, 01:47 AM
  4. Pallete Swapping
    By Strider in forum Multimedia Fusion 2 - Technical Support
    Replies: 3
    Last Post: 30th August 2006, 12:10 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •