Jump to content
  •   Announcement

  •    Alternatively see here for an enhanced Google site search, which you may find provides more accurate search results. (More Info)

Search the Community

Showing results for tags 'coding'.



More search options

  • Search By Tags

    Type tags separated by commas. These are keywords which should describe the item of content.
  • Search By Author

Content Type


Forums

  • Simtropolis Department of Public Works
    • Simtropolis Recovery Project
  • SimCity 4 Players Forum
    • SimCity 4 General Discussion
    • SC4 Showcase
    • SC4 City Journals
    • SC4 Mac Users
    • SC4 Bugs & Technical Issues
  • SimCity 4 Builders Forum
    • SC4 - Custom Content
    • Mapping Community Room
    • SC4 BAT & Lot Workshop
    • SC4 Modding - Open Discussion
    • NAM & Transit Networks
  • Cities: Skylines & CS2
    • Cities: Skylines General Discussion
    • Cities: Skylines Modding - Open Discussion
    • Cities: Skylines Showcase
    • Cities: Skylines City Journals
    • Cities: Skylines Technical Help Q&A
  • SimCity (2013)
    • SimCity (2013) General Discussion
    • SimCity (2013) Modding - Open Discussion
    • SimCity (2013) Region Games
    • SimCity (2013) Showcase
    • SimCity (2013) Technical Help Q&A
  • Simtropolis Social Forum
    • New Members Information
    • Simtropolis Related
    • General Off-Topic
    • Current Events
    • Architecture & Urban Planning
  • Gamer Topics
    • SimCity 3000
    • City-Building Games
    • Gaming Talk
  • Challenges Forum
    • SC4 Challenges - Info and Discussion
  • Trixies Forum
    • Trixie Awards - Community Discussion
  • Club-owners Club's Club Discussion
  • Simtropolis en Español's Plaza Mayor
  • Simtropolis en Español's Soporte Técnico
  • Simtropolis en Español's Parque Industrial
  • SimCampus Students's Topics
  • The Transit and Aviation Geeks Club's Topics
  • Arden County City Council's Topics
  • Alliance of Independent Nations on Simtropolis's Discussion
  • The Major Club's Topics
  • Project Rich Water's Topics
  • Furry Community's Topics
  • Simtropolis Italia's Discussioni
  • New Washington's Topics
  • Everything about details's Topics
  • CityBuildingMasters X's Topics
  • City Journal Club's Topics
  • City Journal Club's Photo Shopping, Type Faces, Page Layout !
  • City Journal Club's Writing
  • Coolio Club For Cool Children's Topics
  • Atlantic Energy Co.'s Topics
  • Micropolis's Topics
  • City-Builders Website's Club Topics
  • SimCity Polska Organization's Topics
  • Simtropolis em português's Topics
  • Simtropolis em português's Fórum
  • My Little Pony Club's Topics
  • SimCity 2000 Resource Club's Topics
  • Simtropolis中文's Topics
  • Simtropolis en français's Topics
  • NewCity's Topics
  • Simtropolis Historical/Aesthetically Accurate Topography Society's Topics
  • Southeast Asian Mayors's Topics
  • Simtropolis Historical/Aesthetically Accurate Topography Society's Request Maps
  • Simtropolis Historical/Aesthetically Accurate Topography Society's Social and Events
  • Simtropolis Historical/Aesthetically Accurate Topography Society's Mapping
  • SimCity 3000 Resource Club's Information
  • The Great British Simtropolis Club's Topics
  • Roller Coaster Park Builders's Topics
  • Banished's Topics
  • Banished's Modding
  • Banished's Questions
  • Banished's Stories
  • Android City Builders & Other Games's Topics
  • City-Builders Website's Banished Toolkit
  • City-Builders Website's Banished Villages
  • City-Builders Website's Banished Achievements
  • Spooky Souls Building's Topics
  • TheoTown's Topics
  • Found Custom Contents's Topics
  • Cities in Motion's Topics
  • SimCity 3000 Resource Club's SC3000 Ordinances

Categories

  • SimCity 4
    • SC4 Reference
    • SC4 Tutorials
    • BAT & Lot Editor Tutorials
    • Modding Information
    • Mapping & Terraforming
  • Other Games
  • Simtropolis Articles
    • Interviews

Categories

  • News
  • News
  • News

Categories

  • SimCity 4 Files
    • Residential
    • Commercial
    • Industrial
    • Agricultural
    • Building Sets
    • Civic & Non-RCI
    • Utilities
    • Parks & Plazas
    • Waterfront
    • Transportation
    • Automata
    • Gameplay Mods
    • Graphical Mods
    • DLL Mods
    • Cheats
    • Tools
    • Maps
    • Ready Made Regions
    • Dependencies
    • 3ds Models
    • Obsolete & Legacy
    • Reference & Info
  • SimPeg (PLEX) Files
    • PLEX Custom Lots & Mods
    • CDK - Coastal Development Kit
    • MTP - Mountain Theme Pack
    • SPAM - SimPeg Agricultural Mods
    • PEG Utopian Series
  • SimCityBrasil Files
  • SimCityPolska Files
  • WorkingMan Productions (WMP)
  • Cities: Skylines II Mods
  • Cities: Skylines Buildings
    • CSL Maps
    • CSL Roads & Traffic
    • CSL Vehicle Assets
    • CSL Game Mods
    • CSL Props
    • CSL Programs & Tools
  • SimCity (2013) Buildings
    • SC13 Game Mods
    • SC13 Roads & Traffic
    • SC13 Vehicles
    • SC13 Programs & Tools
    • SC13 User Interface
  • SimCity 3000 Files
    • SC3K Maxis Files
    • SC3K Cities & Maps
  • CitiesXL Buildings
    • CXL Mods & Tools
    • CXL Maps
    • CXL Textures & Props
    • CXL Lots
    • CXL 3d Models
  • Simtropolis en Español's Descargas
  • Club-owners Club's Dirk's Files
  • The Major Club's Files
  • Project Rich Water's Files
  • Furry Community's Files
  • Simtropolis Italia's Archivio
  • New Washington's Files
  • Everything about details's Files
  • CityBuildingMasters X's Files
  • City Journal Club's Files
  • Coolio Club For Cool Children's Files
  • Atlantic Energy Co.'s Files
  • Micropolis's Files
  • City-Builders Website's CB Files
  • SimCity Polska Organization's Files
  • Simtropolis em português's Descargas
  • My Little Pony Club's Files
  • SimCity 2000 Resource Club's SCURK Tilesets
  • SimCity 2000 Resource Club's CITY Files
  • SimCity 2000 Resource Club's Multi Object Tilesets
  • SimCity 2000 Resource Club's Single Object Tilesets
  • Simtropolis中文's Files
  • Simtropolis en français's Files
  • NewCity's Files
  • Simtropolis Historical/Aesthetically Accurate Topography Society's Files
  • Southeast Asian Mayors's Files
  • SimCity 3000 Resource Club's SimCity 3000 Starter Towns
  • SimCity 3000 Resource Club's SimCity 3000 Cities
  • SimCity 3000 Resource Club's SimCity 3000 Terrains
  • The Great British Simtropolis Club's Files
  • Roller Coaster Park Builders's Files
  • Banished's Banished Mods
  • Banished's Kid's Mods
  • Android City Builders & Other Games's Files
  • City-Builders Website's Banished Save Games
  • Banished's Modding Files
  • SimCity 2000 Resource Club's MAC Files
  • Spooky Souls Building's Files
  • TheoTown's Files
  • Found Custom Contents's Chinese Sites
  • Found Custom Contents's European Sites
  • Found Custom Contents's Japanese Sites
  • Found Custom Contents's North America Sites
  • Found Custom Contents's Asia-Pacific Sites
  • Cities in Motion's CiM Maps
  • Cities in Motion's CiM Mods

City Journals

There are no results to display.

There are no results to display.

Calendars

  • Alliance of Independent Nations on Simtropolis's Alliance Calendar
  • Club-owners Club's Events
  • SimCampus Students's Events
  • SimCampus Students's Noggin Thinkers Dates
  • Arden County City Council's Events
  • The Major Club's Events
  • Project Rich Water's Events
  • Furry Community's Events
  • Simtropolis Italia's Eventi
  • New Washington's Events
  • Everything about details's Events
  • CityBuildingMasters X's Events
  • City Journal Club's Events
  • Coolio Club For Cool Children's Events
  • Atlantic Energy Co.'s Events
  • Micropolis's Events
  • SimCity Polska Organization's Events
  • My Little Pony Club's Events
  • Simtropolis中文's Events
  • Simtropolis en français's Events
  • Simtropolis Historical/Aesthetically Accurate Topography Society's Events
  • Southeast Asian Mayors's Events
  • The Great British Simtropolis Club's Events
  • Roller Coaster Park Builders's Events
  • Android City Builders & Other Games's Events
  • Spooky Souls Building's Events
  • TheoTown's Events
  • Cities in Motion's Events

City-building game(s)

Found 4 results

  1. SimCity 4 OPEN ACCESS This page has been created to create a list of all available tools that the various modders and NAM Team use to create mods for SC4. The purpose of this list is to create a database of the tools used and that are available on GitHub making it accessible to edit and improve these tools. The main purpose is to speed up the development of new programs for modding by making it easier to access the source code of the programs used so far but they are showing their old age by making it increasingly difficult to use them in modern versions of Windows and in case create specific versions for the MAC If you create programs that start from the source code of the programs available on GitHub, it is strongly recommended to give credits to the original authors as well. The library consists of three main sections LIST OF MODDING TOOLS ON GITHUB LIST OF SC4 DLLs FOR ADVANCED MODDING OPENSC4 The list is still incomplete due to the difficulty of performing reverse engineering of the programs used.
  2. When the killer robots come in packs of five: Or the volcanoes sprout en masse simultaneously: ( Don't mind me. I've just been playing around in Lua code. )
  3. 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)
  4. In mods we need to call private methods sometimes. But calling private methods with reflection makes some significant performance hit. During today's lunch I came up with this simple stupid technique for invoking private methods that uses Sebastian Schöner's RedirectionHelper. Note that the technique is slightly different for classes and for structs. using System.Reflection; using ICities; namespace TestMod { public class TestMod : IUserMod { public string Name { get { Test(); return "Test mod"; } } public string Description => "Some test mod"; public void Test() { RedirectionHelper.RedirectCalls ( typeof(SomeClassDetour).GetMethod("PublicStaticMethod", BindingFlags.Public | BindingFlags.Static), typeof(SomeClass).GetMethod("PrivateInstanceMethod", BindingFlags.NonPublic | BindingFlags.Instance) ); var classInstance = new SomeClass("private value1"); var arg1 = "method argument1"; //classInstance.PrivateInstanceMethod(arg1); //That's impossible! SomeClassDetour.PublicStaticMethod(classInstance, arg1); //Here we go! RedirectionHelper.RedirectCalls ( typeof(SomeStructDetour).GetMethod("PublicStaticMethod", BindingFlags.Public | BindingFlags.Static), typeof(SomeStruct).GetMethod("PrivateInstanceMethod", BindingFlags.NonPublic | BindingFlags.Instance) ); var structInstance = new SomeStruct("private value2"); var arg2 = "method argument2"; //structInstance.PrivateInstanceMethod(arg2); //That's impossible! SomeStructDetour.PublicStaticMethod(ref structInstance, arg2); //Here we go! } class SomeClass { private readonly string _privateField; public SomeClass(string value) { _privateField = value; } private void PrivateInstanceMethod(string arg) { UnityEngine.Debug.Log($"Class: This is a private method. Private value: {_privateField}. Arg: {arg}"); } } class SomeClassDetour { [MethodImpl(MethodImplOptions.NoInlining)] //to prevent inlining public static void PublicStaticMethod(SomeClass instance, string arg) { //This line is crucial for success! We can't detour empty or too simple methods UnityEngine.Debug.Log($"Class: This is a static method. Instance type: {instance?.GetType().ToString() ?? "Null"}. Arg: {arg}"); } } struct SomeStruct { private readonly string _privateField; public SomeStruct(string value) { _privateField = value; } private void PrivateInstanceMethod(string arg) { UnityEngine.Debug.Log($"Struct: This is a private method. Private value: {_privateField}. Arg: {arg}"); } } struct SomeStructDetour { [MethodImpl(MethodImplOptions.NoInlining)] //to prevent inlining public static void PublicStaticMethod(ref SomeStruct instance, string arg) { //This line is crucial for success! We can't detour empty or too simple methods UnityEngine.Debug.Log($"Struct: This is a static method. Instance type: {instance.GetType()}. Arg: {arg}"); } } } } That gives the following output in output_log on game loading: (Filename: C:/buildslave/unity/build/artifacts/generated/common/runtime/UnityEngineDebugBindings.gen.cpp Line: 65) Class: This is a private method. Private value: private value1. Arg: method argument1 (Filename: C:/buildslave/unity/build/artifacts/generated/common/runtime/UnityEngineDebugBindings.gen.cpp Line: 65) Struct: This is a private method. Private value: private value2. Arg: method argument2 As you see, the private instance method was called successfully. I think it won't be hard for you to figure out by yourself how to apply this technique to properties and to static methods
×

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