adding_a_new_level_pt.2

Adding a New Level pt.2

In this second part of the guide we will analyze each entry in the scene descriptor file we created in the first part.
We will then open the Descriptor.json file located in

C:\Users\{YOUR USERNAME}\AppData\LocalLow\RadicalFiction\HARDTIMES\Mods\MyMod_MODPKG\Scenes\Mod_Scene\Descriptor.json
  • sceneId: is the scene unique id you wish to give to your new scene. Keep it brief and descriptive even if you should then add an entry in the lang files for it to be properly displayed.sceneId
  • sceneDirectory: just leave it as it is and don't edit this entry for whatever reason in the world, no matter even in case of life or death.
  • startingSpawnPointX: the x position of the starting point the player should spawn at in case this scene is set as a starting scene. Note that 0 being the center of the map and the value is expressed in game units (1 game unit = 64px)
  • startingSpawnPointY: the y position of the starting point the player should spawn at in case this scene is set as a starting scene. Note that 0 being the center of the map and the value is expressed in game units (1 game unit = 64px)
  • doOverwriteBaseproperties: this bool is to be set to true if you are creating a new scene or do you want to completely overwrite an existing scene. Set it to false i you are just adding fixedfurnitures or other entities to an existing scene you don't want to overwrite in it's base properties values.
  • civilianPopulation: The base civillian population for this area. It will change also based on the hour of the day and other factors.
  • civilianGenerosity: This value influences the amount of cash civilian people will give when asked for money. It will also influence their chance of giving money or calling the police.
  • copPopulation: The base number of cops patrolling the streets.
  • fascistsPopulation: The base number of fascist scum patrolling the streets.
  • forbidPlacingFurnitures: If set to true this scene will be forbidden to the placing of any kind of player furniture.
  • minimumTemperature: The minimum temperature allowed in this scene regardless of weather value.
  • maximumTemperature: The maximum temperature allowed in this scene regardless of weather value.
  • mapRadious: The radious of the NPCs spawning area. Should be left as it is normally.
  • sceneMusic: The name of the music to be played in this scene. TD1 is the default id of the first song of the game. You can add your own music to any scene in the game, but it's not in this guide span to achieve this. Check che Adding your sounds and music to the game tutorial or ping the author if you need help.
  • sceneBgSounds: The name of the bg sound clip to be looped as a background soundscape for this scene. You can add your own music to any scene in the game, but it's not in this guide span to achieve this. Check che Adding your sounds and music to the game tutorial or ping the author if you need help.
  • playerEffectOnEnter: You can specify an effect that will be active and added to the player as long as he will stay in this scene.
  • isIndoor: A boolean value that specifies if the scene is indoor or outdoor.
  • isLoosingBags: A boolean value that specifies if in this scene npcs are allowed to loose bags.
  • isLoosingMoney: A boolean value that specifies if in this scene npcs are allowed to loose wallets.
  • loosingCheckInterval: Every how many minutes game time should a check be made, to see if anyone looses anything?
  • loosingItemProbability: A precentage value that states the probability anyone is loosing anything on every loosingCheckInterval
  • pavementSpriteName: The name and location of the sprite to use as a pavement (check first part for more info).

The objects collection contains a number of static objects that will be rendered on the base pavement of the scene. The can be tiled or not and can have a collider or not. They represent scene features like buildings, static objects or graphic features like streets of grass ecc.
We will now examine a single object parameters and their functions.

  • sceneObjectId: give this object a unique string id.
  • sceneObjectType: Static is the only choice now, but I could add more types later.
  • sceneObjectSprite: The name and location of the sprite to use for this object (check first part for more info).
  • positionX: the x position of this object. Note that 0 being the center of the map and the value is expressed in game units (1 game unit = 64px)
  • positionY: the y position of this object. Note that 0 being the center of the map and the value is expressed in game units (1 game unit = 64px)
  • spriteRotation: the rotation of the sprite.
  • isCollider: if set to true this object will have a collider active following the paraters descripted later.
  • colliderType: box is the only choice for now!
  • boxColliderSizeX: the width of the collider active for this object. Note that 0 being the center of the map and the value is expressed in game units (1 game unit = 64px)
  • boxColliderSizeY: the height of the collider active for this object. Note that 0 being the center of the map and the value is expressed in game units (1 game unit = 64px)
  • boxColliderOffsetX: the horizontal offset of the collider active for this object. Note that 0 being the center of the map and the value is expressed in game units (1 game unit = 64px)
  • boxColliderOffsetY: the vertical offset of the collider active for this object. Note that 0 being the center of the map and the value is expressed in game units (1 game unit = 64px)
  • boxColliderEdgeRadius: This is not yet implemented.
  • isTiled: If set to true this object will be tiled as a texture (useful for long walls or streets: look at the code!).
  • tileSizeWidth: the width of the tiled object. Note that 0 being the center of the map and the value is expressed in game units (1 game unit = 64px)
  • tileSizeHeight: the height of the tiled object. Note that 0 being the center of the map and the value is expressed in game units (1 game unit = 64px)

Spawners are added to the scene pretty much like static objects. And they have fewer attributes to be set:

  • modSpawnerId: Specify here the id of the spawner you want the game to place here.
  • modSpawnerPositionX: the x position of this spawner. Note that 0 being the center of the map and the value is expressed in game units (1 game unit = 64px)
  • modSpawnerPositionY: the y position of this spawner. Note that 0 being the center of the map and the value is expressed in game units (1 game unit = 64px)
  • modSpawnerRotation: the rotation of the spawner.
  • spawnerColliderRadius: specify here the radious of the circle collider you want to attach to this spawner.

Fixed furnitures are pretty much regular furnitures, except that they are fixed onto the map and can't be removed.

  • modFixedFurnitureId: Specify here the id of the furniture you want the game to place here.
  • modFixedFurnitureUniqueId: Specify here a UNIQUE id you want to give to this furniture.
  • modFixedFurniturePositionX: the x position of this spawner. Note that 0 being the center of the map and the value is expressed in game units (1 game unit = 64px)
  • modFixedFurniturePositionY: the y position of this spawner. Note that 0 being the center of the map and the value is expressed in game units (1 game unit = 64px)
  • modFixedFurnitureRotation: the rotation of the furniture.
  • isLocked: if isLocked is set to true players can't interact with this furniture.
  • isPackable: if isPackable is set to true players will be able to pack and pick up this furniture.

In this guide i analyzed the entries presented in the previous guide. There a lot more that can be achieved with the modding features of Hard Times, and I will try to make more guides as soon as possible.
Thank you for reading!
If you have problems or find errors in this guide please get in touch at info@tempi-duri.net.

You could leave a comment if you were logged in.
  • adding_a_new_level_pt.2.txt
  • Last modified: 2019/02/19 11:28
  • by thorfinio