Dev:SDK/Core - Functions - Bit Flags

From Slavemaker Wiki
Jump to: navigation, search
<<first <prev SDK/Core - Functions - Bit Flags next> last>>


SlaveMaker 3 SDK Core Bit Flag Functions


These functions are in _root scope

Note some classes, like the Place & Person classes, have versions of these functions, generally without the number suffix

All bitflags in the game are instances of the class BitFlags (provided in Examples/Common Scripts/Classes). Simplified it is

class BitFlags {
        public function BitFlags()

        public function Load(cookieobj:Object)
        public function Save(cookieobj:Object)
        public function CheckBitFlag(flag:Number) : Boolean
        public function SetBitFlag(flag:Number)
        public function ClearBitFlag(flag:Number)
        public function CheckAndSetBitFlag(flag:Number) : Boolean
        public function ShowBitFlags(cnt:Number) : String
}

Notes:

There are 96 flags true/false flags accessible in this class. By default all flags are false

ShowBitFlags will return all flags setting in a string, eg

_root.AddText(BitFlag1.ShowBitFlags());

To save for a custom event

cookie.data.MyFlags = new BitFlags();
MyFlags.Save(cookie.data.MyFlags);

To load for a custom event

delete MyFlags;
MyFlags = new BitFlags();
MyFlags.Load(cookie.data.MyFlags);

BitFlags[edit]

There are 3 bitflags

1 - core game flags
2 - custom for slave girl use
SM - slave maker related, persists for all slave girl trainings

BitFlag 1[edit]

class instance

BitFlag1

For these flags there are the old legacy way to access like CheckBitFlag1 and the new class method BitFlag1.CheckBitFlag. The class method is more efficient as the legacy methods just call those directly, but as flash does not inline function calls this means there is additional code executed for the calls to the legacy functions.

CheckBitFlag1

test if a flag is true. There are 96 true/false flags for internal use by the game (0 to 95)

function CheckBitFlag1(flag:Number) : Boolean
OR
BitFlag1.CheckBitFlag(flag:Number) : Boolean
Standard BitFlags used by the game
0 = seen cowgirls
1 = visited farmer and allowed to see cowgirls
2 = Demon encounter 1
3 = Demon Girl encounter 2
4 = Demon DG escape witness
5 = Demon DG escape attempt
6 = First Milk Event
7 = Milk Accident
8 = Catgirl flag (toggle)
9 = used Cheat button
10 = Lesbian training
11 = decided to not do lesbian training
12 = reset = Offer Lesbian Training next Lesbian act, else offered
13 = gaining weight
14 = First visit armourer
15 = catgirl
16 = always win attacks in tentacle abduction + and can wander indefinitely
17 = Lady Farun favour owed
18 = Odd teacher agreement
19 = Fix race
20 = Searching for nymphs tear supply
22 = sleazy blowjob (male)
23 = sleazy blowjob (dickgirl)
24 = met disciple tutor
25 = Count owns farm
26 = cowgirls removed from farm
27 = start lesbian training at start of day
28 = first visit shop
29 = first visit salon
30 = first visit tailor
31 = first job at restaurant
32 = working as chef
33 = offered job as chef
34 = SlaveMaker tentacle pregnancy
35 = first visit stables
36 = advanced housework contest
37 = assisted at Prostitute Party
38 = assisted at High Class Party
39 = did other at Prostitute Party
40 = did other at High Class Party
41 = acolyte tentacle raid has happened
42 = Met Narana at High Class Party
43 = Puppygirl is guarding a dickgirl
44 = Puppygirl is guarding a female
45 = Started catgirl training
46 = demon tail
47 = giga BE
48 = offer of cat items by Lady Farun (one off per slave)
49 = bypass training with Meesh
SetBitFlag1
set the flag true
function SetBitFlag1(flag:Number)
OR
BitFlag1.SetBitFlag(flag:Number)
ClearBitFlag1
set the flag false
function ClearBitFlag1(flag:Number)
OR
BitFlag1.ClearBitFlag(flag:Number)
CheckAndSetBitFlag1
test if a flag is false. If so the flag is set and returns true, else

returns false

function CheckAndSetBitFlag1 (flag:Number) : Boolean
OR
BitFlag1.CheckAndSetBitFlag(flag:Number) : Boolean
equivallent to
if (!CheckBitFlag1(1)) {
        SetBitFlag1(1);
        ....
}

BitFlag2[edit]

No flags are defined, all are available for slave use

Class instance BitFlag2

CheckBitFlag2
test if a flag is true. There are 96 true/false flags for use by a slave

girl (0 to 95)

function CheckBitFlag2(flag:Number) : Boolean
OR
BitFlag2.CheckBitFlag(flag:Number) : Boolean
SetBitFlag2
set the flag true
function SetBitFlag2(flag:Number)
OR
BitFlag2.SetBitFlag(flag:Number)
ClearBitFlag2
set the flag false
function ClearBitFlag2(flag:Number)
OR
BitFlag2.ClearBitFlag(flag:Number)
CheckAndSetBitFlag2
test if a flag is false. If so the flag is set and returns true, else

returns false

function CheckAndSetBitFlag2 (flag:Number) : Boolean
OR
BitFlag1.CheckBitFlag(flag:Number) : Boolean

BitFlagSM[edit]

These relate to your slave maker. Please do not use any undefined flags, some flags are used internally by the game but are not documented

Class Instance BitFlagSM

CheckBitFlagSM
test if a flag is true. There are 96 true/false flags for internal use by

the game (0 to 95)

function CheckBitFlagSM(flag:Number) : Boolean
OR
BitFlagSM.CheckBitFlag(flag:Number) : Boolean
Standard BitFlags used by the game
0 = Seer visited
1 = Meigura is a dickgirl
2 = asked about Ponygirls and Epona
3 = know location of Astrid
4 = Odd Teacher supplies 'Nymph's Tears'
5 = Rumour - Nymph's Tears
6 = Rumour - Tentacles
7 = Rumour - Faerie Hunting
8 = Rumour - Furries
9 = Sold a slave
11 = Sold a slave to the Lord
12 = Know location of Item Salesman's home
13 = Know location of Dealer's home
14 = Spider Woman is a dickgirl
15 = catgirl rumour
Some tutorial related flags are omitted from the above list
SetBitFlagSM
set the flag true
function SetBitFlagSM(flag:Number)
OR
BitFlagSM.SetBitFlag(flag:Number)
ClearBitFlagSM
set the flag false
function ClearBitFlagSM(flag:Number)
OR
BitFlagSM.ClearBitFlag(flag:Number)
CheckAndSetBitFlagSM
test if a flag is false. If so the flag is set and returns true, else

returns false

function CheckAndSetBitFlagSM (flag:Number) : Boolean
OR
BitFlagSM.CheckAndSetBitFlag(flag:Number) : Boolean


<<first <prev SDK/Core - Functions - Bit Flags next> last>>