14 Feb 18 - Mod.fla template v0.98.3 (2 Viewers)

mike

Casual Client
Joined
Feb 4, 2012
Re: 22 Feb 14 - Mod.fla template v0.96.4

Hey guys, I'd like to make something a little bit different but I'm kinda blocked by my lack of code knowledge so I thought maybe you could provide help.

What I'd like to achieve is switching between a layer's frames using mouse clicks. I know it can be done since Calla did it for his mass effect's tali import link

I guess code would look something like that :
Code:
chest.stop()
chest.addEventListener(MouseEvent.CLICK,dothething);
main.unloadMod();
}

function dothething(){
	if(frame != lastframedrawn){
		gotoandstop(currentframe + 1);
	}
	else{
		gotoAndStop(frame 0);
	}
}

What I have in mind is a revamp of my supergirl import with normal and torn costumes. If possible I'd like a single mod rather than two different so thanks if someone can provide help.
 

ModGuy

Content Creator
Joined
Feb 17, 2011
Re: 22 Feb 14 - Mod.fla template v0.96.4

Code fine, consider an inline if statement for niceness:

Code:
var a = 0;
...
function switchFrames(e){ // <- Don't forget the listener param.
	a = (a < someNum) ? a + 1 : 0;
	thing.gotoAndPlay(a);
}

Or something like that. You could switch on frameNumber etc.
It's probably important to ensure that shift was held too, in the above code that'd include: "e.shiftKey" evaluating to true.
Moving across timelines is always tricky business on the AS3 side because objects are created and destroyed outside of the code.

Another thing to note is that this will not always function correctly due to the nesting of objects in the scene layer. If you run in to something like this and you're loader modding consider implementing a modpage for clearer but less intuitive control. Dev Guide explains it IIRC.
 

mike

Casual Client
Joined
Feb 4, 2012
Re: 22 Feb 14 - Mod.fla template v0.96.4

Awesome ! It works like a charm, with shift key and all. I can even toggle multiple layouts at the same time 8).

Thanks MG.
 

Faceless

Content Creator
Joined
Jun 12, 2011
Re: 22 Feb 14 - Mod.fla template v0.96.4

I would have used modulo myself to remove the need for comparisons:
Code:
function blah(Event e) {
   a = (++a) % thing.totalFrames;
   thing.gotoAndPlay(a);
}

But the essential logic behind that is pretty much identical to what you already have.
 

ModGuy

Content Creator
Joined
Feb 17, 2011
Re: 22 Feb 14 - Mod.fla template v0.96.4

Very classy, I like seeing conditionals in the event I ever want to step some other way.
 

mike

Casual Client
Joined
Feb 4, 2012
Re: 22 Feb 14 - Mod.fla template v0.96.4

Faceless said:
I would have used modulo myself to remove the need for comparisons:
Code:
function blah(Event e) {
   a = (++a) % thing.totalFrames;
   thing.gotoAndPlay(a);
}

But the essential logic behind that is pretty much identical to what you already have.

As a code noob, I managed to more or less understand MG's proposal but yours lost me.

Also gotoAndPlay seems to launch all frames loop on click so I went with gotoAndStop.
 

sby

Content Creator
Coder
Joined
Sep 11, 2012
Re: 22 Feb 14 - Mod.fla template v0.96.4

Mike said:
Faceless said:
I would have used modulo myself to remove the need for comparisons:
Code:
function blah(Event e) {
   a = (++a) % thing.totalFrames;
   thing.gotoAndPlay(a);
}

But the essential logic behind that is pretty much identical to what you already have.

As a code noob, I managed to more or less understand MG's proposal but yours lost me.

Also gotoAndPlay seems to launch all frames loop on click so I went with gotoAndStop.

a = (++a) % thing.totalFrames;

this is updating 'a' to the next valid frame value.

it increments 'a', and then does remainder division by the total number of frames. This essentially keeps 'a' inside the set of possible frames it could be, so incrementing past the last frame results in it being assigned frame zero instead.
 

Faceless

Content Creator
Joined
Jun 12, 2011
Re: 22 Feb 14 - Mod.fla template v0.96.4

Mike said:
As a code noob, I managed to more or less understand MG's proposal but yours lost me.

Also gotoAndPlay seems to launch all frames loop on click so I went with gotoAndStop.
Yeah, that should be gotoAndStop(). Herp derp.

Anyway, like sby explained, the modulo operator ('%') is basically taking the remainder. With two evenly divisible numbers, the remainder is 0. Hence, if incrementing 'a' makes it equal to 'thing.totalFrames', 'a' is set to 0 instead.
 

mike

Casual Client
Joined
Feb 4, 2012
Re: 22 Feb 14 - Mod.fla template v0.96.4

sby said:
a = (++a) % thing.totalFrames;

this is updating 'a' to the next valid frame value.

it increments 'a', and then does remainder division by the total number of frames. This essentially keeps 'a' inside the set of possible frames it could be, so incrementing past the last frame results in it being assigned frame zero instead.

Faceless said:
Yeah, that should be gotoAndStop(). Herp derp.

Anyway, like sby explained, the modulo operator ('%') is basically taking the remainder. With two evenly divisible numbers, the remainder is 0. Hence, if incrementing 'a' makes it equal to 'thing.totalFrames', 'a' is set to 0 instead.

Okay thanks for the heads up. I'll check that line too.

Either way I can now achieve what I was intending...so up to tearing some supergirl costume :P.
 

Sombra

Content Creator
Joined
Jan 3, 2014
Re: 22 Feb 14 - Mod.fla template v0.96.4

Is there a way to add a layer above the right arm of "her" but still be apart of the torso (back, chast, etc)?
 

Faceless

Content Creator
Joined
Jun 12, 2011
Re: 5 Sept 14 - Mod.fla template v0.97

New template. Main thing is layout consolidation, so that you can actually see how stuff lines up. Also added code and outlines for his shirt. Still no sleeves, sorry.

Faceless said:
Huh. Weird. For now, change the target path to main.her.torso.leg.

Or alternatively, unlock the template layers, select them both, and set them to position (0,2). You'll also need to add this line for the thigh costume:
Code:
main.XYRA(thighr, "x:-141.5;y:-141;r:0;a:1");
Probably a better solution would be to go into the main loader settings.txt and add this:
Code:
thighX=0
thighY=0
 

Faceless

Content Creator
Joined
Jun 12, 2011
Re: 11 Sept 14 - Mod.fla template v0.97.1

Main thing is the addition of a generic RGB method.
Code:
/**
 * manages RGB sliders
 * @param rgbSrc the control object from which the RGBA values are extracted,
 *   with the list of valid control objects listed below:
 *  hisTop:             main.him.bodies[0].topControl
 *  hisBottoms:         main.him.bodies[0].bottomsControl
 *  hisFootwear:        main.him.currentBody.footwearControl
 *  collar:             main.g.characterControl.collarControl
 *  cuffs:              main.g.characterControl.cuffsControl
 *  ankleCuffs:         main.g.characterControl.ankleCuffsControl
 *  gag:                main.g.characterControl.gagControl
 *  panties:            main.g.characterControl.pantiesControl
 *  top:                main.g.characterControl.braControl
 *  armwear:            main.g.characterControl.armwearControl
 *  bottoms:            main.g.characterControl.bottomsControl
 *  tops:               main.g.characterControl.topControl
 *  legwear:            main.g.characterControl.legwearControl
 *  legwearB:           main.g.characterControl.legwearBControl
 *  footwear:           main.g.characterControl.footwearControl
 *  eyewear:            main.g.characterControl.eyewearControl
 *  headwear:           main.g.characterControl.headwearControl
 *  tonguePiercing:     main.g.characterControl.tonguePiercingControl
 *  nipplePiercing:     main.g.characterControl.nipplePiercingControl
 *  bellyPiercing:      main.g.characterControl.bellyPiercingControl
 *  earring:            main.g.characterControl.earringControl
 * @param dest an Array containing the mod components to which the RGBA values are applied
 */
function rgbSliders(rgbSrc, dest:Array) {
    var rgba:Array = rgbSrc.getDataString().split(",");
    var trans:ColorTransform = new ColorTransform(
        0, 0, 0, 1,
        int(rgba[1]), int(rgba[2]), int(rgba[3]), int(rgba[4])
    );
    var trans2:ColorTransform = new ColorTransform(
        0, 0, 0, 1,
        int(rgba[1])/2, int(rgba[2])/2, int(rgba[3])/2, int(rgba[4])
    );

    for each(var o in dest) {
        if(o != null && o.rgbFill != null) {
            o.rgbFill.transform.colorTransform = trans;

            //breast outline
            if(o.outline != null) {
                o.outline.transform.colorTransform = trans2;
            }
        }
    }
}

Invoked every frame like so
Code:
rgbSliders(
    main.g.characterControl.armwearControl,
    [
        newupperarml, newforearml, newhandl,
        newupperarmr, newforearmr, newhandr
    ]
);
for gloves, for example. Although admittedly it would be better to define a variable for the array rather than creating a new one every frame. The objects "o.rgbFill" and "o.outline" are both created and named on the stage, just like in the vanilla template.
 

Faceless

Content Creator
Joined
Jun 12, 2011
Re: 11 Sept 14 - Mod.fla template v0.97.2

Revamped her head components. Her upper lip, eye ridge and nose are now separate from her face, her jaw follows the proper tweening, and now you can mess with her teeth and lipstick.
 

ModGuy

Content Creator
Joined
Feb 17, 2011
Re: 20 Sept 14 - Mod.fla template v0.97.2

Looked in to this to see if you'd filled the lip mod request, those tweens look broken from decompilation, do they still look right?
 

Faceless

Content Creator
Joined
Jun 12, 2011
Re: 20 Sept 14 - Mod.fla template v0.97.2

Her lower lip is a little fat, but other than that they should be good.
 

ModGuy

Content Creator
Joined
Feb 17, 2011
Re: 20 Sept 14 - Mod.fla template v0.97.2

Try to get things looking identical to vanilla if possible. If it serves as just a guideline then a perfect copy isn't necessary.
 

Faceless

Content Creator
Joined
Jun 12, 2011
Re: 20 Sept 14 - Mod.fla template v0.97.2

Well, they are intended as guides, which is why they're colored the same as the vanilla template references. The purpose is more to have the proper number of frames and keyframes than a 1-to-1 frame match, although it's nice when that happens.
 

RC

Potential Patron
Joined
Nov 27, 2012
Re: 20 Sept 14 - Mod.fla template v0.97.2

Where does this Mod Template.fla come from exactly? Is there any way I could put my hands on a version where the sprites are colored and not grey?

Thanks.
 

Faceless

Content Creator
Joined
Jun 12, 2011
Re: 20 Sept 14 - Mod.fla template v0.97.2

The template is something I put together myself over many hours of tinkering with ModGuy's defunct modder.swf and poking around a decompiled SDT.fla. I chose to use grayscale assets to keep it in line with the vanilla template. If you want, however, I can upload SDT.fla for you, which will have all the assets as they appear in game, with the proper hierarchies.

EDIT: file removed
 

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.