Each of my houses has 4 views since initially it was going to be an eyecandy set and I would like to be able to take advantage of it for my town set, that the houses can detect the roads and orient themselves correctly. In another topic Eddi and Andrew helped me and I already have it working for 1x1 templates but now I want to do it for 2x1.
I know that doing it for 4 views would perhaps be a lot to ask and I honestly do not know if it is possible to have 4 different views in a House as you have in the eyecandy objects, so im thinking to do it only for 1 view and repeat that Code/house 4 times changing the graphic and the orientation, In that way a eyecandy house with 4 different views / oriented graphics would actually become inside the code in 4 different houses, one for view / detected road.
I just need to know how to add street detection to this example of my set,
I want the house to only appear if it detects a street in SW (1,0)
Thanks in advance guys.
Code: Select all
//HOUSE 6 2x1 --------------------------------------------------------------
//template for the frontsprite
template template_realhouse6_front(x,y,filename) {
[x+2, y+2, 64, 64, -1, -1, filename]
[x+2, y+2, 64, 64, -1, -1, filename]
[x+2, y+2, 64, 64, -1, -1, filename]
[x+2, y+2, 64, 64, -1, -1, filename]
}
//template for the frontsprite 32
template template_realhouse6_front_32(x,y,filename) {
[x+15, y+77, 264, 264, -126, -118, filename] //1f
[x+561, y+77, 264, 264, -131, -136, filename] //2f
[x+848, y+77, 264, 264, -125, -136, filename] //3f
[x+1392, y+77, 264, 264, -123, -135, filename] //4f
}
//template for the backsprite
template template_realhouse6_back(x,y,filename) {
[x+2, y+2, 64, 64, -1, -1, filename]
[x+2, y+2, 64, 64, -1, -1, filename]
[x+2, y+2, 64, 64, -1, -1, filename]
[x+2, y+2, 64, 64, -1, -1, filename]
}
//template for the backsprite 32
template template_realhouse6_back_32(x,y,filename) {
[x+141, y+16, 264, 264, -127, -115, filename] //1b
[x+429, y+16, 264, 264, -135, -133, filename] //2b
[x+973, y+16, 264, 264, -128, -133, filename] //3b
[x+1264, y+16, 264, 264, -123, -132, filename] //4b
}
//template 2x1
//spritesets with 4 directions.
spriteset (spriteset_template_realhouse6_001_front) {
template_realhouse6_front(0,0,"gfx/template_realhouse_001.png")
}
alternative_sprites (spriteset_template_realhouse6_001_front, ZOOM_LEVEL_IN_4X, BIT_DEPTH_32BPP) {
template_realhouse6_front_32(0,0,"gfx/template_realhouse_32_002.png")
}
spriteset (spriteset_template_realhouse6_001_back) {
template_realhouse6_back(0,0,"gfx/template_realhouse_001.png")
}
alternative_sprites (spriteset_template_realhouse6_001_back, ZOOM_LEVEL_IN_4X, BIT_DEPTH_32BPP) {
template_realhouse6_back_32(0,0,"gfx/template_realhouse_32_002.png")
}
//Direction_1
spritelayout spritelayout_template_realhouse6_001_front_1 {
ground {
// normal ground sprite - always draw
sprite: LOAD_TEMP(0) + LOAD_TEMP(1);
}
building {
sprite: spriteset_template_realhouse6_001_front(0);
hide_sprite: nearby_tile_height(0, 0) >= snowline_height;
xoffset: 0; //from NE edge
yoffset: 0; //from NW edge
zoffset: 0;
xextent: 16;
yextent: 16;
zextent: 16;
}
}
spritelayout spritelayout_template_realhouse6_001_back_1 {
ground {
// normal ground sprite - always draw
sprite: LOAD_TEMP(0) + LOAD_TEMP(1);
}
building {
sprite: spriteset_template_realhouse6_001_back(0);
hide_sprite: nearby_tile_height(0, 0) >= snowline_height;
xoffset: 0; //from NE edge
yoffset: 0; //from NW edge
zoffset: 0;
xextent: 16;
yextent: 16;
zextent: 16;
}
}
item (FEAT_HOUSES, item_realhouse_006, -1, HOUSE_SIZE_2X1) {
property {
substitute: 74;
name: string(STR_template_realhouse_006);
building_flags: bitmask();
population: 255;
mail_multiplier: 22;
accepted_cargos: [[PASS, 8], [MAIL, 2], [GOOD, 2]];
local_authority_impact: 150;
removal_cost_multiplier: 180;
probability: 1.0 * 0.33;
years_available: [1930, 9999];
minimum_lifetime: 10;
// availability_mask: [bitmask(TOWNZONE_CENTRE, TOWNZONE_INNER_SUBURB, TOWNZONE_OUTER_SUBURB), bitmask(CLIMATE_TEMPERATE, CLIMATE_ARCTIC, ABOVE_SNOWLINE, CLIMATE_TROPICAL)];
availability_mask:[ALL_TOWNZONES, ALL_CLIMATES | bitmask(ABOVE_SNOWLINE)];
random_colours: [COLOUR_DARK_BLUE, COLOUR_DARK_BLUE, COLOUR_DARK_BLUE, COLOUR_DARK_BLUE];
refresh_multiplier: 0;
building_class: 0;
}
graphics {
graphics_north: spritelayout_template_realhouse6_001_back_1;
graphics_west: spritelayout_template_realhouse6_001_front_1;
}
}