-
Announcement
-
Simtropolis Returns! 05/26/2026
See here for details about our site recovery efforts.
-
Search the Community
Showing results for tags 'method'.
Found 6 results
-
(Tutorial) Updating Lot Monthly Cost While Avoiding Phantom Budget Predicaments
CorinaMarie posted a topic in SC4 Modding - Open Discussion
(Tutorial) Updating Lot Monthly Cost While Avoiding Phantom Budget Predicaments This tutorial is in reply to @TheMurderousCricket from his post here. The key part being: This is an advanced concept I introduced in Crime and Police Station Fixes for ModPacc Zero. I'm going to use the vanilla Open Grass Park as the sample for this tutorial. Here's the extracted version if'n y'all want to follow the steps: Open Grass Sample for Cricket - File 1 - Original Extraction.dat Step 01: Pic showing the initial file opened in Reader 0.9.3: In File Explorer, copy that to a new file and give it a new name. I made mine Open Grass Sample for Cricket - File 2 - Cori Updated - v0.01.dat. Step 02: Control + Click the first three entries: Right click them, select Copy File(s) then right click in the white space below the DIR entry and select Paste File(s). Step 03: It should now look like this: Step 04: Right click the newly copied LotConfigurations Exemplar and select Generate New Instance ID: Step 05: Edit the IID of the new Building Exemplar to have the same IID as the new LotConfigurations: Step 06: Generate a new IID for the newly copied LText and update the verbiage: Step 07: Go to the corresponding original LText and update its verbiage: Step 08: In the original Building exemplar, open the OccupantGroups property: ^ The 0x00001006 value tells it in which menu to will appear. Step 09: We want to remove it from the menu so it can no longer be selected. Remove the 0x00001006 and it now looks like this: ^ Be sure to click the first Apply button followed by the 2nd Apply button. Step 10: Update the name in the new LotConfigurations entry: ^ This isn't strictly necessary, but you'll thank yourself for it later. Step 11: Change Rep 13 of the LotConfigPropertyLotObject (the one that starts with 0x00000000) to the IID of the new building exemplar: ^ Apply and Apply. Step 12: Update the name in the new Building Exemplar: Step 13: Update the IID in the User Visible Name Key to match the IID of the new LText: Step 14: Update the Lot Resource Key to match the IID of the new LotConfigurations entry: Step 15: Update the Budget Item Cost: ^ Note: In this case I'm going for minus 10 Simoleons per month. While it converts an entry to 16 hex digits, you need to only enter 8 digits. So for this I typed in 0xFFFFFFF6 then Apply and Apply. Step 16: Here's how it looks with those changes: Step 17: Single click the DIR entry: Step 18: Right click and select Remove File. This pic shows it is now gone: Step 19: Save the file. Close the file. Reopen the file. It'll now have a new DIR entry: Ofc, be sure your new file loads last or you've removed any other overrides for the Maxis Open Grass lot. Step 20: In the game when you query a previously plopped Open Grass lot it'll show the correct original cost and it'll have the new name we gave it: Step 21: Find the Open Grass in the Parks Menu: ^ Note: Only the new one will show because we told the original to hide (by removing the 0x00001006 OccupantGroups value). Step 22: Hovering over a plop of the new one with the query tool will show the new name: Step 23: And here's the query of the updated lot: -
ReShade and SimCity 4: A horrible experiment
Toby Ferrian posted a topic in SimCity 4 General Discussion
After seeing the recent discussions about using DirectX wrappers to run SimCity 4 at higher resolutions, I thought, can I use this to run ReShade with SimCity 4? The answer, to quote myself from Discord, is: In this thread I will share the results of my experimentation. Prepare yourselves, we are about to tread on unholy ground. To make this work, I used the dgVoodoo2 wrapper, along with the latest version of ReShade at the time of this writing, ReShade 4.8.2. I also ran the game at 1440p. If you wish to try this yourself, download dgVoodoo2 and extract the files within the MS\x86 folder within the zip file into the game's Apps folder, same as the game's exe file. ReShade comes with its own installer, so I will not provide instructions for that here. (Note: The performance impact of all this is minimal on my system, but your mileage may vary.) Once both are installed, simply run the game, and you should see the following: The ReShade overlay at the top of the screen, and the dgVoodoo2 watermark in the bottom right. If you see both of these, you are now able to see the horrors I have witnessed with your own two eyes. Now let's move on to my experiments. Antialiasing Easily the best use of ReShade within SimCity 4, at least in my opinion. It simply smooths out jagged edges in an image. It does not make a huge difference, but it results in a softer image. In my opinion, it looks much nicer than it did before, and is the only effect I can recommend using for normal gameplay. HDR HDR will make the image look more vibrant and colorful. With the right settings, it can look great. However, I don't recommend enabling it for normal gameplay, only for screenshots. The reason: Like all other effects, it also affects the user interface. Bloom don't just don't but if you do anyway, it will allow for some fantastic night shots: It can also be combined with other effects for an even better result: It might even look good during the day, but in my experimentation I found that it mostly ends up too bright: However, do make sure you hide the UI and unpause the game first, otherwise the bloom from the UI will bleed into whatever you're taking a screenshot of: And do be careful when adjusting the settings, otherwise you might find your eyes dripping down your face from the blindingly bright images: This is everything I have tested so far, but feel free to experiment with ReShade on your own and share your results here. -
CoriBoom Cori's Lua Coding Explorations for Reader 1.5.4
CorinaMarie posted a topic in SC4 Modding - Open Discussion
Some fun with Lua scripting inside Reader 1.5.4 As some of you know @BartonThinks and @Raymond7cn did some poking into using Lua coding to automate some tasks in Reader 1.5.4. Raymond beeped me into the topic where I wrote a couple of lines of code to tweak what he created. The result is something which saved BT from several hours of manually modifying a few hundred exemplar names for his project. Once I understood the possibilities, I was off and running with some code of my own by creating a Lua script which outputs all of the Properties lines and values of every Cohort and Exemplar in any given SC4 data file (that includes .dat, .sc4lot, .sc4desc, and any other file Reader can display). The output is a text file and is formatted into columns just like you see in Reader (with the exception that I re-arranged the columns so the two most important (IMO) are together on the right side. I've already had a viable use for this inasmuch as @Sunrader needed a Raiser Lot set to a non-standard height for modifying SC4 terrain for later importing into The Sims 2 game. While chatting with @Cyclone Boom, he was sure it was set somewhere in the LotConfigurations Exemplar. So, I loaded up the 7.5m, the 8m, and the 10m Raiser Lots included in NAM and created text reports of each. Then with the help of WinMerge, I quickly found which data rep of which property was the likely controller for the height amount. While I did simply view the output on my screen, CB made some images comparing the differences. Here's what those look like: The 7.5 meter Raiser Lot: The 8 meter Raiser Lot: The 10 meter Raiser Lot: So, I was able to deduce that it was indeed the 5th rep of property 0x88edc900 (LotConfigPropertyLotObject) which needed tweaked. I changed that to 0x0007C000 and it worked as expected. What I'd noticed was the hex thousands position has value 8 for the 7.5 meter raiser. Said 8 being exactly half of 16 made it likely that was the fraction of a meter while the more significant digit to the left of it was the number of whole meters. 75% of 16 is 12 and that's how I decided to try C in that position. I was pleasantly surprised it did actually work. (Tested in the game using the TerrainQuery option.) Now, this topic isn't about that specific tweak at all. I wrote the above to showcase one of the potentially many possibilities for having the SC4 information in a pure text form. Cori's new Lua code as a pretty picture: Here's a pretty picture CB made of my new code so you can see the colors Notepad++ uses to aid programming: ^ I've attached this code in text form at the bottom of this post in case any of y'all want to take it for a test drive. Applying the 4 GB Patch to Reader.exe Before we get started running Lua code in Reader 1.5.4, it's a good idea to apply the 4 GB Patch to it. (While this might not be needed, it won't hurt anything and has the possibility to help.) Rather than run the 4gb_patch.exe with administrator rights, I copied the file to be patched to its own folder, applied the patch there, and then copied the modified file back into its home in Program Files (x86). Here's the steps I followed: Locate the Reader.exe file: ^ Note the last modified date is 2 October, 2015. (Not important to know, but I'll reference the date again in a wee little while.) Copy Reader.exe to a new folder that does not require admin rights to edit files and also copy the 4gb_patch.exe file in as well: ^ You could make the new folder in your Documents folder if you feel more comfy doing it there. Double-click the 4gb_patch.exe file and it'll pop up a file selection dialog window. Select the Reader.exe that's in the new folder and click Open: After it instantly does its magic, you'll see the confirmation: Next, copy the updated Reader.exe and paste it back into its original location. Windoze will notice there is already a file there with that name and give you some choices for what you want to do. Click the Copy and Replace option: Since Windoze is really fussy about the Program Files folders, it's going to require a signed affidavit from God and his mother to allow this confirmation from you. Click continue: And here you can see it has an updated modified date: While we are chatting about the 4 GB Patch, this is the very same little program that is used to fix SimCity 4.exe to work with the new NAM 37 mod. There's a real nice explanation for that in the context of the game. That particular post is for the Steam version, but just as above and in that linky it's the same general steps. Personalizing the Code before running it the First time. There is one thing you MUST do before using my Lua code for the first time and that is to personalize it for your comp by telling it where you want the output text file to be created. Here's that part of the code, zoomed up: ^ That needs to be a valid path to a folder on your comp some place. The part to change is between the opening [[ and the closing ]]. You'll find this on line 59 of the code. Save the file after editing this. Note: There is no need for a trailing backslash for the path. My code will slip that in between the path and the file name. Also, Lua actually uses forward slashes, but I've written the code so you can use the standard Windoze format and I flip them before creating the output file. You can also, but don't need to, change the next line for the text output file name: ^ If editing this, it is the same as above inasmuch as you edit the part between the opening [[ and the closing ]]. While not imperative, it's good to give the file name a .txt extension as shown. The next line can be left alone, but it's there if you have a techy reason to need all data returned as pure Hex instead of the more human readable XML lookup text Reader does by default (for properties and values it has names for). That's this line: ^ My notes in the attached source code file fully explain this. The options are 0 or 1. Basically the 1 option is for later code modification where I'll need to know the exact hex value for pattern matching and alteration. (More specifically, that's what I'll be using to check for certain OccupantGroups for use with our upcoming Expanded Tilesets mod.) Ofc, save the file after you've finished editing it. Running the Lua Script in Reader 1.5.4 To give my new code a workout, let's have it analyze the SimCity_1.dat file. ( No need to think small when putting it thru its paces. ) Run Reader 1.5.4 and open a file which has either cohorts or exemplars (or both) in it. In Windoze 10, Barton said Reader needs set to Win 8 compatibility mode. (I'm running in Win 7 and didn't have to jump thru any extra hoops.) Within Reader, I have to click something in the left-hand pane before it will enable the script option in the ribbon bar: After clicking the script button to get the code area, I expand that white box where the code will go: ^ This step is not required. Then copy the code from your text editor and paste it in the code section. Next, click the itty-bitty black triangle play button thinger to run the script: And then as it runs, you can watch the gray display box under the code. For all normal files, it'll run so quick you won't see them as separate messages, but here's the progression when doing a huge file: And now go open the output file in your fav ASCII Text Editor program. Remember word (or line) wrap will make it look goofy as hell, so be sure to turn that option off. Conclusion This is some exciting new territory here. While the above is simply to display the data in a useful manner, the possibilities for repetitive tasks being automated could be a significant time saver for many peeps. Let me know if the above code works for you. Without feedback, I'd likely assume I'm off in left field barking up an empty tree. Special thanks to @Cyclone Boom for his continued help testing, proofreading, making images, and presentation advice. Without his dedicated help, this topic would be rather ho-hum looking. Also, thanks to @Raymond7cn for prodding me by creating the first script in Barton's thread. Attachments Even if you never plan to use the Lua Code, you might find the text output is a handy reference. Here are both versions: SC_1.dat - Cohorts and Exemplar Properties - Cori's Lua Output - XML.txt.zip (2.67 MB) SC_1.dat - Cohorts and Exemplar Properties - Cori's Lua Output - Hex.txt.zip (2.65 MB) Additionally, I've tidied up the ilive_script.txt file (found in the installation directory of Reader 1.5.4): ilive_script-vCori.txt (19.4 kB) And, ofc, my Lua Code: Cori's Cohort and Exemplar Properties Script v1.00.lua (24 kB) -
How to Install SC4DatPacker 2008 / CAM, the SysWOW64 Way!
Leo -- posted a topic in SC4 Modding - Open Discussion
You probably know if you try to install CAM on windows 10 SC4DatPacker 2008 will crash during setup. This is caused by missing libraries for 32-bit apps in the SysWOW64 folder. So if we put the required .dll s in the SysWOW folder SC4DatPacker, SC4 Mapper, and SC4TerraFormer (SC4TerraFormer might need more dlls to work read its readme) should work. Step 1 : Get The dlls Step 1a :Get MFC71.DLL https://www.dll-files.com/mfc71.dll.html Step 1b :Get MSVCR71.dll https://www.dll-files.com/msvcr71.dll.html Step 1c :Get GDIPLUS.DLL https://www.dll-files.com/gdiplus.dll.html (Note : my system already had this file so you might not need to download it) Step 2 :Unzip the dll s and place it in the root of C:\Windows\SysWOW64 Step 3 :Reboot Step 4 Run the CAM installer and enjoy I am not responsible if something goes wrong. This Tutorial only applies of 64-bit versions of windows 10 -
Tutorial: Method for Automated SimCity 4 Screen Mode Switching
Cyclone Boom posted a topic in SimCity 4 General Discussion
A Neat Little Tool to use with the "Raise the UI Mod" Here is a tutorial explaining how to automatically raise SimCity 4's user interface (UI) when switching to windowed mode. This may specifically be useful for those who wish to alternate between running SC4 windowed and in full screen. Please Note To achieve this, it requires copying and saving simple command line scripts (.cmd), and adjusting relevant paths. The problem being, when running the game windowed and with a custom resolution, you may notice the taskbar inconveniently overlays the UI like so: To workaround this limitation, in Windows it's possible to use the "Auto-hide the taskbar" option from Taskbar Properties. This does what it says, and makes the taskbar hidden from view when not hovered over. However, this requires toggling back the setting once exiting the game. So while that works it's not the most ideal solution since to run the game windowed, it may be desired to have quick access to the taskbar at all times. A means of fixing this is by raising up the UI slightly. Then the taskbar can still be seen in full view while not obscuring the lower-positioned menu options in the game. A useful mod which does exactly this is the appropriately named Raise the UI Mod. Which upon installation in Plugins, will solve the problem like so: However... What if you'd then wish to play the game full screen, or often swap between both modes? Perhaps doing so would be useful if needing convenient access to other programs while playing. But later would like to change over based on your monitor configuration, or to benefit from the reduced memory usage in full screen. At least from testing, I found there was around 18% less system RAM used in a fully loaded large tile. This can be done manually by moving the mod in and out of Plugins when needed. But in terms of automating the process, that's where my little command line scripts may come in handy. Should that sound of interest, keep on reading on... Note: This is really intended for those comfortable working with batch files, and so this may not be the ideal solution for everyone. Prerequisites SimCity 4 Deluxe / RH installed and patched at least to the EP1 update. Digital versions other than Origin should come fully pre-patched. Although Notepad or a plain text editor will do the job, I recommend using Notepad++ to benefit from syntax highlighting. A Windows operating system (this has been tested on Win 7). Download the Raise the UI Mod created by @warrior. A local folder created outside of Plugins. Setting Up First of all, the initial step is to decide where you'd like to store the mod when not needed. This will be a holding folder and can be anywhere outside from your Plugins folder. Then when running the game windowed, it'll be moved into your Plugins so then the UI is raised accordingly. So either create a new folder, or copy the path of an existing folder where Raise the UI Mod.dat can be stored. A simple way of copying the path is by right clicking the location bar in Windows Explorer: Then click the "Copy address as text" option as highlighted. At the top of both scripts (which we'll get to in a moment), there are 4 adjustable options: File=<File Name> Description: This is the file name name of the mod, so needn't be changed unless renaming the actual file. E.g. File=Raise the UI Mod.dat PluginPath=<Path> Description: The location inside your Plugins folder to contain the mod. This can be in the root or inside a subfolder structure of your choice. Unless modified it should be the one in Documents. Leave out quotes since those are added in the main body of the code. E.g. PluginPath=C:\Users\<Account>\Documents\SimCity 4\Plugins HoldPath=<Path> Description: Here is the location of the holding folder where the mod will be stored. Use the "Copy address as text" method described earlier to make sure this is correctly specified. It can be set anywhere of your choice, providing the folder is fully accessible. E.g. HoldPath=C:\Users\<Account>\Documents\SimCity 4\Hold UI Mod TheGame="" "<Game Location>" <Shortcut Parameters> Description: It wouldn't be any use without starting the game itself, and that's what this option does. Here there are 2 variables which can be tailored specifically. The location of the game's executable file, and also the parameters (switches) used to set a custom resolution, toggle windowed or full screen, force SC4 to run on a single core, skip the intro, or any other such options. E.g. Disc based game: TheGame="" "C:\Program Files (x86)\Maxis\SimCity 4 Deluxe\Apps\SimCity 4.exe" -CustomResolution:enabled -r1600x900x32 -w E.g. Digital game from GOG: TheGame="" "C:\GOG Games\SimCity 4 Deluxe Edition\Apps\SimCity 4.exe" -CustomResolution:enabled -r1600x900x32 -w For a custom resolution, this must be specified to the desired screen width and height. The above examples represent my own monitor's size of 1600x900 pixels. The x32 at the end is the bit colour depth, which in normal circumstances can be safely left as is. Those using Steam or other launchers may need to experiment with workarounds to start the game directly for this to work. The empty quotes ("") at the beginning are required since they pass a null title in the command. However the rest of the command can simply be copied over from an existing desktop shortcut Target line, with the format being identical. Note: Where applicable for it to be valid, the <Account> path must be changed to the name of your user account. Windowed Script Here is the script for running the game windowed. It does the following: First checks whether Raise the UI Mod.dat is located in your Plugins folder. If found, the game is started using any parameters specified. If not present, it moves Raise the UI Mod.dat from the holding folder to your Plugins, before starting the game. Should the file not be found in the holding folder, a message pops up in a command window making that known. For Example (Modify custom paths as needed) @Echo Off Set File=Raise the UI Mod.dat Set PluginPath=C:\Users\<Account>\Documents\SimCity 4\Plugins Set HoldPath=C:\Users\<Account>\Documents\SimCity 4\Hold UI Mod Set TheGame="" "C:\Program Files (x86)\Maxis\SimCity 4 Deluxe\Apps\SimCity 4.exe" -CustomResolution:enabled -r1600x900x32 -w If Not Exist "%PluginPath%\%File%" ( If Not Exist "%HoldPath%\%File%" ( Start "" cmd /C "Echo %File% not found in: &Echo( %HoldPath% &Echo( &Pause" Goto :End ) Else Move "%HoldPath%\%File%" "%PluginPath%" ) Else ( Goto :StartSC4 ) :StartSC4 Start %TheGame% :End Exit Important: For the game's parameters, it's essential the -w switch is used, or else the game won't be told to run windowed. Full Screen Script Here is the script for running the game in full screen. It does the following: Checks whether Raise the UI Mod.dat is located in your Plugins folder. If found, it moves the file back to your holding folder, then starts the game. If not found, it just starts the game, also using any parameters specified. For Example (Modify custom paths as needed) @Echo Off Set File=Raise the UI Mod.dat Set PluginPath=C:\Users\<Account>\Documents\SimCity 4\Plugins Set HoldPath=C:\Users\<Account>\Documents\SimCity 4\Hold UI Mod Set TheGame="" "C:\Program Files (x86)\Maxis\SimCity 4 Deluxe\Apps\SimCity 4.exe" -CustomResolution:enabled -r1600x900x32 -f If Exist "%PluginPath%\%File%" ( Move "%PluginPath%\%File%" "%HoldPath%\%File%" ) Else ( Goto :StartSC4 ) :StartSC4 Start %TheGame% Important: For the game's parameters, it's essential the -f switch is used here, or else the game won't be told to run in full screen. Saving the Scripts Both work by saving them as command line scripts with the .cmd file extension. This can be done using any plain text editor, including Windows Notepad. Personally as hinted above, I would recommend Notepad++ for the benefit of the code syntax highlighting. It also handily comes with many other features for manipulating text, featuring a powerful find & replace tool with regex ability (advanced search mode). But in terms of what's required here as a simple copy, paste and save to file, these are just little extras which you may find useful for other projects in future. The end goal is to have both scripts saved, ideally for convenience to the same folder. For instance: The actual task of saving is very simple. I'll describe the steps for both Notepad++ and Windows Notepad using the windowed mode code. However as this part may well be self-explanatory, feel free to skip the following instructions and continue onto setting up the desktop shortcuts. Using Notepad++ OR Using Windows Notepad Creating Desktop Shortcuts To run either of the scripts, it's possible by navigating to their folder and double clicking on them. This will do the job just fine. However for accessibility and since it's probably what you're already familiar with, I recommend linking each via a shortcut placed on your desktop (or wherever is convenient). Then there will be two shortcuts – One referencing the windowed script, the other for full screen. Step 1 of 3 First make a copy of your existing SC4 shortcut. Or if you don't have one already, go to your game's installation path and open the Apps subfolder. Then right click the executable file ( SimCity 4.exe ), and in the context menu choose: Send to > Desktop (create shortcut). Then make a duplicate copy so you've got two exactly the same. Rename accordingly to whatever you'd like them called. For example: For the next steps I'll explain the process with the windowed shortcut. Repeat the same for your full screen one... Step 2 of 3 The next task involves editing the Target path in the shortcut. Right click and open the Properties. Then remove the current path pointing to the game's executable. This is no longer needed because the script does this part, along with passing the parameters to set a custom resolution and toggle between windowed or full screen modes. Then paste in the path to the script like so: Note: This can be easily obtained by navigating to the script, holding the Shift key, then right clicking and choosing the Copy as path option. If you copied in a path which didn't contain spaces, the quotation marks will automatically be removed from the Target line upon saving and opening the shortcut Properties. Those are only needed to preserve a path should there be any spaces included. Step 3 of 3 Click Apply, then OK and close the shortcut. Repeat for the full screen shortcut or vice versa. At this point it's good to go, but there is an additional adjustment possible should you wish... Addendum A big thanks to @CorinaMarie for inspiration behind this idea, helping me with technical aspects, and also sharing many valuable suggestions along the way. There could be other uses with this or similar techniques. For example, to potentially expand and tailor scripts specifically to: Move another mod file in and out, such as the Diagonal Bridge Enabler. Control sets of custom content by moving multiple files in and out of your Plugins folder as needed. Have a multiple choice option in the command line for using certain shortcut parameters. Log the time when starting SC4 to keep track of how long you're in the mayor's office. Create incremental backups of your Regions before starting the game. So that brings this tutorial to a conclusion. Once you've saved both scripts and created the shortcuts, the game can then be fully enjoyed in either full screen or windowed mode with a simple double click. Hopefully this may come in useful and even inspire other possibilities. Be creative! Any feedback, comments or questions welcome. -
Whenever I try to place roads, I receive this error: Method not found: 'BuildingTool.CheckCollidingBuildings'. [System.MissingMethodException] Details: No details A popup message appears whenever I click on the road infrastructure menu icon, and keeps reappearing whenever I close it. It does not disappear unless I switch to another menu between the first popup closing and the second one opening. This has only occurred today, after the recent patch. I'm on my lunch hour and haven't any time to complete a binary search of my mods, but I didn't have much luck in removing the ones I suspected of causing this problem.

