Making a loader mod to change variables in action script (1 Viewer)

Shadow7988

Potential Patron
Joined
Jun 29, 2012
I'm a bit confused as to how I'm supposed to go about this. I've gotten the source code and found the values I wanna mess with, but I'm also rather new to Flash, and using a swf decompiler to actually mess with the .fla is...daunting. I just want to make a loader mod that changes a few variables around, nothing too advanced. The art-side stuff is pretty straight forward, but how would I go about pulling this off?
 

anonymous

Avid Affiliate
Joined
Feb 16, 2011
Shadow7988 said:
I'm a bit confused as to how I'm supposed to go about this. I've gotten the source code and found the values I wanna mess with, but I'm also rather new to Flash, and using a swf decompiler to actually mess with the .fla is...daunting. I just want to make a loader mod that changes a few variables around, nothing too advanced. The art-side stuff is pretty straight forward, but how would I go about pulling this off?
why are you using a swf decompiler? Just use Faceless' template and modify what you want. I believe Modguy's Loader forces all variables to be public, so you can change them via a Loader Mod.

I'm sure Moddame will comment on this eventually.
 

Shadow7988

Potential Patron
Joined
Jun 29, 2012
I'm assuming you're referring to the mod.fla up in the loader section, right? I've got it open now, but for the life of me I can't seem to figure out how to actually get to the action script for it! Darn adobe makes my head spin. Things always seemed more straight forward messing with stuff like Maya.

Edit: Nevermind, I'm an idiot and found out how to access it. Reading is fundamental, as my Mother used to say. Alright, so say I want to tell this thing to change one of the variables in the game, how would I go about doing that? Something along the lines of setmaxBreastScale:Number=1.100 ?
 

ModGuy

Content Creator
Joined
Feb 17, 2011
Find where a variable is being declared, for example class "g".
Use a loader reference to the class if it exists, "main.g" or target the class using the application domain:
Code:
main.eDOM.getDefinition("g");

This gives us the class "g" from which our target variable is accessible.
Using an object reference such as:

Code:
var g = main.eDOM.getDefinition("g");

We now have a local object through which to access the variable.
From here on out we just change values assuming that they've been made public.

Code:
g.VARIABLE = VALUE

This code hasn't been tested but should be more or less what you're after.
 

Shadow7988

Potential Patron
Joined
Jun 29, 2012
Thanks! That's pretty much what I was looking for! I'll screw around with it later today and try out some funky stuff.
 

Shadow7988

Potential Patron
Joined
Jun 29, 2012
So I'm trying to mess with the 'Her' class, but there seems to be no effect. Maybe I'm doing it wrong?

Code:
main.Her.getDefinition("Her");
	var Her = main.Her.getDefinition("Her");
	Her.maxBreastScale = 1.30;
 

Shadow7988

Potential Patron
Joined
Jun 29, 2012
Ok, I see, so the first part isn't even really necessary, right? I'm not sure what I'm messing up, though. Even if I did something redundant such as defining something that's already there, wouldn't it work anyway?
 

ModGuy

Content Creator
Joined
Feb 17, 2011
Shadow7988 said:
Ok, I see, so the first part isn't even really necessary, right? I'm not sure what I'm messing up, though. Even if I did something redundant such as defining something that's already there, wouldn't it work anyway?

Thing is you're not redefining it at all:

Code:
main.Her.getDefinition("Her");
	var Her = main.Her.getDefinition("Her");
	Her.maxBreastScale = 1.30;

For a start, the first line isn't doing anything so you should get rid of it.
Second line should replace ".Her" with ".eDOM" otherwise it will just crash.
Third line should work with those fixes.
Although you really only need the last line using "main.her.blah=value"

Even then that only increases the max scale without actually setting the current scale value so it does nothing anyway.
 

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.