goodnight

(more pictures on steam page)
Description:Your colony got the booze, but lacks places to snooze, fear not =)
- adds some additional beds
- all beds can be used like the vanilla beds
- needs research before you can build them, 3 research projects (medieval, industrial, spacer)
- adds 2 medieval beds, 3 industrial beds, 2 spacer beds
- beds are all double + single beds, except the prisoner (only single) and the heart shaped bed (only double)
Sub Topicyou can change the color of the medieval+ industrial beds depending on the fabric/leather you use. the prisoner bed changes color depending on the stone/wood/metal used to build. spacer beds can't be changed colorwise. pictures for different colors of the beds can be found on the steamworkshop link.
the rest effectiveness of the beds is a bit higher then vanilla with each tier (1,1 - 1,2 -1,3). that should reflect the need to research them (with the best bed in legendary quality your colonists will still need around 6hours of sleep). tried to balance out the costs a bit too. will probably need some tweaks there. the last tier of bed hast slightly increased immunity gain (1,2 compared to the 1,144 of the vanilla hospital beds). it needs glitterworld medizine to be build to balance this out.
as of alpha 16, added mass and the heal per day ticker. mass is set to 50/60/70 for medieval/industrial/spacer single beds (vanilla normal single bed is 50). the double beds have the mass 90/100/110 (vanilla royal bed has 90). the heal per day ticker is 8/9/19 for medieval/industrial/spacer, no difference in single or double beds (vanilla royal bed has 8, normal beds have 7, hospital bed has 12).
How to add other linkable buildings/furniture like the vitalsmonitor to the mod?(slightly changed with patches in main mod, but overall process stays the same. if you look in the mod files you get how the end result looks like.)
you will need some basic text altering program where you can open files, change stuff and save. the normal basic windows text edit thingy works fine. (i personally use notepad++, since you have some better structuring for xml files there. we only do minor editing here so you dont need this, but if you wanne do more rimworld xml modding i would recommend it.)
a general patchtutorial you can find
here too.
some explanation to other patchoperations is
hereWith a17 this can be done over the patchopoerations. For an example you should look into one of the patch files below in the download section. these only include the bare bones file of a patch. an about folder (information that is displayed in the modlist ingame) and the actual patchfile in the patches folder (the patchoperation,alterting/adding/removing that is done). (the preview picture is not needed. the changelog is really only sth i do for me to keep track a bit what i did, not need too.)
to add custom things you will need at least both these folders and one xml file in them. you can just copy them and alter these.
you patchmod structure would look like this:
patchmodName/
About/About.xml
Patches/FileNameOfYourChoice.xml
the patchmodName folder with all the other stuff in that would be put into the rimworld/mods folder of your game at the end.
so the main question here is now, what goes into the patches xml file. since that is was determines what the patch actually does. for that you can look in one of the goodnight patches. it would look something linke this:
<?xml version="1.0" encoding="utf-8" ?>
<Patch>
<!--================================ patches for mod sd medicaddons ======================================-->
<!--========================= adding facilities =============================-->
<Operation Class="PatchOperationAdd">
<xpath>*/ThingDef[defName = "sd_basebed"]/comps/li[1]/linkableFacilities</xpath>
<value>
<li>sd_medicaddons_medieval_surg_washpan</li>
<li>sd_medicaddons_medieval_surg_instruments</li>
<li>sd_medicaddons_medieval_surg_lamp</li>
<li>sd_medicaddons_industrial_surg_instruments</li>
<li>sd_medicaddons_industrial_surg_lamp</li>
<li>sd_medicaddons_spacer_surg_vitalsmonitor</li>
<li>sd_medicaddons_spacer_surg_instruments</li>
<li>sd_medicaddons_spacer_surg_lamp</li>
</value>
</Operation>
</Patch>
first off all things inside a <!-- and --> are just comments not "read" by the game when the file is loaded. they are just to have some better structure, add notes etc. so these we will not talk about and are not needed.
the actual file starts with:
<?xml version="1.0" encoding="utf-8" ?>
<Patch>
and ends with
</Patch>
to use the patch operations this is the base structure we need for the patch where all other stuff gets included in no matter how big the patch is.
the main thing to notice in all xml files is that things are opened and closed. so the patch tag has an opening tag and a close tag. this is true for almost all xml tags you use. it simply tells the game the information we input to a certain property. when it start and where this ends.
we could think of xml modding in general as using "linkpoints"(xml tags + the input/information in them) that the preset structure (code base of the game) is given to use. so we can not use whatever we want here. what xml tags work and what information we can put in them is limited by the game. so keep that in mind.
now to using the actual patchoperation we have the operation tag. inside this we have the class. for our case since we want to add other linkable facilities it is the add version we need. so we would have this at the moment:
<Operation Class="PatchOperationAdd">
</Operation>
next comes the xpath, which tells the game what item to alter and where this need to be done:
<xpath>*/ThingDef[defName = "sd_basebed"]/comps/li[1]/linkableFacilities</xpath>
for the goodnight mod i have basicly a preset object named sd_basebed. this has some base properties and all other beds use this as a preset. so changing things there automaticlly affect all other beds. it makes things a bit simpler. to add your linkable thing to goodnight just copy that part.
if you wanted add things to your custom item you would need the defining name of the item you want to affect (defName) or the abstract it uses if the propertie you want to change is in the abstract. the xpath for an abstract would look a bit different like for example like:
[@Name = "CTSAdvHospitalBedBase"]
(check CTS patch for medicaddons or more furniture)
some problem with xpath is explained
here if you are looking to change your custom items/things. you would too have to specify for you custom xpath where changes excatly should be made. a bit mroe for that in the next section.
so moving on since the game knows now what patch operation and what object to change. the next part is the value section and the end of the xpath where we specify basiclly the excat position the patchoperation work on. for that we have to look a bit in the value section too, since the thing we change and how this is found in the xml content we want to change is important on how the value section looks like. the value tells the actuall content that is handled. so for our adding patch operation this is the meat. the stuff that is actually added to you object ingame. since we want to add other linkable things to your bed we have to check first how the linkable section on the actual object looks like to know how the value section has to look and the xpath end telling the patch where to work. for the goodnight beds and other base beds this would look like this:
<comps>
<li Class="CompProperties_AffectedByFacilities">
<linkableFacilities>
<li>VitalsMonitor</li> <!-- vanilla vitals monitor -->
</linkableFacilities>
</li>
....
</comps>
for goodnight you can find this in: sd_goodnight/Defs/sd_goodnight_beds__ThingDefs_a_base.xml
for the base game these would be in Rimworld/mods/core/defs/thingdefs_buildings/Buildings_Furniture.xml
just search linkable and you will find the section in the files.
so for goodnight the actual stuff that matters is:
<ThingDef Name="SDGoodnightBedBase" ParentName="SDBuildingBase" Abstract="True">
<defName>sd_basebed</defName>
...
<comps>
<li Class="CompProperties_AffectedByFacilities">
<linkableFacilities>
<li>VitalsMonitor</li> <!-- vanilla vitals monitor -->
</linkableFacilities>
</li>
...
</comps>
...
</ThingDef>
the xpath he have on the goodnight patch as reference:
<xpath>*/ThingDef[defName = "sd_basebed"]/comps/li[1]/linkableFacilities</xpath>
when we look at this we see we have the ThingDef since the object is a thingdef, basiclly a thing that is defined. it has a defining name (defname) we use. then we go deeper in the section and inside the thingdef section of that object we go into the cmps section. so we have /comps. the comps section itself is a list of multiple things in our case. so the compproperties_affectedbyfacilities we want to get into is the first point of the list so the next xpath thing is /li[1]. the li for list the [1] for the 1st place in the comp section list. so now we go deeper in the path and have the xml tag linkablefacilites. so next xpath is /linkableFacilites. these are itself a list. but we want to add to the list of the linkablefacilites. so the xpath in our case stops here. since the linkablefacilites are a list. here we see all things have the li tag in front+back. so if the patchoperation would add things we would have to write this tag too. so this determines the value section in your patch operation. since the linkablefacilites are a list. the things we add are list parts and have to look as such. thats the reason the value section of the patch looks the way it does. where/what we want to add determines how the patch file looks like. so at the end the whole patch xml file looks like this:
<?xml version="1.0" encoding="utf-8" ?>
<Patch>
<Operation Class="PatchOperationAdd">
<xpath>*/ThingDef[defName = "sd_basebed"]/comps/li[1]/linkableFacilities</xpath>
<value>
<li>sd_medicaddons_medieval_surg_washpan</li>
<li>sd_medicaddons_medieval_surg_instruments</li>
<li>sd_medicaddons_medieval_surg_lamp</li>
<li>sd_medicaddons_industrial_surg_instruments</li>
<li>sd_medicaddons_industrial_surg_lamp</li>
<li>sd_medicaddons_spacer_surg_vitalsmonitor</li>
<li>sd_medicaddons_spacer_surg_instruments</li>
<li>sd_medicaddons_spacer_surg_lamp</li>
</value>
</Operation>
</Patch>
(to note here the xpath defname bracket section could be [@Name = "SDGoodnightBedBase"], since the thing we use is an abstract too. i did not know you could alter abstracts too at the time i wrote the goodnight patch, thats why the defname workaround. using the abstract version works the same. it does not change anything on the patch.)
so the last thing would be how do we know what comes in the value section. in our case we have for example sd_medicaddons_medieval_surg_washpan. how we know its not like medicaddons_washpan. we covered the sturcture it has to be with the list character,but not where the item names come from. in case of linkablefacilites that are the defnames of the objects. in case of other properties it varys what the possible input for the xml tag we alter is.
for linkable facilites the defnames can be found in the sd_medicaddons/Defs/ThingDefs/ and then the medieval, industrial, spacer xml files. the base is jsut abstract, but in that case we need the actual defining names of the objects. the names given in the defname xml tag section of the objects in the xml files.
for any other mod it depends on the file structure the mod author uses. but it should be in most cases something like: modname/Defs/ThingDefs or ThingDef_Buildings. then you have to manually check the xml files for the object you are looking for. if know the ingame name of the item,search for that in the xml files. it is determined by the label xml tag. but please keep in mind to use the patchoperation you will need the defname not the label. both can be the same, but they can be different. so make sure to check the xml files of the mod. once you got the defname the patch xml file to add your linkable stuff to goodnight beds would look liek this:
<?xml version="1.0" encoding="utf-8" ?>
<Patch>
<Operation Class="PatchOperationAdd">
<xpath>*/ThingDef[defName = "sd_basebed"]/comps/li[1]/linkableFacilities</xpath>
<value>
<li>defnameOfTheLinkableThing</li>
</value>
</Operation>
</Patch>
AuthorThx to the author of PatchOperationFindmod code (not sure who came up with this), using the one from
cuproPanda alloyssulusdacor
DownloadSteamworkshop: http://steamcommunity.com/sharedfiles/filedetails/?id=763943290Dropbox: https://www.dropbox.com/s/wve0kqx7flx4idp/sd_goodnight_v1.7z?dl=0GitHub: https://github.com/sulusdacor/sd_goodnight/releasessource code for modders:
https://www.dropbox.com/s/vudx6549j5ijxu3/sd_goodnight_v1_source.7z?dl=0Version for previous Rimworld versions can be found in my dropbox folder with older mods:
https://www.dropbox.com/sh/zicyfuehl0aeta2/AADHVYYYU8yhJ2yUWttwnf1ma?dl=0Compatibility Patchesthe main mod version now includes the patches over patchoperations and mod load checker. So you don't need these anymore as extra mods. Let me know if want some compatibility added with specific mods.
so far it includes:
CTS = makes the adv vitals monitor that comes with CTS linkable
[sd]medicaddons = makes all beds form goodnight linkable with the medic stuff in the addons mod
More Furniture = makes beds form goodnight link with linkable stuff from furniture, like endtable, dresser etc.
How to install:- Unzip the contents and place them in your RimWorld/Mods folder.
- Activate the mod in the mod menu in the game.
Changelogpersonal changelog for mod "sd_goodnight"
- 20/09/2016 (date)
- updatet ludeon forum link in about file
- made beds tradeable, furniture category (exotic goods)
- all beds are now in seperate category (sd_beds)
- 14/10/2016
- added abstract def building to thingdef, added section marker in xml
- 22/10/2016
- added facilites defs for medieval+industrial+space tech level in abstrract def to activate
- changed abstract base in beds to include linked stuff for easier changing stuff
- 09/11/2016
- added single beds to all medieval and industrial (not heart bed so far)
- lowered costs for all beds
- added new textures for all medieval and industrial beds (not heart bed so far)
- changed def names + texture folder structure to better identify single+double beds
- 14/11/2016
- added multi texture for cryo double bed + cryo single bed
- moved most xml lines into abstract for beds
- looked over hp values (medieval 200, industrial 250, space 300), single beds -50hp
- 15/11/2016
- added first draft multi texture for space double bed + single bed
- 17/11/2016
- added new texture for space double + single bed
- 18/11/2016
- cleaned up texture for space single bed side
- added texture multi for heartshaped bed double
- added vanilla designator uninstall in bed category
- added stuff to the space+cryo bed class (half the steel can be metallic stuff)
- 22/12/2016
- updated to a16, added mass
- moved hammock to industrial for eventual future additions of more medieval looking hammock and a futuristic one
- removed tags in research (means starting at any the techlevel, you will have to reseach the beds)
- split thingdef xml in various for better overview, added letter for order in designation category
- changed some def names, texture folder structure, texture names, filestructure to allow better overview + potential updates in future
- various def names, texture names from space to spacer
- research def names from bed to beds
- healticker is 8,9,10 for medieval,industrial,spacer (vanilla royal has 8, hospital 12)
- mass is 50,60,70 for singles and 90,100,110 for double beds (50 and 90 is vanilla value for normal single bed and royal bed)
- renamed space to spacer in medicaddons defnames additon comment in base xml
- 25/12/2016
- updated defnames of more furn mod in comment section of base xml
- 06/01/2017
- updated the worktobuild xml tag, used old worktomake one,resulted in instant building
- 30/05/2016
- update to a17
- added roomidentifier for beds, cleaned up the xml (removed some notations since new patch options allow smother compatibility patches)
- adjusted heal per day to 3 (value of all other beds in vanilla game) for medieval, 5 industrial, 7 spacer (vanilla hospital has 9)
- 29/12/2017
- update to b18
- fixed roots to <Defs>
- added research tab
- fixed case sensitive xml tags
- fixed wrong heal per day for medieval bed to basic 3
- added new linkable endtable+dresser
- spacer beds replaced component cost with advanced components: (slight wealth/cost incr)
single: 3 comp to 1 adv
double: 5 comp to 2 adv
- 06/01/2017
- added modloadedchecker to include patches in main mod
- added compatibility patches over pacthoptions, so far for medicaddons and more furniture
(patching both sides or additional xml seems to cause non errors)
-> makes load order not matter form what i tested
- so far supports: CTS, medicaddons, more furniture
- 15/01/2018
- added modsync file
- 25/10/2018
- rimworld 1.0 update
- assemblies update
- xml fixes/updates
- textures renamed for new multi endings (north,south,east)
- more furniture mod name updated for patches
- added basic constr skill requirements (4,8,12 for medieval,industr, spacer)
- 03/11/2018
- added spanish and spanislatin by canaleta
- german by sulusdacor