I'm working on a maze tease and would like to achieve the following functionality to make my tease extensible.
I would like to have a base tease file with the map and the normal navigation between the rooms.
Normal navigation in the example:
start -> room1 -> room2
And then use the include-functionality to script the encounters in additional xml files.
Navigation with encounter:
start (base) -> room1 (encounter) -> room1-a (encounter) -> room2 (base)
Ideally it should be possible to use the same page id (room1) in this additional file and the runtime would pick this version of the page instead of the base one. In this way the base tease file doesn't need to be changed if you want to add an additional encounter later.
I tested it and it didn't work, it just showed the base version of room1.
Is this something that can be achieved with the current version of the software, maybe by using script or so?
Thanks for your help!
If it is not possible now, maybe it's an idea to add an attribute to the page element (override, order, ...) and when searching for a page with a specific id sort by that attribute and pick the first one in the list with that id or something similar.
Main file:
Code: Select all
<?xml version="1.0" encoding="utf-8"?>
<Tease scriptVersion="v0.1">
<Title>Test</Title>
<Author>
<Name>Takenaga</Name>
</Author>
<MediaDirectory>test</MediaDirectory>
<Include file="encounters.xml" />
<Settings>
<AutoSetPageWhenSeen>false</AutoSetPageWhenSeen>
</Settings>
<Pages>
<Page id="start">
<Text>Welcome.</Text>
<Buttons>
<Button target="room1">North</Button>
</Buttons>
</Page>
<Page id="room1">
<Text>First room (general).</Text>
<Buttons>
<Button target="room2">North</Button>
</Buttons>
</Page>
<Page id="room2">
<Text>Second room (general).</Text>
<Buttons>
<Button target="room1">South</Button>
</Buttons>
</Page>
</Pages>
</Tease>
And the contents of file test/encounters.xml:
Code: Select all
<?xml version="1.0" encoding="utf-8"?>
<Tease scriptVersion="v0.1">
<Pages>
<Page id="room1">
<Text>First room (override). You see a girl bla bla...</Text>
<Buttons>
<Button target="room1-a">Edge</Button>
</Buttons>
</Page>
<Page id="room1-a">
<Text>Thank you, you may continue.</Text>
<Buttons>
<Button target="room2">North</Button>
</Buttons>
</Page>
</Pages>
</Tease>