You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As alternative_sprite blocks can be placed away from their 'parent' sprites, the NML syntax implies you can do things like define alternative_sprites in a conditional block which are used only when that condition is met. For example:
As alternative_sprite definitions have the global action of providing alternative sprites for a uniquely named block of sprites, the requirement could be that they are only placed outside of conditional statements. Similar behaviour to template definition.
Prevent 'orphan' definitions of alternative sprites: If an alternative_sprite definition is in a conditional statement, require the 'parent' block of sprites is also defined in that conditional statement.
Option 1 is a heavy-handed change that may break existing NML which functions as expected. This would no longer be valid:
if (climate==CLIMATE_TEMPERATE) {
replace sprite_set_1(....
alternative_sprites (sprite_set_1, ...
}
Option 2 would prevent both syntax issues above. But, would it solve all cases?
As
alternative_sprite
blocks can be placed away from their 'parent' sprites, the NML syntax implies you can do things like definealternative_sprites
in a conditional block which are used only when that condition is met. For example:This doesn't work as you'd expect from the code. The alternative sprites are always used irrespective of climate.
The syntax also allows some quite nonsensical definitions:
Such behaviour is not possible for NewGRFs (cf. NFO specs) as alternative sprites are just one part of the definition of a single real sprite.
Some example NML and images:
redef-alternate.zip
The text was updated successfully, but these errors were encountered: