SDT Loader question (7 Viewers)

ModGuy

Content Creator
Joined
Feb 17, 2011
aztlan said:
Why did the settings.txt with 5.40 drop the lines below?

allowBreathLevel=80
allowRecover=25

These were used in the loader auto mode that was removed, speaking of which we still haven't published the alternative for it.
Please forward all complaints to sby.
 

sby

Content Creator
Coder
Joined
Sep 11, 2012
BuckWild said:
MG said:
Please forward all complaints to sby.

And that's how you avoid taking the fall for your shortcomings; pin the responsibility on someone else. 8)
well, modguy wanted me to add it into animtools. thing is, i do things at my own pace and that is mostly driven by interest. since the built in autos seem to work and are varied enough for me, there isn't much motivation driving it and it keeps getting bumped behind other more interesting things ::)
 

Faceless

Content Creator
Joined
Jun 12, 2011
Got an error that I've never seen before, ModGuy.

TypeError: Error #1009: Cannot access a property or method of a null object reference.
at obj.ui::ModFilePathEntry/recheck_l()
at obj.ui::ModFilePathEntry/errorHandler_l()
at obj::LoadedModPackage/fileIOErrorHandler_l()

EDIT:
Removed, can't replicate error.
 

ModGuy

Content Creator
Joined
Feb 17, 2011
That error is firing in vanilla code, so it's not something I can identify immediately.
Also, I can't replicate the error by loading those files, there's something else in your configuration that's misbehaving.
Given that it's related to checking mod file paths it's related to vanilla mods.
 

Faceless

Content Creator
Joined
Jun 12, 2011
Hm, looks like it's that armband acting up. Oh well, the error doesn't seem to actually affect anything, so I'll just ignore it for now.
 

JosephBado

Potential Patron
Joined
Sep 2, 2013
May I make a suggestion? You should make a version for those whom have never installed SDT Loader before, and make a version that's update only. I get a little tired of having to carefully watch to see if something needs to be updated or not, for example, mods.txt, and characterfolders.txt. Would be nice, thanks ^^;
 

sby

Content Creator
Coder
Joined
Sep 11, 2012
Faceless said:
Hm, looks like it's that armband acting up. Oh well, the error doesn't seem to actually affect anything, so I'll just ignore it for now.
i think i actually saw this error, initially thought it was moreclothing breaking something xD


edit - any ideas why my bounding boxes are breaking?
 

ModGuy

Content Creator
Joined
Feb 17, 2011
Some stuff redraws every frame which might cause that issue.
Give me what I need to observe the issue and I'll work on a solution.

EDIT:

Think I've sorted it, wasn't something that was screwing up on my side, or Kona's side for that matter.
Issue is (probably) that you're adding to a bad layer.

Change:
Code:
l.addIn(mc,l.g.inGameMenu.costumeMenu);

To:
Code:
l.addIn(mc,l.g.inGameMenu.costumeMenuScroller);

EDIT2:
Even better...
Code:
l.addIn(mc,l.g.inGameMenu.costumeMenuScroller.scroller.scrollerContent);
This will allow the control to properly detect and dynamically expand Kona's scrolling area for freedom to add without tiny fonts and such.
 

sby

Content Creator
Coder
Joined
Sep 11, 2012
it seems to deal with being in proximity to something else or overlapping. cause if i move them around (x,y) i can get some to show, some to not

edit - it does seem to be that menu that is causing it though, cause if i throw it on the front layer it is all happy.
(i did try the scroll area, produced similar results)

even more edit - order of adding also seems to determoine which one might show up. pretty much just gonna say screw it and people can have no bordered buttons xD
 

Faceless

Content Creator
Joined
Jun 12, 2011
Question! How do I get the modSettingsLoader to look in the current directory instead of the ~/Settings directory? That is, the directory that a mod is loading from.

Also, what is the purpose of this line?
Code:
var loader = e.loader;					//Loader Reference.
Is this referring to the loader itself (ie, var main)?
 

sby

Content Creator
Coder
Joined
Sep 11, 2012
Faceless said:
Question! How do I get the modSettingsLoader to look in the current directory instead of the ~/Settings directory? That is, the directory that a mod is loading from.

Also, what is the purpose of this line?
Code:
var loader = e.loader;					//Loader Reference.
Is this referring to the loader itself (ie, var main)?
actually is normally supported, but is a race condition. this is the workaround i have used for a while now.

first do the initl function setting up the settings loader:
Code:
public function initl(l)
		{
			main = l;
			g = l.g;
			
			CharacterControl = main.eDOM.getDefinition("obj.CharacterControl") as Class;
			
			
			var modSettingsLoader = main.eDOM.getDefinition("Modules.modSettingsLoader") as Class;			//finds the modsettingsloader class from the loader
			var mySettingsLoader = new modSettingsLoader("allalphaslidersV4settings",onSettingsSucceed);	//creates a new settingsloader specifying the file to load and the funtion to run
			mySettingsLoader.addEventListener("settingsNotFound",onSettingsFail);						//adds an event listener in case the settings file is failed to be found/loaded

			
		}
then have both functions that cover the success and failure of the settings loading, both end with calling a finishing function:
Code:
function onSettingsSucceed(e)			
		{
			var errorCounter:int = 0;
			var dict:Dictionary = e.settings;
			
			for (var key:Object in dict)
			{
				var val:Object = dict[key];
				if ( this.hasOwnProperty( key ) )			//checks if variable exists
				{
					this[key] = Number(val);    								//replaces all switch statement variable assignments
					//main.updateStatusCol(key + " = "+ val,"#00ff00");   //replaces all switch statement updatestatus notifications, comment line to hide
					//main.monitorDebug(key+": ",this,key);
				}
				else
				{
					if(key == "")
					{
						//main.updateStatusCol("blank line found in settings","#FF0000");
					}
					else
					{
						main.updateStatusCol("invalid setting: "+key,"#FF0000");	//displays if there is a setting in the settings file that does not match any variables
						errorCounter++;
					}
				}
			}
			
			if(errorCounter > 0)
			{
				main.updateStatusCol("allaphasliders settings done loading,"+errorCounter+" errors","#ff0000");
			}
			else
			{
				//main.updateStatusCol("allaphasliders settings done loading","#00ff00");
			}
			finishinit();
		}
		
		/** function registered to run when the settings file fails to load **/
		function onSettingsFail(e)			
		{
			main.updateStatusCol(e.msg,"#FF0000");		//displays error message
			finishinit();
		}

then the finishing function sets up the rest of the init stuff that requires the loaded settings, and calls the unload mod loader function:
Code:
function finishinit()
		{
			var igm = g.inGameMenu;
			
			if(addnipplebutton == 1)
			{
				var Button:Class =  main.lDOM.getDefinition("Modules.Controls.Button") as Class;
				var cbNipple = new Button(16, 16, "\u03f8");
				cbNipple.x = 198;
				cbNipple.y = 272;
				cbNipple.setTextSize(10);
				cbNipple.addEventListener(MouseEvent.CLICK, cbNippleToggled);
				main.g.inGameMenu.costumeMenu.addChild(cbNipple);
			}
			
            g.characterControl.collarControl.registerRGBButton(igm.costumeMenu.rgbCollar, igm.underwearSwatch, 256);
            g.characterControl.collarControl.registerSecondaryRGBButton(igm.costumeMenu.rgbCollar2, igm.underwearSwatch, 256);
            g.characterControl.gagControl.registerRGBButton(igm.costumeMenu.rgbGag, igm.underwearSwatch, 256);
            g.characterControl.cuffsControl.registerRGBButton(igm.costumeMenu.rgbCuffs, igm.underwearSwatch, 256);
            g.characterControl.cuffsControl.registerSecondaryRGBButton(igm.costumeMenu.rgbCuffs2, igm.underwearSwatch, 256);
            g.characterControl.ankleCuffsControl.registerRGBButton(igm.costumeMenu.rgbAnkleCuffs, igm.underwearSwatch, 256);
            g.characterControl.ankleCuffsControl.registerSecondaryRGBButton(igm.costumeMenu.rgbAnkleCuffs2, igm.underwearSwatch, 256);
            g.characterControl.armwearControl.registerRGBButton(igm.costumeMenu.rgbArmwear, igm.underwearSwatch, 256);
            g.characterControl.bottomsControl.registerRGBButton(igm.costumeMenu.rgbBottoms, igm.underwearSwatch, 256);
            g.characterControl.bottomsControl.registerSecondaryRGBButton(igm.costumeMenu.rgbBottoms2, igm.underwearSwatch, 256);
            g.characterControl.footwearControl.registerRGBButton(igm.costumeMenu.rgbFootwear, igm.underwearSwatch, 256);
            g.characterControl.footwearControl.registerSecondaryRGBButton(igm.costumeMenu.rgbFootwear2, igm.underwearSwatch, 256);
            g.characterControl.eyewearControl.registerRGBButton(igm.costumeMenu.rgbEyewear, igm.underwearSwatch, 256);
            g.characterControl.pantiesControl.registerRGBButton(igm.costumeMenu.rgbPanties, igm.underwearSwatch, 256);
            g.characterControl.braControl.registerRGBButton(igm.costumeMenu.rgbBra, igm.underwearSwatch, 256);
            g.characterControl.tonguePiercingControl.registerRGBButton(igm.costumeMenu.rgbTonguePiercing, igm.underwearSwatch, 256);
            g.characterControl.nipplePiercingControl.registerRGBButton(igm.costumeMenu.rgbNipplePiercing, igm.underwearSwatch, 256);
            g.characterControl.bellyPiercingControl.registerRGBButton(igm.costumeMenu.rgbBellyPiercing, igm.underwearSwatch, 256);
            g.characterControl.earringControl.registerRGBButton(igm.costumeMenu.rgbEarring, igm.underwearSwatch, 256);
            g.characterControl.headwearControl.registerRGBButton(igm.costumeMenu.rgbHeadwear, igm.underwearSwatch, 256);
            g.characterControl.headwearControl.registerSecondaryRGBButton(igm.costumeMenu.rgbHeadwear2, igm.underwearSwatch, 256);
			

			
			var mb = g.him.bodies[0];
			mb.topControl.registerRGBButton(mb._bodyMenu.rgbTop, mb.hisSwatch, 489);
            mb.bottomsControl.registerRGBButton(mb._bodyMenu.rgbBottoms, mb.hisSwatch, 489);
            mb.footwearControl.registerRGBButton(mb._bodyMenu.rgbFootwear, mb.hisSwatch, 489);
			
			g.him.penisControl.registerRGBButton(g.him.characterMenu.rgbPenis, igm.underwearSwatch, 489);
			
			var fb = g.him.bodies[1];
			fb.footwearControl.registerRGBButton(fb._bodyMenu.rgbFootwear, fb.herSwatch, 489);
			
			
			var hpc = g.her._penisControl;
			hpc.penisControl.registerRGBButton(igm.costumeMenu.rgbPenis, igm.underwearSwatch, 489);
			
			
			
			if(preventtopalphashuffle == 1)
			{
			
				var lProxy:Class;
				lProxy = main.lDOM.getDefinition("Modules.lProxy");
				
				//var prox = lProxy.createProxy(g.characterControl,"setTopFill")
				//prox.addPre(setTopFill,true);
				//prox.hooked = false;
				
				var shufp = lProxy.createProxy(g.inGameMenu,"shuffle")
				shufp.addPre(shuffle,true);
				shufp.hooked = true;
				
				var shufp2 = lProxy.createProxy(g.inGameMenu,"shuffle")
				shufp.addPost(shufflep,true);
				shufp.hooked = true;
			
				g.characterControl.topControl.fillFunction = setTopFill;
			
			}
			
			main.updateStatusCol("all alpha sliders loaded","#00ff00");
			main.unloadMod();
		
		}

this code was copied from allalphasliders, and will have plenty of unnecessary info in it
 

ModGuy

Content Creator
Joined
Feb 17, 2011
MSL attempts to load from "Settings/" then from the mod directory.
It made sense to me in terms of overriding behaviour, given that you lot are the only ones using it how would you prefer it behaved?

EDIT:
Loader reference discourages having a global reference, it does in fact refer to "l", "main", etc.
 

sby

Content Creator
Coder
Joined
Sep 11, 2012
MG said:
MSL attempts to load from "Settings/" then from the mod directory.
It made sense to me in terms of overriding behaviour, given that you lot are the only ones using it how would you prefer it behaved?

EDIT:
Loader reference discourages having a global reference, it does in fact refer to "l", "main", etc.
hmm, for some reason i thought it loaded from mod directory first, and then the settings folder.
it doesn't really matter to me much cause since i make the mods, i keep all of their settings in their source folder. ...

however, i think that having it load from the mod folder first makes sense because then you could create special settings for specific character folders, and have the one in the settings folder to be the generic thing to fault back to. having it load the other way around would require you to not use the settings folder one to have customized settings for each character.
 

Faceless

Content Creator
Joined
Jun 12, 2011
What I've noticed is that local settings files only seem to be loading for Mod.swf. If I change the mod name to anything else, it will look in fail to find the local settings file.
 

sby

Content Creator
Coder
Joined
Sep 11, 2012
Faceless said:
What I've noticed is that local settings files only seem to be loading for Mod.swf. If I change the mod name to anything else, it will look in fail to find the local settings file.
var mySettingsLoader = new modSettingsLoader("allalphaslidersV4settings",onSettingsSucceed);

that should be what the mod will attempt to load as a settings file
 

Faceless

Content Creator
Joined
Jun 12, 2011
sby said:
var mySettingsLoader = new modSettingsLoader("allalphaslidersV4settings",onSettingsSucceed);

that should be what the mod will attempt to load as a settings file
Right. But it doesn't seem to be able to actually find that file if I name it anything other than Mod.swf. I've attached two test folders, where literally the only difference in the included mods is the filename. One loads the local settings file, the other doesn't. Both can load the global settings fine, though.

For reference, this is the code I'm using.
Code:
var modSettingsLoader:Class;
var main;

function settingsLoaded(e) {
    var dict:Dictionary = e.settings;

    var initKey:String = labels[0];

    if(dict["prince"] == null) {
        main.updateStatusCol("No applicable settings in settings file.", "#FF0000");
    }

    else {
        initKey = labels[dict["prince"]-1];
        main.updateStatusCol("Loading Prince with " + initKey, "#00FF00");
    }

    changePrince(initKey);
}

function noSettingsFound(e) {
    main.updateStatusCol(e.msg, "#FF0000");

    changePrince(labels[0]);
}

function initl(l) {
    main = l;

    //..stuff

    var msl = new modSettingsLoader("prince", settingsLoaded);
    msl.addEventListener("settingsNotFound", noSettingsFound);

    //...more stuff

    main.unloadMod();
}
 

sby

Content Creator
Coder
Joined
Sep 11, 2012
Faceless said:
sby said:
var mySettingsLoader = new modSettingsLoader("allalphaslidersV4settings",onSettingsSucceed);

that should be what the mod will attempt to load as a settings file
Right. But it doesn't seem to be able to actually find that file if I name it anything other than Mod.swf. I've attached two test folders, where literally the only difference in the included mods is the filename. One loads the local settings file, the other doesn't. Both can load the global settings fine, though.

For reference, this is the code I'm using.
Code:
var modSettingsLoader:Class;
var main;

function settingsLoaded(e) {
    var dict:Dictionary = e.settings;

    var initKey:String = labels[0];

    if(dict["prince"] == null) {
        main.updateStatusCol("No applicable settings in settings file.", "#FF0000");
    }

    else {
        initKey = labels[dict["prince"]-1];
        main.updateStatusCol("Loading Prince with " + initKey, "#00FF00");
    }

    changePrince(initKey);
}

function noSettingsFound(e) {
    main.updateStatusCol(e.msg, "#FF0000");

    changePrince(labels[0]);
}

function initl(l) {
    main = l;

    //..stuff

    var msl = new modSettingsLoader("prince", settingsLoaded);
    msl.addEventListener("settingsNotFound", noSettingsFound);

    //...more stuff

    main.unloadMod();
}
edit - oops, i was 1 loader version behind
anyway, this is the race condition i was mentioning earlier. if you call main.unloadmod while the settings are loading, the loader may clear your cdata character folder path before the settings loader uses the character folder's path. break the code up to do the common finishinit function that calls the unloadmod function after all the settings are loaded.
sorry if my other post was not very clear and making you run in circles


aztlan said:
Is there a allalphaslidersV4settings yet?
i need to upload it on my next batch of stuff. new thing will be a toggle nipple button because mg wanted me to release a mod that essentially did a small portion of all alpha sliders, but had that extra ability to toggle the nipple. so allalphasliders4 will have an option to turn off the nipple button
 

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.