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

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

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

Tue Oct 27, 2020 11:53 am
Hi, feel free to just copy these prefab icons and xmls from one of the departments from the base game, these should 'just work' in any department, then create a GameDBAsset and a new <GameDBPrefabObject ID="MOD_PREFAB_ROOM_ON_CALL_ROOM_LARGE_OTOR"> that would point to it.

Btw, we usually have a set color scheme for each department, but as basically all the colors are already used, just grab the prefabs from a department that matches what you're looking for.

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 - Page 2 Empty Re: Modding tutorial - Database - Department creation

Sat Oct 31, 2020 4:50 am
Just another question, I hope I'm not annoying you jan, but what does this line of code mean?
<DisplayedSizeX>8</DisplayedSizeX>
<DisplayedSizeY>6</DisplayedSizeY>
jan.oxymoron
jan.oxymoron
developer
Posts : 2309
Reputation : 335
Join date : 2018-03-23

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

Mon Nov 02, 2020 10:55 am
Hi James, no worries! Smile These are for the tooltips for your prefab rooms - the text is composed from the name of the room (so it can reuse existing name of the room itself) and from these two numbers that indicate the room size, filling them by hand turned out to be the easiest as the prefabs are usually one tile wider than the room saved in them and this way we can have control on which number is shown first.

Example: Doctor's office - 6 x 4

Btw I got the invite, will probably stop by tomorrow (looking at the amount of stuff from the weekend I'll need to go through today Smile ).
James
James
fellow
Posts : 82
Reputation : 6
Join date : 2019-11-10
Location : Malaysia, Kuala Lumpur

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

Mon Nov 02, 2020 11:25 am
Ah, okay Jan. Looking forward to see you joining our Discord. Thanks btw! Smile
jan.oxymoron
jan.oxymoron
developer
Posts : 2309
Reputation : 335
Join date : 2018-03-23

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

Tue Nov 03, 2020 3:08 pm
Message reputation : 100% (1 vote)
Hi, one more quick update - somebody from the team pointed me to the Modding Community Wishlist (https://steamcommunity.com/app/868360/discussions/2/4153959587249752961/) that Sleepy068 posted on Steam, so probably the best if I go through it first. Great job putting all these points together and categorizing the requests!

A few quick notes after a quick first look: while there's a lot of great ideas (and also features we considered using ourselves in some of the DLC content), let's not beat around the bush - most of the items would mean pretty big changes affecting some of the main systems, adding new user interface and probably requiring days of work each. On the other hand I'm pretty sure that a few items are actually already implemented, although not used, one example would be the multi-frame object animations, the very first item on the list. Smile Anyway, let me get back to you when I have a better picture.

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 - Page 2 Empty Re: Modding tutorial - Database - Department creation

Wed Nov 04, 2020 4:40 am
Hi @jan , I am so sorry but this stupid prefabs still isn't working for some reason

I've found this in the output.log



Loading database from addon path: C:\Program Files (x86)\Steam\steamapps\common\Project Hospital\ProjectHospital_Data\StreamingAssets\Addons\Mod_Otorhinolaryngology

(Filename: C:\buildslave\unity\build\Runtime/Export/Debug.bindings.h Line: 43)

Database - ReadFiles C:\Program Files (x86)\Steam\steamapps\common\Project Hospital\ProjectHospital_Data\StreamingAssets\Addons\Mod_Otorhinolaryngology

(Filename: C:\buildslave\unity\build\Runtime/Export/Debug.bindings.h Line: 43)

Duplicate database entry, overriding the original one: PREFAB_ROOM_INPATIENT_OT_OFFICE_SMALL

(Filename: C:\buildslave\unity\build\Runtime/Export/Debug.bindings.h Line: 43)

Duplicate database entry, overriding the original one: PREFAB_ROOM_SONOGRAPHY_UNIT_OT

(Filename: C:\buildslave\unity\build\Runtime/Export/Debug.bindings.h Line: 43)

Duplicate database entry, overriding the original one: PREFAB_ROOM_OPERATING_THEATRE_OT

(Filename: C:\buildslave\unity\build\Runtime/Export/Debug.bindings.h Line: 43)

Unknown Database Entry type: PrefabPersistentData

(Filename: C:\buildslave\unity\build\Runtime/Export/Debug.bindings.h Line: 43)

Unknown Database Entry type: m_size

(Filename: C:\buildslave\unity\build\Runtime/Export/Debug.bindings.h Line: 43)

Unknown Database Entry type: m_x

(Filename: C:\buildslave\unity\build\Runtime/Export/Debug.bindings.h Line: 43)

Unknown Database Entry type: PrefabPersistentData

(Filename: C:\buildslave\unity\build\Runtime/Export/Debug.bindings.h Line: 43)

Unknown Database Entry type: m_size

(Filename: C:\buildslave\unity\build\Runtime/Export/Debug.bindings.h Line: 43)

Unknown Database Entry type: m_x

(Filename: C:\buildslave\unity\build\Runtime/Export/Debug.bindings.h Line: 43)

Unknown Database Entry type: PrefabPersistentData

(Filename: C:\buildslave\unity\build\Runtime/Export/Debug.bindings.h Line: 43)

Unknown Database Entry type: m_size

(Filename: C:\buildslave\unity\build\Runtime/Export/Debug.bindings.h Line: 43)

Unknown Database Entry type: m_x

(Filename: C:\buildslave\unity\build\Runtime/Export/Debug.bindings.h Line: 43)

Unknown Database Entry type: PrefabPersistentData

(Filename: C:\buildslave\unity\build\Runtime/Export/Debug.bindings.h Line: 43)

Unknown Database Entry type: m_size

(Filename: C:\buildslave\unity\build\Runtime/Export/Debug.bindings.h Line: 43)

Unknown Database Entry type: m_x

(Filename: C:\buildslave\unity\build\Runtime/Export/Debug.bindings.h Line: 43)

Unknown Database Entry type: PrefabPersistentData

(Filename: C:\buildslave\unity\build\Runtime/Export/Debug.bindings.h Line: 43)

Unknown Database Entry type: m_size

(Filename: C:\buildslave\unity\build\Runtime/Export/Debug.bindings.h Line: 43)

Unknown Database Entry type: m_x

(Filename: C:\buildslave\unity\build\Runtime/Export/Debug.bindings.h Line: 43)

Unknown Database Entry type: PrefabPersistentData

(Filename: C:\buildslave\unity\build\Runtime/Export/Debug.bindings.h Line: 43)

Unknown Database Entry type: m_size

(Filename: C:\buildslave\unity\build\Runtime/Export/Debug.bindings.h Line: 43)

Unknown Database Entry type: m_x

(Filename: C:\buildslave\unity\build\Runtime/Export/Debug.bindings.h Line: 43)

Unknown Database Entry type: PrefabPersistentData

(Filename: C:\buildslave\unity\build\Runtime/Export/Debug.bindings.h Line: 43)

Unknown Database Entry type: m_size

(Filename: C:\buildslave\unity\build\Runtime/Export/Debug.bindings.h Line: 43)

Unknown Database Entry type: m_x

(Filename: C:\buildslave\unity\build\Runtime/Export/Debug.bindings.h Line: 43)

Unknown Database Entry type: PrefabPersistentData

(Filename: C:\buildslave\unity\build\Runtime/Export/Debug.bindings.h Line: 43)

Unknown Database Entry type: m_size

(Filename: C:\buildslave\unity\build\Runtime/Export/Debug.bindings.h Line: 43)

Unknown Database Entry type: m_x

(Filename: C:\buildslave\unity\build\Runtime/Export/Debug.bindings.h Line: 43)

Unknown Database Entry type: PrefabPersistentData

(Filename: C:\buildslave\unity\build\Runtime/Export/Debug.bindings.h Line: 43)

Unknown Database Entry type: m_size

(Filename: C:\buildslave\unity\build\Runtime/Export/Debug.bindings.h Line: 43)

Unknown Database Entry type: m_x

(Filename: C:\buildslave\unity\build\Runtime/Export/Debug.bindings.h Line: 43)

Unknown Database Entry type: PrefabPersistentData

(Filename: C:\buildslave\unity\build\Runtime/Export/Debug.bindings.h Line: 43)

Unknown Database Entry type: m_size

(Filename: C:\buildslave\unity\build\Runtime/Export/Debug.bindings.h Line: 43)

Unknown Database Entry type: m_x

(Filename: C:\buildslave\unity\build\Runtime/Export/Debug.bindings.h Line: 43)

Unknown Database Entry type: PrefabPersistentData

(Filename: C:\buildslave\unity\build\Runtime/Export/Debug.bindings.h Line: 43)

Unknown Database Entry type: m_size

(Filename: C:\buildslave\unity\build\Runtime/Export/Debug.bindings.h Line: 43)

Unknown Database Entry type: m_x

(Filename: C:\buildslave\unity\build\Runtime/Export/Debug.bindings.h Line: 43)

Unknown Database Entry type: PrefabPersistentData

(Filename: C:\buildslave\unity\build\Runtime/Export/Debug.bindings.h Line: 43)

Unknown Database Entry type: m_size

(Filename: C:\buildslave\unity\build\Runtime/Export/Debug.bindings.h Line: 43)

Unknown Database Entry type: m_x

(Filename: C:\buildslave\unity\build\Runtime/Export/Debug.bindings.h Line: 43)

Unknown Database Entry type: PrefabPersistentData

(Filename: C:\buildslave\unity\build\Runtime/Export/Debug.bindings.h Line: 43)

Unknown Database Entry type: m_size

(Filename: C:\buildslave\unity\build\Runtime/Export/Debug.bindings.h Line: 43)

Unknown Database Entry type: m_x

(Filename: C:\buildslave\unity\build\Runtime/Export/Debug.bindings.h Line: 43)

Unknown Database Entry type: PrefabPersistentData

(Filename: C:\buildslave\unity\build\Runtime/Export/Debug.bindings.h Line: 43)

Unknown Database Entry type: m_size

(Filename: C:\buildslave\unity\build\Runtime/Export/Debug.bindings.h Line: 43)

Unknown Database Entry type: m_x

(Filename: C:\buildslave\unity\build\Runtime/Export/Debug.bindings.h Line: 43)

Unknown Database Entry type: PrefabPersistentData

(Filename: C:\buildslave\unity\build\Runtime/Export/Debug.bindings.h Line: 43)

Unknown Database Entry type: m_size

(Filename: C:\buildslave\unity\build\Runtime/Export/Debug.bindings.h Line: 43)

Unknown Database Entry type: m_x

(Filename: C:\buildslave\unity\build\Runtime/Export/Debug.bindings.h Line: 43)

Unknown Database Entry type: PrefabPersistentData

(Filename: C:\buildslave\unity\build\Runtime/Export/Debug.bindings.h Line: 43)

Unknown Database Entry type: m_size

(Filename: C:\buildslave\unity\build\Runtime/Export/Debug.bindings.h Line: 43)

Unknown Database Entry type: m_x

(Filename: C:\buildslave\unity\build\Runtime/Export/Debug.bindings.h Line: 43)

Unknown Database Entry type: PrefabPersistentData

(Filename: C:\buildslave\unity\build\Runtime/Export/Debug.bindings.h Line: 43)

Unknown Database Entry type: m_size

(Filename: C:\buildslave\unity\build\Runtime/Export/Debug.bindings.h Line: 43)

Unknown Database Entry type: m_x

(Filename: C:\buildslave\unity\build\Runtime/Export/Debug.bindings.h Line: 43)

Unknown Database Entry type: PrefabPersistentData

(Filename: C:\buildslave\unity\build\Runtime/Export/Debug.bindings.h Line: 43)

Unknown Database Entry type: m_size

(Filename: C:\buildslave\unity\build\Runtime/Export/Debug.bindings.h Line: 43)

Unknown Database Entry type: m_x

(Filename: C:\buildslave\unity\build\Runtime/Export/Debug.bindings.h Line: 43)

Unknown Database Entry type: PrefabPersistentData

(Filename: C:\buildslave\unity\build\Runtime/Export/Debug.bindings.h Line: 43)

Unknown Database Entry type: m_size

(Filename: C:\buildslave\unity\build\Runtime/Export/Debug.bindings.h Line: 43)

Unknown Database Entry type: m_x

(Filename: C:\buildslave\unity\build\Runtime/Export/Debug.bindings.h Line: 43)

Unknown Database Entry type: PrefabPersistentData

(Filename: C:\buildslave\unity\build\Runtime/Export/Debug.bindings.h Line: 43)

Unknown Database Entry type: m_size

(Filename: C:\buildslave\unity\build\Runtime/Export/Debug.bindings.h Line: 43)

Unknown Database Entry type: m_x

(Filename: C:\buildslave\unity\build\Runtime/Export/Debug.bindings.h Line: 43)

Unknown Database Entry type: PrefabPersistentData

(Filename: C:\buildslave\unity\build\Runtime/Export/Debug.bindings.h Line: 43)

Unknown Database Entry type: m_size

(Filename: C:\buildslave\unity\build\Runtime/Export/Debug.bindings.h Line: 43)

Unknown Database Entry type: m_x

(Filename: C:\buildslave\unity\build\Runtime/Export/Debug.bindings.h Line: 43)

Unknown Database Entry type: PrefabPersistentData

(Filename: C:\buildslave\unity\build\Runtime/Export/Debug.bindings.h Line: 43)

Unknown Database Entry type: m_size

(Filename: C:\buildslave\unity\build\Runtime/Export/Debug.bindings.h Line: 43)

Unknown Database Entry type: m_x

(Filename: C:\buildslave\unity\build\Runtime/Export/Debug.bindings.h Line: 43)

Unknown Database Entry type: PrefabPersistentData

(Filename: C:\buildslave\unity\build\Runtime/Export/Debug.bindings.h Line: 43)

Unknown Database Entry type: m_size

(Filename: C:\buildslave\unity\build\Runtime/Export/Debug.bindings.h Line: 43)

Unknown Database Entry type: m_x

(Filename: C:\buildslave\unity\build\Runtime/Export/Debug.bindings.h Line: 43)

Unknown Database Entry type: PrefabPersistentData

(Filename: C:\buildslave\unity\build\Runtime/Export/Debug.bindings.h Line: 43)

Unknown Database Entry type: m_size

(Filename: C:\buildslave\unity\build\Runtime/Export/Debug.bindings.h Line: 43)

Unknown Database Entry type: m_x


and the cryptic message still appears at the end of the log
Here is the mod:  https://drive.google.com/drive/folders/1mhI3JNHP0-uHcHwR8MN6V9Zzhd38DrvC?usp=sharing
jan.oxymoron
jan.oxymoron
developer
Posts : 2309
Reputation : 335
Join date : 2018-03-23

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

Wed Nov 04, 2020 4:35 pm
Hi, I'll probably have a proper look tomorrow, but after a quick glance the issue seems to be caused by the location of the prefab files - these shouldn't be under database as the game expects all xmls under the database folder to be in the standard format you know, while the prefab xmls are different, basically raw xml data saved from the game. Hopefully this helps - and again, feel free to use Traumatology as an example.
James
James
fellow
Posts : 82
Reputation : 6
Join date : 2019-11-10
Location : Malaysia, Kuala Lumpur

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

Thu Nov 05, 2020 1:07 pm
So the prefab issue was fixed but the cryptic error still persists and the game still loads infinitely. Which is better Very Happy
jan.oxymoron
jan.oxymoron
developer
Posts : 2309
Reputation : 335
Join date : 2018-03-23

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

Thu Nov 05, 2020 4:33 pm
Hi, could you re-upload the current version once again so I can give it one more look? Smile Hopefully we're getting there!
(I'll probably have a look on Monday as I'll be taking a day off tomorrow).
James
James
fellow
Posts : 82
Reputation : 6
Join date : 2019-11-10
Location : Malaysia, Kuala Lumpur

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

Fri Nov 06, 2020 1:14 am
Sure! Here it is: https://drive.google.com/file/d/1vilSx1Qig0GhJ4XbyZtn6bzm_JkItMJr/view?usp=sharing
jan.oxymoron
jan.oxymoron
developer
Posts : 2309
Reputation : 335
Join date : 2018-03-23

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

Mon Nov 09, 2020 12:53 pm
Hi, ok, so a little big update:

I managed to get the department to load - I'm attaching a zip with the changed files. This was mostly due to problems with the department itself and assets, not the prefabs (wrong ID of a room was referenced, there were references to rooms that have been commented out), also prefab icons need to be of the correct asset type: <Type>TEXTURE_CUSTOM_PREFAB_SPRITE</Type>

Here's how the department needs to be configured to show icon in prefabs, I'll update the guide at some point too.
Code:

 <ShowInPrefabs>true</ShowInPrefabs>
 <PrefabsTag>ui_prefab_otorhinolaryngology</PrefabsTag>
 <PrefabsTooltipId>TOOLTIP_BUILDING_PREFAB_OTORHINOLARYNGOLOGY</PrefabsTooltipId>

I also discovered a few items that will need to be addressed on our side, but shouldn't block you from testing:
- Support for custom icons in the list of departments under prefabs
- Support for resizable panel of departments under prefabs

Modding tutorial - Database - Department creation - Page 2 Screen10
Attachments
Modding tutorial - Database - Department creation - Page 2 Attachment
mod_or_changes.zip You don't have permission to download attachments.(8 Kb) Downloaded 2 times
James
James
fellow
Posts : 82
Reputation : 6
Join date : 2019-11-10
Location : Malaysia, Kuala Lumpur

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

Mon Nov 09, 2020 1:09 pm
Thank you so much jan! You've been such a big help. I can't express how grateful I am!
James
James
fellow
Posts : 82
Reputation : 6
Join date : 2019-11-10
Location : Malaysia, Kuala Lumpur

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

Fri Nov 13, 2020 9:23 am
The Cryptic Message in the log still appears even after adding the changes.
jan.oxymoron
jan.oxymoron
developer
Posts : 2309
Reputation : 335
Join date : 2018-03-23

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

Mon Nov 16, 2020 1:14 pm
James wrote:The Cryptic Message in the log still appears even after adding the changes.

Hi James, so I quickly tested the latest version of the mod with the current Steam version of the game and it actually seems to be working fine including the prefabs (I tried to drop it both under Streaming Assets\Addons under the game installation and under one of the folders loaded from the workshop).

Not sure what the issue is then, I'd definitely suggest to back up all your changes and try again on a clean install of the game, it's possible that you have some outdated files somewhere causing false alarms - for example if you're subscribed to a workshop version of a mod while editing it under Streaming Assets, the game will be loading both possibly leading to some weird behavior.

We can talk more on the discord, hopefully I'll manage to show up in about an hour.

James likes this post

Sponsored content

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

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