Dev:SDK/Core - XML Events - Common

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


SlaveMaker 3 SDK

XML Event Parser[edit]

There is an event parser that allows events to be processed without any flash coding. These can be considered in several broad categories

Slave Initialisation and Images - see Dev:SDK/Core - XML Slaves, but first read this document for fundamental things like conditionals and file structure

Assistant Initialisation - as above see Dev:SDK/Core - XML Slaves

Pure text fields used for on screen messages and labels

Events that occur during walk events, visits, actions like chores, schools, sex acts. Also daily and morning events.

A quick note on terminology

<Events>
        <Daily>
                <FortuneTellerVisit>
                        <AttachMovie movie='ClipFortuneTelling' place='1' align='0'/>
                        <ShowPerson person='Fortune Teller' place='0' align='2'/>
                        <PersonSpeak person='Fortune Teller'>I can predict the future of #slave and do a reading for you for just 10GP.</PersonSpeak>
                        <YesNoQuestion eventno='8'>Do you want to see the future?</YesNoQuestion>
                </FortuneTellerVisit>
               
        </Daily>
</Events>
  • In the above <Event> is referred to as a node and <Daily> is a subnode of <Event> (and is a node as well). The text Events is called a tag
  • movie='ClipFortuneTelling' movie is an attribute and ClipFortuneTelling is it's value
  • the text "Do you want to see the future?" is effectively a subnode of <YesNoQuestion> but it is also referred to as element data or as a text node
  • you may optionally use ' or " at all times but you must pair them appropriately
  • You cannot use a number of characters in element data (or text nodes). Basically any xml markup like <> for instance. Instead use terms like &lt; for < and &gt; for > &apos; for '. There are more but you would seldom need them.
<!-- used in #assistantis and #assistanthas -->

this is a comment and is ignored by the parser as all comments are.

  • in most cases the parser is case insensitive, with the exception of pure text nodes. For almost all cases in the event parser you may use AttachMovie or attachmovie. Just make sure the opening and closing tags match

Any typos or mismatched tags will result in the entire XML file failing to load. To verify your changes open the xml file in your browser. It will report any errors in the file. There are also a lot of other programs to edit and validate XML.

The meta nodes like <xml> are not required here.

Lastly in general save all xml files using UTF-8

XML Files in the game[edit]

All XML files used by the game are in several locations

Language/English

This folder contains all events and pure text fields

  • Base.xml - pure text used by the game, no event code. General messages
  • SlaveMaker.xml - Slave Maker specific pure text
  • Slaves.xml - minor slaves in the game, format detailed in Core - XML Slaves.rtf

Translations are stored in folders like

Language/Russian

Twins have special files like Base (Twins).xml. These files should be exact copies of their non-twin version altered so text makes sense for a set of twins. Only the nodes that differ need to be present the the xml. All other nodes can be deleted.

Slaves[edit]

All slave specific xml is stored in files like

Slave-Aeris.xml

These files are optional.

For translation copy this file and create for Russian

Slave-Aeris-Russian.xml

and similarly for other languages. Note these are in the same folder, not a subfolder like above.

Note for translations you again do not need to repeat nodes that are not changed, like stats or other numeric nodes. These can be deleted from the translated version.

Assistants[edit]

As for slaves but instead for slave maker assistants,

Assistant-Hild.xml

Note: All xml files are logically loaded into the one xml tree and are merged at runtime. The base node in

  • <Language>

with major subnodes

  • <Gender> gender differences like he/she
  • <Statistics> slave statictics
  • <Equipment> equipment names and decriptions, and text when wearing/removing them
  • <Shopping> messages with shopping
  • <Other> miscellaneous
  • <SlaveMaker> slave maker specific messages, including advantages etc
  • <Slaves> minor slaves statistics
  • <Slave> your current slave (optional)
  • <Assistant> assistant specific messages
  • <Events> event nodes

and other lesser nodes

The system allows you to overwrite/replace standard messages in your slave/assistant xml, and thus customise messages. This is detailed in DEV:SDK/Core - XML Slaves

Pure Text Nodes[edit]

These nodes are stored in Base.xml, SlaveMaker.xml and are detailed in Dev:SDK/Guide to translating.

These contain various nodes broken into categories like <Shopping> and have nodes like

<AlreadyOwnDress>You already own this article of clothing.</AlreadyOwnDress>

Note 1) DO NOT add new nodes to these files, they are for core game use. To use text nodes for your slave add them to your slave's xml file

eg

Slave-Aeris.xml
into the <Slave> node

2) the node's tags are case sensitive. but they should NEVER be changed

Event Nodes[edit]

All events are stored in the

<Events>

node and this is stored in the file

Language/English/Events.xml

All nodes are parsed event nodes, but some will appear to be pure text like

<InhumanAncestryPray>For some reason you are uncomfortable praying with her and for no reason think of your father.</InhumanAncestryPray>

This is still a full event node but in this case it only displays text

General Structure of the Events Node

There are a series of standard events used by the core game and are explicitly used in code (see functions list below) eg

<InhumanAncestryPray>For some reason you are uncomfortable praying with her and for no reason think of your father.</InhumanAncestryPray>
        <FellSick>
                <Diary>#slave fell ill due to exhaustion</Diary>
                <AddText>#slave fell sick because of exhaustion, and #slaveheshe will need one day to rest and get better.</AddText>
                <DoEvent>9900</DoEvent>
        </FellSick>

The remaining nodes are collections of events the game will choose when certain events happen. Your custom events are added as new nodes, you may specify any name, as long as it is unique for the current node.

Categories

<EarlyMorning>
</EarlyMorning>
These are events that happen early in the morning. In the standard methods, this is equivallent to the

function PreEvent()

see Dev:SDK/Slave Girl - Events - Common
<Daily>
</Daily>
These are events that happen at the start of the day. In the standard methods, this is equivalent to the

function Events()

see Dev:SDK/Slave Girl - Events - Common
<Walk>
</Walk>
These are events that happen when you send your slave (or take them) for a walk to a city/country location using the 'Take A Walk' action.

Each location has specific subnodes

  • Forest
  • Lake
  • TownCenter
  • Slums
  • Palace
  • DocksPort
  • DocksSlavePens
  • DocksSlavePensSecure
  • Farm
  • Ruins
  • BeachSwim
  • BeachWalk
  • BeachPrivate
  • BeachRocks
  • SlaveMarket

eg

        <DocksSlavePens>
        </DocksSlavePens>
<StartDay>
</StartDay>
Happens when you leave the morning screen and start daily planning
<StartNight>
</StartNight>
Happens when you start night time planning
<Acts>
</Acts>

General usage[edit]

All events are added as nodes in one one the above nodes like <EarlyMorning>.

The general structure

<EarlyMorning>
        <nodename1 [conditional]>
                .....
        </nodename1>
        <nodename2 [conditional]>
                .....
        </nodename2>
       
        <nodenamen [conditional]>
                .....
        </nodenamen>
</EarlyMorning>

Where .... is more xml statements and nodename1..n is your chosen name. See below for valid conditionals.

The game will scan this list from the first to last and will pick an event based on the supplied conditionals. All conditional are optional and in that case the event will never happen randomly but you can still invoke it using code or xml statements (ie call it from another event) eg

        <MitotoMorning chance="10%">
                <SetText>
                        .....
                </SetText>
        </MitotoMorning>

This uses the conditional chance (a percentage chance of the event happening). If the conditionals are met then the statements of the node are executed. See below for a list of the valid statements and conditionals

For your node names make sure they are unique for it's parent node (ie in EarlyMorning). Case does not matter but you must be consistent in it's usage.

Naming[edit]

There are some special namings

<Day-xxxxxxxxxxx>
eg <Day-PedlerVisit>
Events with the Day- prefix will only happen in the daytime and will be ignored otherwise.
<Night-xxxxxxxxxxx>
eg <Night-WolfHowl>
Events with the Night- prefix will only happen in the nighttime and will be ignored in the daytime.


<<first <prev SDK/Core - XML Events - Common next> last>>