|
CustomLevels
How custom levels work
Level ConfigurationThe original game had a system where one file contained the layout of the map (*.lX) another was a base configuration for all levels in one difficulty setting (e.g. easy00.sam) and finally one file for each level (easyXX.sam). Previously only the map file was used, but starting with beta 3 parts of these configuration files are also loaded. For example starting balance, available diseases and rooms, and competitor names. Though not all values from these files are desirable a few more will be checked in the future. As of beta 5 CorsixTH uses the following system: For all maps a base configuration is loaded from base_config.lua. This is done so that there is always some value for a given variable. The campaign maps then load e.g. the FULL00.sam file, followed by FULLxx.sam. Finally, if present, an additional originalxx.level file is loaded from the levels folder. Since the demo files lack any level configuration at all CorsixTH provides some configuration with demo.level. Custom maps just load their .level file after the base_config file. Since we don't want to create things more than once the same syntax is used in the new custom level system as was used in the original. Creating Custom LevelsTo create a new custom level the easiest way to start is to copy the file [CorsixTH directory]/Levels/example.level and give it a new name retaining the file ending. That file contains some general advice to what can be done at the moment. Each line beginning with a %-sign are directives to use when loading the game, such as what the level is called and where to find the map file. Available commands:
original game will be searched, and then the Levels directory of CorsixTH.
Note: The LevelBriefing may be long, but must be on one line in the file! Every line that starts with a #-sign is a definition. After that comes that variable's name, and if it is a table its position in it, e.g. [10]. Then each consecutive .VariableName is a value name in that definition, and the numbers following these are the actual values. Example: #objects[22].StartAvail.StartStrength.AvailableForLevel 1 9 1 Ultrascan This is an object definition, namely the 22nd element in the objects table. There are three variables that define this object, StartAvail, StartStrength and AvailableForLevel. StartAvail is set to 1 (the first integer after the variables), which means that the object (and consequently the associated room) will be available from the start of the level. It will have strength 9, and it is actually available at all on this particular level. The rest of the row, in this case "Ultrascan" is ignored and can, as in this case, be a comment. Note that object 22 in the objects list is defined to be the Ultrascan, not vice versa. The following variables are used in both the original game and CorsixTH. Fieldsawards_trophiesProperties that define when the player wins trophies or awards, and how much one gets/loses. Currently only two trophies are implemented in CorsixTH, but many more will come in the future.
computerDefines all possible AI opponents.
emergency_controlThis field defines when emergencies should happen. There are two ways to do it. Either let random emergencies happen in random intervals or specify each emergency. Random emergenciesIf you just want some random emergencies now and then, write #emergency_control[0].Random 0 If a little more control is desired you can instead write #emergency_control[0].Mean.Variance X Y where X and Y are mean and variance for a normal distribution. The amount of days between two consecutive emergencies is then roughly X +- Y days.
Controlled emergenciesIf you want complete control over your emergencies this is the way to write: #emergency_control[i].StartMonth.EndMonth.Min.Max.Illness.PercWin.Bonus where i starts at 0.
Any number of such entries can be given. expertiseThis property is a table of all diseases in the game, or more exactly the ones which show up in the drug casebook in-game including diagnoses.
gbvThis is some kind of general property gatherer where many different things are defined.
objectsThis table contains all objects in the game. Have a look in base_config.lua to see which element corresponds to which object.
popnHandles the spawn rate of patients. Tells the system how many more patients should arrive a given month. The standard values for example: #popn[0].Month.Change 0 4 #popn[1].Month.Change 1 1 results in an initial spawn rate of 4 patients per month, and then one more each month, i.e. 5 in February, 6 in March. An additional row #popn[1].Month.Change 6 0 would halt the increase in June so that there would be 9 patients each month thereafter. Note that these values are global. The patients are then divided among the competing hospitals according to the market share.
roomsAll rooms are present here. Indexing starts at 7 for some strange reason. For a list of which room is which index, check out base_config.lua.
staffA table where each element is a staff category.
staff_levelsProperties which specify the behaviour of the dialog where the player can hire new staff. May contain many elements.
visuals and non-visualsTwo tables which define which diseases the hospital may come across during the level. Note the difference between these tables and the expertise table even though they both regard diseases.
win_criteria and lose_criteriaHere winning and losing conditions are defined each table element is defined to specify the following possible crieria: 1 = Total reputation 2 = Total balance 3 = Percentage of all patients your hospital has treated 4 = Percentage people that have been cured 5 = Percentage people that have been killed 6 = Hospital value
New VariablesFurthermore we are as time goes by introducing some new definitions: town
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
does the map editor work? I have looked into compiling it, but had issues trying to get the required version of wxWidgets. If it is working, would you be able to put a copy on here for downloading? thanks
Maybe support for amount of staff at start?
Do you mean pre-hired or available to hire? Either way it's unlikely, and you can just give yourself another 1000 to look for good people from the first month.
Can you update the example file with the new diseases please.
I mean available to hire. But Today I Started to mess around with LUA and i´m now able to edit a lot of things :P
The "%LevelFile?"-string is kind of weird. I just called my map "NoNameYet?", but the game couldn't find the map. So I changed it to only small letters, and then it was found.
So then I started testing out. "nonameyet" = found "Nonameyet" = found "NOnameyet" = found "NONameyet" = not found "NONameYET" = found "NoNameYet?" = not found "NoNaMeYeT" = found "NONAMEYET" = found
So just be aware of this "bug" or what I should call it, if you can't find your map. But if you just write with small letters it should always work :)
A request:
edit the wiki so it describes how to save a map properly, i made a custom map myself but have no idea on how to open it in the game.