Dev:SDK/Slave Girl - Override Functions

From Slavemaker Wiki
Jump to: navigation, search
<<first <prev SDK/Slave Girl - Override Functions next> last>>


This is work-in-progress code for the SDK. The version found on this page has not been officially released, use at your own risk. If you need a stable version, please download the official release.

Functions a Slavegirl can Override[edit]

These functions can be defined in the Slave Girl swf file and are called by the main engine when certain actions are taken. Most of these are duplicated in _root scope and call these. To prevent infinite loops do not call say _root.HideImages() from within a local override of HideImages()

The game engine will call these functions when certain events happen.

Note in examples a line .. means there is more but I have cut it out for brevity.

_______________________________________________________________


You must implement the following functions
StartGame()

called at the start of a new game. You initialise her stats and difficulties here. You set things here for start of game only, This function is not called when a saved game is loaded.

Note: all initialisation can be done in XML if desired, see

Slaves/Slave-Ranma.xml

for an example

Initialise()

called after StartGame() or when a game is loaded - Used to initialise buttons, and other variaibles needed for both cases. For instance providing dress names etc. Also used for any changes to non-saved variables. For instance if you wish to rename your slavegirl

Note: all initialisation can be done in XML if desired, see

Slaves/Slave-Ranma.xml

for an example

eg

function Initialise() {
 
	_root.SetDressDetails(1, "Long Dress");
	_root.SetDressDetails(2, "Short Dress");
	_root.SetDressDetails(3, "Country Dress", "Refinement + 10\rSensibility + 5\rEnjoys walks more.");
	_root.SetDressDetails(4, "Kimono");
	_root.SetDressDetails(5, "Gym Clothes", "Refinement + 10\rCharisma + 10\rConstitution + 15");
	_root.SetDressDetails(6, "Mini Skirt", "Charisma + 35, Obedience + 10\rLibido + 15, Nymphomania + 15\rSensibility + 15, Joy + 15\rShe is carefree and energetic.");
	_root.SetDressCourtly(4);
	_root.SetDressEasy(5);
	_root.SetDressEasy(6);
 
	_root.NobleLoveType = 8;
	_root.Milkable = true;
}

NOTE: SetGirlsVital has moved from Initialise() to StartGame() to allow changes to be remembered

Showxxxxxxx

All functions Showxxxxxxx are called to display the image and optionally text

eg

ShowNaked() - shows the girl naked in the main screen
ShowDress() - shows the girl wearing her dress
ShowSexActFuck() - show the image of her being fucked usually for night time fuck action, but sometimes from elsewhere

See Slave Girl - Plannings - General Actions.rtf and Slave Girl - Plannings - Sex Actions.rtf for more details

HideImages()

hide slavegirl specific images, events, like contests, love confession etc
Make sure to hide any image you show in any function, except sex/day act images. Do not alter core images, they are hidden automatically

eg

function HideImages() {
	ClipContestsBeauty._visible = false;
	ClipContestsCourt._visible = false;
	ClipContestsXXX._visible = false;
	... 
}
HideSlaveActions()

hide slave actions (ie fuck, cleaning etc)
Make sure to hide all sex, day actions that are shown

eg

function HideSlaveActions() {
	BondageClip._visible = false;
	AnalClip.Anal3.gotoAndStop(1);
	AnalClip.gotoAndStop(1);
	AnalClip._visible = false;
    	FuckClip._visible = false;
	...
}
HideEndings()

Hide all ending graphics, including standard and custom endings.
see Dev:SDK/Slave Girl - Endings for more details

HideDresses()

Hide any dress images or naked images

WearDress

function WearDress()

Here you apply the effect of wearing a dress, generally by calling the PointsMod function

You may apply other effects, like increasing her Slutiness (Reisz when she wears her wolf dress or teddy) or loyalty etc

NOTE: this function is optional if you define the dress details using XML. In that case do not implement this function or you may apply the dress effects twice

eg

function WearDress() {
	if (_root.DressWorn == 1) _root.PointsMod(0, 0, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
	else if (_root.DressWorn == 2) _root.PointsMod(10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
	else if (_root.DressWorn == 3) _root.PointsMod(0, 5, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
	else if (_root.DressWorn == 4) {
		_root.Slutiness = _root.Slutiness + 1;
		_root.PointsMod(10, 10, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
	} else if (_root.DressWorn == 5) {
		_root.PointsMod(10, 0, 10, 10, 0, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10);
	} else if (_root.DressWorn == 6) {
		_root.Slutiness = _root.Slutiness + 1;
		_root.PointsMod(35, 0, 15, 0, 0, 15, 0, 0, 0, 0, 0, 0, 0, 0, 15, 0, 15, 35);
	}
}
RemoveDress

function RemoveDress()

Here you remove the effect of wearing a dress, generally by calling the PointsMod function. Generally a reverse of the effects of WearDress.

Remember to reverse any other effects

NOTE: this function is optional if you define the dress details using XML. In that case do not implement this function or you may apply the dress effects twice

eg

function RemoveDress() {
	if (_root.DressWorn == 1) _root.PointsMod(0, 0, -5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
	else if (_root.DressWorn == 2) _root.PointsMod(-10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
	else if (_root.DressWorn == 3) _root.PointsMod(0, -5, -10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
	else if (_root.DressWorn == 4) {
		_root.Slutiness = _root.Slutiness - 1;
		_root.PointsMod(-10, -10, -10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
	} else if (_root.DressWorn == 5) {
		_root.PointsMod(-10, 0, -10, -10, 0, -5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -10);
	} else if (_root.DressWorn == 6) {
		_root.Slutiness = _root.Slutiness - 1;
		_root.PointsMod(-35, 0, -15, 0, 0, -15, 0, 0, 0, 0, 0, 0, 0, 0, -15, 0, -15, -35);
	}
}
ShowNaked

function ShowNaked()

Here you show the graphic in the main window of your slave girl naked. Remember dickgirl state, and MilkInfluence if you have a larger breast version. Consider the function ChoiceNaked.

You also position items like leash, halo etc

eg

function ShowNaked() {
	if (_root.DickgirlXF > 0) NakedClip.gotoAndStop(_root.ChoiceNaked(2, 4));
	else NakedClip.gotoAndStop(_root.ChoiceNaked(3, 1));
	switch(_root.NakedChoice) {
		case 1:
			_root.PositionHalo(218, 18, 10, 100, 40);
			_root.PositionGag(2, 228, 66);
			_root.PositionLeash(1, 252, 40, 0, 70, 120);
			_root.PositionNymphsTiara(240, 18, 0, 60, 60);
			_root.PositionTail(250, 145, 0, 110, -65);
			break;
		case 2:
			_root.PositionHalo(220, 20);
			_root.PositionGag(2, 230, 78);
			_root.PositionLeash(1, 262, 30, 0, 80, 145);
			_root.PositionNymphsTiara(235, 20, 0, 60, 60);
			_root.PositionTail(180, 224, 210, 110, 65);
			break;
		case 3:
		case 5:
			_root.PositionHalo(220, 20, 20, 100, 40);
			_root.PositionGag(1, 230, 59, 0, 30, 30);
			_root.PositionLeash(1, 252, 25, 0, 70, 100);
			_root.PositionNymphsTiara(225, 20, 0, 60, 60);
			_root.PositionTail(175, 160, 0, -110, -65);
			break;
		...
	}
	NakedClip._visible = true;
}
ShowDress

function ShowDress()

Here you show the graphic in the main window of your slave girl wearing a dress. Remember dickgirl state, and MilkInfluence if you have a larger breast version

You also position items like leash, halo etc

eg

function ShowDress() {
	var dress:Number = _root.DressWorn;
	if (_root.CurrentPath == 3 && dress == 6) dress = 7;
	else if (_root.CurrentPath == 2 && dress == 6) dress = 8;
	if (dress == 0) {
		_root.PositionGag(2, 254, 67, 20, 30, 30);
		_root.PositionLeash(1, 280, 30, 0, 70, 100);
		_root.PositionNymphsTiara(250, 15, 0, 40, 40);
		_root.PositionTail(225, 210, 90, 110, 65);
		RobePlainClip._visible = true;
	} else if (dress == 1) {
		_root.PositionHalo(265, 18, 20);
		_root.PositionGag(2, 256, 96, 20, 50, 50);
		_root.PositionLeash(2, 365, 70, 25, 90, 140);
		_root.PositionNymphsTiara(265, 20, 20, 60, 60);
		_root.PositionTail(175, 240, 0, -110, -65);
		Robe1Clip.gotoAndStop(_root.MilkInfluence > 0 ? 2 : 1);
		Robe1Clip._visible = true;.
	} else
	 ...
}

_______________________________________________________________


You do not have to override any of the following, default actions will happen if you do not

StartMessage

function StartMessage() : Boolean

Show text at the start of the game

return true to disable the standard message

eg from Ranma

function StartMessage() : Boolean
{
	_root.ServantSpeak("The training of " + _root.SlaveName + " will last for " + _root.TrainingTime + " days, and then she will unfortunately be delivered to her owner.");
	return true;
}
Isxxxxxxxxx

Isxxxxxxxxx functions tell if the girl is in a particular state

eg
IsDickgirl() - a special case of dickgirl

please ignore this normally, used for some cases where she spontaneously changes to a dickgirl for the entire day

IsCatgirl() - is she a catgirl

ClearRule

- reset a rule

function ClearRule(rule:Number)

rule

0 = talk
1 = pray
2 = go out
3 = fuck
4 = touch herself
5 = write letters to family
6 = have pocket money

return false to override default action, normally to prevent a rule being changed

Note will be changed to return true to override for consistency

SetRule

- set a rule

function SetRule(rule:Number) : Boolean
rule as above.

return false to override, generally to prevent it being set

Note will be changed to return true to override for consistency


DrinkPotion

- called as she drinks a potion

function DrinkPotion(potion:Number, price:Number, say:String) : Boolean
potion
0 - Priapus Draft
1 - Uninhibitor potion
2 - Aphrodisiac
3 - Soothing Potion
4 - Energy Drink
5 - Dorei
6 - Zodai
7 - Gaman
8 - Biyaku
9 - Ishinai
10 - Lust Draft
11 - Odd Pill
12 - Nymph's Tears
13 - Jukens Orgasm Potion
price - cost of potion
say - standard message on drinking the potion

return true to prevent standard message on drinking

Most commonly here for potion == 0 display the dickgirl transformation graphic and text and return false, see SlaveGirl - Dickgirl Transformation.rtf


UpdateSlave

- called when something changes (stats, skill, training) for your slave. Can be called several times per act

function UpdateSlave()

override do special effects, for instance button changes, or some stat limitations. Usage varies a lot.


UpdateDateAndItems

- called when the game advances to a new day

function UpdateDateAndItems(NumDays:Number)
NumDays - number of days advanced

override to carryout custom processing in new day, say changing stats, but it will not change the standard effects, just use to add more effects

ShowTentacleRumour

function ShowTentacleRumour()

Called after standard text and graphics are shown for tentacle rumous. This allows you to append/replace the text or graphics. You can completely disable the event too

eg disable the rumour

function ShowTentacleRumour()
{
	_root.DoneEvent = 0;
	_root.SetText("");
	_root.HideImages();
	_root.HideBackgrounds();
}

eg add text

function ShowTentacleRumour()
{
	_root.AddText("\r\r" + _root.SlaveName + " wonders what it would feel like to be.....");
}
TempleHouseRent

function TempleHouseRent() : Boolean

Show text and graphics for when the rent for the temple house is due

return true to disable standard message, graphics and events show your own

eg To totally remove the rent

function TempleHouseRent() : Boolean
{
	return true;
}
ShowStatHint

function ShowStatHint(stat:Number) : Boolean

shows the hint for a stat (count from top of screen, 18 = special)

return true to override the default description

eg from Ranma

function ShowStatHint(stat:Number) : Boolean
{
	if (stat == 18) {
		_root.SetText("<b>Femininity:</b> How womanly or tomboyish she acts.\r\rShe is <b>");
		if (_root.VarSpecialRounded < 25) _root.AddText("a tomboy");
		else if (_root.VarSpecialRounded < 50) _root.AddText("a little unwomanly");
		else if (_root.VarSpecialRounded < 75) _root.AddText("feminine");
		else _root.AddText("a paragon of women");
		_root.AddText("</b>\nwhich is " + _root.VarSpecialRounded + " in a range of 0 to 100.");
		return true;
	}
	return false;
}
SaveGame

function SaveGame(savedata:Object)

Allows you to save any arbitrary variables for recording the state of training or any special cases. Allows you to use realistically named variables instead of the standard CustomFlag1 and so on. You should initialise the variables in StartGame()
Note the variables here should be class members or local variables. ie do not use _root

eg

var FurryState:Number;
 
function SaveGame(savedata:Object)
{
	savedata.FurryState = FurryState;
}
LoadGame

function LoadGame(savedata:Object)

Allows you to load any arbitrary variables saved in SaveGame
Note this loading takes place after Initialise() is called so you cannot use these variables there. If needed do additional initialisation here
Note the variables here should be class members or local variables. ie do not use _root

Remember a variable has a value undefined if it has not been saved before. If you are upgrading or adding this for an existing save game then also initialise the variable here

eg

function LoadGame(savedata:Object)
{
	FurryState = savedata.FurryState;
	if (FurryState == undefined) FurryState = 0;
}

________________________________________________________________


When she visits people Please see Dev:SDK/Core - People


The Slave Girl As An Assistant Please see Dev:SDK/Assistants


<<first <prev SDK/Slave Girl - Override Functions next> last>>