Skip to content

instantiation from xml

mistermangaker edited this page Oct 29, 2024 · 1 revision

#instantiation from xml

mission objects are very complicated to make and organize so the option to use xml files to make them instead of python code is also available

mission_from_xml(path,identifier = None)

aurguments:
path: takes in a file name from the "data" folder or an override path to the file location in the game directory
identifier: an optional arbitrary string known as an 'identifier' which is used to identify the mission if the xml file has multiple missions

usage:
Story_Mission.mission_from_xml('xmlfile.xml')
or
Story_Mission.mission_from_xml('missions/mymissionfolder/xmlfile.xml')

Story_Mission.mission_from_xml('xmlfile.xml') -> will always and only take the first mission it finds
Story_Mission.mission_from_xml('xmlfile.xml',"myid1") -> will only return the mission with the identifier "myid1"
usage in the xml file:

...

Clone this wiki locally