From 14e69b6fff5171d3362c88fdaf00edf6ca4f6a13 Mon Sep 17 00:00:00 2001 From: Charles Date: Mon, 12 Apr 2010 00:52:07 +0000 Subject: [PATCH] modified leveleditor documentation moved the sandbox map into the CarFire project git-svn-id: https://bd85.net/svn/cs3505_group@61 92bb83a3-7c8f-8a45-bc97-515c4e399668 --- .../CarFire/Content/Maps/sandbox.cfmap} | 15 +++-- CarFire/leveleditor/doc/leveleditor.txt | 55 +++++++++++-------- CarFire/leveleditor/readme.txt | 2 +- 3 files changed, 43 insertions(+), 29 deletions(-) rename CarFire/{leveleditor/sandbox.ini => CarFire/CarFire/Content/Maps/sandbox.cfmap} (88%) diff --git a/CarFire/leveleditor/sandbox.ini b/CarFire/CarFire/CarFire/Content/Maps/sandbox.cfmap similarity index 88% rename from CarFire/leveleditor/sandbox.ini rename to CarFire/CarFire/CarFire/Content/Maps/sandbox.cfmap index 97c0198..f537127 100644 --- a/CarFire/leveleditor/sandbox.ini +++ b/CarFire/CarFire/CarFire/Content/Maps/sandbox.cfmap @@ -6,13 +6,13 @@ [metadata] author = Chaz McGarvey levelname = Sandbox - type = Campaign + type = Campaign dimensions = [80,21] - tileset = FuturisticBuilding - numplayers = <1-4> + tileset = FuturisticBuilding + numplayers = <1,4> [A] - entity = SaberMonster + entity = SaberMonster path = [1,1] [5,6] wait(5) [45,2] loop = true [B] @@ -22,9 +22,10 @@ ; Function ideas: ; has(entity) Player has given entity in his inventory. ; wait(seconds) Pause for some number of seconds. -; remove(entity) Remove an entity from the game. +; remove(entity) Remove entities of a certain type from the game. ; remove(coord) Remove whatever is at the given coordinates. -; create(entity, coord) Create an entity at some location +; create(entity, coord) Create an entity at some location. +; play(soundname) Play a sound. [maptable] +------------------------------------------------------------------------------+ @@ -53,3 +54,5 @@ ; [-+|] Place wall segments. ; [1-4] Identify the player starting positions. ; [A-Za-z] Place a defined game entity. + +; vi:ft=dosini diff --git a/CarFire/leveleditor/doc/leveleditor.txt b/CarFire/leveleditor/doc/leveleditor.txt index 46cfb63..377cbf9 100644 --- a/CarFire/leveleditor/doc/leveleditor.txt +++ b/CarFire/leveleditor/doc/leveleditor.txt @@ -33,10 +33,15 @@ vim directory; usually: $HOME/.vim/doc or $HOME/vimfiles/doc -You're done! To use the level editor without installing the plugin, just -|source| the plugin in vim: +Alternatively, you can use the level editor without installing the plugin, +just |source| the plugin in vim: - :source path/to/leveleditor.vim + :so /path/to/leveleditor.vim + +Or setup Vim to do it automagically with |:autocmd|; put this in your user +Vim config file: + + au BufNewFile,BufRead *.cfmap so /path/to/leveleditor.vim =========================================================================== 3. Features *leveleditor-features* @@ -68,6 +73,9 @@ A. Map File Format *leveleditor-fileformat* The format of the CarFire map file follows the de facto standard INI file format, with at least one notable exception which we'll get to shortly. +Because of that exception, a specialized loader is necessary, so map files +should carry the extension `cfmap' so as not to have them be mistook as +your everyday household variety INI file. *leveleditor-metadata* The metadata section of the file contains just that: metadata. Some of the @@ -114,27 +122,34 @@ B. Basic Syntax *leveleditor-syntax* To make parsing simple, the format of the values that make up a key-value pair follows a consistent pattern based on the type of thing being -described. Here are the things that can appear on the right side of a -key-value pair assignment: +described. Except in the case of strings, white space is ignored. Here +are the things that can appear in a map file. + + *leveleditor-keys* +Keys are special strings that appear on the left side of a key-value pair, +which combined is a key and value separated by an equals sign. Keys are +simply a sequence of alphabet characters. No white space, digits, or +punctuation is allowed in a key. *leveleditor-strings* Strings are simply a sequence of characters. If the key expects to be set to a string, then the right side of the assignment up to the line-end will be parsed as a string, including any white space. If a string value is not -necessarily expected, you can explicitly surround the string with quotes; -otherwise, the value could be interpreted as a list if it contains any -white space. +necessarily expected, you can explicitly surround the string with double +quotes; otherwise, the value could be interpreted as a list if it contains +any white space. The characters given as a string are interpreted as-is. +No escape characters are ever parsed (i.e. \t or \n). -The characters that make up the string are included in the string according -to their literal characters; no escape characters are ever parsed (i.e. \t -or \n). Any value which does not follow any of the following formats will -be read as a string. - - *leveleditor-numbers* + *leveleditor-integers* Base-ten numbers are parsed as they appear. The parser is allowed to read numbers with special characters such as -10e5. Numbers cannot be specified in any other base than ten. + *leveleditor-booleans* +Boolean values are one of two keywords: `true' and `false.' Case is +ignored when parsing booleans, but abbreviations are not allowed. For +example, `TrUe' is okay, but `T' is not. + *leveleditor-coordinates* To specify a coordinate or location on the map, surround two comma-separated integers with square brackets. For example, @@ -150,7 +165,7 @@ you go down. A range of integer values is parsed as two comma-separated integers with angular brackets. For example, - <1-4> Matches any integer between 1 and 4, inclusive. + <1,4> Matches any integer between 1 and 4, inclusive. In this way, you could set a range as the value for the key `numplayers' in the |leveleditor-metadata| section, representing the minimum and maximum @@ -159,16 +174,12 @@ number of players the map supports. *leveleditor-functions* The syntax of a function call is familiar. First comes the name of the function to be called, then an open parenthesis, followed by a -comma-separated list of arguments before a closing parenthesis. For -example, +whitespace-separated (no commas!) list of arguments before a closing +parenthesis. For example, wait(3) Delay for 3 seconds. has(F) Check if a player has an entity F in inventory. - create(B,[2,3]) Create an entity B on the map at [2,3]. - -Note, the file loader parses each group of characters between white space -separately; therefore, do not include spaces between the arguments of the -function call, only a single comma. + create(B [2,3]) Create an entity B on the map at [2,3]. *leveleditor-lists* Some keys can be assigned a list of things, such as functions to be called diff --git a/CarFire/leveleditor/readme.txt b/CarFire/leveleditor/readme.txt index e9593d4..fa3fcc3 100644 --- a/CarFire/leveleditor/readme.txt +++ b/CarFire/leveleditor/readme.txt @@ -9,5 +9,5 @@ If you are not a Vim user or don't plan on being involved in any level design, you can safely ignore all of this. Maintainer: Chaz McGarvey - Date: 9 Apri 2010 + Date: 9 Apr 2010 -- 2.43.0