SDT Loader question (2 Viewers)

sby

Content Creator
Coder
Joined
Sep 11, 2012
hey modguy, i put together a new modtemplate that i use to handle the typical settings and initialization stuff. just wanted to run it by you first to see if you agree on how i did things:

edit - link to old template removed, current template can be found in my loader imports thread.

it has a smigit of complexity compared to the given method of doing settings, due to me trying to make it flexible and less error prone.
 

ModGuy

Content Creator
Joined
Feb 17, 2011
sby said:
hey modguy, i put together a new modtemplate that i use to handle the typical settings and initialization stuff. just wanted to run it by you first to see if you agree on how i did things

The settings loader should automatically try the mod folder and upon failing, the settings folder.
You've got it to load a file based on the file name, and then using a fixed name. I'd rather you used a fixed name instead of dynamically pulling the name as this is what's causing issues.
It works, and that's fine, but it makes more sense to cut down on the number of methods being used so that users are clear on what needs to be done.
You're currently using the "name it the same as the swf" style, why not just hardcode the name of the SWF as filename? It would give the same result.

So something like this:

Code:
import flash.utils.Dictionary;

var main;
var modSettingsLoader:Class;
var cMC:MovieClip = new MovieClip();
var setsettingsfilename = "mysettings";
var triedsetfilename = false;

var testoption:Number = 0;

function initl(l)
{
	main = l;
	var msl = new modSettingsLoader(setsettingsfilename,settingsLoaded);
	msl.addEventListener("settingsNotFound",settingsNotFound);
	cMC.addEventListener(Event.ENTER_FRAME, doCheck);
	main.registerUnloadFunction(doUnload);
	main.unloadMod();
}

function settingsLoaded(e)
{
	var dict:Dictionary = e.settings;
	for (var key:Object in dict)
	{
		var val:Object = dict[key];
		if (this.hasOwnProperty(key))
		{
			this[key] = val;
			main.updateStatusCol(key + " = "+ val,"#00ff00");
		}
		else
		{
			main.updateStatusCol("invalid setting: "+key,"#FF0000");
		}
	}
	main.traceDebug("testoption:"+testoption);
	main.monitorDebug("testoption monitored: ",this,"testoption");
}

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

function doCheck(e)
{
	testoption++;
}

function doUnload()
{
	main.clearDebug();
	cMC.removeEventListener(Event.ENTER_FRAME, doCheck);
}

EDIT:
sby said:
also, just found an amazing way to cut out those annoying switch statements:
when i have the variable the same name as the key (in most cases i do) i can assign it through this way quite easily. this will cut down so much clutter in those high-settings mods xD.

I seen your implementation of hasOwnProperty, I didn't even know that was a thing so it was pretty neat seeing it used.
I use switches for a few reasons. Sometimes I don't have a variable with the same name, and sometimes I do more than just assign the value.
If you like to work in stages (init, load, parse, process, unload) then this fits fine.
I prefer to work with things on a per-case basis, not because I want to but because it helps debug situations where input/output is unexpected. And that happens a lot.

not because I want to
Mod-Tsun

Also 5.19 is ready, put a lot of time in to fixing some bugs so hopefully I'll minimize issues.
Upload in a bit.

EDIT2:

Uploaded.
 

Faceless

Content Creator
Joined
Jun 12, 2011
ModGuy, I don't know if you're planning on doing anything else with the debug view, but here's a suggestion for it anyway. Printing status messages as mods are loaded would be nice.

For example, say Mods.txt was
Code:
a.swf
b.swf
c.swf

Then if c.swf wasn't loading properly the debug would display something like
Code:
loading a.swf 
   [debug messages] 
a.swf done
loading b.swf 
   [debug messages]
b.swf done
loading c.swf
   [debug messages]
 

ModGuy

Content Creator
Joined
Feb 17, 2011
Faceless said:
ModGuy, I don't know if you're planning on doing anything else with the debug view, but here's a suggestion for it anyway. Printing status messages as mods are loaded would be nice.

For example, say Mods.txt was
Code:
a.swf
b.swf
c.swf

Then if c.swf wasn't loading properly the debug would display something like
Code:
loading a.swf 
   [debug messages] 
a.swf done
loading b.swf 
   [debug messages]
b.swf done
loading c.swf
   [debug messages]

debugfuntimes.png


Disabled by default, requires a Settings.txt enable. Expect in next release.
 
D

Doomknight

Suggestion:

While datamining SDT.swf, I came across this:

" public static var bukkakeMode:Boolean = false; "

Would it be possible to put this into the "settings.txt" file to allow an user to turn it on by default (as the bukkake is technically invisible, and if you don't know where it is, you'll be unlikely to find it; I know where it is, but could be a nice feature)
 

ModGuy

Content Creator
Joined
Feb 17, 2011
Doomknight said:
Suggestion:

While datamining SDT.swf, I came across this:

" public static var bukkakeMode:Boolean = false; "

Would it be possible to put this into the "settings.txt" file to allow an user to turn it on by default (as the bukkake is technically invisible, and if you don't know where it is, you'll be unlikely to find it; I know where it is, but could be a nice feature)

There's a hotkey available to assign to it already. Read the guide if unsure.
I could add a setting to have it change at startup but it feels kind of pointless.


EDIT:

Was requested to have another look at the dialogue code and check if there was any possibility of implementing custom commands.
This is what I came up with:

Code:
package flash
{
	import flash.events.Event;
	import flash.display.MovieClip;

	public dynamic class Main extends MovieClip
	{
		var loader;
		var diag;
		var t:MovieClip = new MovieClip();
		public function initl(l)
		{
			loader = l;
			diag = loader.g.dialogueControl;
			l.registerUnloadFunction(removeDialogueHack);
			t.addEventListener(Event.ENTER_FRAME,processDialogue);
			addChild(t);
			l.unloadMod();
		}
		function removeDialogueHack(){
			removeChild(t);
			t.removeEventListener(Event.ENTER_FRAME,processDialogue);
		}
		function processDialogue(e)
		{
			if (diag.words)
			{
				var proceed = true;
				var delay:int = 0;
				//example command interps [INVIS] -> INVIS, add more cases for more actions
				if (diag.words[diag.sayingWord] != undefined)
				{
					switch (diag.words[diag.sayingWord].action)
					{
						case "INVIS" :
							loader.her.visible = !loader.her.visible;
							delay = 3;
							break;
						default :
							proceed = false;
							break;
					}
					if (proceed)
					{
						diag.pauseSpeakingForAction(delay);
						diag.nextWord();
					}
				}
			}
		}
	}
}

Compile using Compiler for the loader.
 

gollum

Avid Affiliate
Joined
Dec 31, 2011
ModGuy said:
EDIT:

Was requested to have another look at the dialogue code and check if there was any possibility of implementing custom commands.
This is what I came up with:

Code:
package flash
{
	import flash.events.Event;
	import flash.display.MovieClip;

	public dynamic class Main extends MovieClip
	{
		var loader;
		var diag;
		var t:MovieClip = new MovieClip();
		public function initl(l)
		{
			loader = l;
			diag = loader.g.dialogueControl;
			l.registerUnloadFunction(removeDialogueHack);
			t.addEventListener(Event.ENTER_FRAME,processDialogue);
			addChild(t);
			l.unloadMod();
		}
		function removeDialogueHack(){
			removeChild(t);
			t.removeEventListener(Event.ENTER_FRAME,processDialogue);
		}
		function processDialogue(e)
		{
			if (diag.words)
			{
				var proceed = true;
				var delay:int = 0;
				//example command interps [INVIS] -> INVIS, add more cases for more actions
				if (diag.words[diag.sayingWord] != undefined)
				{
					switch (diag.words[diag.sayingWord].action)
					{
						case "INVIS" :
							loader.her.visible = !loader.her.visible;
							delay = 3;
							break;
						default :
							proceed = false;
							break;
					}
					if (proceed)
					{
						diag.pauseSpeakingForAction(delay);
						diag.nextWord();
					}
				}
			}
		}
	}
}
this is awesome!
 

Casonig

Potential Patron
Joined
Nov 13, 2011
I downloaded the newest loader and it's impossible now to select the character code (the one generated in custom save data).

EDIT: Also, is there any way to stop her from moving when going through the options?
 

ModGuy

Content Creator
Joined
Feb 17, 2011
Casonig said:
I downloaded the newest loader and it's impossible now to select the character code (the one generated in custom save data).

EDIT: Also, is there any way to stop her from moving when going through the options?

Fix in next version, just didn't bother releasing it until I added something worthwhile.
Working on some new dev stuff now, I'll release it when I finish implementing custom counters.

EDIT2:
Released.
 

Casonig

Potential Patron
Joined
Nov 13, 2011
That's awesome, thanks.

You know what's weird? Whenever I open the loader in the folder where I always had it ("sdt") there is no girl and part of the penis is missing. If I rename the folder ("sdt1" or whatevs), or put a "sdt" folder anywhere else then the previous place where I had it, it works as always. Does this have something to do with the loader?
 

gollum

Avid Affiliate
Joined
Dec 31, 2011
Casonig said:
That's awesome, thanks.

You know what's weird? Whenever I open the loader in the folder where I always had it ("sdt") there is no girl and part of the penis is missing. If I rename the folder ("sdt1" or whatevs), or put a "sdt" folder anywhere else then the previous place where I had it, it works as always. Does this have something to do with the loader?

had that problem as well, check your %APPDATA%/roaming/macromedia/flash player/#sharedobjects/whatever/localhost/ directotry for the sdt-folder and delete it.

€edit:

modguy, is it intentional you removed showCumInMouth and showHeldBreath from the settings?
 

gollum

Avid Affiliate
Joined
Dec 31, 2011
question:

I'd like to store the addins in %OVER%, but have an addin.txt in those mod-folders that use it.
so if a mod is loaded, the addin either finds no txt (or uses the default one in %OVER%, it works without a txt, but it's on by default, have to check the code again), but also checks the loaded mod-folder for a txt to retrieve the values from (if both %OVER% and mod folder have addin.txt, modfolder wins).

is that possible and if yes, how? if no, could you pleeeeeease make it possible? :)
 

ModGuy

Content Creator
Joined
Feb 17, 2011
gollum said:
question:

I'd like to store the addins in %OVER%, but have an addin.txt in those mod-folders that use it.
so if a mod is loaded, the addin either finds no txt (or uses the default one in %OVER%, it works without a txt, but it's on by default, have to check the code again), but also checks the loaded mod-folder for a txt to retrieve the values from (if both %OVER% and mod folder have addin.txt, modfolder wins).

is that possible and if yes, how? if no, could you pleeeeeease make it possible? :)

I don't want to modify the loading algo to include any more files for now, just got things stable.
Having another text file to parse and feed in, especially with a priority system seems tedious and a bit much tbh.
Why not just write a GUI yourself and load it in?
 

gollum

Avid Affiliate
Joined
Dec 31, 2011
ModGuy said:
Why not just write a GUI yourself and load it in?

cause I have no clue how to do it... I'm not even talking gui, passing the mod-path to the addin is my problem. once I have the path in the addin, it should be a piece of cake...
 

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.