News:

MFG's Character of the Month: October 2026 Nominations

Main Menu

Learning coding

Started by Xenomic, January 05, 2015, 02:35:27 AM

Previous topic - Next topic

Xenomic

So I'm trying to learn a bit of coding here and there, and using Kung Fu Man as a basis of learning from, using the animation numbers for the most part. However, I am perplexed an issue I am having right now:




I do not know what this means at all, and cannot seem to find this at all? Because of this one issue, I cannot test the character to make sure animations are working properly (I cannot tell if I'm doing the jump forward/backward animation right at all).

I'll probably be using this topic a fair bit, so please bear with me. I've not dealt with MUGEN coding outside of doing animations for MB, Shocks, and Sangues ^^;

Odb718

I'd say download Fighter Factory 3, open the sff, hit organizer/auto, save only the sff as a totally new file name. Then adjust your character's def to look for the newly named sff. If the problem is still there, you'll have to do some major adjustments.
vVv Gouken718 vVv SabreTooth718 vVv


Xenomic

I already use Fighter Factory 3. It seems that I just had to delete the sprites that well...didn't have anything in them. I realized what that error was saying and removing all of those fixed the problem. Of course, right now there's the issue of getting everything fixed up in the proper animations and making sure things aren't wonky, but that's for another time I suppose. Dunno how to differentiate between close and far attacks just yet either. >_<

GT

Quote from: Xenomic on January 05, 2015, 07:49:03 AM
Dunno how to differentiate between close and far attacks just yet either. >_<

You mean telling the engine when to use close standing punch and when to use far standing punch?

You can do that from the CMD or the CNS (CMD is easier IMO).

[State -1, Heavy Punch]
type = Changestate
value = 250 + 5*(P2Dist x < 34) ; This tells Mugen to use State 255 when player 2's distances is less than 34 pixels. When greater than that amount
triggerall = Statetype = S           ; the character will go into state 250.
trigger1 = Ctrl


http://www.elecbyte.com/mugendocs/trigger.html#p2dist



Alternatively, you can use ifelse for the value.


                         (A)  (B)   (C)
value = ifelse(P2dist x < 34, 255, 205) ; If the first condition (A) returns true, then Mugen will use the second value (B), otherwise, it will use
                                                            ; the third value (C)


http://www.elecbyte.com/mugendocs/trigger.html#ifelse-math

Xenomic

Ok, not so much coding problems as palette problems, but same thing to me. So, with this character that I'm working on/helping with, I have sprites that I put in long ago that worked perfectly fine when I put them in. Nothing wrong with the background or anything. However, all of the sprites past that seem to want to not work properly with the background color.



The one in the upper-left is the transparency color of course, being the pink. The black that's selected is what every other freaking sprite seems to want to use as the background color. I tried switching these two colors in FF3 and saving the files, then putting the sprites in, and it looked it worked...until I saved, reopened the file, and all but one sprite still had the black background, and some even had the pink background showing when it shouldn't be (for some reason (Sprite 0,0 is using the first palette of the bunch. 3 of the sprites are using palette 8 for some reason, which gives black background, 2 are using palette 9 for some reason, which gives pink background, and 1 is using palette 10 for some reason, but background color is gone (but is still wrong palette).

I am unsure as to what it is I am doing wrong at all...I cannot tell what the character is that I am working on unless the author gives me his consent to do so. But this palette issue is really driving me batty and I'm getting quite annoyed by it. Any help would be much appreciated. I even tried following a tutorial on this issue, and it didn't solve it properly at all...

MadkaT

The SFF is corrupted if not is arranged (At least on winmugen :P ) As far I can remember the recommended order of the sprites in a SFF is the following:

-First the sprites of the group 9000 (Shared pallete for the lifebar sprite)
-Second, the sprite 0,0 (Shared pallete)
-Third sprites with shared pallete
-Fourth sprites with individual pallete

This is the recommended sort of the sprites, Fighter Factory have a tool to arrange/sort the sprites I use a very old version (2.0 :P) but i'm sure the new versions have this button or option. The most common cause of the sprites pallete distortion is mixing sprites with shared pallete with the sprites of individual pallete, the 0,0 sprite is very important in most of the cases.

Hope it helps ;)
<- Foros Mugen en espaƱol. And also English forums.

Xenomic

Hm...strange. I generally add the sprites in order (for instance, after the first set of sprites that work perfectly fine is when I started adding in the new sprites), which I have them share with Index 1, Palette 1 (1,1 whenever I choose Force/Adapt to palette). How problematic hmm...>_<

ESFAndy011

Quote from: Xenomic on February 27, 2015, 06:19:22 AM
The one in the upper-left is the transparency color of course, being the pink.

Wait, I'm pretty sure the transparency colors are located at the bottom right. What you're seeing there is a sprite palette turned upside-down. This usually happens when you turn a .pcx into a .bmp or export a sprite as a .bmp. Don't ever do this. Keep them as .pcx at all times.
Quote from: Millie, &quot;Ozy and Millie&quot;"I think there are really three types of people: "Glass is half-full" sorts of people, "Glass is half-empty" sorts of people,
and people who will spit into the glass until that's fixed."

Koop

Some image editing software will automatically flip the palette indexes of images. You can use Gimp or Fighter Factory 3 to flip the palettes around.
Another thing to watch out for is optimized pngs. The general consensus is to NEVER save pngs as optimized.

JustNoPoint

Just save a .act or whatever format your art program saves palettes in and just force that palette instead. Then you can save in any format.

Xenomic

@[user id=29990]ESFAndy011[/user]: I think that's in FFC and not FF3. When I was checking the original sprites, and I think I checked KFM's too, it was top-left.

@[user id=11282]Koop[/user]: Hm...I don't think I've ever had Photoshop do that to me whenever I've taken sprites and added them to characters (though I didn't use Photoshop this time around).

Ah. Guess I should say that these are in fact PNGs that I'm using (I always use PNGs), and they were all taken from a spritesheet using a tool that extracts all of the sprites from said sheet in one go. I wonder if that's what caused the issue is the tool by any chance??

ESFAndy011

Quote from: Xenomic on March 10, 2015, 07:33:16 PM
@[user id=29990]ESFAndy011[/user]: I think that's in FFC and not FF3. When I was checking the original sprites, and I think I checked KFM's too, it was top-left.

I don't think that depends on which fighter factory you're using, but your image editing software. Are you using Paintshop Pro? Here's why I'm asking:

QuoteYour background colour should be the top left colour of your pallete in Paintshop Pro. It should be bottom right in Photoshop. Please ensure it doesn't show up more than once.

Found that in the FAQ thread,
Quote from: Millie, &quot;Ozy and Millie&quot;"I think there are really three types of people: "Glass is half-full" sorts of people, "Glass is half-empty" sorts of people,
and people who will spit into the glass until that's fixed."

Xenomic

I don't use Paint at all for sprites. I only use Photoshop for sprites, though I did not use either for these, just a tool that ripped them all from the spritesheet. Which I am now thinking is the cause of the problem.

Speedy9199

I just want to say something about learning to code in general, I'd suggest you study up on or review Algebra, Trigonometry, Calculus, basic Physics and Graphic art. You will be using them! I say this from my own experience.
The answer to most of your mugen problems is to know more math.

How can you get the "feel" of a character if you are only touching a keyboard or controller?!?!

altoiddealer

Just a tip which might come in handy in the future: In Photoshop, when you change the mode to Indexed color... in the window that pops up you can go to "Forced Colors" and in the first box, assign the background color. That will force the background color into the first slot.

I haven't done any real palette management yet with my project in FF3, but I know that much to at least get the background in the right spot every time


Odb718

Personally I build my palette(s) in part in Photoshop. Then using the palettes I've made I use FF3's Advanced Palette option to make the palette I'll use for the character.
Separate the reds/blues/skin/blacks/clothes/ which ever colors in photoshop. Save each one as reds/blues/skin/blacks/clothes/whatever.
Then in FF3 I open up red first, kick them over to the right palette. Then do the same for blues/skin/blacks/clothes
Once all of the colors are over to the right, I copy all of them back over to the left and save as an external file, then as an index (I make 1.0 chars).

If you just tell photoshop to make the palette for you all of the colors wont be sorted by parts. You'll have a much harder time making alternate palettes.
vVv Gouken718 vVv SabreTooth718 vVv


altoiddealer



Bane84

Personally, I would just throw all of the sprites from a single set into a sprite sheet, use Photoshop or GIMP (whatever image editor you're using) to create the indexed image, move the background color to the appropriate transparency index, then save the palette off to reassign to all of the sprites in that sheet.

You can then use Fighter Factory to assign alternate palettes by using the Advanced Palette Editor.