I am trying to use a random switch to recolor one of the views of an object.
Code is like this:
Code: Select all
random_switch (FEAT_OBJECTS, SELF, RandomColour_01) {
1: return COLOUR_BLUE;
2: return COLOUR_RED;
}
Can anyone help?
Moderator: Graphics Moderators
Code: Select all
random_switch (FEAT_OBJECTS, SELF, RandomColour_01) {
1: return COLOUR_BLUE;
2: return COLOUR_RED;
}
To isolate the issue...does the recolour to red work otherwise (in a test case without a random switch)?
It will recolor to any color I put first, but to none of the colors I place later on.andythenorth wrote: ↑16 Aug 2022 19:56To isolate the issue...does the recolour to red work otherwise (in a test case without a random switch)?
Code: Select all
switch (FEAT_OBJECTS, SELF, RandomColour_2x1_Random01, view) {
0: RandomColour_01;
1: return COLOUR_ORANGE;
}
I asked on OpenTTD Discord...
[21:53] JGR: The recolour callback is called before the object is placed on the map, so there are no random bits yet...
[21:56] frosch: https://github.com/OpenTTD/OpenTTD/comm ... 77b1c7120d <- there was a similar thing for industries and houses
[21:56] frosch: looks like the same problem was added for objects
Thnx for asking!
Yes not possible currently, could be possible in future - it would need a change for objects, similar to the change that was made for houses.
Righto! Thanks Andy for clearing that up!andythenorth wrote: ↑17 Aug 2022 09:08 Yes not possible currently, could be possible in future - it would need a change for objects, similar to the change that was made for houses.
Users browsing this forum: No registered users and 10 guests