Eufloria > Eufloria Classic Mods

Level design demystification / scripting guide - XML

(1/10) > >>

Alex:
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.
* "team":
Followed by an integer number, this sets the team to which this event applies. See above (asteroid "owner") for team designations.
* "until","before","end":
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.
* "every":
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.
* "spawnseedling","spawnseedlings":
These set the event type to spawn a seedling from a random Dyson tree in the empire of the given team.[/li]
[li]Conditions
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:

* "team":
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.
* "all":
(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".
* "teams":
(Noun) Sets the article to be teams. e.g. "team 1 defeated more than 2 teams".
* "asteroid":
(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.
* "asteroids":
(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".
* "trees":
(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.
* "seedlings":
(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.

[/li]
[li]Teams
Use the "empire" tag to specify a team:

--- Code: ---  <empire team="2" grace="99000" />

--- End code ---
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]

Alex:
OK, and if you want to debug your scripting...

WARNING: READING THIS AND ACTING ON THE CONTENTS MAY COMPLETELY RUIN THE GAME EXPERIENCE FOR YOU
or enhance it - hehe

[spoiler:mlfanmmo]Press left Ctrl and D to enter developer mode.

While in debug mode:
Press D to cycle through debug information layers. The conditions should appear in the top right. Also the game will list the log of the level parsing, so maybe you can tell what went wrong if it doesn't work.[/spoiler:mlfanmmo]

[spoiler:mlfanmmo]Not had enough yet huh? Okay.
The +/- keys on the number pad will accelerate and decelerate the passage of time in the game.[/spoiler:mlfanmmo]

[spoiler:mlfanmmo]I can see you want the whole deal. Okay.

Press F2 to open the variable directory. This contains a list of variables sorted into directories. You can change stuff here and load/save them to settings files and level files. It's usually better to edit the levels by hand. Remember to back up your stuff. You can always just reinstall the game if you want to restore defaults.

Press F3 to open the graph window. This will show you various graphs for different things in the game - it's intended to give an idea of how certain elements of the game change with respect to attributes.

Press F4 to open the debug window. This lets you turn off/on visibility of different teams, and lets you spy on entities by clicking on them with the middle mouse button. You can also deactivate the camera limit and the sending limit here.

Some windows are resizable - just drag the edges like you would in other GUIs.[/spoiler:mlfanmmo]

metarinka:
thanks soooo much!

this gives me the motivation to kick out those remaining levels I've got stored away!

dbltnk:
I removed the write protection both on the game folder, the ressources folder and all files in them. There level files should be editable now. Still, both edit++ and the windows editor tell me that I can't write there. Using Vista x64. Any suggestions?

Alex:
That's really odd - and I've had other people note that Dyson crashes or has other bad behaviour on Vista owing to write permission. I've not become familiar with Vista so I don't know where it's appropriate for games to store their data. I'll look it up. Thanks for the info.

Navigation

[0] Message Index

[#] Next page

Go to full version