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

Modding tutorial: objects

+7
sleepy068
Furst
James
Floracelia
jan.oxymoron
Dalairen
roman.oxymoron
11 posters
Go down
roman.oxymoron
roman.oxymoron
developer
Posts : 103
Reputation : 81
Join date : 2018-03-22
http://oxymoron.games/projecthospital/

Modding tutorial: objects Empty Modding tutorial: objects

Tue Nov 20, 2018 6:18 pm
Message reputation : 100% (4 votes)

Modding tutorial: objects


Hi, this is modding tutorial, focused on creating new objects, walls, doors and tiles for Project Hospital. Examples and texture grids you will find below in attached files. Software used by devs is mainly adobe illustrator and photoshop.
.png files you'll create, has to be saved in your mode folder \\Assets\StreamingAssets\Addons\ModName\
.xml files in \\Assets\StreamingAssets\Addons\ModName\Database\


Attachements:

TestMod (https://oxymoron.games/projecthospital/TestMod.zip) contain:
.png textures with example objects
.xml files (scripts for all example objects)

Helpful files (https://oxymoron.games/projecthospital/HelpfulFiles.zip) contain:
.ai files (layers with isometric grid used in game, texture grid, example of objects used in xml and id numbers)
.png files (grids for those who prefer raster editors)


Objects


step 1)

Use the isometric grid to create your object for all possible direction (north-west NW, north-east NE, south-east SE, south-west SW), . Remeber that no indoor object can be higher than 3 tiles and objects wider than 1 tile (table, sofa, etc...) are called composite objects ... explained below.

Modding tutorial: objects Cap110


step 2)

Place your object into proper texture grid on grayed tiles, all four directions in order (NW, NE, SE, SW) ... follow examples. Gray tiles represetns 1 tiles in game, so consider suitable postion. Object higer than 1 tile needs to be placed in "tall_objects" texture, wider or taller outdoor object (like tree) belongs to "objects_big_demo" texture, etc.

Modding tutorial: objects Captur11


step 3)

Export your texture as .png file, with proper name and resolution into your mode location: \\Assets\StreamingAssets\Addons\ModName\

mod_objects_small_atlas.png - 2048x8192
mod_objects_tall_atlas.png - 2048x8192
mod_objects_big_demo_atlas.png - 2048x2048
mod_decals_2048_atlas.png - 2048x2048
mod_doors_4096_atlas.png - 4096x4096
mod_tiles_4096_atlas.png - 4096x4096
mod_walls_patterns_atlas.png - 4096x2048


step 4)

Create new xml, according to your object type and texture into mode location database: \\Assets\StreamingAssets\Addons\ModName\Database\

ModObjects.xml - objects_small_atlas
ModObjectsAttachments.xml - objects_small_atlas
ModObjectsCompositeParts.xml - multi-tile objects
ModObjectsOutdoorBig - objects_big_demo_atlas
ModObjectsTall.xml - objects_tall_atlas
ModDecals.xml - decals_2048_atlas
ModDoorsAndWindows.xml - doors_4096_atlas
ModDoorPrefabs.xml - double doors
ModWalls.xml - walls_patterns_atlas
ModFloorTypes.xml - tiles_4096_atlas

Best way to create new object is copy paste similar one, from the game xml and edit. Here is oxygen tank for instance ... important parametrs for editing are:

id - must be unique
texture - path to the texture ... don't forget write your mode name ( <Texture>Addons/ModName/mod_objects_small_atlas.png</Texture> )
texture id - id of object directions (in ai files is a layer with id for all usable tiles)
IconIndex - doesn't work for mods
script parameters - will be explained in separate tutorial (not available yet)
tags - used by UI and scripts (tags for building filters: ui_furniture, ui_decorations, ui_equipment, ui_outside, ui_decals)

Code:

<GameDBObject ID="OBJECT_OXYGEN_TANK">
        <AbbreviationLocID>OBJECT_OXYGEN_TANK_DESCRIPTION</AbbreviationLocID>
        <TextureRef>ASSET_TEX_MOD_NAME_OBJECTS_TALL</TextureRef>
        <TextureAtlasLayout>LAYOUT_16_X_64</TextureAtlasLayout>
        <SpriteShape>SHAPE_1_X_1</SpriteShape>

        <TextureIDNW>356</TextureIDNW>
        <TextureIDNE>357</TextureIDNE>
        <TextureIDSE>358</TextureIDSE>
        <TextureIDSW>359</TextureIDSW>
        <CustomIconAssetRef>ASSET_TEX_MOD_NAME_CUSTOM_ICON</CustomIconAssetRef>

        <AccessPositions>
            <AccessPosition>
                <m_x>-1</m_x>
                <m_y>0</m_y>
            </AccessPosition>
        </AccessPositions>

        <PlacedToEdge>false</PlacedToEdge>
        <AttachedToWall>false</AttachedToWall>
        <AttachedToObject>false</AttachedToObject>
        <Placement>INDOORS</Placement>
        <AllowsObjectsOnWallsAbove>true</AllowsObjectsOnWallsAbove>

         <Tags>
            <Tag>ui_equipment</Tag>
            <Tag>ui_oxygen_tank</Tag>
        </Tags>

        <Cost>69</Cost>
        <ColorSetRef>COLOR_SET_BUILDING_OBJECT_OXYGEN_TANK</ColorSetRef>
    </GameDBObject>

Modding tutorial: objects Icons210


step 5)

Object icon can be used from icons.png by using parameter and its id (id_icons.psd):
<IconIndex>716</IconIndex>

Or you can create Custom icons that are currently supported for objects and composite objects.
The icons themselves need to be a 64x64 px png, while the game creates a sprite from the inner 60x60 px area - make sure you leave some space around the icon graphics.
Asset type in the asset lists xml is TEXTURE_CUSTOM_SPRITE.

Add icon parameter to object xml:
<CustomIconFile>Addons/ModName/icon_object_oxygen.png</CustomIconFile>


step 6)

For changing object color in game set "hue" of selected faces on your object to 300°.

Modding tutorial: objects Icons310

Create ModColorSets.xml and create new color list you want to use (5 colors max).

Code:

<GameDBColorSet ID="COLOR_SET_BUILDING_OBJECT_OXYGEN_TANK">
        <Colors>
            <GameDBColor> <R>70</R>  <G>128</G>  <B>106</B>  </GameDBColor>
            <GameDBColor> <R>128</R>  <G>70</G>  <B>70</B>  </GameDBColor>
            <GameDBColor> <R>70</R>  <G>95</G>  <B>128</B>  </GameDBColor>
            <GameDBColor> <R>209</R>  <G>209</G>  <B>73</B>  </GameDBColor>
            <GameDBColor> <R>38</R>  <G>38</G>  <B>38</B>  </GameDBColor>
        </Colors>
 </GameDBColorSet>

Then paste this parametr with id of you color list to the xml of your object:
<ColorSetRef>COLOR_SET_BUILDING_OBJECT_OXYGEN_TANK</ColorSetRef>


step7)


Create ModStringTableEn.xml ... to set a name and description for you new object visible in game.

Code:

<Database>
    <GameDBStringTable ID="LOC_EN_MOD_NAME">
        <LanguageCode>en</LanguageCode>
        <LanguageNameLocalized>English</LanguageNameLocalized>
        <Contributors>
            <Name>Oxymoron Games</Name>
        </Contributors>
        <LocalizedStrings>
            <GameDBLocalizedString>      <LocID>OBJECT_OXYGEN_TANK</LocID>                   <Text>Oxygen tank</Text>  </GameDBLocalizedString>
            <GameDBLocalizedString>      <LocID>OBJECT_OXYGEN_TANK_DESCRIPTION</LocID>       <Text>A decoration.</Text>  </GameDBLocalizedString>
        </LocalizedStrings>
    </GameDBStringTable>
</Database>


step8)

Last step is set loading of all your assets, explained in separate tutorial here.


Others


States


If you want to implement object with more states (open/closed, turned on/off), create new state for each direction and place it right behind (see below).

Modding tutorial: objects Cap211

Then add to object xml parameters of animation frames that determines number of states ... you can see that NE, NW has one more frame but SE, SW doesn't, because in those directions it wouldn't be visible.

Code:

        <AnimationFramesNW>2</AnimationFramesNW>
        <AnimationFramesNE>2</AnimationFramesNE>
        <AnimationFramesSE>1</AnimationFramesSE>
        <AnimationFramesSW>1</AnimationFramesSW>


Seats


Seats are little bit complicated, because for SW and SE directions is object partially in front and partially behind the character.

Modding tutorial: objects Cap310

For this case there is a parameter "TextureIDBack" which moves part of chair behind the character ... you need to set direction and proper id (-1 means none).
example:

Modding tutorial: objects Cap4a10


Code:

        <TextureIDNW>-1</TextureIDNW>
        <TextureIDNE>-1</TextureIDNE>
        <TextureIDSE>2</TextureIDSE>
        <TextureIDSW>5</TextureIDSW>

        <TextureIDBackNW>0</TextureIDBackNW>
        <TextureIDBackNE>1</TextureIDBackNE>
        <TextureIDBackSE>3</TextureIDBackSE>
        <TextureIDBackSW>4</TextureIDBackSW>


Composite objects


When indoor object is wider than one tile, it needs to be splitted out into tile parts and scripted separately.

Modding tutorial: objects Cap510

Example of office desk:

Modding tutorial: objects Cap610

Open/create ModObjectsCompositeParts.xml and both sides of the desk create separately with unigue id:

Code:

<GameDBObject ID="OBJECT_OFFICE_DESK_A">
        <AbbreviationLocID>OBJECT_OFFICE_DESK2_A</AbbreviationLocID>
        <TextureRef>ASSET_TEX_MOD_NAME_OBJECTS_SMALL</TextureRef>
        <TextureAtlasLayout>LAYOUT_16_X_64</TextureAtlasLayout>
        <SpriteShape>SHAPE_1_X_1</SpriteShape>
        <TextureIDNW>360</TextureIDNW>
        <TextureIDNE>362</TextureIDNE>
        <TextureIDSE>365</TextureIDSE>
        <TextureIDSW>367</TextureIDSW>
        <CustomIconAssetRef>ASSET_TEX_MOD_NAME_CUSTOM_ICON</CustomIconAssetRef>

        <PlacedToEdge>false</PlacedToEdge>
        <AttachedToWall>false</AttachedToWall>
        <AllowsObjectsOnWallsAbove>true</AllowsObjectsOnWallsAbove>

        <AttachmentSlot>
            <HeightOffset>0.9</HeightOffset>
            <AllowedTags>
                <Tag>decoration</Tag>
                <Tag>pc</Tag>
                <Tag>tv</Tag>
                <Tag>radio</Tag>
                <Tag>printer</Tag>
                <Tag>lab_eq</Tag>
                <Tag>lab_eq_small</Tag>
                <Tag>microscope</Tag>
                <Tag>hematoanalyzer</Tag>
                <Tag>defibrillator</Tag>
                <Tag>surgery_instruments</Tag>
                <Tag>electrocautery_machine</Tag>
                <Tag>fast_usg</Tag>
                <Tag>RIA</Tag>
                <Tag>audiometer</Tag>
                <Tag>crp_scan</Tag>
                <Tag>spirometer</Tag>
                <Tag>shockwave</Tag>
                <Tag>electromyograph</Tag>
                <Tag>lab_analyzer</Tag>
                <Tag>stool_analyzer</Tag>
                <Tag>thermal_cycler</Tag>
                <Tag>electrocardiograph</Tag>
                <Tag>ui_coffee_machine</Tag>
            </AllowedTags>
            <ForcesAttachmentOrientation>true</ForcesAttachmentOrientation>
        </AttachmentSlot>

        <ConnectedSlots>
            <ConnectedSlot>
                <PositionX>-1</PositionX>
                <PositionY>0</PositionY>
                <AllowedTags>
                    <Tag>office_chair</Tag>
                </AllowedTags>
                <ForcedDirection>SE</ForcedDirection>
            </ConnectedSlot>
        </ConnectedSlots>

        <AttachedToObject>false</AttachedToObject>
        <PartOfCompositeObject>true</PartOfCompositeObject>
        <ForcesAttachmentOrientation>true</ForcesAttachmentOrientation>
        <Placement>INDOORS</Placement>

        <Tags>
            <Tag>desk</Tag>
        </Tags>
        <ColorSetRef>COLOR_SET_BUILDING_OBJECT_OFFICE_DESK2</ColorSetRef>
</GameDBObject>

 <GameDBObject ID="OBJECT_OFFICE_DESK2_B">
        <AbbreviationLocID>OBJECT_OFFICE_DESK2_B</AbbreviationLocID>
        <TextureRef>ASSET_TEX_MOD_NAME_OBJECTS_SMALL</TextureRef>
        <TextureAtlasLayout>LAYOUT_16_X_64</TextureAtlasLayout>
        <SpriteShape>SHAPE_1_X_1</SpriteShape>
        <TextureIDNW>361</TextureIDNW>
        <TextureIDNE>363</TextureIDNE>
        <TextureIDSE>364</TextureIDSE>
        <TextureIDSW>366</TextureIDSW>
        <CustomIconAssetRef>ASSET_TEX_MOD_NAME_CUSTOM_ICON</CustomIconAssetRef>

        <PlacedToEdge>false</PlacedToEdge>
        <AttachedToWall>false</AttachedToWall>
        <AllowsObjectsOnWallsAbove>true</AllowsObjectsOnWallsAbove>

        <AttachmentSlot>
            <HeightOffset>0.9</HeightOffset>
            <AllowedTags>
                <Tag>decoration</Tag>
                <Tag>pc</Tag>
                <Tag>tv</Tag>
                <Tag>radio</Tag>
                <Tag>printer</Tag>
                <Tag>lab_eq</Tag>
                <Tag>lab_eq_small</Tag>
                <Tag>microscope</Tag>
                <Tag>hematoanalyzer</Tag>
                <Tag>defibrillator</Tag>
                <Tag>surgery_instruments</Tag>
                <Tag>electrocautery_machine</Tag>
                <Tag>fast_usg</Tag>
                <Tag>RIA</Tag>
                <Tag>audiometer</Tag>
                <Tag>crp_scan</Tag>
                <Tag>spirometer</Tag>
                <Tag>shockwave</Tag>
                <Tag>electromyograph</Tag>
                <Tag>lab_analyzer</Tag>
                <Tag>stool_analyzer</Tag>
                <Tag>thermal_cycler</Tag>
                <Tag>electrocardiograph</Tag>
                <Tag>ui_coffee_machine</Tag>
            </AllowedTags>
            <ForcesAttachmentOrientation>true</ForcesAttachmentOrientation>
        </AttachmentSlot>

        <AttachedToObject>false</AttachedToObject>
        <PartOfCompositeObject>true</PartOfCompositeObject>
        <Placement>INDOORS</Placement>
        <ColorSetRef>COLOR_SET_BUILDING_OBJECT_OFFICE_DESK2</ColorSetRef>
</GameDBObject>

Next step is to create ModCompositeObjects.xml and unite those objects as one by setting their id and position towards themselfs.

Code:

<GameDBCompositeObject ID="COMPOSITE_OBJECT_OFFICE_DESK">      
 <AbbreviationLocID>COMPOSITE_OBJECT_OFFICE_DESK_DESCRIPTION</AbbreviationLocID>
        <Parts>
            <GameDBCompositeObjectPart>      
                <TileOffset>
                    <m_x>0</m_x>
                    <m_y>0</m_y>
                </TileOffset>
                <ZOffset>0</ZOffset>
                <ObjectRef>OBJECT_OFFICE_DESK_A</ObjectRef>
            </GameDBCompositeObjectPart>
             <GameDBCompositeObjectPart>      
                <TileOffset>
                    <m_x>0</m_x>
                    <m_y>1</m_y>
                </TileOffset>
                <ZOffset>0</ZOffset>
                <ObjectRef>OBJECT_OFFICE_DESK_B</ObjectRef>
            </GameDBCompositeObjectPart>
        </Parts>

        <Tags>
            <Tag>ui_furniture</Tag>
            <Tag>ui_office_desk</Tag>
            <Tag>desk</Tag>
        </Tags>

        <Cost>99</Cost>
        <CustomIconAssetRef>ASSET_TEX_MOD_NAME_CUSTOM_ICON</CustomIconAssetRef>
    </GameDBCompositeObject>

If you see white or black glitches on the connection edge, it can be solved by moving object's cut slightly over the edge of texture grid, or mostly it's caused by alpa channels where solution is to create new layer (in photoshop), expand the object color (photoshop plugin, dilate many) and set transparency to 1%.

Modding tutorial: objects Cap711

Doors and windows


Copy the door texture from game (Assets/StreamingAssets/Textures/doors_4096_atlas.png) to your mod folder as mod_doors_4094.png.
Create a window and put it into the texture.

The tutorial for creating mods has more info how to switch to the new texture.

Modding tutorial: objects Cap910

Create ModDoorsAndWindows.xml and add a new GameDBDoor ... script uses mostly the same parameters like all the other objects.

TextureIDSW / TextureIDBackSW - here you set only one direction ... the rest of it is automatic.
FrameTextureID / FrameCrossSectionTextureID - set id of wall frame from mod_walls_4096_atlas.png ... id's here are counted as groups start at 0, not tile by tile.

Code:

<GameDBDoor ID="WINDOW_TALL">      
     <AbbreviationLocID>WINDOW_TALL</AbbreviationLocID>
        <TextureIDSW>68</TextureIDSW>
        <TextureIDBackSW>70</TextureIDBackSW>
        <FrameTextureID>8</FrameTextureID>
        <FrameCrossSectionTextureID>0</FrameCrossSectionTextureID>
        <Passable>false</Passable>
        <AnimationFrames>1</AnimationFrames>
        <Cost>50</Cost>
        <CustomIconAssetRef>ASSET_TEX_MOD_NAME_CUSTOM_ICON</CustomIconAssetRef>
        <ColorSetRef>COLOR_SET_BUILDING_OBJECTS_DEFAULT</ColorSetRef>
    </GameDBDoor>

Doors is mostly the same, except you need to create animation states for opening and closing:

Modding tutorial: objects Cap1010

For common doors add a parameter <AnimationFrames>4</AnimationFrames> and set number of your states. For sliding doors add parameter <SlideDirection>1</SlideDirection> (-1 for opposite direction) and AnimationFrames keep at 1.

Code:

<GameDBDoor ID="DOOR_RESTRICTED">  
       <AbbreviationLocID>DOOR_RESTRICTED</AbbreviationLocID>
        <TextureIDSW>48</TextureIDSW>
        <TextureIDBackSW>48</TextureIDBackSW>
        <TextureIDSE>60</TextureIDSE>
        <TextureIDBackSE>60</TextureIDBackSE>
        <FrameTextureID>2</FrameTextureID>
        <FrameCrossSectionTextureID>2</FrameCrossSectionTextureID>
        <Passable>true</Passable>
        <AnimationFrames>4</AnimationFrames>
        <OpeningZOffsetSW>1.0</OpeningZOffsetSW>
        <OpeningZOffsetSE>1.0</OpeningZOffsetSE>
        <Cost>100</Cost>
        <SoundEventOpen>SFX_ENV_DOOR_B_OPEN</SoundEventOpen>
        <SoundEventClose>SFX_ENV_DOOR_B_CLOSE</SoundEventClose>
        <IconIndex>743</IconIndex>
        <ColorSetRef>COLOR_SET_BUILDING_OBJECTS_DEFAULT</ColorSetRef>
    </GameDBDoor>


Walls


Copy the wall pattern texture from game (Assets/StreamingAssets/Textures/walls_patterns_atlas.png) to your mod folder as mod_walls_patterns_atlas.png, similar to the process with doors & windows.
Create new assets for wall patterns and paste it to mod_walls_patters_atlas.png (don't forget to make one side a little bit darker):

Modding tutorial: objects Cap1110

Create ModWalls.xml and add new object. Coloring works for faces with hue 300° (explained above), but color list is fixed for all wall patterns.

TextureID - id of wall frame (walls_4096_atlas.png) ... counted by groups
TextureIDPattern - id of pattern from walls_patterns_atlas.png

Code:

<GameDBWall ID="WALL_TYPE_CONCRETE_COLOR">    
     <AbbreviationLocID>WALL_TYPE_CONCRETE_COLOR</AbbreviationLocID>
        <TextureID>0</TextureID>
        <TextureIDPattern>5</TextureIDPattern>
        <AlwaysVisible>false</AlwaysVisible>
        <Cost>10</Cost>
        <CustomIconAssetRef>ASSET_TEX_MOD_NAME_CUSTOM_ICON</CustomIconAssetRef>
</GameDBWall>


Tiles

Copy the tile texture from game (Assets/StreamingAssets/Textures/tiles_4096_atlas.png)  to your mod folder as mod_tiles_4096_atlas.png, similar to the process with doors & windows.
Create new tile patterns and paste them to the new texture. Coloring works for tile with hue 300°, but the list of colors is fixed.

Modding tutorial: objects Cap1210

Create ModFloorTypes.xml and add new object:

PathCost - prioritizes path finding of the AI

Code:

<GameDBFloorType ID="FLOOR_TYPE_WOOD_RIGHT">
        <AbbreviationLocID>FLOOR_TYPE_WOOD_RIGHT</AbbreviationLocID>
        <TextureID>48</TextureID>
        <CustomIconAssetRef>ASSET_TEX_MOD_NAME_CUSTOM_ICON</CustomIconAssetRef>
        <ConnectedTiles>false</ConnectedTiles>
        <PathCost>1.0</PathCost>
        <Cost>10</Cost>
        <MaxDirtLevel>4</MaxDirtLevel>
        <TextureVariations>1</TextureVariations>
        <Specular>0.75</Specular>
</GameDBFloorType>

For random variation tiles (like grass), create all variations and paste to the texture one after another:

Modding tutorial: objects Cap1310

Create object for each variation in the .xml and for the first one add parameter TextureVariations with number of variations:

Code:

<GameDBFloorType ID="FLOOR_TYPE_GRASS_DARK">
        <AbbreviationLocID>FLOOR_TYPE_GRASS_DARK</AbbreviationLocID>
        <TextureID>27</TextureID>
        <CustomIconAssetRef>ASSET_TEX_MOD_NAME_CUSTOM_ICON</CustomIconAssetRef>
        <ConnectedTiles>false</ConnectedTiles>
        <HighPriority>true</HighPriority>
        <PathCost>3.0</PathCost>
        <Cost>10</Cost>
        <MaxDirtLevel>0</MaxDirtLevel>
        <TextureVariations>4</TextureVariations>
        <Outdoors>true</Outdoors>
        <Specular>0.0</Specular>
    </GameDBFloorType>

    <GameDBFloorType ID="FLOOR_TYPE_GRASS_DARK_01">
        <AbbreviationLocID>FLOOR_TYPE_GRASS_DARK</AbbreviationLocID>
        <TextureID>28</TextureID>
        <CustomIconAssetRef>ASSET_TEX_MOD_NAME_CUSTOM_ICON</CustomIconAssetRef>
        <ConnectedTiles>false</ConnectedTiles>
        <HighPriority>true</HighPriority>
        <PathCost>3.0</PathCost>
        <Cost>10</Cost>
        <MaxDirtLevel>0</MaxDirtLevel>
        <Outdoors>true</Outdoors>
        <HiddenInUI>true</HiddenInUI>
        <Specular>0.0</Specular>
    </GameDBFloorType>

    <GameDBFloorType ID="FLOOR_TYPE_GRASS_DARK_02">
        <AbbreviationLocID>FLOOR_TYPE_GRASS_DARK</AbbreviationLocID>
        <TextureID>29</TextureID>
        <CustomIconAssetRef>ASSET_TEX_MOD_NAME_CUSTOM_ICON</CustomIconAssetRef>
        <ConnectedTiles>false</ConnectedTiles>
        <HighPriority>true</HighPriority>
        <PathCost>3.0</PathCost>
        <Cost>10</Cost>
        <MaxDirtLevel>0</MaxDirtLevel>
        <Outdoors>true</Outdoors>
        <HiddenInUI>true</HiddenInUI>
        <Specular>0.0</Specular>
    </GameDBFloorType>

    <GameDBFloorType ID="FLOOR_TYPE_GRASS_DARK_03">
        <AbbreviationLocID>FLOOR_TYPE_GRASS_DARK</AbbreviationLocID>
        <TextureID>30</TextureID>
        <CustomIconAssetRef>ASSET_TEX_MOD_NAME_CUSTOM_ICON</CustomIconAssetRef>
        <ConnectedTiles>false</ConnectedTiles>
        <HighPriority>true</HighPriority>
        <PathCost>3.0</PathCost>
        <Cost>10</Cost>
        <MaxDirtLevel>0</MaxDirtLevel>
        <HiddenInUI>true</HiddenInUI>
        <Specular>0.0</Specular>
</GameDBFloorType>

For connected tiles (floor lines), create all 16 possible directions in way you want to have it connected:

Modding tutorial: objects Cap1510

Modding tutorial: objects Cap1410

Create new object in .xml, set first tile ID and parameter ConnectedTiles to "true" ... it takes all tiles in the same row as above.

ConnectedTilesByColor - you can use to disconnect lines with different colors

Code:

<GameDBFloorType ID="FLOOR_TYPE_COLORED_DARK_LINE">
        <AbbreviationLocID>FLOOR_TYPE_COLORED_DARK_LINE</AbbreviationLocID>
        <TextureID>112</TextureID>
        <CustomIconAssetRef>ASSET_TEX_MOD_NAME_CUSTOM_ICON</CustomIconAssetRef>
        <ConnectedTiles>true</ConnectedTiles>
        <ConnectedTilesByColor>true</ConnectedTilesByColor>
        <PathCost>1.0</PathCost>
        <Cost>10</Cost>
        <MaxDirtLevel>4</MaxDirtLevel>
        <TextureVariations>1</TextureVariations>
        <Specular>0.5</Specular>
</GameDBFloorType>


Decals


Create asset for all directions and paste to the mod_decals_2048.png.

Modding tutorial: objects Cap1610

Open ModDecals.xml ... script is mostly the same like for the small objects, so is the coloring.

Code:

<GameDBObject ID="OBJECT_DECAL_DPT_ICU">
        <AbbreviationLocID>OBJECT_DECALS_DESCRIPTION</AbbreviationLocID>
        <TextureRef>ASSET_TEX_MOD_NAME_DECALS</TextureRef>
        <TextureAtlasLayout>LAYOUT_16_X_16</TextureAtlasLayout>
        <SpriteShape>SHAPE_1_X_1</SpriteShape>
        <TextureIDNW>64</TextureIDNW>
        <TextureIDNE>65</TextureIDNE>
        <TextureIDSE>66</TextureIDSE>
        <TextureIDSW>67</TextureIDSW>
        <CustomIconAssetRef>ASSET_TEX_MOD_NAME_CUSTOM_ICON</CustomIconAssetRef>

        <Placement>UNLIMITED</Placement>

        <AccessPositions></AccessPositions><!-- No limit -->
        <PlacedToEdge>true</PlacedToEdge>
        <AttachedToWall>true</AttachedToWall>
        <NonBlocking>true</NonBlocking>
        <NotInteractable>true</NotInteractable>
        <HeightOffset>1.5</HeightOffset>

        <Tags>
            <Tag>ui_decals</Tag>
        </Tags>

        <CustomIconFile>Addons/ModTrees/icon_decal_rad.png</CustomIconFile>
        <ColorSetRef>COLOR_SET_BUILDING_DECALS</ColorSetRef>
        <Cost>20</Cost>
 </GameDBObject>
avatar
Dalairen
medic
Posts : 2
Reputation : 0
Join date : 2019-06-15

Modding tutorial: objects Empty Re: Modding tutorial: objects

Sat Jun 15, 2019 3:39 am
Walls do have twice as much colors and I wanted to add missing colors to decals.
With the 5 color limit the only way to do this is to double those in the list with different colors.
Is the limit mandatory?
jan.oxymoron
jan.oxymoron
developer
Posts : 2309
Reputation : 336
Join date : 2018-03-23

Modding tutorial: objects Empty Re: Modding tutorial: objects

Mon Jun 17, 2019 4:22 pm
Dalairen wrote:Walls do have twice as much colors and I wanted to add missing colors to decals.
With the 5 color limit the only way to do this is to double those in the list with different colors.
Is the limit mandatory?

Hi, the number of color slots for objects (decals are technically objects) is currently limited to 5, that's correct - the code would have to support resizing the palette panel etc., which we originally decided not to implement, as the UI would overflow in lower resolutions (especially 1366 x 768), even with the automatic UI scale. The panel barely fits after adding palette slots for floors and walls and the respective panels are slightly smaller. A possible solution on our side would be to increase the palette size and decrease the number of rows in the object catalogue at the same time, we can quickly discuss this in the next design meeting. Probably not the highest priority though. Smile
avatar
Dalairen
medic
Posts : 2
Reputation : 0
Join date : 2019-06-15

Modding tutorial: objects Empty Re: Modding tutorial: objects

Mon Jun 17, 2019 10:18 pm
jan.oxymoron wrote:Hi, the number of color slots for objects (decals are technically objects) is currently limited to 5, that's correct - the code would have to support resizing the palette panel etc., which we originally decided not to implement, as the UI would overflow in lower resolutions (especially 1366 x 768), even with the automatic UI scale. The panel barely fits after adding palette slots for floors and walls and the respective panels are slightly smaller. A possible solution on our side would be to increase the palette size and decrease the number of rows in the object catalogue at the same time, we can quickly discuss this in the next design meeting. Probably not the highest priority though. Smile
Thank you. So, I guess, it's the decal duplicates with different palette for now.
avatar
Floracelia
intern
Posts : 4
Reputation : 0
Join date : 2019-06-22

Modding tutorial: objects Empty Re: Modding tutorial: objects

Sat Jun 22, 2019 4:02 pm
Is there any way to replace the colors of walls, floors and objects already in the game? While I don't mind the color selection I would enjoy a more muted palette more and would like to match all the wood items with each other as literally every item that has wood in it has a different wood color.
jan.oxymoron
jan.oxymoron
developer
Posts : 2309
Reputation : 336
Join date : 2018-03-23

Modding tutorial: objects Empty Re: Modding tutorial: objects

Mon Jun 24, 2019 8:57 am
Floracelia wrote:Is there any way to replace the colors of walls, floors and objects already in the game? While I don't mind the color selection I would enjoy a more muted palette more and would like to match all the wood items with each other as literally every item that has wood in it has a different wood color.

Hi, yes, you can edit the colors in ColorSets.xml.
avatar
Floracelia
intern
Posts : 4
Reputation : 0
Join date : 2019-06-22

Modding tutorial: objects Empty Re: Modding tutorial: objects

Mon Jun 24, 2019 12:14 pm
Thank you! I thought I was gonna have to go through all the textures and actually replace them in a graphics program but this is so much easier Very Happy
James
James
fellow
Posts : 82
Reputation : 6
Join date : 2019-11-10
Location : Malaysia, Kuala Lumpur

Modding tutorial: objects Empty Re: Modding tutorial: objects

Mon Mar 30, 2020 11:51 am
Hi, it seems that the objects i made texture isn't loading. Output_log shows

Texture doesn't exist: C:\Program Files (x86)\Steam\steamapps\workshop\content\868360\1759751921\mod_object_jm_covid19_poster.png

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

Texture doesn't exist: C:\Program Files (x86)\Steam\steamapps\workshop\content\868360\1759751921\mod_object_jm_bamboo_plant.png

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

Texture doesn't exist: C:\Program Files (x86)\Steam\steamapps\workshop\content\868360\1759751921\mod_object_jm_empty_shelf.png

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

Texture doesn't exist: C:\Program Files (x86)\Steam\steamapps\workshop\content\868360\1759751921\mod_object_jm_shelf.png

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

Texture doesn't exist: C:\Program Files (x86)\Steam\steamapps\workshop\content\868360\1759751921\mod_object_jm_strep_poster.png

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

Texture doesn't exist: C:\Program Files (x86)\Steam\steamapps\workshop\content\868360\1759751921\mod_objects_tall_atlas.png

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

Texture doesn't exist: C:\Program Files (x86)\Steam\steamapps\workshop\content\868360\2015448513\mod_moredg_exam_icon_01.png

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

Texture doesn't exist: C:\Program Files (x86)\Steam\steamapps\workshop\content\868360\2015448513\mod_moredg_exam_icon_01_small.png

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

Texture doesn't exist: C:\Program Files (x86)\Steam\steamapps\workshop\content\868360\2015448513\mod_moredg_ttt_icon_01.png

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

Texture doesn't exist: C:\Program Files (x86)\Steam\steamapps\workshop\content\868360\2015448513\mod_moredg_ttt_icon_01_small.png

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

Texture doesn't exist: C:\Program Files (x86)\Steam\steamapps\workshop\content\868360\2015440728\sym_sl_signet1a.png

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

Texture doesn't exist: C:\Program Files (x86)\Steam\steamapps\workshop\content\868360\1920731522\mod_sm_icon_010.png

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

Texture doesn't exist: C:\Program Files (x86)\Steam\steamapps\workshop\content\868360\1920731522\mod_sm_icon_010_small.png

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

Creating sprite from a texure which is not loaded: ASSET_OR_COVID_POSTER

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

Creating sprite from a texure which is not loaded: ASSET_OR_BAMBOO_PLANT

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

Creating sprite from a texure which is not loaded: ASSET_OR_EMPTY_SHELF

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

Creating sprite from a texure which is not loaded: ASSET_OR_SHELF

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

Creating sprite from a texure which is not loaded: ASSET_OR_STREP_POSTER

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

Creating sprite from a texure which is not loaded: ASSET_MOREDG_ICON_E1

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

Creating sprite from a texure which is not loaded: ASSET_MOREDG_ICON_E1_SMALL

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

Creating sprite from a texure which is not loaded: ASSET_MOREDG_ICON_TTT1

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

Creating sprite from a texure which is not loaded: ASSET_MOREDG_ICON_TTT1_SMALL

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

Creating sprite from a texure which is not loaded: ASSET_CRP_SYM_ICON_393

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

Creating sprite from a texure which is not loaded: ASSET_GYNECO_ICON_SM10

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

Creating sprite from a texure which is not loaded: ASSET_GYNECO_ICON_SM10_SMALL

I don't know what to do and how to fix it Link for mod: https://drive.google.com/open?id=10jsLNvud4W34Zeb41Jkja_BrrOEXOhGB
jan.oxymoron
jan.oxymoron
developer
Posts : 2309
Reputation : 336
Join date : 2018-03-23

Modding tutorial: objects Empty Re: Modding tutorial: objects

Mon Mar 30, 2020 12:03 pm
Hi, there seems to be an error when loading one of the xmls because of invalid markup, the affected line should only have <!-- and --> without any extra dashes:

<!-- Objects for ENT Version 1.15 V -->

Could you check if fixing this makes a difference? Btw the error gets displayed in options in main menu.
James
James
fellow
Posts : 82
Reputation : 6
Join date : 2019-11-10
Location : Malaysia, Kuala Lumpur

Modding tutorial: objects Empty Re: Modding tutorial: objects

Mon Mar 30, 2020 12:09 pm
jan.oxymoron wrote:Hi, there seems to be an error when loading one of the xmls because of invalid markup, the affected line should only have <!-- and --> without any extra dashes:

<!-- Objects for ENT Version 1.15 V -->

Could you check if fixing this makes a difference? Btw the error gets displayed in options in main menu.

Thanks jan!
avatar
Furst
intern
Posts : 6
Reputation : 0
Join date : 2020-04-18

Modding tutorial: objects Empty Re: Modding tutorial: objects

Sat Apr 18, 2020 11:16 pm
Hi! In what program do you make objects?
sleepy068
sleepy068
fellow
Posts : 85
Reputation : 24
Join date : 2019-11-28
Age : 31
Location : Australia

Modding tutorial: objects Empty Re: Modding tutorial: objects

Sun Apr 26, 2020 8:18 am
Hi Oxymoron,

Do you guys have any near future plans to expand walls, doors, windows and floors similar to what you've done with objects so modders can add more content? Floors (100+ free) and Walls (~25 free) aren't too much of an issue but doors is down to 1 basic door or maybe 4 basic windows. I assume 4096x4096 is pretty much as large as you want to go with for a single sprite sheet so was hoping this was in the works anyways.
I'd be happy with just more free spaces if it is a bit of a pain getting it to work like objects/decals.

I've started a new mod and am looking to heavily expand walls, doors, windows and floors just to give players more options but I am limited with the doors at the moment.

Thanks very much and no rush, I think you guys deserve a good break and a few beers after the amazing DLC you guys got out.
avatar
Furst
intern
Posts : 6
Reputation : 0
Join date : 2020-04-18

Modding tutorial: objects Empty Re: Modding tutorial: objects

Sun Apr 26, 2020 1:44 pm
sleepy068 wrote:
I've started a new mod and am looking to heavily expand walls, doors, windows and floors just to give players more options but I am limited with the doors at the moment.

Thanks very much and no rush, I think you guys deserve a good break and a few beers after the amazing DLC you guys got out.

Hello! If it’s not difficult, in mode we need a door with a WC sign Very Happy

Nana76 likes this post

sleepy068
sleepy068
fellow
Posts : 85
Reputation : 24
Join date : 2019-11-28
Age : 31
Location : Australia

Modding tutorial: objects Empty Re: Modding tutorial: objects

Mon Apr 27, 2020 12:42 pm
Hi Furst, that'd actually very easy and I can definitely look at getting that done, the only issue is the limit with the number of doors I can add. Hoping Oxymoron can get back to me sometime this week with hopefully good news. I have some experience with unity so I am doubting I'll be able to just expand the sprite sheet for doors although I guess I could give it a try.
roman.oxymoron
roman.oxymoron
developer
Posts : 103
Reputation : 81
Join date : 2018-03-22
http://oxymoron.games/projecthospital/

Modding tutorial: objects Empty Re: Modding tutorial: objects

Mon Apr 27, 2020 4:29 pm
sleepy068 wrote:Hi Oxymoron,

Do you guys have any near future plans to expand walls, doors, windows and floors similar to what you've done with objects so modders can add more content? Floors (100+ free) and Walls (~25 free) aren't too much of an issue but doors is down to 1 basic door or maybe 4 basic windows. I assume 4096x4096 is pretty much as large as you want to go with for a single sprite sheet so was hoping this was in the works anyways.
I'd be happy with just more free spaces if it is a bit of a pain getting it to work like objects/decals.

I've started a new mod and am looking to heavily expand walls, doors, windows and floors just to give players more options but I am limited with the doors at the moment.

Thanks very much and no rush, I think you guys deserve a good break and a few beers after the amazing DLC you guys got out.

Hi, we'll extend a door texture for sure ... and we don't have a plans to add some major amount of new patterns on wall and floors (maybe just one or two Wink )

Nana76 likes this post

avatar
Furst
intern
Posts : 6
Reputation : 0
Join date : 2020-04-18

Modding tutorial: objects Empty Re: Modding tutorial: objects

Mon Apr 27, 2020 6:41 pm
roman.oxymoron wrote:
Hi, we'll extend a door texture for sure ... and we don't have a plans to add some major amount of new patterns on wall and floors (maybe just one or two Wink )
This is sad news. The game really lacks new decorators: doors, floors, walls. Think about it.

Nana76 likes this post

sleepy068
sleepy068
fellow
Posts : 85
Reputation : 24
Join date : 2019-11-28
Age : 31
Location : Australia

Modding tutorial: objects Empty Re: Modding tutorial: objects

Tue Apr 28, 2020 12:28 pm
Hi Furst,

I think that's where I step in for now. Wink
I'd imagine as far as content goes, decorations like doors , floors etc isn't as high a priority as the more medical aspects of the game (like adding in the pharmacy). This might be where Oxymoron's focus is for now.

Hi Roman,

That's really good to hear, how exactly do you guys plan to extend it? Will doors, floors and walls possibly be expanded like objects are (e.g. ASSET_TEX_MOD_DOORS)? This would be my preference only because I generally do not like modifying stock content since it is too susceptible to conflicts, mind you it seems the less likely to be game breaking (since worse case is a door is now a window, should still work it'll just look bad). The biggest plus is players wouldn't be limited to only 1 door/wall mod.
No rush at all but I am curious when you guys are planning to expand this? Interestingly enough, doors have been the most requested item of the options of doors, floors, walls and windows so i am hoping i can start to add a bunch. I can't just extend the sprite sheet can I? Might be a really awesome workaround for now.
Thanks very much though, really appreciate all the hard work you guys put in.
roman.oxymoron
roman.oxymoron
developer
Posts : 103
Reputation : 81
Join date : 2018-03-22
http://oxymoron.games/projecthospital/

Modding tutorial: objects Empty Re: Modding tutorial: objects

Tue Apr 28, 2020 12:38 pm
sleepy068 wrote:Hi Furst,

I think that's where I step in for now. Wink
I'd imagine as far as content goes, decorations like doors , floors etc isn't as high a priority as the more medical aspects of the game (like adding in the pharmacy). This might be where Oxymoron's focus is for now.

Hi Roman,

That's really good to hear, how exactly do you guys plan to extend it? Will doors, floors and walls possibly be expanded like objects are (e.g. ASSET_TEX_MOD_DOORS)? This would be my preference only because I generally do not like modifying stock content since it is too susceptible to conflicts, mind you it seems the less likely to be game breaking (since worse case is a door is now a window, should still work it'll just look bad). The biggest plus is players wouldn't be limited to only 1 door/wall mod.
No rush at all but I am curious when you guys are planning to expand this? Interestingly enough, doors have been the most requested item of the options of doors, floors, walls and windows so i am hoping i can start to add a bunch. I can't just extend the sprite sheet can I? Might be a really awesome workaround for now.
Thanks very much though, really appreciate all the hard work you guys put in.

I can't tell ... right now we're focused on fixing bug with new dlc, so when it's done we'll move to other tasks ... I'll write here, when it will be done Wink
roman.oxymoron
roman.oxymoron
developer
Posts : 103
Reputation : 81
Join date : 2018-03-22
http://oxymoron.games/projecthospital/

Modding tutorial: objects Empty Re: Modding tutorial: objects

Tue Jun 02, 2020 4:29 pm
sleepy068 wrote:Hi Furst, that'd actually very easy and I can definitely look at getting that done, the only issue is the limit with the number of doors I can add. Hoping Oxymoron can get back to me sometime this week with hopefully good news. I have some experience with unity so I am doubting I'll be able to just expand the sprite sheet for doors although I guess I could give it a try.

Hi ... so the door texture is extended ... will be available in the upcoming patch, next week probably Wink
sleepy068
sleepy068
fellow
Posts : 85
Reputation : 24
Join date : 2019-11-28
Age : 31
Location : Australia

Modding tutorial: objects Empty Re: Modding tutorial: objects

Thu Jun 11, 2020 1:26 pm
Hi @Roman, thank you very much for doing this!!
I've got a heap already planned based on requests. I'm going to aim for the reduce sprite doors, similar to the standard white one I re-textured to be colourable (you guys can steal that if you want to by the way). Mainly because I am still worried it'll fill up rather fast (I'll need to leave space in case you guys add new doors to give me wiggle room). Not to take away from the absolutely amazing work you guys put in but I do hope, like objects, we can see some means to add walls, floors and doors in the same way. Modders will be able to add an extensive amount without risk on conflict if this can happen. Definitely make future DLCs easier too as you won't really need to touch the stock door texture file.
Nonetheless thank you!
avatar
Butch
attending
Posts : 46
Reputation : 7
Join date : 2019-06-06

Modding tutorial: objects Empty Re: Modding tutorial: objects

Thu Aug 06, 2020 4:26 pm
The helpful files with the .png grids have been extremely useful. They could definitely use an update as some of the newer icons in the game have not been added. Thank you!
avatar
juanferivera
intern
Posts : 5
Reputation : 0
Join date : 2021-03-10

Modding tutorial: objects Empty Re: Modding tutorial: objects

Wed Mar 10, 2021 3:08 pm
Hi Guys,

does anyone play the game on Mac?

I am trying to fin the path where the folder Assets is so i can save my modified textures / objetcts...


Can someone help?

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

Modding tutorial: objects Empty Re: Modding tutorial: objects

Wed Mar 10, 2021 3:16 pm
Message reputation : 100% (1 vote)
juanferivera wrote:Hi Guys,

does anyone play the game on Mac?

I am trying to fin the path where the folder Assets is so i can save my modified textures / objetcts...


Can someone help?

Thnx

Hi, yes, it's a bit diffrent on MAc - you'll need to navigate into the project_hospital.app package, then the path should be something like:
project_hospital.app/Contents/Resources/Data/StreamingAssets

juanferivera likes this post

avatar
anxioustofu
medic
Posts : 1
Reputation : 0
Join date : 2022-04-15

Modding tutorial: objects Empty Re: Modding tutorial: objects

Fri Apr 15, 2022 12:36 am
Hi how do I download the attachments? Are they currently not working or am I just dumb :p
jan.oxymoron
jan.oxymoron
developer
Posts : 2309
Reputation : 336
Join date : 2018-03-23

Modding tutorial: objects Empty Re: Modding tutorial: objects

Tue Apr 19, 2022 10:43 am
Hi, these aren't attachments, there are two links (look for blue text) in the very first post. Smile
Sponsored content

Modding tutorial: objects Empty Re: Modding tutorial: objects

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