This thread pertains to the old XML level design functionality - all still present, just completely superceded.
Here is a breakdown of the current level design abilities given to levellers
Currently supported tokens (some are overloaded and have the same function, just choose a word and stick with it):
- "after", "begin":
Followed by a number, this sets the starting time for the event. Failure to specify this results in the event being triggered as soon as the level begins. Time is measured in seconds from the start of a level.
Followed by an integer number, this sets the team to which this event applies. See above (asteroid "owner") for team designations.
Set the end time for the event. Set this to a negative number to have the event continue forever. I am unsure what happens if the number is positive but before the starting time; if it doesn't do so already, this ought to cause the event to be a one-shot event. I will fix this if it isn't the case.
Sets the frequency of the event for the duration for which it is active. The value is measured in seconds and may contain a decimal point. The event will trigger every X seconds after the start time and it will do this until the end time is reached.
These set the event type to spawn a seedling from a random Dyson tree in the empire of the given team.
These are pretty complicated already. The conditions set winning and losing conditions for the game. They are designated by the tags "win" and "lose" and have one attribute, "if", which contains a script that tells the game about the condition.
Conditions have a source team, a target team, a noun, a verb, and a comparison.
Currently supported tokens:
If we already parsed the verb, this will refer to the target team. Otherwise it refers to the source team. It must be followed by a team number, which is the same designation as the above team designations.
- "owns", "own":
(Verb) Sets the condition to be about posession. It just means "in the empire at the current time". You can set the condition to test if the team owns a certain number of trees, seedlings, or asteroids. You could set it so the player has to acquire a certain number of asteroids, trees, seedlings, or a specific asteroid (e.g. "team 1 owns asteroid 1) for instance. If you specify a number after this, the comparison is set to "exactly" by default (e.g. "team 1 owns 5 asteroids"). Otherwise, you may want to specify your own comparison or a specific entity in the game.
- "destroy", "destroys", "destroyed", "defeated":
(Verb) Destruction. This isn't fully implemented as we don't currently tally kills and destriction and asteroid takeover. Essentially this only works against teams at the moment (e.g. "team 1 defeated team 2"). You can also say "team 1 defeated 2 teams" which will count up the remaining enemy AI teams and if it's 2 less than the number that started, the condition will be satisfied.
- "create", "created", "make", "made", "plant", "planted":
(Verb) For now, this is the same as "own". Later it will be a tally of created entities.
(Comparison) Sets the comparison to be "all". The condition will test all the relevant entities. e.g. "team 1 owns all asteroids" will test all the asteroids and if the player owns them all then the condition will be satisfied.
- "more", "morethan", "more than", ">":
(Comparison) Sets the comparison to be "more than".
- "less", "lessthan", "less than", "<":
(Comparison) Sets the comparison to be "less than".
(Noun) Sets the article to be teams. e.g. "team 1 defeated more than 2 teams".
(Noun) A specific asteroid. Follow this with a number that specifies an asteroid. This is only really useful if you specified some particular asteroids in the level data. The asteroids will have identification numbers starting at 0 and going up by 1 for each asteroid encountered in the file. So the first asteroid you specify will be asteroid 0 and the next one will be asteorid 1 etc.
(Noun) A number of asteroids. Precede this with a number or "all" e.g. "team 1 owns all asteroids" or "team 2 owns 2 asteroids".
(Noun) This is a tricky one as it could refer to any or all types of tree. If you write "Dyson trees" then the game will recognise that as Dyson trees. Same for defense trees. However, if you just write "trees", and haven't written "Dyson" or "defense", then the noun will refer to either type of tree. e.g. "team 2 owns 20 trees".
- "dyson", "dysontrees":
(Noun) Refers to Dyson trees.
- "defense", "defensetrees":
(Noun) Refers to defense trees.
(Noun) Refers to seedlings. e.g. "team 2 owns more than 400 seedlings"
These are fairly intuitive to mix and match. Mostly you can just write what you feel. The game will be won if all win conditions are satisfied. The game is similarly lost if all lose conditions are satisfied. If you don't specify any conditions, the game defaults to having the player's team win if all other races are defeated and lose if no asteroids are owned.
Use the "empire" tag to specify a team:
<empire team="2" grace="99000" />
The team attribute should be self explanatory by now. The grace period refers to the period in seconds from the beginning of a level in which a team is denied the right to move seedlings around the map.[/li]