Project Hospital
Would you like to react to this message? Create an account in a few clicks or log in to continue.

Go down
igor.oxymoron
igor.oxymoron
developer
Posts : 347
Reputation : 25
Join date : 2018-03-23
Location : Czech republic

Modding tutorial - Database - Department creation Empty Modding tutorial - Database - Department creation

Wed Oct 23, 2019 2:25 pm
While it's possible to add new diagnoses to existing departments, since Halloween patch 2019 the game supports addition of whole specialized departments similar to General Surgery, Internal Medicine, Orthopaedy, Cardiology or Neurology in the base game.

First, make sure you've read the tutorial how to create new mods: https://projecthospital.forumotion.com/t1750-modding-tutorial-creating-new-mods

1. DEFINING A DEPARTMENT

Each department consist of a clinic and a part for hospitalization.

XML files belong under the Database folder under your mod's folder in \\Assets\StreamingAssets\Addons\ModName\Database\

ID - DPT_... must be unique

<LockedByDefault> - needs to be set to false
<HospitalizationLockedByDefault> - needs to be set to false

<MinDoctorLevel> - by default it should be set to "2" - represents the minimum level of doctor, that could be hired, as every doctor at any specialized department needs first specialization that is relevant to its department.

<PatientGenerationWeight> - one tricky parameter - could be set to 1 - 100; if it is set to 100 (only Emergency nad New department are present) => 1/2 of all patients is generated at Emergency and 1/2 is generated at New department  . If parameter is set to 50 => 2/3 patients generated at Emergency and 1/3 is generated at New department.
We recommend to set this to 50.]




2. CREATING SPECIALIZATIONS

Every specialized department needs its own specialization (example: General Surgery dpt - skill General Surgery) that's used in the unique examinations and treatments.
You need to create 2 new specializations - 1 for every doctor and 1 for surgeons only.

Here you will find all existing skills and specializations:
\\Assets\StreamingAssets\Database\Skills.xml

Create another file that will be saved in format of .xml files in \\Assets\StreamingAssets\Addons\ModName\Database\ModSkills.xml

ID - SKILL_DOC_SPEC_ ....  - must be unique
<AbbreviationLocID> - actually localization ID for the detailed description
<ParentSkill>SKILL_DOC_QUALIF_GENERAL_MEDICINE</ParentSkill> - should be set to general medicine - so every doctor could choose and master your new specialization

<IconIndex> -  - choose icon for current skill - take a look at https://projecthospital.forumotion.com/t2069-modding-tutorial-medical-database-custom-icons

<ExtraLevelingPercent>- we recommend to have this set to 100 for common specialization, nad set to 50 for operative specialization

Example (General Surgery):
Code:

<GameDBSkill ID="SKILL_DOC_SPEC_GENERAL_SURGERY">
        <AbbreviationLocID>SKILL_DOC_SPEC_GENERAL_SURGERY_DESCRIPTION</AbbreviationLocID>
        <ParentSkill>SKILL_DOC_QUALIF_GENERAL_MEDICINE</ParentSkill>
        <IconIndex>403</IconIndex>
        <ExtraLevelingPercent>100</ExtraLevelingPercent>
</GameDBSkill>

<GameDBSkill ID="SKILL_DOC_SPEC_OPERATIVE_SURGERY">
        <AbbreviationLocID>SKILL_DOC_SPEC_OPERATIVE_SURGERY_DESCRIPTION</AbbreviationLocID>
        <ParentSkill>SKILL_DOC_QUALIF_GENERAL_MEDICINE</ParentSkill>
        <IconIndex>2388</IconIndex>
        <ExtraLevelingPercent>50</ExtraLevelingPercent>
</GameDBSkill>



3. ASSIGNING SPECIALIZATIONS TO THE DEPARTMENT

<FirstDoctorSpecialization> - ID of respective common specialization for every doctor at New department, that you have created in previous step

<SecondDoctorSpecializations> - list of possible second specializations - see example:
Code:

<SecondDoctorSpecializations>
            <SkillRef>SKILL_DOC_SPEC_ADVANCED_DIAGNOSIS</SkillRef>
            <SkillRef>SKILL_DOC_SPEC_OPERATIVE_SURGERY</SkillRef>
            <SkillRef>SKILL_DOC_SPEC_ANESTHESIOLOGY</SkillRef>
</SecondDoctorSpecializations>

<SurgerySpecialization> - ID of respective operative/surgical specialization that you also created in previous step



4. ROOMS
// not four and not by Tarantino

<RequiredRoomsClinic> - list of all rooms needed for clinic

Example better than 1000 words:
Code:

<RequiredRoomsClinic>
            <GameDBDepartmentRoomRequirement>
                <RoomDatabaseEntryRef>ROOM_TYPE_WAITING</RoomDatabaseEntryRef>
                <MinCount>1</MinCount>
                <MaxCount>1</MaxCount>
            </GameDBDepartmentRoomRequirement>
            <GameDBDepartmentRoomRequirement>
                <RoomDatabaseEntryRef>ROOM_TYPE_GENERAL_SURGERY_OFFICE</RoomDatabaseEntryRef>
                <MinCount>1</MinCount>
                <MaxCount>1</MaxCount>
            </GameDBDepartmentRoomRequirement>
            <GameDBDepartmentRoomRequirement>
                <RoomDatabaseEntryRef>ROOM_TYPE_RECEPTION</RoomDatabaseEntryRef>
                <MinCount>0</MinCount>
                <MaxCount>1</MaxCount>
            </GameDBDepartmentRoomRequirement>
            <GameDBDepartmentRoomRequirement>
                <RoomDatabaseEntryRef>ROOM_TYPE_CLEANING_CLOSET</RoomDatabaseEntryRef>
                <MinCount>0</MinCount>
                <MaxCount>1</MaxCount>
            </GameDBDepartmentRoomRequirement>
</RequiredRoomsClinic>

<SharedRoomsClinic> - list of all shared rooms for clinic

Again example (taken from General Surgery dpt):
Code:

<SharedRoomsClinic>
            <GameDBDepartmentRoomRequirement>
                <RoomDatabaseEntryRef>ROOM_TYPE_WC</RoomDatabaseEntryRef>
                <MinCount>0</MinCount>
                <MaxCount>1</MaxCount>
            </GameDBDepartmentRoomRequirement>

            <GameDBDepartmentRoomRequirement>
                <RoomDatabaseEntryRef>ROOM_TYPE_COMMON_ROOM</RoomDatabaseEntryRef>
                <MinCount>0</MinCount>
                <MaxCount>1</MaxCount>
            </GameDBDepartmentRoomRequirement>
            <GameDBDepartmentRoomRequirement>
                <RoomDatabaseEntryRef>ROOM_TYPE_CORRIDOR</RoomDatabaseEntryRef>
                <MinCount>0</MinCount>
                <MaxCount>1</MaxCount>
            </GameDBDepartmentRoomRequirement>
            <GameDBDepartmentRoomRequirement>
                <RoomDatabaseEntryRef>ROOM_TYPE_ELEVATOR_MARKER</RoomDatabaseEntryRef>
                <MinCount>0</MinCount>
                <MaxCount>2</MaxCount>
            </GameDBDepartmentRoomRequirement>
</SharedRoomsClinic>

Note: whether a room of a certain type is actually shared between departments is mostly determined in code, these lists affect which rooms are shown in which section in the UI

<RequiredRoomsHospitalization> - list of required rooms for hospitalization

One more example (taken from General Surgery dpt):
Code:

 <RequiredRoomsHospitalization>
            <GameDBDepartmentRoomRequirement>
                <RoomDatabaseEntryRef>ROOM_TYPE_ON_CALL_ROOM</RoomDatabaseEntryRef>
                <MinCount>1</MinCount>
                <MaxCount>1</MaxCount>
            </GameDBDepartmentRoomRequirement>
            <GameDBDepartmentRoomRequirement>
                <RoomDatabaseEntryRef>ROOM_TYPE_NURSES_STATION</RoomDatabaseEntryRef>
                <MinCount>1</MinCount>
                <MaxCount>1</MaxCount>
            </GameDBDepartmentRoomRequirement>
            <GameDBDepartmentRoomRequirement>
                <RoomDatabaseEntryRef>ROOM_TYPE_INPATIENT_GS_OFFICE</RoomDatabaseEntryRef>
                <MinCount>1</MinCount>
                <MaxCount>1</MaxCount>
            </GameDBDepartmentRoomRequirement>
            <GameDBDepartmentRoomRequirement>
                <RoomDatabaseEntryRef>ROOM_TYPE_INPATIENT_WARD</RoomDatabaseEntryRef>
                <MinCount>1</MinCount>
                <MaxCount>1</MaxCount>
            </GameDBDepartmentRoomRequirement>
            <GameDBDepartmentRoomRequirement>
                <RoomDatabaseEntryRef>ROOM_TYPE_HIGH_PRIORITY_INPATIENT_WARD</RoomDatabaseEntryRef>
                <MinCount>1</MinCount>
                <MaxCount>1</MaxCount>
            </GameDBDepartmentRoomRequirement>
            <GameDBDepartmentRoomRequirement>
                <RoomDatabaseEntryRef>ROOM_TYPE_CARDIOVASCULAR_DIAGNOSTIC_UNIT_GS</RoomDatabaseEntryRef>
                <MinCount>0</MinCount>
                <MaxCount>1</MaxCount>
            </GameDBDepartmentRoomRequirement>
            <GameDBDepartmentRoomRequirement>
                <RoomDatabaseEntryRef>ROOM_TYPE_DIAGNOSTIC_SONOGRAPHY_UNIT_GS</RoomDatabaseEntryRef>
                <MinCount>0</MinCount>
                <MaxCount>1</MaxCount>
            </GameDBDepartmentRoomRequirement>
</RequiredRoomsHospitalization>

<SharedRoomsHospitalization> - finally only one thing that is shared among hospitalizations

Example:
Code:

<SharedRoomsHospitalization>
            <GameDBDepartmentRoomRequirement>
                <RoomDatabaseEntryRef>ROOM_TYPE_OPERATING_ROOM</RoomDatabaseEntryRef>
                <MinCount>0</MinCount>
                <MaxCount>1</MaxCount>
            </GameDBDepartmentRoomRequirement>
</SharedRoomsHospitalization>

Tips for creating rooms and avoiding errors:

Here are all room types for reference:
\\Assets\StreamingAssets\Database\RoomTypes.xml

It's usually best to start by copying and modifying the list of rooms of one of the existing departmenst. Navigate to for example to General Surgery and copy and paste all needed rooms to your new xml file, then start to modify IDs, abbreviations and all other stuff.

<AccessRights> - access limitations for patients
PATIENT_PROCEDURE - patient can enter this type of room only when invited for any procedure there (marked blue in management mode)
STAFF - no patient can enter (marked red in management mode)
PATIENT - free to enter at any time (marked green in management mode)

<RequiredEquipment> - list of tags of all equipment
      if <MinCount>=1 => equipment is mandatory and will be highlighted red in the building mode catalogue if missing
     if <MinCount>=0 => equipment is recommended and will be highlighted yellow if missing

<BuildingModeFilters> - tags of all optional equipment and decorations

Check every single diagnosis that you assigned for your new department, check what equipment you need for every examination, treatment - if it's missing, add it to a suitable room. Radiology department and Laboratory department are standalone, but you can add every diagnostic unit that you will need (USG, CARDIO, etc.)

Example - General Surgery office:
Code:

<RequiredEquipment>
            <GameDBRequiredEquipment>    <Tag>ui_pc</Tag>               <MinCount>1</MinCount>    </GameDBRequiredEquipment>
            <GameDBRequiredEquipment>    <Tag>ui_print</Tag>         <MinCount>1</MinCount>    </GameDBRequiredEquipment>
            <GameDBRequiredEquipment>    <Tag>ui_cabinets_equipment</Tag>       <MinCount>1</MinCount>    </GameDBRequiredEquipment>
            <GameDBRequiredEquipment>    <Tag>ui_exam_table</Tag>         <MinCount>1</MinCount>    </GameDBRequiredEquipment>
            <GameDBRequiredEquipment>    <Tag>ui_exam_lamp_def</Tag>       <MinCount>1</MinCount>    </GameDBRequiredEquipment>
            <GameDBRequiredEquipment>    <Tag>ui_clean_hands</Tag>       <MinCount>1</MinCount>    </GameDBRequiredEquipment>
            <GameDBRequiredEquipment>    <Tag>ui_biohazard_bin</Tag> <MinCount>1</MinCount>    </GameDBRequiredEquipment>
            <GameDBRequiredEquipment>    <Tag>ui_eye_test</Tag>               <MinCount>1</MinCount>  </GameDBRequiredEquipment>
            <GameDBRequiredEquipment>    <Tag>ui_crp_scan</Tag>               <MinCount>1</MinCount>  </GameDBRequiredEquipment>
            <GameDBRequiredEquipment>    <Tag>ui_audiometer</Tag>               <MinCount>1</MinCount>  </GameDBRequiredEquipment>
</RequiredEquipment>

<BuildingModeFilters>
         <Tag>ui_office_desk</Tag>
         <Tag>ui_chair_office</Tag>
         <Tag>ui_oxygen_tank</Tag>
         <Tag>ui_equipment_table</Tag>
         <Tag>ui_mobile_cabinet</Tag>
         <Tag>ui_cabinets</Tag>
         <Tag>ui_bookcase</Tag>
         <Tag>ui_card_file</Tag>
         <Tag>ui_chair_def</Tag>
         <Tag>ui_privacy_screens</Tag>
        </BuildingModeFilters>

<LockedByDefault> - needs to be set to "false"

<AcceptsOutpatients> - true/false - outpatient -> patients that are not hospitalized, these mark doctor's offices that patients visit first

<NoNightShift> - deprecated

<Tags> - list of specific tags related to every room type needed for gameplay. If you're adding procedures that should be only available in this room, add a new tag both here and to the examination/treatment

<RequiredSkill> - ID of specific requiered skill, that you have created in step 2

<MinWidth> - 1 unit = 1 tile
<MinHeight> - 1 unit = 1 tile

<StatisticsMultiplier> - multiplier value for showing workload in management

Example:
Code:

 <GameDBRoomType ID="ROOM_TYPE_GENERAL_SURGERY_OFFICE">
        <AbbreviationLocID>ROOM_TYPE_GENERAL_SURGERY_OFFICE_DESCRIPTION</AbbreviationLocID>
        <TextureID>384</TextureID>
        <IconIndex>800</IconIndex>
        <AccessRights>PATIENT_PROCEDURE</AccessRights>

        <RequiredEquipment>
            <GameDBRequiredEquipment>    <Tag>ui_pc</Tag>               <MinCount>1</MinCount>    </GameDBRequiredEquipment>
            <GameDBRequiredEquipment>    <Tag>ui_print</Tag>         <MinCount>1</MinCount>    </GameDBRequiredEquipment>
            <GameDBRequiredEquipment>    <Tag>ui_cabinets_equipment</Tag>       <MinCount>1</MinCount>    </GameDBRequiredEquipment>
            <GameDBRequiredEquipment>    <Tag>ui_exam_table</Tag>         <MinCount>1</MinCount>    </GameDBRequiredEquipment>
            <GameDBRequiredEquipment>    <Tag>ui_exam_lamp_def</Tag>       <MinCount>1</MinCount>    </GameDBRequiredEquipment>
            <GameDBRequiredEquipment>    <Tag>ui_clean_hands</Tag>       <MinCount>1</MinCount>    </GameDBRequiredEquipment>
            <GameDBRequiredEquipment>    <Tag>ui_biohazard_bin</Tag> <MinCount>1</MinCount>    </GameDBRequiredEquipment>
            <GameDBRequiredEquipment>    <Tag>ui_eye_test</Tag>               <MinCount>1</MinCount>  </GameDBRequiredEquipment>
            <GameDBRequiredEquipment>    <Tag>ui_crp_scan</Tag>               <MinCount>1</MinCount>  </GameDBRequiredEquipment>
            <GameDBRequiredEquipment>    <Tag>ui_audiometer</Tag>               <MinCount>1</MinCount>  </GameDBRequiredEquipment>
        </RequiredEquipment>

        <LockedByDefault>false</LockedByDefault>

        <BuildingModeFilters>
         <Tag>ui_office_desk</Tag>
         <Tag>ui_chair_office</Tag>
         <Tag>ui_oxygen_tank</Tag>
         <Tag>ui_equipment_table</Tag>
         <Tag>ui_mobile_cabinet</Tag>
         <Tag>ui_cabinets</Tag>
         <Tag>ui_bookcase</Tag>
         <Tag>ui_card_file</Tag>
         <Tag>ui_chair_def</Tag>
         <Tag>ui_privacy_screens</Tag>
        </BuildingModeFilters>

        <AcceptsOutpatients>true</AcceptsOutpatients>

        <NoNightShift>true</NoNightShift>

        <Tags>
            <Tag>doctor_workspace</Tag>
            <Tag>intern_workspace</Tag>
            <Tag>examinations_no_equipment</Tag>
            <Tag>examinations_basic_equipment</Tag>
            <Tag>any_outpatient_office</Tag>
            <Tag>any_office</Tag>
            <Tag>specialized_office</Tag>
            <Tag>general_surgery_office</Tag>
            <Tag>receipt</Tag>
        </Tags>

        <RequiredSkill>SKILL_DOC_SPEC_GENERAL_SURGERY</RequiredSkill>
        
        <MinWidth>4</MinWidth>
        <MinHeight>4</MinHeight>

        <StatisticsMultiplier>1.75</StatisticsMultiplier>
</GameDBRoomType>



5. STAFF REQUIREMENTS

<MinClinicnDoctorsDay> - 1 by default

<MinStretchers> - 1 by default

<MinHospitalizationDoctorsDay> - 3 by default
<MinHospitalizationDoctorNight> - 1 by default
<MinHospitalizationNursesDay> - 3 by default
<MinHospitalizationNursesNight> - 3 by default

<MinSurgeonsDay> - 1 by default
<MinAnestezilogistDay> - 1 by default
<MinSurgeryNurseDay> - 2 by default

IF sonography unit is present, then <RecommendedUSGTechnlogist>true</RecommendedUSGTechnlogist> - in management you will see that for hospitalization is recommended USG technologist

Other units:
- cardiovascular unit - <RecommendedCardiologist>true</RecommendedCardiologist>
- neurodiagnostic unit -  <RecommendedNeurologist>true</RecommendedNeurologist>

6. MISC
<PatientRounds> - list of examinations for hospitalized patients, that are repeated during the whole hospitalization to discover hidden and critical symptoms

Example:
Code:

<PatientRounds>
            <ExaminationRef>EXM_INTERVIEW</ExaminationRef>
            <ExaminationRef>EXM_PHYSICAL_AND_VISUAL_EXAMINATION</ExaminationRef>
        </PatientRounds>

<PrefabTag> - prefab tag for UI (custom prefabs aren't currently supported)
<PrestigeModifier...> - better leave it set to 1.0

7.Example of a Department
Code:

    <GameDBDepartment ID="DPT_GENERAL_SURGERY_DEPARTMENT">
        <LockedByDefault>false</LockedByDefault>
        <HospitalizationLockedByDefault>true</HospitalizationLockedByDefault>

        <MinDoctorLevel>2</MinDoctorLevel>

        <PatientGenerationWeight>50</PatientGenerationWeight>

        <FirstDoctorSpecialization>SKILL_DOC_SPEC_GENERAL_SURGERY</FirstDoctorSpecialization>

        <SecondDoctorSpecializations>
            <SkillRef>SKILL_DOC_SPEC_ADVANCED_DIAGNOSIS</SkillRef>
            <SkillRef>SKILL_DOC_SPEC_OPERATIVE_SURGERY</SkillRef>
            <SkillRef>SKILL_DOC_SPEC_ANESTHESIOLOGY</SkillRef>
        </SecondDoctorSpecializations>

        <SurgerySpecialization>SKILL_DOC_SPEC_OPERATIVE_SURGERY</SurgerySpecialization>

        <RequiredRoomsClinic>
            <GameDBDepartmentRoomRequirement>
                <RoomDatabaseEntryRef>ROOM_TYPE_WAITING</RoomDatabaseEntryRef>
                <MinCount>1</MinCount>
                <MaxCount>1</MaxCount>
            </GameDBDepartmentRoomRequirement>
            <GameDBDepartmentRoomRequirement>
                <RoomDatabaseEntryRef>ROOM_TYPE_GENERAL_SURGERY_OFFICE</RoomDatabaseEntryRef>
                <MinCount>1</MinCount>
                <MaxCount>1</MaxCount>
            </GameDBDepartmentRoomRequirement>
            <GameDBDepartmentRoomRequirement>
                <RoomDatabaseEntryRef>ROOM_TYPE_RECEPTION</RoomDatabaseEntryRef>
                <MinCount>0</MinCount>
                <MaxCount>1</MaxCount>
            </GameDBDepartmentRoomRequirement>
            <GameDBDepartmentRoomRequirement>
                <RoomDatabaseEntryRef>ROOM_TYPE_CLEANING_CLOSET</RoomDatabaseEntryRef>
                <MinCount>0</MinCount>
                <MaxCount>1</MaxCount>
            </GameDBDepartmentRoomRequirement>
        </RequiredRoomsClinic>

        <SharedRoomsClinic>
            <GameDBDepartmentRoomRequirement>
                <RoomDatabaseEntryRef>ROOM_TYPE_WC</RoomDatabaseEntryRef>
                <MinCount>0</MinCount>
                <MaxCount>1</MaxCount>
            </GameDBDepartmentRoomRequirement>

            <GameDBDepartmentRoomRequirement>
                <RoomDatabaseEntryRef>ROOM_TYPE_COMMON_ROOM</RoomDatabaseEntryRef>
                <MinCount>0</MinCount>
                <MaxCount>1</MaxCount>
            </GameDBDepartmentRoomRequirement>
            <GameDBDepartmentRoomRequirement>
                <RoomDatabaseEntryRef>ROOM_TYPE_CORRIDOR</RoomDatabaseEntryRef>
                <MinCount>0</MinCount>
                <MaxCount>1</MaxCount>
            </GameDBDepartmentRoomRequirement>
            <GameDBDepartmentRoomRequirement>
                <RoomDatabaseEntryRef>ROOM_TYPE_ELEVATOR_MARKER</RoomDatabaseEntryRef>
                <MinCount>0</MinCount>
                <MaxCount>2</MaxCount>
            </GameDBDepartmentRoomRequirement>
        </SharedRoomsClinic>
        
        <RequiredRoomsHospitalization>
            <GameDBDepartmentRoomRequirement>
                <RoomDatabaseEntryRef>ROOM_TYPE_ON_CALL_ROOM</RoomDatabaseEntryRef>
                <MinCount>1</MinCount>
                <MaxCount>1</MaxCount>
            </GameDBDepartmentRoomRequirement>
            <GameDBDepartmentRoomRequirement>
                <RoomDatabaseEntryRef>ROOM_TYPE_NURSES_STATION</RoomDatabaseEntryRef>
                <MinCount>1</MinCount>
                <MaxCount>1</MaxCount>
            </GameDBDepartmentRoomRequirement>
            <GameDBDepartmentRoomRequirement>
                <RoomDatabaseEntryRef>ROOM_TYPE_INPATIENT_GS_OFFICE</RoomDatabaseEntryRef>
                <MinCount>1</MinCount>
                <MaxCount>1</MaxCount>
            </GameDBDepartmentRoomRequirement>
            <GameDBDepartmentRoomRequirement>
                <RoomDatabaseEntryRef>ROOM_TYPE_INPATIENT_WARD</RoomDatabaseEntryRef>
                <MinCount>1</MinCount>
                <MaxCount>1</MaxCount>
            </GameDBDepartmentRoomRequirement>
            <GameDBDepartmentRoomRequirement>
                <RoomDatabaseEntryRef>ROOM_TYPE_HIGH_PRIORITY_INPATIENT_WARD</RoomDatabaseEntryRef>
                <MinCount>1</MinCount>
                <MaxCount>1</MaxCount>
            </GameDBDepartmentRoomRequirement>
            <GameDBDepartmentRoomRequirement>
                <RoomDatabaseEntryRef>ROOM_TYPE_CARDIOVASCULAR_DIAGNOSTIC_UNIT_GS</RoomDatabaseEntryRef>
                <MinCount>0</MinCount>
                <MaxCount>1</MaxCount>
            </GameDBDepartmentRoomRequirement>
            <GameDBDepartmentRoomRequirement>
                <RoomDatabaseEntryRef>ROOM_TYPE_DIAGNOSTIC_SONOGRAPHY_UNIT_GS</RoomDatabaseEntryRef>
                <MinCount>0</MinCount>
                <MaxCount>1</MaxCount>
            </GameDBDepartmentRoomRequirement>
        </RequiredRoomsHospitalization>

        <SharedRoomsHospitalization>
            <GameDBDepartmentRoomRequirement>
                <RoomDatabaseEntryRef>ROOM_TYPE_OPERATING_ROOM</RoomDatabaseEntryRef>
                <MinCount>0</MinCount>
                <MaxCount>1</MaxCount>
            </GameDBDepartmentRoomRequirement>
        </SharedRoomsHospitalization>

        <MinClinicnDoctorsDay>1</MinClinicnDoctorsDay>

        <MinStretchers>1</MinStretchers>

        <MinHospitalizationDoctorsDay>3</MinHospitalizationDoctorsDay>
        <MinHospitalizationDoctorNight>1</MinHospitalizationDoctorNight>
        <MinHospitalizationNursesDay>3</MinHospitalizationNursesDay>
        <MinHospitalizationNursesNight>1</MinHospitalizationNursesNight>

        <MinSurgeonsDay>1</MinSurgeonsDay>
        <MinAnestezilogistDay>1</MinAnestezilogistDay>
        <MinSurgeryNurseDay>2</MinSurgeryNurseDay>
        
        <RecommendedUSGTechnlogist>true</RecommendedUSGTechnlogist>
        <RecommendedCardiologist>true</RecommendedCardiologist>

        <IconID>402</IconID>
        <PatientRounds>
            <ExaminationRef>EXM_INTERVIEW</ExaminationRef>
            <ExaminationRef>EXM_PHYSICAL_AND_VISUAL_EXAMINATION</ExaminationRef>
        </PatientRounds>

        <PrefabTag>ui_prefab_surgery</PrefabTag>
        <PrefabButtonIndex>5</PrefabButtonIndex>

        <PrestigeModifierStaff>1.0</PrestigeModifierStaff>
        <PrestigeModifierPatients>1.0</PrestigeModifierPatients>
        <PrestigeModifierTreated>1.0</PrestigeModifierTreated>
        <PrestigeModifierDead>1.0</PrestigeModifierDead>

        <DisplayIndex>4</DisplayIndex>
        <DiagnosisRoleIcon>403</DiagnosisRoleIcon>
    </GameDBDepartment>


8. Custom prefabs
- Create your prefabs ingame, save them, then copy the files (xml, sitting in a folder next to the folder with your saves) under the Mod folder
- In your department, set a custom tag for the prefabs <PrefabTag>ui_prefab_traumatology</PrefabTag>
- Create assets in the database for your prefabs and icons
Code:

    <GameDBAsset ID="ASSET_PREFAB_OUTPATIENT_TRM_OFFICE_SMALL">  <Type>PREFAB</Type>    <File>MOD_ROOT/room_outpatient_trm_office_small.xml</File> </GameDBAsset>
    <GameDBAsset ID="ASSET_PREFAB_ICON_OUTPATIENT_TRM_OFFICE_SMALL">    <Type>TEXTURE_CUSTOM_PREFAB_SPRITE</Type><File>MOD_ROOT/trm_gp_office_small.png</File> </GameDBAsset>
- Define the prefabs for the catalogue, probably the best with a full example, notice references to the custom tag and both assets:
Code:

 <GameDBPrefabObject ID="PREFAB_ROOM_OUTPATIENT_TRAUMATOLOGY_OFFICE_SMALL">
        <AbbreviationLocID>ROOM_TYPE_TRAUMATOLOGY_OFFICE</AbbreviationLocID>
        <PrefabAssetRef>ASSET_PREFAB_OUTPATIENT_TRM_OFFICE_SMALL</PrefabAssetRef>
        <DisplayedSizeX>6</DisplayedSizeX>
        <DisplayedSizeY>6</DisplayedSizeY>
        <Cost>5200</Cost>

        <IconIndex>-1</IconIndex>
        <CustomIconAssetRef>ASSET_PREFAB_ICON_OUTPATIENT_TRM_OFFICE_SMALL</CustomIconAssetRef>

        <Tags>
            <Tag>ui_prefab_traumatology</Tag>
        </Tags>

        <LayerFloors>true</LayerFloors>
        <LayerWalls>true</LayerWalls>
        <LayerDoors>true</LayerDoors>
        <LayerObjects>true</LayerObjects>
    </GameDBPrefabObject>
avatar
MoominLittlesocks
resident
Posts : 24
Reputation : 6
Join date : 2019-09-25
Age : 31
Location : Cardiff, Wales

Modding tutorial - Database - Department creation Empty Re: Modding tutorial - Database - Department creation

Thu Oct 31, 2019 6:44 pm
Hello, thanks for the guide. Quick question - Is it possible for a new department to not have hospitalisation? The only way I have found to do this is by not having a clinic either? If not, can you control which staff requirements show up under management. Even though I'm only adding minimum requirements for doctors and nurses, its showing requirements for surgeons, anaesthetists etc.
QEUH
QEUH
specialist
Posts : 239
Reputation : 42
Join date : 2018-03-26
Location : Glasgow

Modding tutorial - Database - Department creation Empty Re: Modding tutorial - Database - Department creation

Thu Oct 31, 2019 7:25 pm
I'm curious about that too, I'm looking to make a facilities department just to hire janitors for areas outside of other departments.
igor.oxymoron
igor.oxymoron
developer
Posts : 347
Reputation : 25
Join date : 2018-03-23
Location : Czech republic

Modding tutorial - Database - Department creation Empty Re: Modding tutorial - Database - Department creation

Fri Nov 01, 2019 11:22 am
Hello everyone!

Well, in the case that you want to add some medical department that consist only of clinic, create whole department as it is described in this tutorial. But with these changes:
1.) leave these lists empty:
Code:

<RequiredRoomsHospitalization>
<SharedRoomsHospitalization>
<PatientRounds>
2.) set to 0:
Code:

<MinStretchers>0</MinStretchers>
<MinHospitalizationDoctorsDay>0</MinHospitalizationDoctorsDay>
<MinHospitalizationDoctorNight>0</MinHospitalizationDoctorNight>
<MinHospitalizationNursesDay>0</MinHospitalizationNursesDay>
<MinHospitalizationNursesNight>0</MinHospitalizationNursesNight>
<MinSurgeonsDay>0</MinSurgeonsDay>
<MinAnestezilogistDay>0</MinAnestezilogistDay>
<MinSurgeryNurseDay>0</MinSurgeryNurseDay>

- you will create department that has only clinic, but in the management mode you will still see hozpitalization part, but empty - and also you will not get rid of blinking red triangle.

In the future we will  implement functions to create only clinic departments - novadays there is possible to create easily whole department and only-hospitalization department like the ICU.

And in the case of non medical - facility department... well maybe there is chance, that you will copy the actual laboratory department and change everything to fit to your expectations - and maybe it will be working, but we have never tried it. Possible positive result will be that the department full of janitors will be always clean, so janitors would clean everything else... (but in this case we can not guarantee it).
avatar
MoominLittlesocks
resident
Posts : 24
Reputation : 6
Join date : 2019-09-25
Age : 31
Location : Cardiff, Wales

Modding tutorial - Database - Department creation Empty Re: Modding tutorial - Database - Department creation

Fri Nov 01, 2019 12:54 pm
Thanks for your quick response Igor. Your code for setting hospitalization staff obviously brings the requirements down to 0, but what I'm after is removing the staff type from the list completely, Emergency for example, only shows a requirement for doctors and nurses and this is what I tried to replicate but it is somehow getting information about surgeons, surgery nurses etc. Where does it pull this info from?
avatar
MoominLittlesocks
resident
Posts : 24
Reputation : 6
Join date : 2019-09-25
Age : 31
Location : Cardiff, Wales

Modding tutorial - Database - Department creation Empty Re: Modding tutorial - Database - Department creation

Fri Nov 01, 2019 5:44 pm
Just to follow up from my previous post, it's become clear that regardless of what you set your minimum staff requirements to, the game still requires a set number of various staff for hospitalization to be functional. It's a real shame that the player is forced to hire 3 doctors and 3 nurses to lose the blinking red triangle for a custom department. Is there no way around this?
igor.oxymoron
igor.oxymoron
developer
Posts : 347
Reputation : 25
Join date : 2018-03-23
Location : Czech republic

Modding tutorial - Database - Department creation Empty Re: Modding tutorial - Database - Department creation

Mon Nov 04, 2019 1:22 pm
Hello, well Emergency dpt, is a very special type of department - it has also hospitalization that is represented by observation and trauma. In code - thera are too many exceptions involved in Emergency, because it has to function properly as welcome door to every hospital. in fact every doc related department has those two parts - clinic and hospitalization, Only ICU is the only hospitalization department (there is "noclicnic" variable - but we have no contrary variable implemented for now) . As i wrote before, we will maybe add some of these functions/variables/parameters in the future - but for now we are focused on finishing first DLC (will be for free) and new assets for modding are at lower priority.

Anyway - thanks for the report of that not working way around, we will check it out with our coders and if we will find something better we will announce it, ok?
avatar
bredabanaan
medic
Posts : 2
Reputation : 0
Join date : 2019-11-05

Modding tutorial - Database - Department creation Empty Re: Modding tutorial - Database - Department creation

Tue Nov 05, 2019 3:10 pm
2 bugs I noticed when creating a department. When selecting a department for an employee, the patients list in front of the bar with the departments. Also when adding more than 6 rooms to a department the panel doesn't extend, but the new rooms are placed to the right of it, outside of the panel
igor.oxymoron
igor.oxymoron
developer
Posts : 347
Reputation : 25
Join date : 2018-03-23
Location : Czech republic

Modding tutorial - Database - Department creation Empty Re: Modding tutorial - Database - Department creation

Thu Nov 07, 2019 10:04 am
Hello! thanks for the report - actually the employee card issue will be fixed in the coming patch and the next issue is not exactly bug, but limitation. as the GUI in management mode is fixed for all departments, yes, adding more than 6 rooms, will cause visual and gameplay issues - just try to limit yourself to those 6 rooms per department group.
jan.oxymoron
jan.oxymoron
developer
Posts : 2309
Reputation : 335
Join date : 2018-03-23

Modding tutorial - Database - Department creation Empty Re: Modding tutorial - Database - Department creation

Tue Nov 12, 2019 3:32 pm
bredabanaan wrote:When selecting a department for an employee, the patients list in front of the bar with the departments.

Hi, good news about this one - we have a fix ready for the next patch.
avatar
MoominLittlesocks
resident
Posts : 24
Reputation : 6
Join date : 2019-09-25
Age : 31
Location : Cardiff, Wales

Modding tutorial - Database - Department creation Empty Re: Modding tutorial - Database - Department creation

Thu Feb 13, 2020 1:04 am
Thank you for implementing the <NoHospitalization> tag!!
James
James
fellow
Posts : 82
Reputation : 6
Join date : 2019-11-10
Location : Malaysia, Kuala Lumpur

Modding tutorial - Database - Department creation Empty Re: Modding tutorial - Database - Department creation

Thu Jul 23, 2020 8:58 am
Hi!, James here. I'm creating a Sleep Lab for the ENT Department, Is it possible to make a custom icon for a custom made room? (Including the Texture on the floor)
jan.oxymoron
jan.oxymoron
developer
Posts : 2309
Reputation : 335
Join date : 2018-03-23

Modding tutorial - Database - Department creation Empty Re: Modding tutorial - Database - Department creation

Thu Jul 23, 2020 4:21 pm
Hi - I'm looking at what's currently supported, but I'm afraid it would be only possible to change the floor icon, not the icon in the user interface (and the former would mean overriding the whole floor texture, so it wouldn't work in combination with any mod that for example adds new floor types. Also, changes on our side to add full support don't seem practical at this stage of development. I'm sorry I don't have better news. Smile
James
James
fellow
Posts : 82
Reputation : 6
Join date : 2019-11-10
Location : Malaysia, Kuala Lumpur

Modding tutorial - Database - Department creation Empty Re: Modding tutorial - Database - Department creation

Fri Jul 24, 2020 4:33 am
@jan.oxymoron That's okay but still I really wanted a custom icon though
James
James
fellow
Posts : 82
Reputation : 6
Join date : 2019-11-10
Location : Malaysia, Kuala Lumpur

Modding tutorial - Database - Department creation Empty Re: Modding tutorial - Database - Department creation

Tue Oct 20, 2020 10:18 am
Hi, I've got a question, so after Patch 32 is there any tutorial or any info on how to make custom prefabs for a custom made department?
jan.oxymoron
jan.oxymoron
developer
Posts : 2309
Reputation : 335
Join date : 2018-03-23

Modding tutorial - Database - Department creation Empty Re: Modding tutorial - Database - Department creation

Tue Oct 20, 2020 10:47 am
James wrote:Hi, I've got a question, so after Patch 32 is there any tutorial or any info on how to make custom prefabs for a custom made department?

Hi, we'll probably update the tutorial in the future, but for the Traumatology department will be basically a 1:1 example that can be used for reference. Still, we're waiting for some results of testing this on the workshop, so you might actually end up being the first to test this in the real world. Smile

Actually, let me write down a few steps:
- Create your prefabs ingame, save them, then copy the files (xml, sitting in a folder next to the folder with your saves) under the Mod folder
- In your department, set a custom tag for the prefabs <PrefabTag>ui_prefab_traumatology</PrefabTag>
- Create assets in the database for your prefabs and icons
Code:

    <GameDBAsset ID="ASSET_PREFAB_OUTPATIENT_TRM_OFFICE_SMALL">   <Type>PREFAB</Type>     <File>MOD_ROOT/room_outpatient_trm_office_small.xml</File> </GameDBAsset>
    <GameDBAsset ID="ASSET_PREFAB_ICON_OUTPATIENT_TRM_OFFICE_SMALL">    <Type>TEXTURE_CUSTOM_PREFAB_SPRITE</Type><File>MOD_ROOT/trm_gp_office_small.png</File> </GameDBAsset>
- Define the prefabs for the catalogue, probably the best with a full example, notice references to the custom tag and both assets:
Code:

 <GameDBPrefabObject ID="PREFAB_ROOM_OUTPATIENT_TRAUMATOLOGY_OFFICE_SMALL">
        <AbbreviationLocID>ROOM_TYPE_TRAUMATOLOGY_OFFICE</AbbreviationLocID>
        <PrefabAssetRef>ASSET_PREFAB_OUTPATIENT_TRM_OFFICE_SMALL</PrefabAssetRef>
        <DisplayedSizeX>6</DisplayedSizeX>
        <DisplayedSizeY>6</DisplayedSizeY>
        <Cost>5200</Cost>

        <IconIndex>-1</IconIndex>
        <CustomIconAssetRef>ASSET_PREFAB_ICON_OUTPATIENT_TRM_OFFICE_SMALL</CustomIconAssetRef>

        <Tags>
            <Tag>ui_prefab_traumatology</Tag>
        </Tags>

        <LayerFloors>true</LayerFloors>
        <LayerWalls>true</LayerWalls>
        <LayerDoors>true</LayerDoors>
        <LayerObjects>true</LayerObjects>
    </GameDBPrefabObject>

James likes this post

James
James
fellow
Posts : 82
Reputation : 6
Join date : 2019-11-10
Location : Malaysia, Kuala Lumpur

Modding tutorial - Database - Department creation Empty Re: Modding tutorial - Database - Department creation

Tue Oct 20, 2020 11:06 am
Thanks for the tutorial Jan! but I've done the same thing after I've done some code digging but it broke my game and it showed this

Modding tutorial - Database - Department creation Screen23
Modding tutorial - Database - Department creation Screen22
Modding tutorial - Database - Department creation Screen21

The output.log shows

NullReferenceException: Object reference not set to an instance of an object
at MapEditorUIController.UpdateMouse () [0x00000] in <filename unknown>:0
at MapEditorUIController.Update () [0x00000] in <filename unknown>:0

(Filename: Line: -1)

Here is the file: https://drive.google.com/file/d/1W8XtoscghwHiaLYWqw6PNxz8vzjnkeBb/view?usp=sharing
if you would like to take a look at the file
jan.oxymoron
jan.oxymoron
developer
Posts : 2309
Reputation : 335
Join date : 2018-03-23

Modding tutorial - Database - Department creation Empty Re: Modding tutorial - Database - Department creation

Tue Oct 20, 2020 11:13 am
Hi, I see - I'll have a look at the mod itself, the error is unfortunately very vague. Smile
FYI - today we're finishing the builds for Traumatology DLC, so I'm expecting a bit of a hectic day and I'll most likely check the mod data tomorrow.
James
James
fellow
Posts : 82
Reputation : 6
Join date : 2019-11-10
Location : Malaysia, Kuala Lumpur

Modding tutorial - Database - Department creation Empty Re: Modding tutorial - Database - Department creation

Tue Oct 20, 2020 11:17 am
Ah, that's okay Jan, I can wait
jan.oxymoron
jan.oxymoron
developer
Posts : 2309
Reputation : 335
Join date : 2018-03-23

Modding tutorial - Database - Department creation Empty Re: Modding tutorial - Database - Department creation

Wed Oct 21, 2020 4:45 pm
Hi, so I had a quick look at the mod data and while I can't see the same issue, I get a lot of errors from texture loadings. Not sure if this isn't just unfinished, but you'll need to either move the png files directly to the root of the mod folder or update the paths in ModAssetLists.xml, something like this:

<File>MOD_ROOT/Database/ModTextures/Prefab/mod_prefab_or_ent_office_large.png</File>

Let me know if changing this on your side made any difference/had effect on the original issue!

James likes this post

James
James
fellow
Posts : 82
Reputation : 6
Join date : 2019-11-10
Location : Malaysia, Kuala Lumpur

Modding tutorial - Database - Department creation Empty Re: Modding tutorial - Database - Department creation

Thu Oct 22, 2020 2:58 am
@jan.oxymoron Thanks for helping! I thought that function would just find the file within the mod, I guess I was wrong
James
James
fellow
Posts : 82
Reputation : 6
Join date : 2019-11-10
Location : Malaysia, Kuala Lumpur

Modding tutorial - Database - Department creation Empty Re: Modding tutorial - Database - Department creation

Fri Oct 23, 2020 3:19 am
@jan.oxymoron The game seems to not load now, it keeps loading on forever and at the end of the output.log shows this

Unloading 4 Unused Serialized files (Serialized files now loaded: 0)
UnloadTime: 15.181500 ms

Unloading 112 unused Assets to reduce memory usage. Loaded Objects now: 13974.
Total: 81.287000 ms (FindLiveObjects: 1.628400 ms CreateObjectMapping: 0.361400 ms MarkObjects: 79.073200 ms DeleteObjects: 0.223300 ms)

UriFormatException: Invalid URI: Invalid port number
at System.Uri.Parse (UriKind kind, System.String uriString) [0x00000] in <filename unknown>:0
at System.Uri.ParseUri (UriKind kind) [0x00000] in <filename unknown>:0
at System.Uri..ctor (System.String uriString, Boolean dontEscape) [0x00000] in <filename unknown>:0
at System.Uri..ctor (System.String uriString) [0x00000] in <filename unknown>:0
at UnityEngineInternal.WebRequestUtils.MakeInitialUrl (System.String targetUrl, System.String localUrl) [0x00000] in <filename unknown>:0

(Filename: Line: -1)

Setting up 2 worker threads for Enlighten.
Thread -> id: 2de4 -> priority: 1
Thread -> id: 1344 -> priority: 1
NullReferenceException: Object reference not set to an instance of an object
at MapEditorController.OnDestroy () [0x00000] in <filename unknown>:0

(Filename: Line: -1)

and I still don't know what's wrong
Here is the link for the mod: https://drive.google.com/file/d/1U00g1BHUMZqehv_vqgGCyqiYIBsYh6VH/view?usp=sharing
jan.oxymoron
jan.oxymoron
developer
Posts : 2309
Reputation : 335
Join date : 2018-03-23

Modding tutorial - Database - Department creation Empty Re: Modding tutorial - Database - Department creation

Mon Oct 26, 2020 8:13 am
Hi, thanks for the update, let me check the files! I know the C# error message is a bit cryptic (UriFormatException: Invalid URI: Invalid port number), but most likely there will be something wrong with the file paths...

James likes this post

jan.oxymoron
jan.oxymoron
developer
Posts : 2309
Reputation : 335
Join date : 2018-03-23

Modding tutorial - Database - Department creation Empty Re: Modding tutorial - Database - Department creation

Mon Oct 26, 2020 1:53 pm
Message reputation : 100% (1 vote)
Hi, ok, I think can see the main issue - it looks like you took one of the base departments in the game as the example to follow, but only Traumatology is using the new system.

The main difference would be in ModRoomPrefabs:
Instead of  
<PrefabNW>ot_ent_office_small.xml</PrefabNW> you need to reference an asset:
<PrefabAssetRef>ASSET_PREFAB_OUTPATIENT_TRM_OFFICE_SMALL</PrefabAssetRef>

Which can then be defined/set to be loaded like this:
<GameDBAsset ID="ASSET_PREFAB_OUTPATIENT_TRM_OFFICE_SMALL">         <Type>PREFAB</Type>       <File>MOD_ROOT/room_outpatient_trm_office_small.xml</File> </GameDBAsset>

I hope this was it!

Btw, a pro tip: for basic rooms like an office feel free to copy the xml from the base game for a similar one and just change the room type directly in the xml to your depatment's office. For specific stuff you'll unfortunately have to build the rooms and save prefabs in game.
Also, it's probably worth it to start with just one room prefab to make sure it's set up correctly and then continue adding more content.

James likes this post

James
James
fellow
Posts : 82
Reputation : 6
Join date : 2019-11-10
Location : Malaysia, Kuala Lumpur

Modding tutorial - Database - Department creation Empty Re: Modding tutorial - Database - Department creation

Tue Oct 27, 2020 9:07 am
Ah, Thanks Jan!

James likes this post

Sponsored content

Modding tutorial - Database - Department creation Empty Re: Modding tutorial - Database - Department creation

Back to top
Permissions in this forum:
You cannot reply to topics in this forum