Zephyris' Houses (and other things) in NML questions
Moderator: Graphics Moderators
Re: Zephyris' Houses in NML questions
New question: Why do sprite sets in a sprite layout require the same number of sprites? Or is there a more subtle distinction I'm not aware of? For example:
I have 4 random variants of a house. There are 4 different snow overlays. This all makes sense, the sprite sets have a 1:1 correspondence (4 houses, 4 overlays) and are picked using the same variable (in my case, LOAD_TEMP(1)).
I want to add fences to the buildings, picked from a set of 16 sprites depending on the neighbouring roads. Now things get messy. I can pick the fence sprites from the fence sprite set using a different variable (in my case, animation_frame). However, if I try to do this nml gives an error, saying the sprite sets for the building (4 houses, 4 snow overlays, 16 fences) are not the same size...
I can get around this by adding 12 dummy sprites to the house and overlay sets, but that's a big waste if sprites and is very inelegant!
Is this a real limitation, or am I misunderstanding? Or is there some clever way around this I haven't thought of?
I have 4 random variants of a house. There are 4 different snow overlays. This all makes sense, the sprite sets have a 1:1 correspondence (4 houses, 4 overlays) and are picked using the same variable (in my case, LOAD_TEMP(1)).
I want to add fences to the buildings, picked from a set of 16 sprites depending on the neighbouring roads. Now things get messy. I can pick the fence sprites from the fence sprite set using a different variable (in my case, animation_frame). However, if I try to do this nml gives an error, saying the sprite sets for the building (4 houses, 4 snow overlays, 16 fences) are not the same size...
I can get around this by adding 12 dummy sprites to the house and overlay sets, but that's a big waste if sprites and is very inelegant!
Is this a real limitation, or am I misunderstanding? Or is there some clever way around this I haven't thought of?
Re: Zephyris' Houses in NML questions
In totally different news, I wanted to modify the default recolouring sprites so made a reference of what they look like without modification. These should be correct, but I haven't tested them.
DOS: Windows: Looking over them the bare earth (791) and church (1438, 1439) are pretty weird; there's not a lot of logic to them. It'd probably make sense to modify these in OpenGFX...
DOS: Windows: Looking over them the bare earth (791) and church (1438, 1439) are pretty weird; there's not a lot of logic to them. It'd probably make sense to modify these in OpenGFX...
Re: Zephyris' Houses in NML questions
This is a limitation of NML. Mixing spritesets of different sizes is only supported by OpenTTD after NML was designed, and NML has not been updated since.Zephyris wrote:New question: Why do sprite sets in a sprite layout require the same number of sprites? Or is there a more subtle distinction I'm not aware of? For example:
Why would you want to modify the default recolouring sprites? Just add new ones.Zephyris wrote:In totally different news, I wanted to modify the default recolouring sprites so made a reference of what they look like without modification. These should be correct, but I haven't tested them.
You can reference them in the sprite_layout.
Also, the original recolouring sprites are defined by the original graphics and won't be changed.
Also, when it comes to recolouring, use TTDViewer
https://dev.openttdcoop.org/projects/ttdviewer
Should work, looks like a bug in NML.Zephyris wrote: In NML a spritelayout can take parameters for offset in a sprite set, (...)
I would have thought you could use a similar approach to modify recolouring, eg:
Also, if you want to disable recolouring, use the palette PALETTE_IDENTITY.
It probably works, but usually you allow players to remove all houses. Removal by AIs and town-growth itself can be intentionally blocked via "HOUSE_FLAG_PROTECTED" or the "protected" callback.Zephyris wrote:New question: Is it intentional behaviour to be able to block removal of buildings by setting the local authority rating impact to greater than 1000? I'm not complaining (it would be very useful for landmark-type buildings) but I found it a little surprising.
Town var 0x80 only really works for 256x256 maps.michael blunck wrote:accessing town var 0x80
⢇⡸⢸⠢⡇⡇⢎⡁⢎⡱⢸⡱⢸⣭⠀⢸⢜⢸⢸⣀⢸⣀⢸⣭⢸⡱⠀⢰⠭⡆⣫⠰⣉⢸⢸⠀⢰⠭⡆⡯⡆⢹⠁⠀⢐⠰⡁
Re: Zephyris' Houses in NML questions
Ah, ok, feature request submittedfrosch wrote:This is a limitation of NML. Mixing spritesets of different sizes is only supported by OpenTTD after NML was designed, and NML has not been updated since.
I didn't have any luck with this; I'm using the house colour callback to switch recolour palettes.frosch wrote:Why would you want to modify the default recolouring sprites? Just add new ones.
You can reference them in the sprite_layout.
Code of this type:
Code: Select all
recolour_sprite (recolour_sprite_greys) {
0x46..0x4F: 0x04..0x0D; //Structure red/browns to greys
0xC6..0xCD: 0x01..0x08; //Company colour 1 to dark greys
0x50..0x57: 0x90..0x97; //Company colour 2 to dark blues
}
switch (FEAT_HOUSES, SELF, switch_house_redrecolour_random_paintedhouse, [
(random_bits>>4)%7
]) {
0: PALETTE_CC_WHITE;
1..2: recolour_sprite_greys;
3..6: PALETTE_STRUCT_WHITE;
PALETTE_STRUCT_WHITE;
}
item(FEAT_HOUSES, item_house_thatched, 0) {
property {
substitute: 25;
name: string(STR_HOUSE_THATCHED_NAME);
population: 10;
mail_multiplier: 2;
accepted_cargos: [[PASS, 2], [MAIL, 1], [FOOD, 1]];
local_authority_impact: 75;
removal_cost_multiplier: 75;
probability: 6;
years_available: [0, 1950];
availability_mask: [bitmask(TOWNZONE_EDGE), ALL_CLIMATES | bitmask(ABOVE_SNOWLINE)];
random_colours: [COLOUR_WHITE, COLOUR_GREY, COLOUR_BROWN, COLOUR_DARK_GREEN];
building_class: 10; //Detached class
}
graphics {
construction_check: switch_house_thatched_constrcheck;
colour: switch_house_redrecolour_random_paintedhouse;
anim_control: switch_house_aminframe_4road;
default: switch_house_thatched_constr;
}
}
Code: Select all
Palette is not recognized as a valid palette.
I'd argue the OpenGFX recolouring sprites could be modified; it'd make sense to me to alter the bare ground and church recolours...Also, the original recolouring sprites are defined by the original graphics and won't be changed.
Bug reportedfrosch wrote:Should work, looks like a bug in NML.
What's the issue? Is it limited to a byte or similar? I'd like to have a random (or pseudorandom) variable for towns. As I understand it there are no random bits for towns?frosch wrote:Town var 0x80 only really works for 256x256 maps.
Re: Zephyris' Houses (and other things) in NML questions
I still want to use recolouring, but I still can't get it to work! Does anyone have any ideas about this?
Re: Zephyris' Houses (and other things) in NML questions
Have you ever been able to get it to work?
I would like to try to have objects that randomly recolor the blue Company Colors, but some working examples (doesnt have to be objects) would be nice
Projects: http://www.tt-forums.net/viewtopic.php?f=26&t=57266
Screenshots: http://www.tt-forums.net/viewtopic.php?f=47&t=56959
Scenario of The Netherlands: viewtopic.php?f=60&t=87604
Winner of the following screenshot competitions:
sep 2012, jan 2013, apr 2013, aug 2013, mar 2014, mar 2016, oct 2020
All my work is released under GPL-license (either V2 or V3), if not clearly stated otherwise.
Screenshots: http://www.tt-forums.net/viewtopic.php?f=47&t=56959
Scenario of The Netherlands: viewtopic.php?f=60&t=87604
Winner of the following screenshot competitions:
sep 2012, jan 2013, apr 2013, aug 2013, mar 2014, mar 2016, oct 2020
All my work is released under GPL-license (either V2 or V3), if not clearly stated otherwise.
Re: Zephyris' Houses (and other things) in NML questions
I haven't tested it recently (last 2 years) but no success last time I tried!
Re: Zephyris' Houses (and other things) in NML questions
Over in this thread:
viewtopic.php?p=1251088#p1251088
2TallTyler wrote what he did to get it to work for his houses.
Sadly doesnt instantly do the trick for objects too, but it may possibly help you in the future.
Projects: http://www.tt-forums.net/viewtopic.php?f=26&t=57266
Screenshots: http://www.tt-forums.net/viewtopic.php?f=47&t=56959
Scenario of The Netherlands: viewtopic.php?f=60&t=87604
Winner of the following screenshot competitions:
sep 2012, jan 2013, apr 2013, aug 2013, mar 2014, mar 2016, oct 2020
All my work is released under GPL-license (either V2 or V3), if not clearly stated otherwise.
Screenshots: http://www.tt-forums.net/viewtopic.php?f=47&t=56959
Scenario of The Netherlands: viewtopic.php?f=60&t=87604
Winner of the following screenshot competitions:
sep 2012, jan 2013, apr 2013, aug 2013, mar 2014, mar 2016, oct 2020
All my work is released under GPL-license (either V2 or V3), if not clearly stated otherwise.
Re: Zephyris' Houses (and other things) in NML questions
Recolouring of houses and objects is a no-brainer. I do that all the time (in NFO), and it works.
There is more than one way to skin that cat. You are probably mixing things up.
Now, I don't do NML, it is Not My Language; but you can send me the GRF (so I can get the NFO code) and I have a look where you are going wrong ...
-
- Tycoon
- Posts: 5950
- Joined: 27 Apr 2005 07:09
- Contact:
Re: Zephyris' Houses (and other things) in NML questions
Probably a bug in that nml (?).
I'm using recolouring of houses and objects in m4nfo (based on nfo) and it works.
regards
Michael
I'm using recolouring of houses and objects in m4nfo (based on nfo) and it works.
regards
Michael
Who is online
Users browsing this forum: No registered users and 3 guests