Hair missing (1 Viewer)

prawnie16

Potential Patron
Joined
Jul 18, 2014
when loading the character folder in the loader, the hair.png flashes and then disappears leaving the default hair style.

it would seem that the character code resets this since it is set to the SD chan hairstyle and it is loaded after the png. file

Problem file includes
Code.txt
Hair.png
swf.file
mod.txt

so i dont think i am missing anything

Would love to know at way to fix this

Thanks
 

sby

Content Creator
Coder
Joined
Sep 11, 2012
hmm, could try setting this in the loader settings:

loadCodeLast=0



description is "Whether code should load last, or first. For bug testing purposes."

i always thought it was talking about actionscript code being applied before sdt code or after (per frame basis), but i am not actually sure as i had fiddled with it and didn't notice anything breaking.
 

sby

Content Creator
Coder
Joined
Sep 11, 2012
oh, i see now. you have an swf and a hair in the same folder. the loader loads the hair first, and then the swf ends up resetting the hair back to normal.


i don't think there are any ways to specify the load order. it might be possible to add some type of "LoadHairAfterMods" setting. since modguy did give me source i could look into how this could be done, depends if modguy prefers to be all-knowing of all the code that is put into the loader (and it would probably be a simple tweak).

edit, or i can just post some code and probably be alright
function loadCharString(c:String)
{
if (!loadingChar)
{
if(c.charAt(0) == "/") c = c.substring(1);
custCount = -1;
officialWait = false;
loadInt = setInterval(resetLoadingChar,3000);
loadingChar = true;
cData = c;
loadHairFile("Mods/" + cData + "/Hair.png");
hueData.load(new URLRequest("Mods/" + cData + "/HueData.txt"));
var settingsLoader2:URLLoader = new URLLoader ;
settingsLoader2.addEventListener(Event.COMPLETE,onSettings);
custMods = ["Mod.swf","Char.swf"];
settingsLoader2.addEventListener(IOErrorEvent.IO_ERROR,function(){
modTxt.load(new URLRequest("Mods/" + cData + "/Mods.txt"));});
settingsLoader2.load(new URLRequest("Mods/" + cData + "/Settings.txt"));
if (! loadCodeLast)
{
ldr.load(new URLRequest("Mods/" + cData + "/Code.txt"));
}
}
}
function loadCharString(c:String)
{
if (!loadingChar)
{
if(c.charAt(0) == "/") c = c.substring(1);
custCount = -1;
officialWait = false;
loadInt = setInterval(resetLoadingChar,3000);
loadingChar = true;
cData = c;
if(! LoadHairLater) loadHairFile("Mods/" + cData + "/Hair.png");
hueData.load(new URLRequest("Mods/" + cData + "/HueData.txt"));
var settingsLoader2:URLLoader = new URLLoader ;
settingsLoader2.addEventListener(Event.COMPLETE,onSettings);
custMods = ["Mod.swf","Char.swf"];
settingsLoader2.addEventListener(IOErrorEvent.IO_ERROR,function(){
modTxt.load(new URLRequest("Mods/" + cData + "/Mods.txt"));});
settingsLoader2.load(new URLRequest("Mods/" + cData + "/Settings.txt"));

if (! loadCodeLast)
{
ldr.load(new URLRequest("Mods/" + cData + "/Code.txt"));
}
if(LoadHairLater) loadHairFile("Mods/" + cData + "/Hair.png");
}
}

//declare 'LoadHairLater' somewhere for the settings and stuff
// i put the hair last because it makes more sense for the hair to override the code settings
//i am also not sure if these are event listener based and not necessarily sequentially finished before the next, just threw a simple idea out there
 

ModGuy

Content Creator
Joined
Feb 17, 2011
That's one option sure, but why not:

Find whatever is resetting the hair.
Proxy it blank if we successfully found a Hair.png
Enable it after successful load.
 

sby

Content Creator
Coder
Joined
Sep 11, 2012
i am thinking to cover situations where a mod also a hair element, but you wish to replace it by having a hair file in that loader folder. if it was an swf hair, that is easy because you could put it after the mod in the 'Mods.txt'

so i suppose if 'Mods.txt' supported loading hairs/backgrounds/code or whatnot, that could probably solve any load ordering that people may desire.

edit - i can see duplicate loading issues possibly arising if this was taken, and so things may require naming conventions depending on how many things you attempt to support
 

ModGuy

Content Creator
Joined
Feb 17, 2011
Code:
var lp = lProxy.createProxy(l.g.inGameMenu, "loadData");
lp.hooked = false;
lp.addPre(vanillaCodeProxy, true);
function vanillaCodeProxy(a:String, b:Boolean=true, c:Boolean=false, d=null){
	var dat:String = l.standardLines(a).join(";").split(";;").join(";");
	if(l.isHairLoaded()){
		dat = dat.split("hair:").join("BLANK:");
	}
	l.g.inGameMenu.loadData_l(dat);
}

The tweak is a much better idea really, but having to manually do this across every mod instead of just modifying vanilla behaviour is easier IMO.
Thoughts?
 

sby

Content Creator
Coder
Joined
Sep 11, 2012
i believe that will solve the issue of the 'code.txt' replacing the loaded hair (assuming that is added and then removed when doing character loading, because it would mess stuff up if left on afterward), but i don't think it will cover the situation where you load a hair.png, and then load a mod.swf that also includes a hair in it. (but the user would want to replace that one since they decided to place the hair.png in that folder in the first place)

i am thinking that the hair file being placed in the folder indicates that it should probably override any hair loaded through code.txt or any hairs loaded through swf mods


edit - also how is adding 2 lines in the loader code not easier than that?
(setting up that setting being ignored, as you could probably just move the loading of the hair down)
 

ModGuy

Content Creator
Joined
Feb 17, 2011
Tweak added.

As for my point of view, I figured the end user would be more comfortable with automation rather than setting things.
Adding in settings almost always results in people missing them so I wasn't too keen.
After implementing it however it works, while a proxy would result in more flexible behaviour I'd probably need a million flags for detection anyway so why bother.
 

sby

Content Creator
Coder
Joined
Sep 11, 2012
just make the default setting to load the hair later on, i think it makes more sense this way
 

ModGuy

Content Creator
Joined
Feb 17, 2011
Tried that out just there, while it sorts out that situation, it causes other hairs to load under what feels like a race condition, ends up becoming unreliable.
Kinda why I suggested the proxy since the loader would be in charge of load order.

I might proxy everything up in the future but who can be bothered now heh.

A different race condition.
 

sby

Content Creator
Coder
Joined
Sep 11, 2012
if that is the case, then your current loading of everything is probably event based and not guaranteed to be loaded in any order xD.

i would suggest changing the way it loads to be sequential instead. perhaps put the code.txt loading with settingsLoader2 onSettings/onfail, and then put the hair loading on ldr onloaded/blank


edit - i see you put the ishairloaded thing on ldr
 

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.