Loader Mod Template: link a piece of clothing to another RGB slider (1 Viewer)

Jaxx

Content Creator
Joined
Aug 15, 2016
Hi,
I couldn't find any answer to what I'm looking for so I'm taking my chances with this thread. If one exists then I appologize, just point me to the thread I wasn't able to find and I'll remove this one.

I'm using the loader mod template from @sby so maybe you're the guy most likely to give the acurate anwser.

What I want to do is simple: make an over top loader mod which uses another RGB slider than the first top one. I'd like to understand how to link another RGB slider slot, but also how to use the 2nd RGB slider from any slot.
I saw many mods supporting this feature but I really don't know if the method differs depending on the template used.
I've been looking on the forum, took a look at the templates code, but unsuccessfuly.

Using the code
Code:
addEventListener(Event.ENTER_FRAME, followColorSlider);
function followColorSlider(e:Event)
{
top.back.rgbFill.transform.colorTransform = collar.rgbFill.transform.colorTransform;
top.chest.rgbFill.transform.colorTransform = collar.rgbFill.transform.colorTransform;
top.rightBreast.rgbFill.transform.colorTransform = collar.rgbFill.transform.colorTransform;
top.leftBreast.rgbFill.transform.colorTransform = collar.rgbFill.transform.colorTransform;
}
placed before or after registerMod(mymodname); from @SyntaxTerror 's tutorial triggers errors (Access to undefined properties top and collar) and won't compile with sby loader mod template.
 

stuntcock

Content Creator
Joined
Jun 5, 2012
how to use the 2nd RGB slider from any slot.
Name your MovieClip instances "rgbFill2" instead of "rgbFill".

It's possible to use the second slider while keeping the "rgbFill" name on your symbols ... but it involves more code and more risk of errors. I would encourage you to just rename them. If there's a compelling reason to keep the names then let us know and we'll send you the necessary code.

Using the code
Please note that this code was written for the vanilla game. If you're using sby's Loader mod template then you're presumably creating a Loader mod. Therefore you can invoke initl and lProxy instead, which yields more compact code and better runtime performance.

If you want your work to be vanilla-compatible then you should continue to use the code written by @SyntaxTerror, but please be careful not to use extended clothing types (such as Legwear). Such elements will not appear when your mod is loaded into the vanilla game. If you're creating a vanilla import, then you must limit yourself to vanilla types -- you can still draw socks, but you must classify them as BOTTOMS.

Edit: wait, you're trying to create an OVERTOP mod. That's a Loader-exclusive thing; vanilla compatibility is not possible.

placed before or after registerMod(mymodname);
The order doesn't matter.

If you're having trouble then I would encourage you to upload a copy of your FLA project file. Someone can post some code snippets to show the work that's needed -- or they could simply insert the necessary code and then explain what was changed. If you decide to post your work then please mention whether you're interested in a vanilla-compatible or Loader-based solution (because they use different code).

There are several FLA files available which reassign the RGB sliders; you could theoretically copy code from one of those projects. The Leash files, for example, are Hair elements which borrow color information from the Collar.RGB2 sliders. But Loader mods often contain a lot of "extra" code (relating to interactivity, animation, physics, etc) and so they're often difficult for a new modder to understand. It's probably simpler if we just make a few code changes directly into your own FLA file. You can then study, adapt, and re-use this code in your own future projects.

triggers errors (Access to undefined properties top and collar) and won't compile with sby loader mod template.
You didn't follow all of the instructions written by @SyntaxTerror (tsk! tsk!) :wink:. His sample involved a "fake" or "placeholder" Collar item being included in the mod package, so that it would serve as a "donor" for color information. This item does not appear in your project, so the associated code can't be resolved (and Flash generates a compiler error).

Flash is complaining about the missing "top" item because your project probably uses a different name -- such as "overtop" or "purpleSweater" or "greenHoodie" or etc.

Loader projects can use more direct script calls. Your own FLA project file will not need to include any placeholder items.
 

Jaxx

Content Creator
Joined
Aug 15, 2016
Name your MovieClip instances "rgbFill2" instead of "rgbFill".
Well... it was that simple :eek: even for a begginer with such a restricted knowledge of actionScript as I am :grin:

I couldn't however, achieve to use another RGB slider. Yes I am making a loader mod as I'm using sby's template, you are correct, and I changed the top and collar properties with the instance names of the mods I included in the main layer. No compiler error, but it's always the default RGB slider which is in use.
I assume it could work as SyntaxTerror wrote that it should be the same for a loader mod, but I'm probably getting something wrong.

I took a look at your leash code, and besides a line "var rgbElement:String = "collarControl";" you wrote in your elements code, I don't see anything else. I wonder if there is not a part of the code I can't manage to find...

I reallly am a newbie with Animate CC so you can't hurt my feelings by giving me an answer as if I was tottaly retarded on the matter :grin::grin::grin: (I don't have a clue of what you talked when you mentionned initl and lProxy lol)
On the opposite, I'll appreciate it very much, just like I did with your previous answer :wink:
Thank you stuntcock !
 

Jaxx

Content Creator
Joined
Aug 15, 2016
Well, with sby help I understood everything I missed. You were right when you said I didn't follow all the instruction from syntaxterror's tutorial. I completely overlooked a few things.
Now that I have a better understanding of the mechanics, I could have it work and I confirm that the method works for the loader mod template from sby.
 

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.