News:

Welcome to World of Banished!

Main Menu

MOD: Modding Friendly Nomad Generation

Started by JamieIdle2.0, November 14, 2014, 09:08:27 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

slink

Yes, @JamieIdle2.0.

I added the following code to the UIDescription section.

{
ObjectType _type = ImmigrationUI;
ElementDescription _element = "Dialog/Immigration.rsc";
String _insertAt = "pageTab";
ElementDescription _tabButton = "Dialog/TownHall.rsc:buttonNomad";
}



JamieIdle2.0

@slink how bizarre I did the same thing and it didn't work. I will re try.

JamieIdle2.0

@slink you must have did something else beyond add that bit of code. That was what I tried and never got the tab.

slink

Here is my entire Inn template file.

// layout of the entity
ComponentDescription resource
{
// how often to update
UpdatePriority _updatePriority = Fourth;

// declare types that will be used
Description _descriptions
[
"ui",

"map",
"zone",
"toolbar",
"createplaced",
"decal",
"model",
"highlight",
"picking",
"interact",
"particle",
"storage",
"work",
"statusicon",
"ambientemitter",
"Common.rsc:fireWoodHouse",

"statemachine",
"cleararea",
"build",
"workplace",
"destroy",
"residence",
"immigration",
]
}

AmbientEmitterDescription ambientemitter
{
bool _addOnCreate = false;
SoundEffect _soundEffects
[
"Audio/Effects/FireEffect.rsc"
"Audio/Effects/CrowdEffect.rsc"
]
}


ClearAreaDescription cleararea { }
StateMachineDescription statemachine { }
ZoneDescription zone { }


DestroyDescription destroy
{
int _damagedSkin = 1;
int _damagedDecal = 1;
}

StatusIconDescription statusicon
{
SpriteSheet _spriteSheet = "StatusIcons\BuildingIconSpriteSheet.rsc";
bool _fixedSize = true;
float _size = 0.04;
float _zoffset = 1.33;
}

ToolbarDescription toolbar
{
SpriteSheet _spriteSheet = "UI/MathieusoHousesSpriteSheet.rsc";
String _spriteName = "BuildInn";

StringTable _stringTable = "UI/MathieusoHousesStringTable.rsc";
String _stringName = "Inn";
String _stringNameLwr = "InnLwr";
String _toolTip = "InnTip";

String _statusStrings
[
"CreateOk",
"CreateBlocked",
]

int _group = 2;
}

CreatePlacedDescription createplaced
{
PathBits _placeBits = Normal | Obstacle;

int _width = 7;
int _height = 10;
int _footprintRotation = 0;

PathBits _placeBitArray
[
Normal | Obstacle,
Normal | Obstacle | Fast | Faster,
]
String _placeBitmap =
"0000001
0000001
0000001
0000001
0000001
0000001
0000001
0000001
0000001
1111111";

ComponentDescription _allowAndRemove = "Template/Clear.rsc";
}

MapDescription map
{
PathType _pathType = Immovable;
String _pathBitmap =
"######.
##__##.
##__##.
##__##.
##__##.
#____#.
#____#.
#____#.
###_##.
.......";

bool _addToOverhead = false;
Color _mapColor = 0xFF545454;
}

DecalDescription decal
{
MaterialInstance _materials
[
"Models/MaterialInstance/InnFootprintMaterial.rsc"
"Models/MaterialInstance/InnFootprintDamageMaterial.rsc"
]
bool _tiled = false;
float _initialAlpha = 0.75;
float _mapWidth = 512.0;

DecalLocation _decalLocations
[
{
float _x0 = 0.0;
float _y0 = 0.0;
float _x1 = 360.0;
float _y1 = 512.0;
}
]
}

PickingDescription picking
{
MaterialInstance _selectMaterial = "Material/SelectionMask/SelectionMask.rsc";
PickingGroup _meshes
[
{
PickingMesh _mesh
[
"Models\InnBuild01Picking.rsc",
"Models\InnBuild02Picking.rsc",
"Models\InnPicking.rsc"
]
}
]
}

ModelDescription model
{
MeshGroup _meshes
[
{
GraphicsMesh _mesh
[
"Models\InnBuild01Mesh.rsc",
"Models\InnBuild02Mesh.rsc",
"Models\InnMesh.rsc"
]
}
]

int _displayIndex = 0;
int _subIndex = 0;
bool _randomIndex = false;
}

HighlightDescription highlight
{
EdgeGroup _meshes
[
{
EdgeMesh _mesh
[
"Models\InnBuild01Mesh.rsc:edge"
"Models\InnBuild02Mesh.rsc:edge"
"Models\InnMesh.rsc:edge"
]
}
]

// materials for drawing selection with no mesh
MaterialInstance _maskMaterial = "Material/SelectionMask/SelectionMask.rsc";
MaterialInstance _edgeMaterial = "Material/SelectionEdge/SelectionEdge.rsc";
}


InteractDescription interact
{
PointList _pointList = "Models\InnPoints.rsc";
}

ParticleDescription particle
{
PointList _pointList = "Models\InnPoints.rsc";

ParticleAttachment _systems
[
{
Time _fadeInOutTime = 2.0;
bool _addOnCreate = false;
bool _addOnNotify = false;
Particle _particle = "ParticleSystems\Fire\FireLarge.rsc";
}
{
bool _addOnCreate = false;
Particle _particle = "ParticleSystems\ChimneySmoke\ChimneySmoke.rsc";
String _attachNode = "smoke1";
}

]
}

StorageDescription storage
{
RawMaterialFlags _storageFlags = Edible | Fuel;
bool _areaBasedLimit = false;
bool _available = false;
int _volumeLimit = 1000;
}

WorkDescription work
{
int _defaultWorkers = 1;
}

WorkPlaceDescription workplace
{
// no actual work done here once the building is built
//Profession _profession = null;
//Profession _pickupProfession = "Game/Profession/Profession.rsc:laborer";
}

BuildDescription build
{
int _workRequired = 150;

BuildRequirement _buildRequirement
[
{
ComponentDescription _rawMaterial = "Template/RawMaterialWood.rsc";
int _count = 80;
}
{
ComponentDescription _rawMaterial = "Template/RawMaterialStone.rsc";
int _count = 40;
}
{
ComponentDescription _rawMaterial = "Template/RawMaterialIron.rsc";
int _count = 15;
}
]
}

ResidenceDescription residence
{
int _maxApartments = 3;
int _maxOccupants = 5;
float _temperatureForFuel = 48.0;
float _fuelPerResource = 60.0;
}
//SJGL
ImmigrationDescription immigration
{
ComponentDescription _nomad = "Template/Nomad.rsc";

int _requiredPopulation = 8;
ComponentDescription _requiredStructures
[
"Template/DoctorHouse.rsc"
]

float _minGroupPercent = 0.05;
float _maxGroupPercent = 0.15;
float _timeDelayMonths = 24;
float _timeDelayMonthsTol = 48;
int _arriveMinMonth = 1;
int _arriveMaxMonth = 3;
int _leaveMonth = 7;
int _spawnRadius = 5;

float _sicknessAmount = 1.0;
int _sicknessTimeInMonths = 6;
}

UIDescription ui
{
int _displayPage = 1; // set to 1 for tab layout
Dialog _dialog = "Dialog/StandardDialog.rsc:entity";

ElementController _controllers
[
{
ObjectType _type = ResidenceUI;
ElementDescription _element = "Dialog/Residence.rsc:residenceLong";
String _insertAt = "pageTab";
ElementDescription _tabButton = "Dialog/Residence.rsc:buttonTabResidence";
}
{
ObjectType _type = StorageUI;
ElementDescription _element = "Dialog/Storage.rsc:storageShort";
String _insertAt = "pageTab";
ElementDescription _tabButton = "Dialog/Storage.rsc:buttonTabStorage";
}
//SJGL
{
ObjectType _type = ImmigrationUI;
ElementDescription _element = "Dialog/Immigration.rsc";
String _insertAt = "pageTab";
ElementDescription _tabButton = "Dialog/TownHall.rsc:buttonNomad";
}

{
ObjectType _type = BuildUI;
ElementDescription _element = "Dialog/Build.rsc:build";
String _insertAt = "pageBuild";
}
{
ObjectType _type = DestroyUI;
ElementDescription _element = "Dialog/Destroy.rsc:destroy";
String _insertAt = "pageDestroy";
}
{
ObjectType _type = WorkPlaceUI;
ElementDescription _element = "Dialog/Work.rsc:workPlace";
String _insertAt = "userTitle0";
}
{
ObjectType _type = StatusIconUI;
ElementDescription _element = "Dialog/Building.rsc:icons";
String _insertAt = "userTitle1";
}
]
}

JamieIdle2.0

Here's mine and yet no tab :/

// layout of the entity
ComponentDescription resource
{
// how often to update
UpdatePriority _updatePriority = Fourth;

// declare types that will be used
Description _descriptions
[
"ui",

"map",
"zone",
"toolbar",
"createplaced",
"decal",
"model",
"highlight",
"picking",
"interact",
"particle",
"storage",
"work",
"statusicon",
"ambientemitter",
"Common.rsc:fireWoodHouse",

"statemachine",
"cleararea",
"build",
"workplace",
"destroy",
"residence",
"immigration",
]
}

AmbientEmitterDescription ambientemitter
{
bool _addOnCreate = false;
SoundEffect _soundEffects
[
"Audio/Effects/FireEffect.rsc"
"Audio/Effects/CrowdEffect.rsc"
]
}

ClearAreaDescription cleararea { }
StateMachineDescription statemachine { }
ZoneDescription zone { }

DestroyDescription destroy
{
int _damagedSkin = 1;
int _damagedDecal = 1;
}

StatusIconDescription statusicon
{
SpriteSheet _spriteSheet = "StatusIcons\BuildingIconSpriteSheet.rsc";
bool _fixedSize = true;
float _size = 0.04;
float _zoffset = 1.33;
}

ToolbarDescription toolbar
{
SpriteSheet _spriteSheet = "Dialog/SpriteSheet.rsc";
String _spriteName = "BuildHostel";

StringTable _stringTable = "Dialog/StringTable.rsc:objects";
String _stringName = "Hostel";
String _stringNameLwr = "HostelLwr";
String _toolTip = "HostelTip";

String _statusStrings
[
"CreateOk",
"CreateBlocked",
]

int _group = 2;
}

CreatePlacedDescription createplaced
{
PathBits _placeBits = Normal | Obstacle;

int _width = 7;
int _height = 14;
int _footprintRotation = 270;

PathBits _placeBitArray
[
Normal | Obstacle,
Normal | Obstacle | Fast | Faster,
]
String _placeBitmap =
"1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000";

ComponentDescription _allowAndRemove = "Template/Clear.rsc";
}

MapDescription map
{
PathType _pathType = Immovable;
String _pathBitmap =
"._#####
._#####
._#####
.######
.######
.######
.######
.######
.######
.######
.######
._#####
._#####
._#####";

bool _addToOverhead = true;
Color _mapColor = 0xFF545454;
}

DecalDescription decal
{
MaterialInstance _materials
[
"Terrain/TiledDecals/BuildingFootprint8Material.rsc"
"Terrain/TiledDecals/BuildingFootprint8DamageMaterial.rsc"
]
bool _tiled = false;
float _initialAlpha = 0.5;
float _mapWidth = 2048.0;

DecalLocation _decalLocations
[
{
float _x0 = 1024.0;
float _y0 = 0.0;
float _x1 = 1408.0;
float _y1 = 768.0;
}
]
}

PickingDescription picking
{
MaterialInstance _selectMaterial = "Material/SelectionMask/SelectionMask.rsc";
PickingGroup _meshes
[
{
PickingMesh _mesh
[
"Models\Buildings\Hostel\HostelBuild01Picking.rsc",
"Models\Buildings\Hostel\HostelBuild02Picking.rsc",
"Models\Buildings\Hostel\HostelPicking.rsc"
]
}
]
}

ModelDescription model
{
MeshGroup _meshes
[
{
GraphicsMesh _mesh
[
"Models\Buildings\Hostel\HostelBuild01Mesh.rsc",
"Models\Buildings\Hostel\HostelBuild02Mesh.rsc",
"Models\Buildings\Hostel\HostelMesh.rsc"
]
}
]

int _displayIndex = 0;
int _subIndex = 0;
bool _randomIndex = false;
}

HighlightDescription highlight
{
EdgeGroup _meshes
[
{
EdgeMesh _mesh
[
"Models\Buildings\Hostel\HostelBuild01Mesh.rsc:edge"
"Models\Buildings\Hostel\HostelBuild02Mesh.rsc:edge"
"Models\Buildings\Hostel\HostelMesh.rsc:edge"
]
}
]

// materials for drawing selection with no mesh
MaterialInstance _maskMaterial = "Material/SelectionMask/SelectionMask.rsc";
MaterialInstance _edgeMaterial = "Material/SelectionEdge/SelectionEdge.rsc";
}


InteractDescription interact
{
PointList _pointList = "Models\Buildings\Hostel\HostelPoints.rsc";
}

ParticleDescription particle
{
PointList _pointList = "Models\Buildings\Hostel\HostelPoints.rsc";

ParticleAttachment _systems
[
{
Time _fadeInOutTime = 2.0;
bool _addOnCreate = false;
bool _addOnNotify = false;
Particle _particle = "ParticleSystems\Fire\FireLarge.rsc";
}
{
bool _addOnCreate = false;
Particle _particle = "ParticleSystems\ChimneySmoke\ChimneySmoke.rsc";
String _attachNode = "smoke01";
}
{
bool _addOnCreate = false;
Particle _particle = "ParticleSystems\ChimneySmoke\ChimneySmoke.rsc";
String _attachNode = "smoke02";
}
{
bool _addOnCreate = false;
Particle _particle = "ParticleSystems\ChimneySmoke\ChimneySmoke.rsc";
String _attachNode = "smoke03";
}
{
bool _addOnCreate = false;
Particle _particle = "ParticleSystems\ChimneySmoke\ChimneySmoke.rsc";
String _attachNode = "smoke04";
}
]
}

StorageDescription storage
{
RawMaterialFlags _storageFlags = Edible | Fuel;

bool _areaBasedLimit = false;
bool _available = false;
int _volumeLimit = 5000;
}

WorkDescription work
{
int _defaultWorkers = 3;
}

WorkPlaceDescription workplace
{
// no actual work done here once the building is built
//Profession _profession = null;
//Profession _pickupProfession = null;
}

BuildDescription build
{
int _workRequired = 150;

BuildRequirement _buildRequirement
[
{
ComponentDescription _rawMaterial = "Template/RawMaterialWood.rsc";
int _count = 100;
}
{
ComponentDescription _rawMaterial = "Template/RawMaterialStone.rsc";
int _count = 45;
}
]
}

ResidenceDescription residence
{
int _maxApartments = 5;
int _maxOccupants = 5;
float _temperatureForFuel = 45.0;
float _fuelPerResource = 60.0;
}
//add nomads
ImmigrationDescription immigration
{
ComponentDescription _nomad = "Template/Nomad.rsc";

int _requiredPopulation = 8;
ComponentDescription _requiredStructures
[
]

float _minGroupPercent = 0.05;
float _maxGroupPercent = 0.15;
float _timeDelayMonths = 24;
float _timeDelayMonthsTol = 48;
int _arriveMinMonth = 1;
int _arriveMaxMonth = 3;
int _leaveMonth = 7;
int _spawnRadius = 5;

float _sicknessAmount = 1.0;
int _sicknessTimeInMonths = 6;
}

UIDescription ui
{
int _displayPage = 1; // set to 1 for tab layout
Dialog _dialog = "Dialog/StandardDialog.rsc:entity";

ElementController _controllers
[
{
ObjectType _type = ResidenceUI;
ElementDescription _element = "Dialog/Residence.rsc:residenceLong";
String _insertAt = "pageTab";
ElementDescription _tabButton = "Dialog/Residence.rsc:buttonTabResidence";
}
{
ObjectType _type = StorageUI;
ElementDescription _element = "Dialog/Storage.rsc:storageShort";
String _insertAt = "pageTab";
ElementDescription _tabButton = "Dialog/Storage.rsc:buttonTabStorage";
}
//add nomad tab
{
ObjectType _type = ImmigrationUI;
ElementDescription _element = "Dialog/Immigration.rsc";
String _insertAt = "pageTab";
ElementDescription _tabButton = "Dialog/TownHall.rsc:buttonNomad";
}

{
ObjectType _type = BuildUI;
ElementDescription _element = "Dialog/Build.rsc:build";
String _insertAt = "pageBuild";
}
{
ObjectType _type = DestroyUI;
ElementDescription _element = "Dialog/Destroy.rsc:destroy";
String _insertAt = "pageDestroy";
}
{
ObjectType _type = WorkPlaceUI;
ElementDescription _element = "Dialog/Work.rsc:workPlace";
String _insertAt = "userTitle0";
}
{
ObjectType _type = StatusIconUI;
ElementDescription _element = "Dialog/Building.rsc:icons";
String _insertAt = "userTitle1";
}
]
}

JamieIdle2.0

@slink try it with the boarding house and not the inn may there is something in the sprite sheets? I don't know this seems odd to me.

slink

Okay, I will have to make an override.  In the meantime, here is the Inn with the nomad tab.  I also tried it with a new start, in case having a Town Hall was important.  The Inn in the new start also had the nomad tab.

JamieIdle2.0

Quote from: slink on November 15, 2014, 10:58:36 AM
Okay, I will have to make an override.  In the meantime, here is the Inn with the nomad tab.  I also tried it with a new start, in case having a Town Hall was important.  The Inn in the new start also had the nomad tab.

Yeah I tried the file you sent the Inn works and I saw the tab. Not sure why it wont show up with the Hostel/Boarding house the only template file differences are in the Toolbar referencing different sprite sheets, but that should effect the building UI

slink

You are correct, the hostel override doesn't have a tab.

slink

Ah, but the override does work in the non-kit version of the game!

JamieIdle2.0

Quote from: slink on November 15, 2014, 11:26:18 AM
Ah, but the override does work in the non-kit version of the game!

Wow and here I was banging my head away wonder why on earth it wouldn't work! lol

Mahnogard

I just got my first group of nomads from @slink's "Room at the Inn" mod. :D (I needed them, too. I don't often take in nomads, but sometimes stuff happens.)


slink


Herrbear