Jump to content

Allow More Building Styles - DLL Plugin  3.6.1

   (4 Reviews)

1 Screenshot

About This File

A DLL Plugin for SimCity 4 that allows the game to use more than 4 building styles.

This DLL mod is intended as a dependency for other mods that add new building styles beyond the 4 that Maxis included, it does not add any building styles to the game by itself.

Maxis programmed the Building Style Control UI to only recognize the check boxes of the 4 built-in styles, no matter how may check boxes are actually present. This mod patches the game's memory to remove that restriction.

Build all styles at once

The DLL fixes a game bug to make this feature work as Maxis intended.

Adding More Building Styles into SC4

The building style IDs are assigned in the SimCity 4 Building Styles Index thread, you will need to use the existing style ID(s) listed there or request your own building style ID range.

Modifying the Building Styles UI

The easiest way to get started is to download the Building Style UI template, but you can also create your own Building Style Control override plugin.

Building Style UI Template

A UI template is available here, which supports all of the new controls the DLL adds.
The UI Template can be configured using either BuildingStyles.ini or the Building Style exemplars.
Once you have configured your styles in BuildingStyles.ini or the style exemplars, see the section below on assigning buildings to custom styles.

Creating a Custom Building Style UI

  1. Create a patch that overrides the default Building Style Control UI, TGI 0x00000000,0x96a006b0,0x6bc61f19 in SimCity_1.dat.
  2. Edit the UI to add the style check boxes, and optionally the new check boxes and radio buttons that the DLL supports. The check box or style ID (e.g. 0x2003) identifies the building style to the game.
  3. See the section below on assigning buildings to custom styles.

Adding Buildings to Custom Building Styles

This process is performed with ilive's Reader or PIMX.

The building's intended styles should be added to the building exemplar using the Building Styles property (property id 0xAA1DD400). The building will only grow when one or more of the custom or Maxis styles in that property is selected in the game's UI. The DLL will ignore the building styles in the Occupant Groups property (property id 0xAA1DD396) when the Building Styles property is present.

For compatibility with players who are not using the DLL, the Maxis styles in the Occupant Groups property should be left alone. If you are creating a new building, add the Building Styles property for users with the DLL and set the Occupant Groups property to one or more of the 4 Maxis styles for users without the DLL.

For Wall-to-Wall (W2W) buildings, add the Building Is Wall-to-Wall property (property id 0xAA1DD401) to the building's exemplar with the value set to true. If the Building Is Wall-to-Wall property is not present or the value is set to false, the building will be treated as non-W2W.

See the Building Styles Exemplar Property (0xAA1DD400) and Building Is Wall-to-Wall Exemplar Property (0xAA1DD401) sections for more details.

New Building Exemplar Properties

Building Styles Exemplar Property (0xAA1DD400)

This property allows the building styles that are active when the DLL is installed to be specified separately from the Maxis building styles in the Occupant Groups property (0xAA1DD396).

Residential and Commercial Buildings

The Building Styles property is optional for custom building style support in residential and commercial buildings.

When the property is present, the building will use custom and Maxis styles specified in the property and ignore the styles in the Occupant Groups property (0xAA1DD396).
When the property is not present, the building will use the custom and Maxis styles specified in the Occupant Groups property (0xAA1DD396).

Industrial Buildings

The Building Styles property is mandatory for custom building style support in industrial buildings.

When the property is present, the building will use custom styles specified in the property.
When the property is not present, the building will be treated as compatible with all styles.

Building Is Wall-to-Wall Exemplar Property (0xAA1DD401)

This is a Boolean property, a value of true indicates that the building is W2W. If the value is false or the property is not present, the building will not be considered W2W. This is the preferred method for identifying W2W buildings that do not already have one of the W2W occupant groups.

Building Style Check Box Tool Tips

The individual building styles can have a tool tip that describes the style when the user hovers over that check box.

When defining styles in a Building Style exemplar, the tool tip can be set with the Building Style Exemplar: ToolTip Key property. For styles that are defined in BuildingStyles.ini, the tool tips must use the LTEXT group id 0x3EE5B610 with the style id as the LTEXT instance id.

The group id supports the standard language offset scheme. The style id is used as the LTEXT instance id. For example, the 0x2004 building style in would use the following TGI in German: 0x2026960B, 0x3EE5B614, 0x00002004.

Tool tips can optionally have a title in addition to a body, this is done by placing both on a single line with a pipe separator. For example: ToolTip Title|Tool tip body
Note that how the game displays tool tips with both a title and body will depend on the user's game settings. If the user has unchecked the expanded tooltips check box in the play options dialog, the game will display the tool tip title (if present) or the body, but not both.

Building Style Exemplars

These exemplars provide a way for building style mods to define the style check boxes without requiring the user to edit BuildingStyles.ini.

See the Building Style Exemplars page for more information.

Cheat Codes

The DLL provides the following cheat codes:

ActiveStyle shows an in-game message box with the ID of the currently active style when Change building style every N years is selected. When Build all styles at once is selected, using this cheat will display a message saying that mode is active.

DebugActiveStyles writes the IDs of all the active/checked styles to the plugin's log file.

BuildingStyles INI File

This file allows styles to be defined without editing the Building Style Control UI file. When the check box button ids for the Building Style Control are in the range of 0-127, these ids can be mapped to a specific style and style name in BuildingStyles.ini.

The style entries are placed under a BuildingStyles section and use the following format:

<UI button id> = <style id>,<style text format>[,<style name>]

<UI button id> is a style check box id in the range of 0-127.
<style id> is the building style id assigned in the Building Style Index, or
the text Show (case-insensitive) to display a disabled placeholder check box.
<style text format> is one of the following values: N (normal text) or B (bold text).
<style name> is optional, when present it uses one of the following formats:
<name> or CaptionRes:<LTEXT group id>,<LTEXT instance id>.
If <style name> is not present, a default name will be used.

Examples:

0 = 0x2005,B,Mediterranean & Tropical
1 = 0x2006,N,CaptionRes:0x6a231eaa,0x6bbbd875
2 = Show,N,Placeholder Check Box
3 = Show,B

SC4MoreBuildingStyles INI File

This file contains settings that control whether the growable debug logging code will write to the plugin's log file. It is recommended that you only enable these options for experimentation. They will slow down your game and quickly produce a large log file.

As an example from one of my tests, a 22 second run with the BuildingStyleSelection and LotStyleSelection options enabled produced a ~2 MB log file with ~15,500 lines.

Lua Functions

The DLL provides a number of building style related functions for use by Lua scripts. See building_style.lua for a list of the provided functions, and building_style_tests.lua for examples of their use.

System Requirements

The plugin may work on Windows 7 or later, but I do not have the ability to test that.

Installation

  1. Close SimCity 4.
  2. Copy SC4MoreBuildingStyles.dll, SC4MoreBuildingStyles.ini, and BuildingStyles.ini into the top-level of the Plugins folder in the SimCity 4 installation directory or Documents/SimCity 4 directory.
  3. Start SimCity 4.

Troubleshooting

The plugin should write a SC4MoreBuildingStyles.log file in the same folder as the plugin.
The log contains status information for the most recent run of the plugin.

Source Code and Support

Plugin thread: https://community.simtropolis.com/forums/topic/762969-allow-more-building-styles-dll-plugin/

The plugin's source code and issue tracker are located on GitHub: https://github.com/0xC0000054/sc4-more-building-styles

  If you would like to make voluntary contributions to support me in continuing to create more content for SimCity 4, I accept donations via PayPal: https://paypal.me/0xC0000054
 

Thanks to the few people who have donated to me.


What's New 3.6.1   View Changelog


Released

Work around a bug in the lot aggregation/subdivision blocking.

  • Like 27
  • Thanks 5



User Feedback

Recommended Comments

I can see fantastic opportunities arising from this mod. A diversity in buildings growing throughout the town, without relying on building/prop family, is the one, most important benefit that I can see...

However, it would be good to have a bit more in-depth tutorial on how one can edit the overridden UI file that you suggest should be created. Even just a basic information on how to add the actual checkbox for an additional building style (it doesn't have to be pretty, just functional *;)).

I'm really eager to test this out but I don't know how to add checkboxes to control my envisaged building sets.

Share this comment


Link to comment
Share on other sites
14 hours ago, TheMurderousCricket said:

However, it would be good to have a bit more in-depth tutorial on how one can edit the overridden UI file that you suggest should be created. Even just a basic information on how to add the actual checkbox for an additional building style (it doesn't have to be pretty, just functional *;)).

I am not an expert on editing UI files, so there probably is a better technique than what I have been using. As I have mentioned previously, editing the census repository query UI to work with my MoreDemandInfo mod took longer than writing the DLL. *:)

The process I used with ilive's UIEditor is as follows:

  1. Export the decompressed UI file from the DAT and load it in the UIEditor.
  2. Delete/resize one or more of the preview images to make space in the dialog.
  3. Make one or mode copies of an existing radio button, and place them in the new space.
  4. Select each new button, click properties, and change the ID to a unique value 0x2004, 0x2008, etc.
    • This value is how the game will identify the style, it must be unique.
    • The unique value requirement is the reason for the warning that is currently on the mod page, as of this post it has not yet been decided how the new building style IDs will be handled in the larger SC4 modding ecosystem.
  5. Change the Radio button name.
  6. Save the modified file.
  7. Import the modified UI file back into the DAT.

I didn't post more detailed instructions on the mod description because I assumed that this mod would be used as a dependency, and anyone using it would already know how to edit the UI files. I also have a post with the edited UI file that I created for my testing.

  • Like 1

Share this comment


Link to comment
Share on other sites
On 18.02.2024 at 9:19 AM, Null 45 said:

Make one or mode copies of an existing radio button, and place them in the new space.

For now, this is actually the only step that eludes me...

How did you actually copy this button? When I click on the appropriate lines, all I get is actually a "properties" popup... *:???: Definitely no "copy" or "paste" options.

On 18.02.2024 at 9:19 AM, Null 45 said:

The unique value requirement is the reason for the warning that is currently on the mod page, as of this post it has not yet been decided how the new building style IDs will be handled in the larger SC4 modding ecosystem.

I'm actually ok with that because I always reedit the building styles. Whatever happens, I think I will still have my own sets and simply adjust anything I download, so I'm happy to test your dll regardless of these considerations.

Share this comment


Link to comment
Share on other sites
3 hours ago, TheMurderousCricket said:

How did you actually copy this button?

The UIEditor has copy and paste buttons in the toolbar.

Share this comment


Link to comment
Share on other sites

How does one access those features like the Auto-Growify Check Box?

Let's say I plop down a typical CS$$ building. I click on it with the query tool but I don't see that Auto-Growify Check Box to toggle.

Share this comment


Link to comment
Share on other sites
1 hour ago, CahosRahneVeloza said:

How does one access those features like the Auto-Growify Check Box?

Let's say I plop down a typical CS$$ building. I click on it with the query tool but I don't see that Auto-Growify Check Box to toggle.

You also need to download an extra menu mod in which there is a checkbox that enables this option.

Share this comment


Link to comment
Share on other sites
1 hour ago, CahosRahneVeloza said:

How does one access those features like the Auto-Growify Check Box?

20 minutes ago, TheMurderousCricket said:

You also need to download an extra menu mod in which there is a checkbox that enables this option.

There's one here. *;)

  • Like 2

Share this comment


Link to comment
Share on other sites
15 hours ago, TheMurderousCricket said:

You also need to download an extra menu mod in which there is a checkbox that enables this option.

An Addendum to add such an additional mod as a required dependency should be included on the Information section for this mod then, don't you folks think? *:lol:

15 hours ago, CorinaMarie said:

There's one here. *;)

Thanks *:thumb:

  • Like 1

Share this comment


Link to comment
Share on other sites
9 hours ago, CahosRahneVeloza said:

An Addendum to add such an additional mod as a required dependency should be included on the Information section for this mod then, don't you folks think? *:lol:

That certainly sounds logical to me. *:ohyes:

Maybe @Null 45 will edit in said linky sometime. *;)

  • Like 1

Share this comment


Link to comment
Share on other sites
7 minutes ago, CorinaMarie said:

Maybe @Null 45 will edit in said linky sometime. *;)

Done. If the community styles ever get finalized, it would make sense for that template to be uploaded to the STEX.

  • Like 3

Share this comment


Link to comment
Share on other sites
7 minutes ago, Null 45 said:

If the community styles ever get finalized, it would make sense for that template to be uploaded to the STEX.

That ball has sort of been in my court for a couple or three months inasmuch as @Ulisse Wolf requested that we (the admins) set up a poll to determine what the final styles should be. I'm uncertain exactly how to start that since my erratic schedule often means I don't get consecutive hours in the day to really concentrate on a big project.

What might work well is if all those involved in the styles discussion come up with the plan and the poll then we (CB and me) simply endorse it?

  • Like 2

Share this comment


Link to comment
Share on other sites

I forgot to ask about the added "No Kickout Lower Wealth Residents" Checkbox. Does this mean this mod can also supercede the "No Kickout Lower Wealth Residents" DLL mod too?

Share this comment


Link to comment
Share on other sites
1 hour ago, CahosRahneVeloza said:

I forgot to ask about the added "No Kickout Lower Wealth Residents" Checkbox. Does this mean this mod can also supercede the "No Kickout Lower Wealth Residents" DLL mod too?

Yes.

However, I keep my original NKO in plugins because @Null 45 coded their DLL to be .dat aware. *:)

If the DLL sees the .dat, it'll always default to NKO enabled in the checkbox. Then you can turn it off selectively for any given city tile and it will remember that when you save.

OTOH, if you do not have NKO in your plugins then the DLL will default to not enabled and you'd have to click it on one time for each and every city tile and save. :O That's way too easy to forget. :meh:
 

tl;dr: Keep my NKO file in plugins if you want NKO always (or even 99% of the time). The DLL is smart and will do the right thing. *;)

  • Like 2

Share this comment


Link to comment
Share on other sites
1 hour ago, CahosRahneVeloza said:

So these two DLL mods are kinda complimenting and supporting each other then? That's awesome *:idea:

Yes, indeed. Extremely good programming. *:ohyes:

So the difference is which way do you want your default to be. I'm an NKOer and as such I want that as my default. Other peeps want rapid replacement growth and they can take the other route.

  • Like 1

Share this comment


Link to comment
Share on other sites

I believe it wasn't answered in the development thread but is 0xAA1DD401 now the only value that instructs a W2W development?

Do I have to change the previous W2W modifiers for the game to recognize particular buildings as W2W?

Share this comment


Link to comment
Share on other sites
1 hour ago, TheMurderousCricket said:

Do I have to change the previous W2W modifiers for the game to recognize particular buildings as W2W?

No, the Building Is Wall-to-Wall (0xAA1DD401) property is backwards compatible. If it is not present in the building exemplar, the Maxis OccupantGroups property will be checked for the appropriate values.

The Building Styles (0xAA1DD400) exemplar property is backwards compatible for residential and commercial buildings. If it is not present in the building exemplar, the Maxis OccupantGroups property will be checked for the appropriate values. Note that this does not apply to industrial buildings, they must always use the Building Styles exemplar property.

  • Like 1
  • Thanks 2

Share this comment


Link to comment
Share on other sites

I don't understand how I can create a new building style. I want to say: how can I assign a ID new style and rename it?

Share this comment


Link to comment
Share on other sites

Sign In or register to comment...

To comment in reply, you must be a community member

Sign In  

Already have an account? Sign in here.

Sign In Now

Create an Account  

Sign up to join our friendly community. It's easy!  

Register a New Account

×

Thank You for the Continued Support!

Simtropolis depends on donations to fund site maintenance costs.
Without your support, we just would not be in our 24th year online!  You really help make this a great community. *:thumb:

But we still need your support to stay online. If you're able to, please consider a donation to help us stay up and running. This helps sustain a platform where we can share our community creations for years to come.

Make a Donation, Get a Gift!

Expand your city with the best from the Simtropolis Exchange.
Make a Donation and get one or all three discs today!

STEX Collections

By way of a "Thank You" gift, we'd like to send you our STEX Collector's DVD. It's some of the best buildings, lots, maps and mods collected for you over the years. Check out the STEX Collections for more info.

Each donation helps keep Simtropolis online, open and free!

Thank you for reading and enjoy the site!

More About STEX Collections