Jump to content

Null 45

Member
  • Content Count

    1,078
  • Joined

  • Last Visited

  • Most Liked  

    18

Everything posted by Null 45

  1. New Modern 3D Camera Plugin

    That is due to the fact that it prevents the game from receiving mouse wheel messages as a brute force way to bypass the Maxis mouse wheel zooming behavior. That Maxis code could be jumped out with a memory patch that redirects to code the DLL provides, but that is more complex to implement due to the fact that it requires working directly with x86 assembly language. I found the location of the cSC4View3DWin_GZOnMouseWheel function in the v641 binary (0x007e6b50), and I also found what I think is a good hook inject point (offset 0x007e6c1a). I may have to try building the plugin and submitting a PR if I get the patch working.
  2. Query Tool UI Extensions DLL

    Release version 2.7.0, which has the following changes: Allow copying the exact building from a building family. Depreciate the use of hexadecimal string parameters. This was fundamentally broken due to Lua automatically converting hexadecimal strings that start with numbers to a decimal number. Hexadecimal strings are supported for backwards compatibility, but callers should convert the strings to a number with the hex2dec function to ensure correct behavior for all possible values.
  3. A DLL plugin that adds various enhancements to the building query tool and query dialog. For DLL developers, it also provides services that can be used to add more building query values and/or customize the building and network tool tips. Download: https://community.simtropolis.com/files/file/36202-query-tool-ui-extensions-dll-for-SimCity-4/ Source Code: https://github.com/0xC0000054/sc4-query-ui-hooks Shift + Click Object Copying Some objects can be copied by holding down the shift key and clicking on them with the query tool. Buildings Clicking a building will activate the Place Lot tool with the building's lot selected. Flora Clicking certain flora types will activate the Place Flora tool with that flora type selected. Note that this only works with the flora objects that have a hover query tool tip. New Building Query Variables The DLL provides a number of new variables that can be used in the LTEXT files of a building query dialog in the form of #variable_name#. See the Query Variable List page on GitHub. Lua Function to Read Occupant Properties A null45_query_ui_extensions.get_property_value function is provided to allow query UIs to read occupant exemplar properties. This can be used to show properties that are not in the Query Variable List page, or use Lua code to customize the display formatting of the occupant property values. See null45_query_ui_extensions.lua for details. Extended Terrain Query The TerrainQuery command now shows the x, y, and z variables without truncating to the first decimal place, and the cell moisture value is now provided as part of the standard query info. Alternate Terrain Query This mode is accessed by holding the Alt key. It shows the humidity and ambient wind information, this data appears to be for the entire tile instead of varying per-cell. Pollution Terrain Query This mode is accessed by holding the Ctrl key. It shows the flammability, land value, mayor rating, and pollution (air, water, garbage, and radiation). Advanced Query Tool Tips These tool tips are accessed by holding Control + Alt + Shift when hovering over an appropriate item. Flora This tool tip provides the flora object's exemplar name, birth date, and last seeding date. Network This tool tip provides technical info about the transportation networks, excluding power lines and pipes. Props This tool tip provides the prop object's exemplar name. SC4QueryUIHooks INI File This file contains the following options. EnableOccupantQuerySounds This option controls whether the query sounds are played when clicking on an item to open the query dialog or copy the lot, the default is true. The occupant query sound properties affected by this option are SFX:Query Sound, SFX:Query Sound Abandoned and SFX:Query Sound Decayed. LogBuildingPluginPath This option controls whether the building name and plugin file path will be written to the log file when the query dialog is opened, the default is false. System Requirements SimCity 4 version 641 Windows 10 or later Microsoft Visual C++ 2022 x86 Redistribute The plugin may work on Windows 7 or later, but I do not have the ability to test that. Installation Close SimCity 4. Copy SC4QueryUIHooks.dll, SC4QueryUIHooks.dat, and SC4QueryUIHooks.ini into the top-level of the Plugins folder in the SimCity 4 installation directory or Documents/SimCity 4 directory. Start SimCity 4. Troubleshooting The plugin should write a SC4QueryUIHooks.log file in the same folder as the plugin. The log contains status information for the most recent run of the plugin. 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.
  4. New Modern 3D Camera Plugin

    It works for me, but since it is a Debug build it won't work for most people due to needing to have Visual Studio 2022 with the C++ tools installed to get those debug CRT DLLs. Even beta DLLs should be Release builds for public distribution because the Microsoft Visual C++ 2022 redistributable does not include the debug versions of the runtime. Is there a way to reset the camera to the Maxis defaults?
  5. So your tool works like the Maxis LotPlop cheat, picking a lot and then letting the game fill in a potentially random building? AFAICT the BuildingPlop cheat works in two stages, effectively calling LotPlop with a restricted set of lots after the user picks a building. I also recently learned that the Navigator feature in Ilives Reader resolves building families and parent cohorts, it is a neat feature but the code is hard to decipher. The lot plop view input control can be made to select a specific lot and building variant using constructor parameters, which I use in my Lua Extensions DLL to allow for scripted lot plopping.
  6. In your external parser? I had set up parent cohort resolving in my assign building styles tool, but I never did anything with the lot configurations.
  7. Post Modding Requests Here

    I am not sure how it keeps track of jobs, the lots and neighbor connections have 'trip data' which includes things like the path that commuter takes through the tile. Based on the fact the eternal commuter bug exists Maxis doesn't appear to have tracked the cities visited through neighbor connections, which would have broken that loop by stopping it from visiting the same city more than once.
  8. Post Modding Requests Here

    An article on SC4D speculates on some of the game's limitations with the traffic simulation/job finding based on the observable behavior, but only the original designers at Maxis would know for sure what the limits are. Specifically it mentions that the game appears to have a hard coded commute time limit of 6 minutes in the path finder, and Maxis also appears to have dumbed down that system for the retail build of the game (likely due to the minimum requirements the game had to run on).
  9. New Modern 3D Camera Plugin

    You should be able to replace both the mouse and keyboard hooks with that filter function, and maybe rename it from HandleCanvasMouseMessage to something like CanvasMessageFilter. Although that would make the filter method more complex. It also looks like the keyboard filter is only used for debug logging, so perhaps that code could be removed from release builds or gated behind a debug logging switch in an INI file. The modern approach for SC4 DLLs is typically to reference the main gzcom-dll repository as a submodule without modifying its code, which allows you to easily update to new gzcom-dll versions. Git submodules also used for any simple dependencies that are header only (e.g. WIL - which greatly simplifies using various Windows APIs), with more complex libraries like boost being handled through a C++ package manager. I also have a repository of common SC4 DLL code that contains code for logging, INI reading, version detection, memory patching, etc. Also, it is customary for SC4 DLLs to list all dependencies and their licenses in the project's readme.
  10. New Modern 3D Camera Plugin

    Interesting idea, it is nice to have more people developing SC4 DLLs . Other DLLs may also hook the middle click message in the city view, but there is no way to know if that would be a conflict. From the Mac symbols, Maxis defined button up/down message codes for the middle mouse button, but they never got around to checking for those messages in the game's window procedure or adjusting the rest of the code to provide middle mouse button support. I find that a shame as you could do some fun things with a ViewInputControl that had middle click filtering, such as implement this type of mod. The city right click scrolling is implemented as a ViewInputControl. Looking at the code I have a few notes: Deriving from cRZMessage2COMDirector could have saved you the effort of reimplementing the QueryInterface/AddRef/Release logic. SC4 has a built-in way of hooking window messages, the AddWinProcFilter function in the cIGZCanvasW32 interface. My Region Census UI DLL uses that interface to implement a middle click hook in the region view.
  11. There is also a Started a petition for EA to release SimCity 4 source code topic on r/SimCity that attracted the attention of a former Maxis artist who worked on SC4 (u/vertexnormal). They mention in the topic that they have copies of all the art source material (and possibly pre-release builds mentioned in another topic), but didn't grab the code and are not sure if EA still has copies. There is also a comment on the building/bridge creation which is a fun read. While I know there is no chance of those pre-release builds ending up in public, especially since someone publicly admitted to possibly having them. IMO that would be a close second to the actual source code in terms of the number of things that could be discovered. I expect some of those internal builds may have things like: Ingred and all the related editors active with the proper file layout. Full Windows debug symbols (and perhaps even a full debug build, which would limit compiler magic). Plus a ton of other possibilities depending on the specific build, like getting a build with the original intended traffic simulator before they altered it to run on low-spec machines.
  12. Does your image match the format the meter images use? I would expect it to be changeable for the query UI, but Maxis hard coded the meter image ids for tool tips. The performance meter is specific to the education, health, fire, police, and utility buildings. Each one of those uses a specific control id that makes the game fill in the appropriate info.
  13. EA has been releasing source code for some older games in recent years, specifically a few games from the Command & Conquer franchise. But it is my understanding that only happened due to an EA insider with connections to the franchise pushing for source code to be released as part of a remaster that was already in the works, and AFAIK there isn't anyone connected to the SimCity franchise still working at EA. The Command & Conquer source code is also not in a state where anyone could build an exact replica of the existing binaries, as the code has dependencies that EA could not or would not include. There is someone who was working on using AI to do that with the SC4 32-bit Mac binaries (which have partial debug information, thank you Aspyr ), but last I heard it would take their local LLM models months to complete the necessary documentation. Even if that is successful in creating all the necessary documentation (of which I am highly skeptical), you would still need programmers to write new code based on that documentation. You may also have a situation where many DLL developers are taken out of the pool of programmers due to the fact that they would have done reverse engineering of EA's code. The same individual was also trying to find people to contact within EA to ask about the actual source code, which I think is a slightly more feasible route. From this post by Karbydis, EA openly admitted to early SC4 modders that code modifications could be made with DLL plugins. But they never officially provided the necessary information to do so. AFAIK the current DLL advances are largely due to the to two things: The late Paul Pedriana (Lead programmer on SC3K and SC4) leaking a few pieces of source code that describe what SC4 looks for when loading DLL plugins, and encouraging reverse engineering of the rest of the game's interfaces. The previously mentioned partial debug information that Aspyr left in the 32-bit Mac binaries, which allowed many of the game's interfaces to be reconstructed. But there are limitations with this strategy. The compilers can modify how things are laid out when compared to the original source code. When porting the code Aspyr removed and changed a number of internal things that have no effect on game-play, but are in some cases visible to code plugins. Most notably they removed the code that would have allowed the game to load the Mac equivalent of DLL plugins. Although Apple security restrictions would likely have killed that eventually even if they left it in. My understanding of the history is that EA's red line has always been distributing modified versions of the EXE, and while many DLLs modify the game's code when it is running the EXE on disk remains untouched. The 4GB patch modifies the EXE by changing an option the OS reads when starting it, but I doubt there would be any issue with that as long as no one distributes a pre-patched executable (but I am not a lawyer).
  14. Yes, as it uses hex2dec. The edits mentioning the string parsing could be removed, but that can be done whenever you have the time to restore the images.
  15. I don't think there is, AFAIK automatic type conversion is a basic feature of the Lua language. The fix is to convert hexadecimal strings to numbers using the hex2dec function before passing them to any function that requires them, same as what Maxis code was already doing. I was surprised by the automatic type conversion myself, but I confirmed it in the debugger on the C++ side. I only learned about the issue after a user reported they were getting errors due to the bad type conversion. I am not sure why I never ran into it myself earlier, possibly because many of my test values had a letter as the first character which would prevent the incorrect detection of a decimal number. If I had known about the possibility of Lua performing an automatic conversion of a string to a number, I would have never added the hexadecimal string code.
  16. This method is depreciated due to it only working correctly for hexadecimal values that start with a letter. The code still exists in the DLL, but only to maintain backwards compatibility with existing mods that may be in the wild. I updated the Lua Extensions DLL to officially depreciate it, but I forgot that the Query Tool UI Extensions DLL had similar code. The issue is that when the C++ side asks Lua 'is this parameter a number', the Lua system will try to convert the string to a decimal number stopping on the first hexadecimal letter. Obviously a hexadecimal string that gets parsed fully or partially as decimal will produce incorrect results.
  17. The Maxis extra cheats DLL would also work under XP. I don't know if SC4Fix works under XP, that would depend on the compiler and build settings. Even Windows 7/8/8.1 are not officially supported by most DLL mods, those OSes may work but it is up to Microsoft if they want to support those OSes with the Visual Studio 2022 C++ x86 redistributeable. AFAIK Windows 7 and later are supported by Visual Studio 2022, but Visual Studio 2026 only supports Windows 10+. How are you running Windows XP, a virtual machine? That could be a hardware or driver issue in the OS. Note that you really should not be running any OS that no longer receives vendor security patches on a machine that is connected to the internet.
  18. How Proximity Effects Work?

    I have no idea, it may not have anything to do with mayor rating. The origin of those names are the kind of details that only the original developers would know.
  19. How Proximity Effects Work?

    No idea. Whatever it is it appears to be the successor to a HappinessCurve from an older game, likely SC3K based on the leftovers that hint at early SC4 builds having been bootstrapped from that game's data.
  20. Simtropolis Returns!

    I was wondering about that. As far as I can tell, the STEX interface available to regular users only allows uploading a new version of a file, not replacing the download attachment of an existing version. For the DLLs that are on GitHub it may be possible for the replacement process to be automated by reading the STEX versions and grabbing the matching download from GitHub.
  21. SimCity 4 randomly crashes

    Based on the Steam system requirements, I think that was the minimum when the game was released in 2003. Which has been out of support since 2014 and can't run SC4 with DLL mods. You didn't specify the brand of GPU, but based on the Dell Latitude E5520 spec sheet I am guessing that it is probably Intel integrated graphics. You may need to use a DirectX wrapper if your GPU doesn't support the legacy DirectX version SC4 uses.
  22. @CasperVg The Powershell script could be made smarter by automatically grabbing the installation directory from the Windows Registry. Here is a Powershell script that implements that based on C# code I wrote to do the same thing: function Get-SC4-Installation-Folder { $path = "$env:PROGRAMFILES(x86)\SimCity 4 Deluxe Edition" # We need to open the 32-bit registry view due to SC4 being a 32-bit application. $hklm = [Microsoft.Win32.RegistryKey]::OpenBaseKey([Microsoft.Win32.RegistryHive]::LocalMachine, [Microsoft.Win32.RegistryView]::Registry32) if ($hklm) { $key = $hklm.OpenSubKey("SOFTWARE\\Maxis\\SimCity 4") if ($key) { $value = $key.GetValue("Install Dir") if ($value) { $path = $value } } } return $path } $sc4path = Get-SC4-Installation-Folder echo $sc4path Also, you can disable execution restrictions for a specific script by using the following in a command window: powershell -executionpolicy unrestricted -file <script path> This is more secure than disabling them globally for the current user.
  23. The opposite. The plant would (possibly) explode when the age degradation reached 100%, and I would expect the efficiency bulbs in the Maxis vanilla query to be unlit before that. See the image and description in this post.
  24. Query Tool UI Extensions DLL

    I had originally designed the DLL to require the use of hex2dec for the same reason, but I found that some people were forgetting to use it and the error was hard to spot due to hex strings looking correct for those APIs. It was easier to change the DLL to support that behavior than to make people rewrite existing code to use hex2dec. I had also never documented the need for hex2dec outside of the example/test code. Sometimes using numbers is easier, e.g. writing 1 instead of '00000001'.
  25. Query Tool UI Extensions DLL

    Release version 2.6.3, which has the following changes: Added a larger test/example suite for the Lua code. Made the null45_query_ui_extensions.get_property_value function easier to use by letting it read a hexadecimal string in addition to a number. The fact that null45_query_ui_extensions.get_property_value required the hexadecimal string to be converted to a number with hex2dec was easy to miss. Old code: local exemplar_name = null45_query_ui_extensions.get_property_value(hex2dec('00000020')) New Code: local exemplar_name = null45_query_ui_extensions.get_property_value('00000020')
×