Jump to content

7 posts in this topic Last Reply

Highlighted Posts

Posted:
Last Online:  
 

A DLL Plugin for SimCity 4 that adds a cheat to display text token values.

This DLL is intended for experimentation and debugging, I am not sure it is useful for normal game play.

Text tokens are strings enclosed in # characters that SC4 will resolve to another value.  For example, Detokenize game.g_city_rci_population would display the value of the total RCI population variable that Lua scripts can use in trigger conditions.

Download: https://community.simtropolis.com/files/file/36844-detokenize-dll/

Source Code: https://github.com/0xC0000054/sc4-detokenize

System Requirements

  • Windows 10 or later

The plugin may work on Windows 7 or later with the Microsoft Visual C++ 2022 x86 Redistribute installed, but I do not have the ability to test that.

Installation

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

Usage

The Detokenize cheat takes the name of the text token to resolve and any required parameters.
Examples:

  • Detokenize game.ga_mayor_rating will display the numeric value of the mayor rating.
  • Detokenize GetDirectory UserPlugins will display the path to the user plugins folder, typically Documents\SimCity 4\Plugins.

Troubleshooting

The plugin should write a SC4Detokenize.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.

  • Like 3

Share this post


Link to post
Share on other sites
Posted:
Last Online:  
 
18 hours ago, Null 45 said:

Text tokens are strings enclosed in # characters that SC4 will resolve to another value.  For example, Detokenize game.g_city_rci_population would display the value of the total RCI population variable that Lua scripts can use in trigger conditions.

This would've been insanely useful back when I was testing out my (eventual) Department of Transportation building. Instead of having to write a line for each variable, to see if it worked, I could've used this mod instead.  

Even still, this will be very helpful in the future for future query mods!

  • Like 1
  • Yes 1

Share this post


Link to post
Share on other sites
  • Original Poster
  • Posted:
    Last Online:  
     

    Release version 2.0, which has the following changes:

    • Fixed a bug that prevents items with multiple parameters from working.
    • Added support for resolving some Maxis development commands.
    • Like 1

    Share this post


    Link to post
    Share on other sites
    Posted:
    Last Online:  
     

    Can you please make this into a patch instead? detokenize everything? RCI, etc everything?

    Share this post


    Link to post
    Share on other sites
  • Original Poster
  • Posted:
    Last Online:  
     
    13 minutes ago, THijSCiTy said:

    Can you please make this into a patch instead? detokenize everything? RCI, etc everything?

    I don't understand what you are asking for.

    This plugin has to be a DLL due to it interacting with the game's code. The data is displays are just things that Maxis decided to expose for use by their Lua code, they also exposed most of the same data in various parts of the game's UI.  @CorinaMarie created the C.O.R.I. Reports mod that dumps the Lua variables to a text file.

    • Like 2

    Share this post


    Link to post
    Share on other sites
    Posted:
    Last Online:  
     

    Oh what I meant was if its possible to detokenize the values by default in the game's ui, for example in combination with the building's query info panel and graphs panels like rci that only got bars, or commute time etc.

    Edit: is it also possible to change % into a number with cap limits?

    Share this post


    Link to post
    Share on other sites
  • Original Poster
  • Posted:
    Last Online:  
     
    30 minutes ago, THijSCiTy said:

    Oh what I meant was if its possible to detokenize the values by default in the game's ui, for example in combination with the building's query info panel and graphs panels like rci that only got bars, or commute time etc.

    Some of that is available in Kel's RCI Query Upgrade and Census Repository Upgrade mods.

    32 minutes ago, THijSCiTy said:

    Edit: is it also possible to change % into a number with cap limits?

    No, the game tracks the data as a percentage.

    • Like 1

    Share this post


    Link to post
    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