alternate loader template, version 3 (1 Viewer)

Jaxx

Content Creator
Joined
Aug 15, 2016
Hey sby sby , I'm running into an issue I can't find a workaround to. I'm making a dynamic hair mod where a dynamic part is supposed to fall above her ear, but remain under a static upper part. However, above ear dynamic layer is at least DYNAMIC_HAIR_OVER, but there is no static part layer which goes above that.
Furthermore, this dynamic part is likely to fall above her forearm in some positions, which requires the DYNAMIC_HAIR_OVER_EXTENDED layer.
Is there a way to redifine a static hair layer order without you to build anymore properties to the template? I mean... could I do it myself without bothering you? :rolleyes::smile:
 

sby

Content Creator
Coder
Joined
Sep 11, 2012
i haven't created dynamic hairs besides tests, i am guessing you can't use the starting link in the dynamic hair chain as an unmoving part? because then i would say just copy that static part onto it.
 

Jaxx

Content Creator
Joined
Aug 15, 2016
Unfortunately, the first symbol of a dynamic hair always rotate no matter what, unless there is a variable that could be set to fix it and I'm not aware of. And if you just draw on the layer without converting into a symbol, it doesn't show up.
The easiest would be to have a HAIR_TOP_EXTENDED type for static hair that would come over everything. Would that be possible without too much trouble?
 

Faceless

Content Creator
Joined
Jun 12, 2011
What you could do is create a copy of your hair part, then go into the copy and duplicate all the components as well, so that the two parts aren't referencing the same components and you can make changes to one without affecting the other. Then, position both copies in the exact same place, but with one on a layer above the ear and the other below. Go into the the hair part that's above the ear, then go into each individual component that doesn't need to cover the ear and delete the shapes in them. You should end up with the anchor component and one or two more components being empty, but don't delete the empty components themselves! SDT needs the origin coordinates for those components to calculate the movement of the rest of the hair part. Finally, you go to the hair part that's below the ear and erase the components corresponding to the ones that you didn't delete before, so that you have a shortened hair part with a number of empty components hanging below. You might not even need to keep the empty components; try it both ways, and if so go ahead and get rid of them, because that's less stuff for Flash to calculate and thus slightly improved performance.
 

Jaxx

Content Creator
Joined
Aug 15, 2016
I do not think you understand what I'm trying to do... I never spoke about anything under the ear though :smile:
I just need to have a static part above a dynamic part, an OVER_EXTENDED one, and for now, nothing can be put above such part.
I'll post a picture with some notes so it'll be clear, my explanations might have been a bit sloppy :smile:
 

Jaxx

Content Creator
Joined
Aug 15, 2016
vnZg7UY copie.jpg

So... I took up a request to convert a static hair into a dynamic one.
Let's consider those 2 layers, the green one and the red one.
The red one (the shape will be a bit different but it doesn't matter) must be dynamic and fall above her ear, and her forearm, which means it has to be a DYNAMIC_HAIR_OVER_EXTENDED element.
The green one MUST be static, it must NOT rotate or move in anyway, even with a scene rotation or anything else, and be ABOVE the red layer. However, there is no element for static hair layering that comes above DYNAMIC_HAIR_OVER_EXTENDED ones.

Unfortunately, even if I define the red layer as a DYNAMIC_HAIR_OVER element (and accept this layer will be behind her forearm), the green one as a HAIR_TOP element, and register the green one after the red one, the red one is still atop the green one.
 

Faceless

Content Creator
Joined
Jun 12, 2011
You should've led with that image, because in pretty every case other than what you have, where the static part itself overlaps with the ear, what I described will work. :tongue:

But this is a perfect example of a problem that can be solved by inverse masking. Check the link in my sig for an overview. Now, in your specific case, what you'll probably want to do is to create an inverse mask layer in each hair segment. Then, in AS3 you want to set the mask property for each of the inverse masks to be the static part (ie her.head.HairOver or whatever the actual path may be). The mask property of a symbol determines which pixels are active, which normally means which pixels are visible, but for inverse masks determine which pixels are erased instead. You might need to create a second instance of the static hair part and refer to that instead, in case setting the static part as a mask causes it to disappear (I don't think that'll happen because the objects aren't siblings in the object hierarchy, but I might be wrong).
 
Last edited:

Jaxx

Content Creator
Joined
Aug 15, 2016
Now that is a very interresting method you just pointed out at me, I'm sure I'll make good use of it for many things :wink: Thank you!

However, after taking a look at the link in your signature and the example you posted, I'm afraid my issue will remain the same.
If I draw an inverse mask onto the red layer (I call it a layer but I might be wrong, as it's actually an instance of a dynamic hair template, that includes a layer with symbols), it will be one more symbol and will be parsed by SDT as a segment of the hair, which will break everything. If I draw this mask inside the first symbol, I don't know if that mask symbol within will be considered as a hair segment, but nonetheless, it WILL rotate with it, which doesn't solve the issue.

And if I draw this mask on the green static hair instance layer, I'm afraid it won't affect the red one as it (the mask's layer) will be beneath it, and worse, it will just erease a part of the green layer.

If I create a new instance from a dynamic hair template that I define as the same element as the red one, registering it after the red one would put it atop of it, however, I would still have a symbol into a dynamic hair layer, and this one will rotate, so I'm back to the original issue.
I still need a static element above DYNAMIC_HAIR_OVER, or better above DYNAMIC_HAIR_OVER_EXTENDED, or, that would work too, a way to deny a dynamic hair element - and only one - from rotating. Unless I missed something in what you suggest :rolleyes::tongue:

In short: an inverse mask or a normal one is the same, I still need a static layer ABOVE that red one, and that's what I can't achieve so far.
 

Faceless

Content Creator
Joined
Jun 12, 2011
You really don't. Both my Mileena and Bayonetta costumes do exactly what you need: use a sprite on a lower layer to hide part of a sprite that's above it. It's kinda hard to explain in words properly, and I don't have access to Flash right now or I'd throw together something for you.

But let me try to explain again anyway. In the properties panel change the display mode of each red layer segment to LAYER, and within each segment add a new symbol that's a duplicate of what's already in the segment. In the properties panel set the new symbol's name (ie fakeMask), and change the display mode to ERASE. Then on the green layer, create a new symbol that's a also duplicate of what's already there. Give that symbol a name (ie maskRef) in the properties panel, and you'll be able to refer to that specific object in AS3. Then, on the red layer (not inside the segments!) you can put
Code:
for(var i = 0; i < this.numChildren; i++)
  this.getChildAt(i).fakeMask.mask = greenLayer.maskRef;
or something, where greenLayer is the full path to the green layer (ie her.head.HairContainer.greenLayer or whatever it actually might be). You'll need to actually figure out the path yourself though, I don't know it off the top of my head.
 

Jaxx

Content Creator
Joined
Aug 15, 2016
I understand what you're advice is, much better with your last post though :grin:. But I'm still concerned about this:
Each segment of a dynamic hair is a symbol, and those symbols are counted by SDT to build the dynamic hair mechanics. I'm pretty sure that if I add another symbol to make a mask inside each of them, they'll be counted as dynamic hair segment and it'll break the mechanism, the hair won't move as expected.
Did you already successfully use this method on a dynamic hair?
 

Faceless

Content Creator
Joined
Jun 12, 2011
No, they won't. Hair strand animation only goes one level deep.
Code:
dynamic hair strand
->segment 1 <--moves independently
--->sprite 1 <--part of segment 1, doesn't move separately
--->sprite 2 <--part of segment 1, doesn't move separately
->segment 2 <--moves independently
--->sprite 3 <--part of segment 2, doesn't move separately
--->sprite 4 <--part of segment 2, doesn't move separately
 

Jaxx

Content Creator
Joined
Aug 15, 2016
That's good news. I'm gonna try all the good advices you shared with me and I'll post some feedback :smile:
 

Jaxx

Content Creator
Joined
Aug 15, 2016
You'll need to actually figure out the path yourself though
Well... I might be a programer... I'm so sadly unexperienced with SDT hierarchy and AS3 that I might have done something a bit ugly... using parent and get ChildAt :wat:
However, I made a gross mod just to test it, and it works just as intended !

Thank you for your patience and this expertise upgrade you shared with me :wink:
 
Last edited:

Jaxx

Content Creator
Joined
Aug 15, 2016
This is really driving me nuts lol
Despite the test worked with 2 rectangles, it's giving me something very strange with more complex shapes.
Take a look at this:

Sans titre-1 copie.jpg


There is only 2 mods
One as a STATIC_HAIR type as a STATIC_HAIR_TOP element, 2 layers, 1 duplicated from the other and converted as a named symbol (maskRef)
Another one as a DYNAMIC_HAIR type as a DYNAMIC_HAIR_OVER element, 1 layer with a symbol with layer display mode, inside you got 2 layers, one with the earlock shape, another one with this duplicated shape and converted as a symbol with invert display type (for the needs of the demonstration).

It looks good on the edge, but inside the mask shape it's really strange... any idea?
I can provide the .fla file if you wanna take a look at it.
 

Faceless

Content Creator
Joined
Jun 12, 2011
Wouldn't do me any good; I won't have access to my Flash installation until the end of the year. sby sby I don't suppose you'd know enough about inverse masks to be able to take a look at this?
 

sby

Content Creator
Coder
Joined
Sep 11, 2012
i understand the concept, but i have little experience making assets in flash. however if you share the fla i can see if i can tinker with it to get it to work.
 

Jaxx

Content Creator
Joined
Aug 15, 2016
Sure, be my guest :smile:
But while we're at it, it reminds me of my former question. What about making a HAIR_TOP_EXTENDED element for static hair that would be over everything else? Is that something possible without too much trouble? Cuz if it is, that would definitely be the easier way.
 

Attachments

TakashimaShigure_test.fla
488.2 KB · Views: 167

Jaxx

Content Creator
Joined
Aug 15, 2016
The invert mode was on purpose to show what was going on by just looking at the picture... so I just made a mistake in the child order? I'm gonna shoot myself! :oops:
 

Murdoc53

Content Creator
Joined
Oct 3, 2011
local dumbass here, where is the tutorial? I have never used code and i dont know what to do with it
 

Users who are viewing this thread

Top


Are you 18 or older?

This website requires you to be 18 years of age or older. Please verify your age to view the content, or click Exit to leave.