The joys of bugs

I've been going crazy all morning, trying to figure out why two of the hands I drew don't properly mask out the items you put in them. Basically what masking means is, I can define an area in one item (the hands) that blocks out part of another item (like guns), so it looks like the hand is actually gripping the gun instead of just being layered on top of it.

That's a bit confusing, so I'll show you what I mean. Here are the two items unmasked:

handgun-unmasked.png

And here they are masked:

handgun-masked.png

You can see the difference -- in the second one, even though the gun is the same illustration as the gun in the first one, the handle gets blocked out by the fingers curling around. This is great because it lets me draw the entire hand-held item (i.e. the gun grip) and still use it in any kind of hand.

But this morning there were two hands that just refused to mask properly. No matter what I did, the proper parts of the gun type items didn't get blocked, and I couldn't figure out why. I tried recreating the mask object, I tried redrawing it, I tried renaming things, I tried deleting and starting over, I tried comparing the non-working ones to the working ones, and nothing made any damn sense at all.

I assume I am not the only programming type person to run into roadblocks like this, where nothing works and you don't know why. I am probably more prone to it than most because I am, frankly, a hack when it comes to Flash (meaning I didn't go through any formal training, I'm entirely self-taught). I keep running into holes in my education, and I never know if it's something wrong with me or the program, or both.

This time, it turned out to be the program, and in an incredibly stupid and irritating way.

It turns out when you're making a mask in Flash, which way you draw the lines matters. If you draw the mask shape clockwise, it all works fine. If you draw it counter-clockwise, though, it won't work.

How freaking jacked-up is that?! I can't imagine the Pope telling Michaelangelo "I like the parts of the Sistene Chapel ceiling you did with the brush strokes going left, but not the strokes going right. Change them all to match."

I mean, I know in Physics there are left-handed and right-handed particles, but this is nuts.

Luckily a Google search turned up a page that held the solution in the comments, for which I am profoundly thankful. This ruined my whole morning and part of last night; it's a really stupid bug, and I hate it, but at least now I know how to work around it. I never would've guessed the solution in a million years, though -- thank goodness for Google!

11 Responses to The joys of bugs

  1. Kaldath says:

    I Like how you have things worked out with the masking, just one little thing bugging me. With swords and other melee weapons how you have things now work just fine, however with Gun ,, Well The Index finger is on the wrong side of the gun, it would either be on the trigger or simple resting on the other side of the Gun ready to slip into the trigger. As it is now it looks like either the finger has manged to punch it’s way Through the guns grip or else the gun is somehow floating directly behind the hand.

  2. DJ says:

    Yeah I agree with Kaldath. I didn’t notice it at first but now it seems as if the index finger has pierced the gun.

  3. The Imp says:

    I think that’s not going to be as obvious though on the completed project. Or maybe it wil be – in that case, why not make the index finger of the hands slightly ‘out’ a little, Jeff? That way it would avoid the gun problem and still be workable for swords/knives/etc.

  4. Kaldath says:

    Looking at the Screen shoot Jeff provided eariler of the full figure a few days ago … http://www.heromachine.com/2008/10/22/warrior-mini-first-figure/ I guess it is not all that odvious unless you know its there to see, or you enlarge the picture

  5. Jeff Hebert says:

    It sort of depends on how you position the gun, too — if it bugs you, you can edge the gun out a bit more so the index finger’s below the trigger guard.

    But, I also plan on having a hand with the trigger finger out and curled as if around the trigger.

    And finally, yes, it’s so small that unless you look closely or zoom in, it’s not terribly noticeable.

  6. DJ says:

    Yeah I looked at the full figure and it actully looks like the finger is on the trigger then.

  7. haz says:

    Good lord, that’s absurd. What’s in the program code to even notice which way you draw the mask?

  8. Ballin' Boy says:

    why not draw a finger into just the guns, and make the gun cover up the index finger of the original hand? Or possibly make the fingers a little bit diagonal like the pinky is narrow but the fist gets wider as it goes up to the index finger. (but you probably already made the hands so that’s a stretch.

    Also just wondering if there is going to be a specific thread somewhere where we could all just post ideas? I know a lot of things I would like to suggest, but I don’t want to clutter up the posts with too much links and stuff?

  9. Ballin' Boy says:

    Oh also, is it okay to give ideas of things from existing characters? Not sure how the copyright laws work exactly

  10. Jeff Hebert says:

    I don’t include the finger on the gun item because then if you move the gun, you have a disembodied finger.

    As far as items from specific characters, it depends on the item. You can’t copyright Punisher’s machine gun if it’s a standard gun, but you can copyright Superman’s logo, for instance.

  11. Jeff Hebert says:

    Ballin’ Boy, feel free to post specific ideas to any of the threads, I’m easy. I had one a long time ago for specific items, and once the Mini is done I’ll start another for HM3 requests (probably more than one).