/------------------------------------------------------------------------------------------\ | | | -KNIGHTS AND MERCHANTS- | | MISSION DESIGN DOCUMENT | | FOR THE PEASANTS REBELLION! | | | | BY REAL HOTDOG | | VERSION 0.7 | | | | INCOMPLETE! | | | | | | THIS IS AN INCOMPLETE VERSION OF THE DOCUMENT AND, | | IS NOT NEARLY AS GOOD AS THE FINAL VERSION WILL BE | | | \------------------------------------------------------------------------------------------/ /---------------------------------------------\ | ====================== | | |0. TABLE OF CONTENTS| | | ====================== | | | THIS GUIDE IS BEING MADE ABSOLUTELY | SECTION CODE | FREE OF ANY PROFIT! IF YOU PAID FOR | 1. Purpose of this guide [POFG] | THIS GUIDE ON USUAL SCAMMING PLACES | 1.1 Version history [VERH] | SUCH AS EBAY, NAG YOUR SELLER, NOW! | 2. Explanation of the commands [EXTC] | | 3. Values [VALU] | | 3.1 Ware ID-Values [WAID] | | 3.2 Unit ID-Values [UNID] | | 3.3 Building ID-Values [BLID] | | 4. Closing & Credits [CGCS] | | | \---------------------------------------------/ ============================================================================================ | 1. Purpose of this guide [POFG] | ============================================================================================ This file will describe all the commands that can be used when editing the mission files. In order to convert the mission files into readable ASCII you must calculate the file with EF using XOR (8-bit Unsigned Byte and value in Hex!). This tutorial has been made using mission1.dat file! Another purpose for this guide is also to help those who might be interested in making a mission editor for the game and make sure they don't need to do the extra job to find out what all the different strings do. Note that a text only version is currently available! A HTML version of this guide will probably be released later... ============================================================================================ | 1.1. Version history [VERH] | ============================================================================================ Version 0.7 Release Date: 21.5.2006 Changes: - Initial release ============================================================================================ | 2. Explanation of the commands [EXTC] | ============================================================================================ When you convert the files you'll probably notice that there are some strings with // in them. By using them, you can write comment/note into the script so that you can easier understand what's happening in different parts of the code. The official missions have also got a lot of comments written inside them. The strange part is that some missions have the comments written in German (not strange since creators are from Germany), but some mission also have the comments in English (maybe Adam Sprys wrote the comments in German & Andre Quaß in English?). You can also put an entire line as a comment by NOT starting it with a !. Please also note that always when scripts include coordinates the first value specifies the x coordinate and the second the y coordinate. Note that when specifing the x coordinate a higher value will mean that the object will be more to the right and a higher y value will put the objective lower on the map. Some things that are yet unknown but would be nice to know is whether there is specific order for the commands to come, or if you're allowed to put them where ever you want. If a piece of script that has been copied has a command inside pharenthesis it means that the command was not in the original script but was added Every mission file should start with the following strings: !SET_MAP "data\mission\sMaps\save01.map" !SET_MAX_PLAYER 4 The first string tells the game which terrain file to be used with the specified mission file. The second string tells how many players can be playing on the map at the same time. Make sure that every string you write starts with an ! as otherwise the game will just ignore it completely taking it as a comment. After that the following strings should come: !SET_CURR_PLAYER 0 !SET_HUMAN_PLAYER 0 !ENABLE_PLAYER 0 !CLEAR_UP 62 65 15 // klärt auf !CENTER_SCREEN 55 65 !RELEASE_HOUSE 9 (!SET_STOCK 15 16) The string !SET_CURR_PLAYER 0 tells the game which players houses, soldiers etc. you're currently scripting. All the scripts that set houses, units etc. after this string will go to the player specified by the value after !SET_CURR_PLAYER. To start scripting to another player put the same command and change the value to that of another player. !SET_HUMAN_PLAYER 0 tells the game which player the human shall control. !ENABLE_PLAYER allows you to move around your units and makes all your citizens work, so it's a neccessary string. The !CLEAR_UP command tells the game somehow (yet unkown) which areas are explored and which aren't. The !CENTER_SCREEN command tells the game from which place the view will start from when you start the mission, using coordinates. !RELESE_HOUSE tells the game to allow you to build the building even though you haven't got the required buildings to normally allow you to build it. You can put a storehouse by using the command !SET_STOCK and then putting the X and Y coordinates after the string like "!SET_STOCK 15 16" would put it into X coordinate 15 and Y coordinate 16. Now you will find these commands: !ADD_GOAL 2 0 511 1200 !ADD_GOAL 3 1 0 1 !ADD_GOAL 3 1 0 2 !ADD_GOAL 4 1 0 1 !ADD_GOAL 4 1 0 2 !ADD_GOAL 4 1 0 3 !ADD_LOST_GOAL 3 0 0 0 All the "!ADD_GOAL" strings above add a building that has to be destroyed. It is currently unknown which of the goals enable what building. It looks like (not confirmed) the first string tells which players building, the second how many of them has to be destoryed, the third is no idea, and the fourth probably which type of building. Let's continue, and face these values: !BLOCK_HOUSE 1 !BLOCK_HOUSE 2 !BLOCK_HOUSE 3 !BLOCK_HOUSE 4 !BLOCK_HOUSE 5 !BLOCK_HOUSE 10 !BLOCK_HOUSE 12 !BLOCK_HOUSE 15 !BLOCK_HOUSE 16 !BLOCK_HOUSE 17 !BLOCK_HOUSE 20 !BLOCK_HOUSE 21 !BLOCK_HOUSE 24 !BLOCK_HOUSE 25 The block house commands tells the game to not allow you to build specific buildings. The value after the !BLOCK_HOUSE part is which building that is not allowed to be built. Building values can be found within the value section of this document. Now to some more values: !SET_GROUP 15 63 54 0 3 10 // axtkämpfer !SEND_GROUP 63 47 0 (!SET_GROUP_FOOD) The above commands will create a group of soldiers and task them to walk into a specific place. The first number in !SET_GROUP is the type of unit (see Solder ID-Values for more information), the second is the X coordinate, third is Y coordinate, fourth is their facing direction, sixth is how many soldiers there should be per row, and the final one tells how many soldiers there are in the group. If you want to place a troop with full condition use the commands !SET_GROUP_FOOD. This is a "compass" telling the directions to use when creating soldier groups: 7 0 1 \|/ 6- -2 /|\ 5 4 3 By using the soldiers per row thing you can change the formation of the units. Putting a higher value to it than the total amount of soldiers could lead to unwanted results so you'd probably be better of without messing around with it. By using the !SEND_GROUP command you will be able to task a group of soldiers to move into an area that you've specified. The first number is the X coordinate and the second one is the Y coordinate. The last one will tell the game in which direction the soldiers shall be looking at when they reach their destination. The game checks which group is supposed to be start moving by looking which group has been previously made. Now it's time to get into the values that will allow you to place buildings and roads: !SET_HOUSE 21 67 67 SET_STREET 66 67 !SET_STREET 66 68 !SET_STREET 67 69 SET_STREET 67 67 !SET_STREET 67 68 !SET_STREET 66 69 !SET_STREET 66 70 !SET_STREET 67 70 !SET_HOUSE 17 67 57 !SET_HOUSE_DAMAGE 200 !SET_HOUSE 17 59 56 !SET_HOUSE_DAMAGE 70 !SET_HOUSE 11 63 70 !SET_HOUSE_DAMAGE 60 !SET_STREET 52 70 !SET_STREET 57 67 !SET_STREET 66 58 ... (Cut due to lenght) Using the command !SET_HOUSE you can put a building on the map. The first value tells the game which type of building in question, and the second will tell the X coordinate and the third the Y coordinate. The second command doesn't start with a ! so the game will ignore the line taking it as a comment. The next line !SET_STREET 66 68 now starts with a ! so it will work. The command will place a piece of road into X coordinate 66 and Y coordinate 68. The next few commands will also place roads until this part comes: !SET_HOUSE 17 67 57 !SET_HOUSE_DAMAGE 200 The first string will put HOUSE 17 (see Values section) into X coordinate 67 and Y coordinate 57. The string coming afterwards will script the house to be damaged by 200. Please make sure that always when you want to damage a building using commands, the house damage commands must be right after the command when you put the house (although it might work by putting it anywhere as long as the building you want to damage is the most recently scripted building, by order in the script). All the commands there are now explained so it's on to the next piece of script: !ADD_WARE 1 400 // Steine !ADD_WARE 2 50 // Bretter !ADD_WARE 7 700 // Truhe !ADD_WARE 8 70 // Wein !ADD_WARE 9 20 // Korn !ADD_WARE 10 50 // Brot !ADD_WEAPON 18 20 !ADD_WEAPON 24 9 These commands above add wares to your primary storehouse, "!ADD_WARE_TO_SECOND" command will add the wares to your second storehouse. "!ADD_WARE_TO_THIRD" probably adds the wares into your third storehouse, but it has not been tested. How the game checks for the first and second storehouses have not yet been tested, but it's probably determinated by the way they come in the script. The number of spaces between the ware ID and the quantity is not important as it will work with only one space. If you want to know the values for each ware check Ware ID-Numbers under the Values section. Now let's see how units are created: !SET_UNIT_BY_STOCK 9 // setze bauarbeiter !SET_UNIT_BY_STOCK 9 // setze bauarbeiter !SET_UNIT_BY_STOCK 9 // setze bauarbeiter !SET_UNIT_BY_STOCK 0 // setze einheit !SET_UNIT_BY_STOCK 0 // setze einheit !SET_UNIT_BY_STOCK 0 // setze einheit !SET_UNIT_BY_STOCK 0 // setze einheit !SET_UNIT_BY_STOCK 0 // setze einheit !SET_UNIT_BY_STOCK 0 // setze einheit !SET_UNIT_BY_STOCK 0 // setze einheit !SET_UNIT_BY_STOCK 0 // setze einheit !SET_UNIT_BY_STOCK 0 // setze einheit !SET_UNIT_BY_STOCK 0 // setze einheit !SET_UNIT 5 54 70 // setze einheit !SET_GROUP 14 55 82 7 5 20 // Mililz !SEND_GROUP 45 67 7 !SET_GROUP 14 57 81 0 5 15 // Mililz !SEND_GROUP 61 63 0 !SET_GROUP 14 76 66 7 5 15 // Mililz The first commands should be really self explaining. !SET_UNIT_BY_STOCK will put an unit by your storehouse, and the number is the unit ID. By using the command !SET_UNIT you can put one unit anywhere you want. The first number is the ID number of the unit, second is the X coordinate and the third is the Y coordinate. The !SET_GROUP commands were explained previously. Now it's time to take a look at how to script computer players, as a lot of the commands are already explained above. !SET_CURR_PLAYER 1 !ENABLE_PLAYER 1 !SET_AI_PLAYER !SET_AI_START_POSITION 20 5 !SET_AI_CHARACTER TOWN_DEFENSE 0 !SET_AI_NO_BUILD !SET_ALLIANCE 2 1 !SET_ALLIANCE 3 1 Some of those commadns are old, but a lot of them are new. Unfortunaely currently nothing is yet tested with the AI players so the document will end here. Don't loose your hope as I WILL continue writing this and try out different things with the AI. ============================================================================================ | 3. Values [VALU] | ============================================================================================ In this section you will find the values of all buildings, units, wares etc. The same ID-Numbers are used in multiple places and they seem to always be the same. ============================================================================================ | 3.1 Ware ID-Values [WAID] | ============================================================================================ ID-Numbers ---------- 0 = Tree trunk 10 = Loaves 20 = Handaxe 1 = Stone 11 = Flour 21 = Longsword 2 = Timber 12 = Leather 22 = Lance 3 = Iron ore 13 = Sausages 23 = Pike 4 = Gold ore 14 = Pig 24 = Longbow 5 = Coal 15 = Skin 25 = Crossbow 6 = Iron 16 = Wooden Shield 26 = Horse 7 = Gold 17 = Long Shield 27 = Fish 8 = Wine 18 = Leather Armor 9 = Corn 19 = Iron Armament ============================================================================================ | 3.2 Unit ID-Values [UNID] | ============================================================================================ If there's a number with two different units, it means that by using the !SET_UNIT command you will get the first unit on the list, and !SET_GROUP can be used to get the second unit on the list. !SET_UNIT can also be used to put normal soldiers. ID-Numbers ---------- UNIT GROUP 0 = Serf 0 = Nothing 1 = Woodcutter 1 = Nothing 2 = Miner 2 = Nothing 3 = Animal Breeder 3 = Nothing 4 = Farmer 4 = Nothing 5 = Carpenter 5 = Nothing 6 = Baker 6 = Nothing 7 = Butcher 7 = Nothing 8 = Fisherman 8 = Nothing 9 = Laborer 9 = Nothing 10 = Stonemason 10 = Nothing 11 = Blacksmith 11 = Nothing 12 = Metallurgist 12 = Nothing 13 = Recruit 13 = Nothing 14 = Militia 14 = Militia 15 = Axe Fighter 15 = Axe Fighter 16 = Sword Fighter 16 = Sword Fighter 17 = Bowman 17 = Bowman 18 = Crossbowman 18 = Crossbowman 19 = Lance Carrier 19 = Lance Carrier 20 = Pikeman 20 = Pikeman 21 = Scout 21 = Scout 22 = Knight 22 = Knight 23 = Barbarian 23 = Barbarian 24 = Wolf 24 = Rebel 25 = Fish 25 = Rogue 26 = Seasnake 26 = Warrior 27 = Seastar 27 = Vagabond 28 = Crab 28 = Catapult 29 = Sea flower 29 = Ballista 30 = Sea leaf 30 = Nothing 31 = Sea duck 31 = Nothing ============================================================================================ | 3.3 Building ID-Values [BLID] | ============================================================================================ ID-Numbers ---------- 0 = Sawmill 11 = Storehouse 22 = Mill 1 = Iron Smithy 12 = Stables 23 = Vehicles Workshop 2 = Weapon Smithy 13 = School House 24 = Butcher's 3 = Coal Mine 14 = Quarry 25 = Tannery 4 = Gold Mine 15 = Metallurgist's 26 = Crashes Game (Used in beta?) 5 = Iron Mine 16 = Swine farm 27 = Inn 6 = Fisherman's Hut 17 = Watch Tower 28 = Vineyard 7 = Bakery 18 = Town Hall 8 = Farm 19 = Weapons Workshop 9 = Woodcutter's 20 = Armory Workshop 10 = Armor Smithy 21 = Barracks ============================================================================================ | 4. Closing & Credits [CGCS] | ============================================================================================ Now it's time for the booring section that noone ever reads. I hope you liked this document and feel free to send suggestions and additional information to me by email, real._.hotdog.@.walla...com (remove punctations, but leave last one) Now I want to say thanks to the following people: free_sms_km Without him this guide would be nothing, he figured out how to break the encryption! Krom Offering to make an editor for the game (labeling this guide useless :P) You For reading this, after all a guide without readers is no guide? [END OF FILE]