Dev:SDK/Core - XML Events - Conditionals & Variables

From Slavemaker Wiki
Jump to: navigation, search
<<first <prev SDK/Core - XML Events - Conditionals & Variables next> last>>


Conditionals[edit]

These are tests used in <if> nodes and events to check if something should happen

eg

<if supervise="slavemaker">
        <!-- slavemaker is supervising the act -->
        <SetText>You watch as #slave .....</SetText>
<else/>
        <!-- assistant is supervising the act -->
        <SetText>#assistant watches as #slave .....</SetText>
</if>

<Events>
        <Walk>
                <Lake>
                        <SwimmingFurry chance="5%" time="11-" furries="true">
                                <SetText>#slave sees a furry girl swimming in the lake</SetText>
                        </SwimmingFurry>
                </Lake>
        </Walk>
</Events>

By default all terms in a conditional are ANDed together, ie the conditional is true if and only if all terms are true. To OR terms together use <ifor> for if statements or the or atribute

<if time="11-" or="true" time="13+">
        <!-- before 11am or 1pm or later -->
        <SetText>.....</SetText>
</if>

Notes:

  • all attribute values MUST be enclosed in "" or '', eg

time="11+"

  • an attribute cannot be repeated so
<if time="11-" or="true" time="13+">

is invalid. In this case (a rather awkward one) you would need to use a subevent

<if time="13+"><DoEvent now="true">MyEvent</DoEventNext></if>
<if time="11-"><DoEvent now="true">MyEvent</DoEventNext></if>

Numeric Expressions[edit]

For many conditionals and statements you can specify an expression to be calculated at runtime and there are several special cases

%
<if chance="50%">
....
</if>
In all cases the % symbol is ignored. You may use it for clarity.
randomx
this is evaluated to a random number between 1 and x,

eg

<if customflag="random5">
means is _root.CustomFlag == a random number from 1 to 5
<if time="random5 + 10">
mean is the time randomly from 11:00 to 15:00
negative/positive values
use standardly
eg
<Money>-1 * charisma  + constitution + nymphomania divide 3</Money>
x + y * 5 or any expression
There are a list of standard variables (see below) that can be used in

expressions, like yous slave's statistics. Calculations can be done but are a little basic so far, partially for efficiency and partially for ease of coding.

eg
<Money>charisma * 2 + constitution + nymphomania divide 3</Money>
This uses left to right evalaution, with two special cases multiply and

divide. This is evaluated as

(((charisma * 2) + constutution) + nymphomania) / 3
Note:
<Money>charisma * 2 + constitution + nymphomania / 3</Money>
evaluates as
(((charisma * 2) + constutution) + (nymphomania / 3)
Precendence order
  • divide
  • multiply
  • +
  • -
  • *
  • /
  • where

divide

evaluates
expression / expression
eg
charisma * 2 + constitution + nymphomania divide 3
is
(charisma * 2 + constitution + nymphomania) / 3
Similarly for multiply
All other operators evaluate left to right
Note this is all a bit awkward and maybe revised later

Conditional Attributes[edit]

There are a set of standard conditional attributes that can be used and a set of standard variables available.

The standard format for a conditional is

left-expression="right-expression"

Where an expression (both left and right) can be a numeric expression calculated value based on standard variables (see below)

A left-expression can also consist of a set of high level keywords like eg

<if furries="true">

Here furries is an abstraction and represents the internal variable _root.FurriesOn. It cannot be used as an attribute or in a numeric expression.

A right-expression can be a numeric expression and for some asbstraction can have the value "true" or "false" as you see above. The values "true" and "false" may not be used in numeric expressions.

Keywords[edit]

In general these are used to check options in the game or particular state of the game. For instance, is the current night a full moon, are there dickgirls in the world etc

They may only appear as a left expression (ie may not appear as an attribute or in an expression)

In General these are used as either

<if fullmoon="true>

or

<if fullmoon="false">

or

<if elapsed="8+>

where the right is either "true", "false" or an expression. Below lists the valid values for each

chance
A percentage chance (that will be true)

eg

<if chance=50%>
   <SetText>something happens</SetText>
</if>
This means that 50% of the time the conditional will be true and it's

subnodes are processed. A value of 100+ will always be true. Note the % is optional but recommended.

supervise
This is the person who is supervising your slave, and is equivallent to

the variable _root.Supervise

Valid values:
"slavemaker" - slave maker supervision
"assistant" - assistant supervision
eg
<if supervise="slavemaker">
...
</if>
slavegender
This is the gender of your current slave. It can alse be used as a

variable, see below, but as a left-expression has a special case

Values
1,2,3,4,5,6 - standard gender values
"twins" - true for value 4,5,6
eg
<if slavegender="twins">
assistantgender
as for slavegender but for your assistant's gender
Note: your slave makers gender is always a variable below as it does not

have "twins" as an option.

lactating
Returns true if your slave is lactating (female or dickgirl slaves only)
Values "true" or "false"

eg

<if lactating="false">
     <SetText>She is not lactating</SetText>
</if>
naked
Is your slave currently naked? This is equivallent to the variable

_root.Naked or _root.DressWorn=-1

Values "true" or "false"

eg

<if naked="true">
    <SetText>The wind is cold on #slavehisher bare skin</SetText>
</if>
day
Is it daytime?
Equivallent to the variable _root.Day
Values "true" or "false"
eg
<if day="false">
     <addtext> it is nighttime</addtext>
</if>
guildmember
Are you a member of the slavemaker guild. This is equivallent to the

variable _root.GuildMember

Values "true" or "false"
furries
Are furries in the game. This is equivallent to the variable

_root.FurriesOn, and the setting in Options

Values "true" or "false"
nonhumans
Is non-human sex in the game. This is equivallent to the variable

_root.FurriesOn, and the setting in Options

Values "true" or "false"
usegeneric
Is a generic image being shown. This is equivallent to the variable

_root.UseGeneric

Values "true" or "false"
milkable
Is the current slave milkable at the farm . This is equivallent to the

variable _root.Milkable

Values "true" or "false"
badends
Are bad ends enabled in the game. This is equivallent to the variable

_root.BadEndsOn, and the setting in Options

Values "true" or "false"
incest
Are events involving inces in the game. Equivalent to _root.IncestOn
Values "true" or "false"
bdsm
Are events involving bondage/domination in the game. Equivalent to

_root.BDSMOn

Values "true" or "false"
rape
Are events involving rape in the game. Equivalent to _root.RapeOn
Values "true" or "false"
pregnancy
Are events involving pregnancy in the game. Equivalent to

_root.PregnancyOn

Values "true" or "false"
hascock
Does your slave have a cock? This is equivallent to the variable

_root.HasCock, and true if your slave is a male or dickgirl

Values "true" or "false"
isfairy
Has your slave completed transforming into a fairy. This is equivallent

to the function _root.IsFairy()

Values "true" or "false"
iscatgirl
Is your slave training as a catgirl or has completed her training? This

is equivallent to the function _root.IsCatgirl()

Values "true" or "false"
isponygirl
Is your slave a ponygirl? This is equivallent to the function

_root.IsPonygirl()

Values "true" or "false"
isdickgirl
Is your slave a dickgirl? This is equivallent to the function

_root.IsDickgirl()

Values "true" or "false"
itemowned
Does your slave have item x. See Core - Items + Dresses.rtf for item

numbers. Equivallent to IsItemAvailable(x)

Values: a number
eg
<if itemowned="1">
itemworn
Is you slave wearing item x. See Core - Items + Dresses.rtf for item

numbers. Equivallent to IsItemWorn(x)

Values: a number
eg
<if itemworn="1">
weaponowned
Do you own this weapon
Values: a number, see Core - Combat.rtf
armourowned
Do you own the peice of armour
Values: a number, see Core - Combat.rtf
displaydate
What date is it, formatted for readability, mainly for use as

#displaydate

eg
<AddText>The date is #displaydate</AddText>
time
What time of day is it (0-23.99), Equivalent to _root.GameTime
eg
<if time="12+">
displaytime
What the time of day, formatted for readability, mainly for use as

#displaytime

eg
<AddText>The time is #displaytime</AddText>
elapsed
How many days have elapsed since training started. Equivalent to

_root.Elapsed

specialevent
What special event has affected your Slave Makers past. Equivalent to

_root.SMSpecialEvent

Values as for the variable
  1. Ex-Milk Slave
  2. Tentacle Hybrid
  3. Converted by Tentacles
  4. Ex-Cowgirl
  5. Demonic Cock
  6. Inhuman Ancestry
  7. Succubus
  8. Demon
hometown
Where was your Slave Maker born, equivalient to _root.SMHomeTown
Values as for the variable
0 = Coutry Town
1 = Old Faith Stronghold
2 = Amazon Tribe
3 = Mardukane
4 = Caravan
5 = Elven Forest
6 = Dark Elven Capital
7 = True Catgirl Tribe
smadvantage
Does your Slave Maker have a particular advantage. Equivalent to

_root.SMAdvantages.CheckBitFlag(x)

Values, see Core - Variables.rtf
eg
<if smadvantage="5">
    <SetText>Being a wealthy person.....</SetText>
</if>
values
slave
Is the named person your current slave. Do not use their quilified name

like 'Cumslut Ranma' just Ranma. Equivalent to the function IsSlave

eg
<if slave="ranma">
    <SetText>You ask Ranma about the curse she had in the past. Was she
really born a boy?</SetText>
</if>
assistant
Is the named person currently your assistant Equivalent to the fucntion

IsAssistant

eg
<if assistant="naru">
    <SetText>You suggest to Naru that your slave is not enough of a
slut...</SetText>
</if>
slaveavailable
Is the named slave available for training, or is already trained.

Equivalent to the function IsSlaveAvailable

eg
<ifnot slaveavailable="tifa">
    <SetText>You see a slave bound nearby, she is named Tifa...</SetText>
</ifnot>
slaveowned
Is the named slave owned by you, or is already trained. Equivalent to the

function IsSlaveOwned

eg
<if slaveowned="tifa">
    <SetText>You ask your slave Tifa to....</SetText>
</if>
tentacleevent
True if the game decides that a tentacle event should happen, based on

the rate specified in Options and time of the month. Always returns false if tentacles are not enabled. Equivalient to Tentacles.IsTentacleEvent()

Values "true" or "false"
eg
<if tentacleevent="true">
   <SetText>#slave notices a slithering, tentacled shape...</SetText>
<else>if</else>
   <SetText>#slave hears a ghostly moan....</SetText>
</if>
dickgirlevent
Same as tentacleevent above, but for dickgirl versions of encounters
Values "true" or "false"
eg
<if tentacleevent="true">
   <SetText>The woman is a hermphrodite, and she part her dress revealing
her cock...</SetText>
<else>if</else>
   <SetText>The woman mentions her pussy is rather wet...</SetText>
</if>
fullmoon
Is today a full moon?
Values "true" or "false" or "close"
newmoon
Is today a new moon
Values "true" or "false" or "close"
lesbiantraining
Is your slave currently under going lesbian training
Values "true" or "false"
lesbian
Is the current sex act a lesbian event (ie only women participants or

dickgirls depending on an Option)

Values "true" or "false"
roomexplored
Has the current room been explored, equivalent to

HouseEvents.IsCurrentRoomExplored()

see Core - House Exploration.rtf for more details
Values "true" or "false"
dickgirls
Are dickgirls present in the current game. equivalent to

_root.DickgirlOn == 1

Values "true" or "false"
tentacles
Are tentacles present in the current game. Normally just use

tentacleevent. Equivalent to _root.TentaclesOn == 1

Values "true" or "false"
ponygirls
Are ponygirls present in the current game. Equivalent to

_root.PonygirlsOn

Values "true" or "false"
pregnancytype | pregnancytype-xxxxxxx
What is the slave pregnant with. Defaults to checking your current slave.

Check slaves or NPCs by name. Also supports 'slavemaker' and 'assistant'

Values "Tentacles" or slave developer specific
eg
<if pregnancytype="Tentacles">
eg
<if pregnancytype-ladyfarun="Tentacles">
eg
<if pregnancytype-slavemaker="Human">
eg
<if pregnancytype-Tifa="Orc">
ispregnant
Is the slave pregnant. Defaults to checking your current slave. Check

slaves or NPCs by name. Also supports 'slavemaker' and 'assistant'

Values "true" or "false"
eg
<if ipregnant="true">
eg
<if ipregnant-ladyfarun="true">
eg
<if ipregnant-slavemaker="false">
eg
<if ipregnant-Tifa="true">
slavefemale
Is your current slave female. This includes dickgirls.
Values "true" or "false"
assistantfemale
Is your current assustant female. This includes dickgirls.
Values "true" or "false"
isdickgirlchangable
DickgirlChangable
islevelup
LevelUp
isdating
(EventBoyfriend == 1)
iscourtesan
DoneCourtesan
ispluginserted
(PlugInserted > 0)
tentacleevent
Tentacles.IsTentacleEvent()
dickgirlevent
IsDickgirlEvent()
firsttimetoday
FirstTimeToday;
lastevent
(OldStrEvent.toLowerCase()
currentevent
(StrEvent.toLowerCase()
iseventallowable
IsEventAllowable()
partner
Is the named slave a partner in the current sex act, only valid for 1 on

1 sex acts.

Values "true" or "false"
eg
<if partner="Kiyone">
anypartner
Is the names slave one of the people in a multiperson sex act
Values "true" or "false"
eg
<if anypartner="Kiyone">
isdressswimsuit
IsDressSwimsuit();
isdresscourtly
IsDressCourtly();
isdressmaid
IsDressMaid();
isdresseasy
IsDressEasy();
isdresssleazybar
IsDressSleazyBar();
isdressslutty
IsDressSlutty();
isdressdancing
IsDressDancing();
isdresslingerie
IsDressLingerie();
isdresscatears
IsDressCatEars();
isdresscattail
IsDressCatTail();
isdressmiko
IsDressMiko();
isdresswaitress
IsDressWaitress();
isdressholy
IsDressHoly();
isdressdemonic
IsDressDemonic();
flagxxxxxxx
Is the particular bit flag true/false
The xxxx part is the name of the flag. Valid values
  • flag1
  • flag2
  • flagsm
  • flagdemon
  • flagfairy
  • flagppppppp, where ppppp is a person
  • flageventname where eventname is the name of a custom event. The event

must implement GetEventFlag function

eg
  • flagcount
  • flagladyfarun
Values are (note a number of alternates like miss n missn prostitute
  • rinno
  • merchant
  • sora
  • barmaid
  • missn
  • miss.n
  • prostitute
  • ladyokyanu
  • highclassprostitute
  • sumi
  • maid
  • shan
  • knightshan
  • knight
  • countgossem
  • count
  • lord
  • farun
  • ladyfarun
  • tena
  • cutelesbian
  • epona
  • mistressepona
  • ponymistress
  • irina
  • bountyhunter
  • headlibrarianlillana
  • lillana
  • librarian
  • dancer
  • alsha
  • swiminstructor
  • sleazybarowner
  • mina
  • singer
  • natsu
flagplace, where place is a location
eg
  • flagforest
Values are
  • forest
  • deepforest
  • lake
  • towncenter
  • slums
  • palace
  • docks
  • docksport
  • docksslavepens
  • docksslavepenssecure
  • farm
  • ruinedtemple
  • ruins
  • beach
  • beachswim
  • beachwalk
  • beachprivate
  • beachrocks
  • slavemarket
Values "true" or "false"
Usage then is to append the particular flag after a -
eg
flag1-5="true"
tests if flag1, bit 5 is true
or
CheckBitFlag1(5) == true
eg
<if flagcount-0="true">

Variables[edit]

note these are all case-insensitive, and listed is the core variable they correspond to. Note there are some alternate variables for some and are listed action | lastaction which means action and lastaction can be used interchangeably

<if action="1">

is the same as

<if lastaction="1">

These maybe use as left or right parts of an if or in an expression

eg

<if faith="1">
<if constitution="80-">
<if chance="intelligence">
<Money>constitution + charisma divide 2</Money>

misc[edit]

customflag
_root.CustomFlag
customflag1
_root.CustomFlag1
customflag2
_root.CustomFlag2
customflag3
_root.CustomFlag3
customflag4
_root.CustomFlag4
customflag5
_root.CustomFlag5
customflag6
_root.CustomFlag6
customflag7
_root.CustomFlag7
customflag8
_root.CustomFlag8
customflag9
_root.CustomFlag9
action | lastactiondone
_root.LastActionDone
lastnumevent
_root.OldNumEvent
currentnumevent
_root.NumEvent
currframe | currentframe
_root.currFrame
date
_root.GameDate
time
_root.GameTime
elapsed
_root.Elapsed
money
_root.VarGold + SMGold
debt
_root.SMDebt
difficulty
_root.Difficulty
walkhome
_root.TotalWalkHouse
walkcustomhome
_root.TotalWalkCustom
specialevent
_root.SMSpecialEvent
hometown
_root.SMHomeTown
rulestalk
_root.RulesTalk
rulesfuck
_root.RulesFuck
rulesgoout
_root.RulesGoOut
rulestouchherself | rulesmasturbate
_root.RulesTouchHerself
ruleswriteletters
_root.RulesWriteLetters
rulespocketmoney
_root.RulesPocketMoney
rulespray
_root.RulesPray
ending
_root.NumFin
buyer
_root.SoldSlave
score
_root.Score
pay
_root.Pay
loveaccepted
_root.LoveAccepted
weapontype
_root.WeaponType
armourtype | armortype
_root.ArmourType
fairytransformation
_root.FairyXF
tentaclepregnancy | pregnancygestation
_root.PregnancyGestation
pregnancycount
_root.PregnancyCount
fairymeeting
_root.FairyMeeting
tentaclehaunt
_root.TentacleHaunt
noblelove
_root.NobleLoveType
trainingtime
_root.TrainingTime
dressframe | nakedchoice
if your slave is naked then _root.NakedChoice
else _root.DressFrame
talentprogress
_root.TalentProgress
badgirl
_root.BadGirl
participanttotal
_root.Participants.length
loop
_root.loopvar
virginvaginal
_root.VirginVaginal
virginanal
_root.VirginAnal
virginoral
_root.VirginOral
totalmales
_root.totmales
totalfemales
_root.totfemales
totaldickgirls
_root.totdickgirls
ishinaieffecting
_root.IshinaiEffecting
doreieffecting
_root.DoreiEffecting
weapon
_root.GetWeaponName(WeaponType)
armour || armor
_root.GetArmourName(WeaponType)

stats[edit]

charisma
_root.VarCharismaRounded
sensibility
_root.VarSensibilityRounded
refinement
_root.VarRefinementRounded
intelligence
_root.VarIntelligenceRounded
morality
_root.VarMoralityRounded
constitution
_root.VarConstitutionRounded
cooking
_root.VarCookingRounded
cleaning
_root.VarCleaningRounded
conversation
_root.VarCharismaRounded
blowjob | blowjobs
_root.VarBlowJobRounded
fuck | fucking
_root.VarFuckRounded
temperament
_root.VarTemperamentRounded
nymphomania
_root.VarNymphomaniaRounded
obedience
_root.VarObedienceRounded
lust
_root.VarLibidoRounded
fatigue | tiredness
_root.VarFatigueRounded
joy
_root.VarCharismaRounded
reputation
_root.VarReputationRounded
special
_root.VarSpecialRounded
fitness
_root.FatigueBonus
slutiness
_root.Slutiness
sexuality
_root.Sexuality
bust
_root.vitalsBust
clit
_root.ClitCockSize
cock
_root.ClitCockSize
lactation
_root.Lactation
breastfixation
_root.BreastFixation
milkinfluence
_root.MilkInfluence
maxfuck
_root.MaxFuck
maxcharisma
_root.MaxCharisma
maxrefinement
_root.MaxRefinement
maxsensibility
_root.MaxSensibility
maxintelligence
_root.MaxIntelligence
maxmorality
_root.MaxMorality
maxconstitution
_root.MaxConstitution
maxcooking
_root.MaxCooking
maxcleaning
_root.MaxCleaning
maxconversation
_root.MaxConversation
maxblowJob
_root.MaxBlowJob
maxtemperament
_root.MaxTemperament
maxnymphomania
_root.MaxNymphomania
maxobedience
_root.MaxObediance
maxlibido
_root.MaxLibido
maxjoy
_root.MaxJoy;
maxspecial
_root.MaxSpecial
daysunavailable
_root.DaysUnavailable
smattack
_root.SMAttack
smdefence
_root.SMDefence
corruption
_root.Corruption
smconstitution
_root.SMConstitution
smconversation
_root.SMConversation
smreputation
_root.SMReputation
smlust
_root.SMLust
smdominiance
_root.SMDominiance
smcharisma
_root.SMCharisma
smrefinement
_root.SMRefinement
smnymphomania
_root.SMNymphomania
smtiredness
_root.SMTiredness
smdaysunavailable
_root.SMDaysUnavailable

skills[edit]

SlaveTraining
Leadership
LesbianTrainer
ExpertTrader
Alchemy
PonygirlTrainer
CatslaveTrainer
SuccubusTrainer
SlutTrainer
OrgasmDenialTrainer
Refined
Nobility
TentacleExpert
SwordSkill
WhipSkill
BowSkill
HammerSkill
NaginataSkill
DaggerSkill
CrossbowSkill
UnarmedCombat
Dancing
SingingSwimming
CourtesanTraining
PonyTraining
CatslaveTraining
SlutTraining
FairyAffinity
Seduction

special cases[edit]

eventtotal | visittotal | lendtotal
When taking a walk this represents the number of times the event has

happened, 1 for the first time. When visiting a person, or lending to a person it is the number of times the person has been visited/loaned to.

It has no meaning for other events and will return 0 then.
totalxxxxxx
When doing a training like a chore/job/sex act it is the number of times

the act has been done.

use as
<if totalmasturbate="1">
<if totalbrothel="3">
or use the act numbers, see Slave Girl - Plannings - Common.rtf
<if total9="1">
levelxxxxxx
as for total above it returns the level of mastery for a sex act. No

meaning for non-sex acts.

potionusedxxxxx
This is the number of times a potion has been used. See Slave Girl -

Override Functions.rtf, DrinkPotion function for the potion numbers

eg
<if potionused1="1">
isaccessible-xxxxxxxxxx
Is the person or place accessible (ie can be visited). See flagxxxxxxx

for the range of values

eg
        <if isaccessible-ladyfarun>
        <if isaccessible-palace>
ismet-xxxxxxxxxxx
As for isaccessible, but is the person met
deficiency
Does the slave have a deficiency in the stat (ie increases at 50% normal

rate)

Valid values are the slave stats plus the special values
sex - fuck and blowjob
slut - nymphomania and lust
eg
        <if deficiency="constitution">
naturaltalent
Does the slave have a particular talent in the stat (ie increases at 150%

normal rate)

Valid values are the slave stats plus the special values
sex - fuck and blowjob
slut - nymphomania and lust
eg
        <if naturaltalent="constitution">
var1
var2
...
varn
These are general purpose variables used for the event(s) being handled.

There is no limit to how many you may use or set. Set the statement <SetVar> below for setting.

In a conditional these return the current value of the variable
eg
<var1="3+>
</if>
eventx
For custom events you can access custom varaibles in the format

eventnamennnnn

The custom event has to implement GetVariable function for this to work
eg
<if tentacleraid1="5">

Less than or Greater than Tests[edit]

x+
<if time="13+">
...
</if>
This means is the time 13 or greater, ie time >= 13
x-
<if time="11-">
...
</if>
This means if the time less than or equal to 11, ie time <= 11

Other Modifiers[edit]

OR Tests
<if time="13+" or="true" furries="true" badends=true>
all terms after or="true" are or'd
ie
time>=13 || furries=true || badends=true
eg
<if time="13+" or="true" furries="true" or="false" badends=true>
time>=13 || furries=true && badends=true
AND Tests
<if time="13+" and="true" furries="true>
all terms after and="true" are and'd
NOT Tests
<if not="true" time="11-">
means
if !(time<=11)
or
if (time>11)


<<first <prev SDK/Core - XML Events - Conditionals & Variables next> last>>