Code: Select all
item(FEAT_INDUSTRIES, ....) {
...
graphics {
...
location_check: build_distance_check;
...
}
}
Moderator: Graphics Moderators
Code: Select all
item(FEAT_INDUSTRIES, ....) {
...
graphics {
...
location_check: build_distance_check;
...
}
}
Code: Select all
" switch (FEAT_INDUSTRIES, SELF, freight_depot_build_distance_check, town_zone(0, 0)) { 5 .. 20: CB_RESULT_LOCATION_ALLOW; return CB_RESULT_LOCATION_DISALLOW; "
Code: Select all
" location_check: freight_depot_build_distance_check; "
Oh indeed! Townzone has only very descrete values. The distance to the town centre is something different than town zone.Transportman wrote:That is because the return of town_zone is not 5..20, but something else, so your switch always disallows. The values to check for are listed here.
If you want to check the actual distance to the town center, you should look at town_manhattan_dist and town_euclidean_dist.
so, you defined a switch, but you did not use it in industry block to attach it to a callback.GarryG wrote:I get the message: is not referenced, ignoring.
Code: Select all
item(FEAT_INDUSTRIES, freight_depot, 62) {
graphics {
location_check: build_distance_check;
}
}
Code: Select all
switch (FEAT_INDUSTRIES, SELF, freight_depot_town_distance, town_manhattan_dist(0, 0)) {
10 .. 20: return CB_RESULT_LOCATION_ALLOW;
return CB_RESULT_LOCATION_DISALLOW;
}
Code: Select all
item(FEAT_INDUSTRIES, freight_depot, 62) {
graphics {
location_check: freight_depot_town_distance;
}
}
Code: Select all
switch (FEAT_INDUSTRIES, SELF, set_company_colour, founder_colour1)
{
2: return founder_colour2;
return founder_colour1;
}
//... in graphic section:
colour: set_company_colour;
Code: Select all
spritelayout building1 {
(...)
building {
(...)
recolour_mode: RECOLOUR_REMAP;
palette: PALETTE_USE_DEFAULT;
}
}
Well, it's two things:McZapkie wrote:Thanks, didn't know that it should be defined in spritelayout (I checked only industry tiles).
Yes. From the callback documentation: " Called after constructing the industry. The colour variable is set to a random value at this point, you can use this callback to change this. "McZapkie wrote:If recolours are defined, and callback not, random colours would appears? I observed something like it.
Users browsing this forum: No registered users and 17 guests