Jump to content
Kel9509

Custom Queries for Custom Buildings

318 posts in this topic Last Reply

Highlighted Posts

Posted:
Last Online:  
 
52 minutes ago, Kel9509 said:

The function included for that is: "#m@100#".  But I can't seem to find how it's created or where it's calculated.

The value isn't calculated anywhere. The m@100 text simply tells the game to convert the number 100 to a money string in whatever format the game's language uses, a result you can see in the UI screenshot. The m@ syntax is one of several Lua number formatting prefixes Maxis added and documented in their advisor scripting conventions, which I will quote below:

Quote

For LUA tokens you might need to use one of the token type tags 
     m@   --  for money amounts.
     d@   --  for dates.
     t@   --  for time.
     n@   --  for numbers (optional). This is also the default type tag.
     s@   --  for strings (optional).

For instance # m@ game . g_budget# will be replaced with the value of total city budget variable. Type tags are needed for lacalization purposes.  

I wasn't able to get the date and time formatting options to work, but the money, number, and string values work.

1 hour ago, Kel9509 said:

Ideally, it'd be great if all of these values, like each Amount, Radius, and Cap Relief, could be pulled directly from a building's exemplar.  That way, a query could be built that shows these amounts for any type of building instead of having to puzzle-piece it together for some.  BSC even couldn't do it for all of their parks because of the significant variation.

Maxis provided something like that for exemplar properties used for menu tool tips (catalog items) that contain a single numeric value. The catalog item syntax is m:<property id> or d:<property id>, which would read the specified property and convert its value to a money or decimal string respectively.

I already have a syntax in the Query UI Hooks DLL for reading user specified values (see budget_purpose_type_cost), so it would just be a matter of naming the new query strings. But I will say that the multiple formats Maxis used for exemplar properties makes it a pain to read arbitrary properties as you have to know the format each one uses.

  • Like 3

Share this post


Link to post
Share on other sites
  • Original Poster
  • Posted:
    Last Online:  
     
    20 hours ago, Null 45 said:

    Maxis provided something like that for exemplar properties used for menu tool tips (catalog items) that contain a single numeric value. The catalog item syntax is m:<property id> or d:<property id>, which would read the specified property and convert its value to a money or decimal string respectively.

    Yeah, that's very common to see.  I wish Maxis had written that to be more open than just restricting it to the tooltip texts.  Do you know if it's for ONLY Menu Tooltips, or can it be used in any tooltip?  Even still, it wouldn't work with things like Cap Relief which is not a single value.

    20 hours ago, Null 45 said:

    I already have a syntax in the Query UI Hooks DLL for reading user specified values (see budget_purpose_type_cost), so it would just be a matter of naming the new query strings. But I will say that the multiple formats Maxis used for exemplar properties makes it a pain to read arbitrary properties as you have to know the format each one uses.

    Yeah, I understand.  And frankly I'm not sure how you'd parse something like Cap Relief, which is just a string of values.  There doesn't seem to be a way to break it up.  

    But ideally, I'd have made a replacement query for the Landmark query, the Church Query, and possibly the Parks Query, because many rewards or other lots in the game have Cap Relief and/or positive Landmark and Park effects and a Mayor has no idea how valuable any lot is unless they look in the exemplar properties.  With custom lots that use those generic queries, I usually add all details about its benefits to its Menu Tooltip so I have some idea of what benefits any particular lot has in deciding what to plop.  It'd be nice if, similar to the BSC Parks, a person could theoretically click on any Landmark or Church or Park, and see its in-game stats similar to how the BSC Parks Menu shows things instead of just it's monthly cost.

    I would totally make replacement Queries for the in-game Queries that do not provide any of that information now, if it were possible.

    • Like 2

    Share this post


    Link to post
    Share on other sites
    Posted:
    Last Online:  
     
    1 hour ago, Kel9509 said:

    Do you know if it's for ONLY Menu Tooltips, or can it be used in any tooltip?

    Only catalog menu tool tips. AFAICT the game pairs the catalog menu items with the relevant exemplar solely for the tool tips to query a limited number of exemplar properties, but that design make sense as you wouldn't want things like cost to be hard coded in the tool tip.

    3 hours ago, Kel9509 said:

    Yeah, I understand.  And frankly I'm not sure how you'd parse something like Cap Relief, which is just a string of values.  There doesn't seem to be a way to break it up.  

    But ideally, I'd have made a replacement query for the Landmark query, the Church Query, and possibly the Parks Query, because many rewards or other lots in the game have Cap Relief and/or positive Landmark and Park effects and a Mayor has no idea how valuable any lot is unless they look in the exemplar properties.  With custom lots that use those generic queries, I usually add all details about its benefits to its Menu Tooltip so I have some idea of what benefits any particular lot has in deciding what to plop.  It'd be nice if, similar to the BSC Parks, a person could theoretically click on any Landmark or Church or Park, and see its in-game stats similar to how the BSC Parks Menu shows things instead of just it's monthly cost.

    The Cap Relief (Demand Satisfied) and Demand Created values aren't even documented in Ingred.ini, I had to look in new_properties.xml for that. To make things more complex, both Demand Satisfied and Demand Created also have Float32 properties that use a different format. 

    The Park, Landmark, Mayor Rating, and Crime effects seem simpler, as Ingred.ini implies that they are a two item array specifying the effect's magnitude and radius.

    • Like 2

    Share this post


    Link to post
    Share on other sites
  • Original Poster
  • Posted:
    Last Online:  
     
    20 hours ago, Null 45 said:

    The Cap Relief (Demand Satisfied) and Demand Created values aren't even documented in Ingred.ini, I had to look in new_properties.xml for that. To make things more complex, both Demand Satisfied and Demand Created also have Float32 properties that use a different format. 

    The Park, Landmark, Mayor Rating, and Crime effects seem simpler, as Ingred.ini implies that they are a two item array specifying the effect's magnitude and radius.

    Maybe I'm overly hopeful due to your impressive work already.  But you tell me if you think this might be feasible in some form:

    69718cd2a5500_Untitled1LibreOfficeCalc1_21_20269_15_22PM.jpg.a747b20f751cc735c9811691017a6c98.jpg

    Cap Relief is, of course, the Demand Satisfied property.  If it were possible to merely report out the current string, similar to how PIM-X does it, that would be awesome.

    Civic Jobs, I originally thought, might be derived from the Demand Created property.  But then I wondered if Landmarks with Civic Jobs have similar job properties like Commercial and Industrial lots?  The Advanced Query Tooltip does show jobs in Landmarks with Civic Jobs, similar to how we worked out Actual Jobs for Industrial and Commercial lots:

    69719012e2f2e_SimCity41_21_20269_46_25PM.jpg.f961647ec8a99c35bd4e3ac72a89e289.jpg

    So I wonder if it'd really be necessary to parse Demand Created jobs to get the actual # of Civic Jobs being worked.  I think that function might already work from your jobs_low_wealth, jobs_medium_wealth, and jobs_high_wealth variables.  In fact, I'll see if I can test those on a working Landmark Query replacement soon.

    As for the other Exemplar properties that I bracketed, if not too hard, why not?  They're nice to see, and perhaps others might have a use for them for queries in the future - particularly items like Power Consumed or Water Consumed.  

    EDIT: Of course I forgot that the query would need to have the Goofy Stats as well...

    • Like 2

    Share this post


    Link to post
    Share on other sites
    Posted:
    Last Online:  
     
    15 minutes ago, Kel9509 said:

    Of course I forgot that the query would need to have the Goofy Stats as well...

    I'm not a fan of Maxis Goofy Stats because their values are too fictitious and not in line with the city's development. With the LUA code, I managed to obtain Box-Muller transformation with a standard deviation, allowing me to have fictitious values in line with the city's growth.

    If you need the LUA script, here is the code used to calculate the number of prostitutes in the city for the CAM Casino expansion.

    function game.cam_get_prostitute()
        local mean = game.g_city_r_population / 100
        local std_dev = mean * 0.25
        local u1 = math.random()
        local u2 = math.random()
        local z = math.sqrt(-2 * math.log(u1)) * math.cos(2 * math.pi * u2)
        local civilian_count = math.floor(math.max(0, z * std_dev + mean) + 0.5)
        return civilian_count
    end

    • Like 2

    Federal Republic of SiculiaFederal Republic of Sonora

       Ain Member  Wiki

    NAM Team - Co-developer of Pedestian Revolution Mod - Railway Department (Hybrid Railway | HRW Expert) - MTA Member - BAT Creator

    Ulisse Wolf YouTube Channel - Ulisse Wolf Mastodon Profile

    Share this post


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

    @Ulisse Wolf, thanks!  Yeah, I don't want to lose the Goofy Stats but I did know you did some work improving them.  Much appreciated!

    Also, I was wondering if you were doing anything on the Casinos, given how you've opened them up in CAM.  For those who don't use CAM, I might make a Casino Query override.  Or if I make one you can use it in CAM.  New_Properties has so many added functions for the new Power Plants but it's been a while since I looked and I wasn't sure if you added things for the Casinos.

    The basic layout above is what I have in mind, generally, with any suggestions as others might have to adapt it a bit further.  Then I'd include the respective goofy Stat line to each standard Maxis query.  So with one template or so, I might end up replacing about 30 or so Queries, listed below:

    Quote

    Landmark Eyecandy Query ID: 0x2a56675c
    Mayor's House: 0x4a8b9396
    Courthouse: 0x0a8b9a67
    City Hall: 0x9b868f68 [or not, if ModPac Zero City Hall is preferable]
    Bureaucracy: 0xAA8B9971
    Convention Center: 0xCA8B9D40
    Statue: 0x8A8B9811
    Space Port: 0x4C0969E2
    Research Center: 0x8A8B95B0
    Lighthouse: 0x2C096DE6
    Casino: 0xAA8B999E
    Toxic Waste Dump: 0x8A8B98A7
    Army Base: 0x4A8B9936
    Missile Range: 0x6A8B9ACC
    UFO Base: 0xCC097FC0

    Parks:
    Park: 0x0A562A05
    Stadium: 0xCA8B9CE7

    Other Rewards:
    Zoo: 0x0A8B98FE
    Farmer's Market: 0x2A8B97C1
    Cruise Ship Port: 0xAC096AC7
    Tourist Trap: 0x6A8B9875

    Worship: 0xCA8B9AA2
    Cemetary: 0xCA8B96C2
    Country Club: 0x2A8B99D0
    State Fair: 0x0A8B9C6A
    Resourt Hotel: 0x2A8B9DF2
    Radio Station: 0x0A8B9C43
    TV Station: 0x8A8B9D12
    Movie Studio: 0x6A8B9AF3
    Stock Exchange: 0x4A8B9C92

    Once 

    • Like 2

    Share this post


    Link to post
    Share on other sites
    Posted:
    Last Online:  
     
    3 minutes ago, Kel9509 said:

    @Ulisse Wolf, thanks!  Yeah, I don't want to lose the Goofy Stats but I did know you did some work improving them.  Much appreciated!

    Also, I was wondering if you were doing anything on the Casinos, given how you've opened them up in CAM.  For those who don't use CAM, I might make a Casino Query override.  Or if I make one you can use it in CAM.  New_Properties has so many added functions for the new Power Plants but it's been a while since I looked and I wasn't sure if you added things for the Casinos.

    The basic layout above is what I have in mind, generally, with any suggestions as others might have to adapt it a bit further.  Then I'd include the respective goofy Stat line to each standard Maxis query.  So with one template or so, I might end up replacing about 30 or so Queries, listed below:

    Once 

    For casinos, the work in New_Properties is already complete. In CAM Core, you will already find the Maxis override that I developed. 

    CAM Casino specialization has not been updated due to a lack of LEX content, which still needs to be restored. 

    For now, I am working hard on rebuilding AMPS. The Maxis lots are already ready and updated using Exemplar Patch (CAM Core is required as a dependency), but I need to update Kloudkicker Transformer, TakemeThere Transformer Substation, and Simmer2 Main Transformers to have the first alpha of the new AMPS version available to the public (using Experimental CAM Core). 

     

    • Like 2

    Federal Republic of SiculiaFederal Republic of Sonora

       Ain Member  Wiki

    NAM Team - Co-developer of Pedestian Revolution Mod - Railway Department (Hybrid Railway | HRW Expert) - MTA Member - BAT Creator

    Ulisse Wolf YouTube Channel - Ulisse Wolf Mastodon Profile

    Share this post


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

    Success on the jobs!   @Null 45 your existing variables work fine for Civic Jobs!

    6971a5b9793ba_GDriverWindow--DirectX1_21_202611_19_59PM.jpg.f652859a9effce3142625d189ba62d7a.jpg

    • Like 3

    Share this post


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

    I tested some standard Maxis variables from the RCI query in the Landmark lots.  Land Value, Powered and Watered work, but the others don't work so well:

    6971a93e37c88_SimCity41_21_202611_34_45PM.jpg.2e24524548e186a6bf088908395de098.jpg

    Anyway, this is looking promising. 

    • Like 2

    Share this post


    Link to post
    Share on other sites
    Posted:
    Last Online:  
     
    19 hours ago, Kel9509 said:

    but the others don't work so well

    For whatever reason, the Maxis implementation restricted those variables to only working with RCI lots.

    20 hours ago, Kel9509 said:

    Cap Relief is, of course, the Demand Satisfied property.  If it were possible to merely report out the current string, similar to how PIM-X does it, that would be awesome.

    Reporting it as a single string is simpler than trying to split it into individual properties. :) 

    So in summary, the requested new occupant variables are:

    • Cap Relief (Demand Satisfied)
    • Landmark Effect
    • Park Effect
    • Mayor Effect
    • Crime Effect
    • Wealth (which SC4 already implements for RCI lots)
    • Pollution at Center
    • Pollution Radius
    • Water Consumed
    • Power Consumed
    • Flammability
    • Mac Fire Stage
    • Bulldoze Cost
    • Like 2

    Share this post


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

    Reporting it as a single string is simpler than trying to split it into individual properties. :) 

    If we know what the data separator is, I believe we could then parse it further with Lua.


    Chance favors the prepared mind. ― Louis Pasteur  
    Remember, a few hours of trial and error can save you several minutes of looking at the README. -- I Am Devloper (on Twitter)

    Clickable ---> The Best of Cori's Posts  (scroll down a wee bit there)    Something fun: MySimtropolis - Invitation to become a SimCity 4 MySim

    Are you new here? Check out the Introduction and Guide to Simtropolis.

    Share this post


    Link to post
    Share on other sites
  • Original Poster
  • Posted:
    Last Online:  
     
    5 hours ago, Null 45 said:

    Reporting it as a single string is simpler than trying to split it into individual properties. :) 

    think that would be sufficient, given how it might be difficult to split.  In the example query, I provided 3 lines to display the potential Cap Relief.  For lots/buildings that have none, it'd be ideal if the Query reported something like "None."  It may look a bit awkward to have a large space in the query for a lot reporting "None" but that's ok.  I assume that if a building has all types of Cap Relief, the Query will display each result as much as possible on one line, moving to the next line in the query's text box until all are displayed.  

    The only possible benefit in splitting them out is better organization, so that I could designate one line as Residential Cap Relief,  a separate one as Commercial, and the last line as Industrial.  But I'm not sure if that's necessary.  Like the building style list, I think just displaying it all might work.  If others have any ideas please speak up.

    Also, I'm not sure what other choice there is.  My idea was merely to report these stats so that people know how useful the buildings/lots are in their city.  It's not like I only want to show Residential Cap relief and not Industrial Cap Relief.  

    5 hours ago, Null 45 said:

    So in summary, the requested new occupant variables are:

    I think that covers it, unless I missed anything?  Monthly cost is already possible.  I don't think we need to see Occupant Groups.  Unless anyone has any other suggestions I think that covers it.

    A while back I tried to implement an update to the RCI query to see if localized Mayor Ratings were possible, but I don't think the game can do that at all.

    • Like 2

    Share this post


    Link to post
    Share on other sites
    Posted:
    Last Online:  
     
    1 hour ago, Kel9509 said:

    A while back I tried to implement an update to the RCI query to see if localized Mayor Ratings were possible, but I don't think the game can do that at all.

    The game tracks mayor rating on a per-cell basis, and you would only get the rating for one cell. So I am not sure how useful that would be.

    I could add that info to one of my extended terrain query tool tips, I am thinking of using the Control query as it already has land value and pollution data for the cell.

    2 hours ago, Kel9509 said:

    It may look a bit awkward to have a large space in the query for a lot reporting "None" but that's ok.

    It may make sense to move that to the bottom of the query dialog and use a format similar to the Building Styles. I expect the Cap Lifter plugins use values that would produce a long number string.

    • Like 2

    Share this post


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

    Here is the cap relief and mayor rating effect strings from my debug logging code. The cap relief is from the Cap Lifter mod. I would not be surprised if some mods also use values above 1,000 for the effect fields.

    #cap_relief# = R§=4,294,967,295 | R§§=4,294,967,295 | R§§§=4,294,967,295 | Co§§§=4,294,967,295 | Co§§=4,294,967,295 | I-D=4,294,967,295 | I-M=4,294,967,295 | I-HT=4,294,967,295 | I-R=4,294,967,295
    #mayor_rating_effect# = magnitude=5 | radius=256

    The thousands separator is whatever SC4 uses for the chosen language.

    • Like 2

    Share this post


    Link to post
    Share on other sites
  • Original Poster
  • Posted:
    Last Online:  
     
    21 minutes ago, Null 45 said:

    Here is the cap relief and mayor rating effect strings from my debug logging code. The cap relief is from the Cap Lifter mod.

    The output looks good.  And while it's unlikely that any single building or lot will have that much relief, it's good to know the DLL can handle large amounts like that.  

    Is it possible to capitalize Magnitude and Radius?

    EDIT: I assume that for buildings with negative effect, like negative mayor or park effects, the negative number would be shown?  And for buildings that do not have a particular exemplar, like Crime Effect, would anything be shown at all or would it show "None" or just blank?  Just trying to figure things out.

    • Like 1

    Share this post


    Link to post
    Share on other sites
  • Original Poster
  • Posted:
    Last Online:  
     
    21 hours ago, Null 45 said:

    It may make sense to move that to the bottom of the query dialog and use a format similar to the Building Styles. I expect the Cap Lifter plugins use values that would produce a long number string.

    Agreed, that is very sensible.  Here's another draft:

    6974580a90227_Landmark-RewardsQueryv2.odsLibreOfficeCalc1_24_202612_23_35AM.jpg.a69d4fdb3121ab217219a0a6321dff8c.jpg

    • Like 4

    Share this post


    Link to post
    Share on other sites
    Posted:
    Last Online:  
     
    36 minutes ago, Kel9509 said:

    Is it possible to capitalize Magnitude and Radius?

    Done. From the Maxis Casino:

    #crime_effect# = Magnitude=50 | Radius=128
    #landmark_effect# = Magnitude=50 | Radius=22
    #park_effect# = Magnitude=-65 | Radius=25
    #mayor_rating_effect# = Magnitude=-7 | Radius=440
    36 minutes ago, Kel9509 said:

    I assume that for buildings with negative effect, like negative mayor or park effects, the negative number would be shown?

    Fixed, and I also fixed another bug where I was not treating the crime effect as Uint8.

    Looking at the Mac disassembly, it appears that a negative crime magnitude isn't supported (the value appears to be treated as unsigned). But I have not tested that theory.

    54 minutes ago, Kel9509 said:

    And for buildings that do not have a particular exemplar, like Crime Effect, would anything be shown at all or would it show "None" or just blank?

    It would be blank, same as most of the other fields in that case.

    • Like 3

    Share this post


    Link to post
    Share on other sites
  • Original Poster
  • Posted:
    Last Online:  
     
    On 1/24/2026 at 12:52 AM, Null 45 said:

    It would be blank, same as most of the other fields in that case.

    That is helpful.

    As I'm considering replacing a lot of the standard Landmark/Reward queries, it might make sense to not make all of them identical.  In particular, if it's typical that a Reward like the Space Port doesn't produce any Crime, it would also make sense to not include the Crime Effect line in its query.  

    The idea here is to really show, at least for Custom buildings & Rewards that use the standard Maxis Landmark/Reward queries (and possibly some BSC queries that are identical but with the BSC logo), what their stats are.  I'm not aware of any custom Space Ports, for instance, that have a crime effect.  So I might have to tailor some of these queries to remove properties from being shown where they aren't normally produced.  My concern was that there could be some crazy Reward building that shows up unexpectedly with something like Crime Effect, or claiming that the Reward helps Industry when in truth it only provides a Park Effect (Maxis landmarks are notorious for claiming properties that they actually do not have). 

    Do people think that I should try to tailor these a bit, or should I just include most of the potential stats anyway even if some show up blank?

    Same question for Parks (one separate query) and Stadiums (another separate query).

    Share this post


    Link to post
    Share on other sites
    Posted:
    Last Online:  
     
    2 minutes ago, Kel9509 said:

    Do people think that I should try to tailor these a bit, or should I just include most of the potential stats anyway even if some show up blank?

    Are the variables to show display only? Or can they be evaluated by Lua before showing them? If the latter you could make the query dynamic by having the text also be a field that you'd fill in with spaces when there is no crime or with a proper label when there is.


    Chance favors the prepared mind. ― Louis Pasteur  
    Remember, a few hours of trial and error can save you several minutes of looking at the README. -- I Am Devloper (on Twitter)

    Clickable ---> The Best of Cori's Posts  (scroll down a wee bit there)    Something fun: MySimtropolis - Invitation to become a SimCity 4 MySim

    Are you new here? Check out the Introduction and Guide to Simtropolis.

    Share this post


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

    Are the variables to show display only? Or can they be evaluated by Lua before showing them? If the latter you could make the query dynamic by having the text also be a field that you'd fill in with spaces when there is no crime or with a proper label when there is.

    I think, based on what @Null 45 has said, that if a building doesn't have a property like Crime Effect, the result is that it will show up blank.  It might be an interesting problem because the DLL can't show what's not there.  It's not even showing a zero, it'd be showing nothing.  I don't know if the DLL would be able to understand if "nothing" is shown and replace it with "None" or something else, particularly in the case where a building doesn't have the specified property like Crime Effect.  Do you know if LUA could evaluate something that's blank?

    Share this post


    Link to post
    Share on other sites
    Posted:
    Last Online:  
     
    2 minutes ago, Kel9509 said:

    Do you know if LUA could evaluate something that's blank?

    Yes. That's a special thing Lua excels at compared to many other programming languages. You can test for "nil". *:golly: 

    The key thing I don't know as I've not been able to test any of Null's recent (past few months) DLLs and so I don't know if the values are ones which will only show in the UI or if they are available to peek at with IF / THEN logic.


    Chance favors the prepared mind. ― Louis Pasteur  
    Remember, a few hours of trial and error can save you several minutes of looking at the README. -- I Am Devloper (on Twitter)

    Clickable ---> The Best of Cori's Posts  (scroll down a wee bit there)    Something fun: MySimtropolis - Invitation to become a SimCity 4 MySim

    Are you new here? Check out the Introduction and Guide to Simtropolis.

    Share this post


    Link to post
    Share on other sites
    Posted:
    Last Online:  
     
    48 minutes ago, Kel9509 said:

    Do people think that I should try to tailor these a bit, or should I just include most of the potential stats anyway even if some show up blank?

    I think it would make sense to consider approaching this from a gameplay perspective. Most stats wouldn't usually be available to a mayor, but are simulation internals. For a park for example, a mayor would mainly know its monthly cost and resource usage, knowing that the park's value for the surrounding neighborhood roughly correlates with its costs. But exposing internal simulation parameters like cap relief, mayor effect and the like, could feel like a cheat.

    Share this post


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

    But exposing internal simulation parameters like cap relief, mayor effect and the like, could feel like a cheat.

    All in the good tradition of modding, I suppose.  We've got ways to see demand,  demand caps, and other stats in the Census Repository, for instance. This is more of the same.  I've always been bothered that a lot of the simulation is a guessing game to some degree.  

    Do you prefer a version with the "top half" of my draft that shows just the jobs, water, fire, pollution, etc?  I suppose I could do that also.

    • Like 1

    Share this post


    Link to post
    Share on other sites
    Posted:
    Last Online:  
     
    7 hours ago, Kel9509 said:

    It might be an interesting problem because the DLL can't show what's not there.  It's not even showing a zero, it'd be showing nothing.

    The DLL is somewhat inconsistent in that behavior. For the job values it shows zero if the value is unknown, but most other properties would show a blank value. 

    10 hours ago, Kel9509 said:

    I don't know if the DLL would be able to understand if "nothing" is shown and replace it with "None" or something else, particularly in the case where a building doesn't have the specified property like Crime Effect.

    I changed the variables to use other default values:

    Spoiler
    
    Coit Tower:
    
    #building_full_funding_capacity# = §0
    #building_full_funding_coverage# = §0
    #building_is_w2w# = No
    #building_styles# = None
    #building_style_lines# = None
    #building_summary# = 
    #growth_stage# = 1
    #mysim_name# = 
    #jobs_low_wealth# = 0
    #jobs_medium_wealth# = 0
    #jobs_high_wealth# = 0
    #travel_jobs_low_wealth# = 0
    #travel_jobs_medium_wealth# = 0
    #travel_jobs_high_wealth# = 0
    #r1_occupancy# = 0
    #r1_capacity# = 0
    #r2_occupancy# = 0
    #r2_capacity# = 0
    #r3_occupancy# = 0
    #r3_capacity# = 0
    #cs1_occupancy# = 0
    #cs1_capacity# = 0
    #cs2_occupancy# = 0
    #cs2_capacity# = 0
    #cs3_occupancy# = 0
    #cs3_capacity# = 0
    #co2_occupancy# = 0
    #co2_capacity# = 0
    #co3_occupancy# = 0
    #co3_capacity# = 0
    #ir_occupancy# = 0
    #ir_capacity# = 0
    #id_occupancy# = 0
    #id_capacity# = 0
    #im_occupancy# = 0
    #im_capacity# = 0
    #iht_occupancy# = 0
    #iht_capacity# = 0
    #water_building_source# = None
    #cap_relief# = None
    #cap_relief_lines# = None
    #crime_effect# = None
    #landmark_effect# = Magnitude=30 | Radius=18
    #park_effect# = None
    #mayor_rating_effect# = Magnitude=5 | Radius=256
    #pollution_at_center# = Air: 0 Water: 1 Garbage: 3 Radiation: 0
    #pollution_radii# = Air: 0 Water: 2 Garbage: 0 Radiation: 0
    #building_wealth# = High Wealth
    #bulldoze_cost# = §4,950
    #flammability# = 10
    #max_fire_stage# = 3
    #power_consumed# = 0
    #water_consumed# = 0
    #budget_purpose_type_cost:0xaa59670c# = §110

     

     

    • Like 1

    Share this post


    Link to post
    Share on other sites
  • Original Poster
  • Posted:
    Last Online:  
     
    On 1/26/2026 at 1:08 AM, Null 45 said:

    I changed the variables to use other default values:

    I think that looks really good.  I'm working on the query now and hope to have it ready for your new version of the DLL soon!

    • Like 1

    Share this post


    Link to post
    Share on other sites
  • Original Poster
  • Posted:
    Last Online:  
     
    On 1/26/2026 at 1:08 AM, Null 45 said:

    #budget_purpose_type_cost:0xaa59670c# = §110

    I was looking at this and was wondering if it's any different from the cost value already used for existing Landmarks/Rewards.  

    A regular landmark will report a Maintenance Cost using the IGZWinText ID of 0x00001049, a Toxic Waste Dump will report income using 0x0000106c (same with a Cruise Ship Port but it's now a cost instead of income).  A park will report a Monthly Maintenance Cost using IGZWinText ID of 0x00001010.  

    Is your variable an easier way to just get those amounts without using the specific IGZWinText ID?  I hope so.  But what's the Hex ID suffix? 

    EDIT: Testing these different IDs in different queries results in a CTD if you don't use the proper ID with the respective query.  For instance, you can't use the Landmark ID of 0x00001049 in a Resort Hotel, which doesn't display a cost in its query.

    Share this post


    Link to post
    Share on other sites
    Posted:
    Last Online:  
     
    1 hour ago, Kel9509 said:

    I was looking at this and was wondering if it's any different from the cost value already used for existing Landmarks/Rewards.  

    It is similar to 0x106c, but unlike that function it can handle buildings that have mixed income and expense budget items.

    1 hour ago, Kel9509 said:

    But what's the Hex ID suffix?

    The hex suffix is the Budget Item: Purpose Type value. The ones Maxis defined are listed in Ingred.ini, but DLLs can also define their own (e.g. my Custom Budget Departments DLL).

    Spoiler
    
    ; Purpose IDs
    [Uint32ValueMap_0xea54d285]
    0xca550301=Mass Transit Switch
    0xca565486=Hospital Staff
    0xea56549e=Hospital Coverage
    0xea5654b6=School Staff
    0x4a5654ba=School Coverage
    0x0a567baa=Police Protection
    0xea56768a=Jail
    0xea567bc3=Fire Protection
    0xca58c9d5=Water Production
    0xca58edc7=Sanitation
    0xca58e540=Power Production
    0xaa59670c=Landmark Effect
    0x4a5a495e=Business Deal Income
    0xca639989=Park Effect
    0x0c3bf549=Toll Booth Maintenance

     

    1 hour ago, Kel9509 said:

    EDIT: Testing these different IDs in different queries results in a CTD if you don't use the proper ID with the respective query.  For instance, you can't use the Landmark ID of 0x00001049 in a Resort Hotel, which expects an ID of 0x00001000 (as well as some additional items in its query).

    Not surprising. Maxis likely assumed that the C++ functions would only be used for their intended purpose, and didn't bother with error checking.

    I dumped the array of 126 functions that Maxis used to implement the 0x10xx query, which I will post below. I am curious why 24 of those function pointers are null (calling one would cause a CTD). Perhaps the function pointers where assigned in blocks and some went unused, or they are leftovers from unimplemented features. Another oddity is that the number format the game checks for is 0x1xxx, allowing for up to 4096 items.

    Spoiler
    
    Function 0 (0x1000) = SetOrGetName
    Function 1 (0x1001) = SetOrGetFireStationEffectiveness
    Function 2 (0x1002) = SetOrGetFireStationLocalFunding
    Function 3 (0x1003) = SetOrGetFireStationEngineCount
    Function 4 (0x1004) = SetOrGetFireStationMaintenanceCost
    Function 5 (0x1005) = NULL
    Function 6 (0x1006) = SetOrGetPoliceStationEffectiveness
    Function 7 (0x1007) = SetOrGetPoliceStationArrestCount
    Function 8 (0x1008) = SetOrGetPoliceStationCrimeCount
    Function 9 (0x1009) = SetOrGetPoliceStationLocalFunding
    Function 10 (0x100a) = SetOrGetPoliceStationPatrolCarCount
    Function 11 (0x100b) = SetOrGetPoliceStationMaintenanceCost
    Function 12 (0x100c) = SetOrGetJailCondition
    Function 13 (0x100d) = SetOrGetJailCellCount
    Function 14 (0x100e) = SetOrGetJailInmateCount
    Function 15 (0x100f) = SetOrGetJailMaintenanceCost
    Function 16 (0x1010) = SetOrGetParkMaintenanceCost
    Function 17 (0x1011) = SetOrGetAirportOccupantAirTrafficVolume
    Function 18 (0x1012) = SetOrGetAirportOccupantNoisePollution
    Function 19 (0x1013) = SetOrGetAirportOccupantMaintenanceCost
    Function 20 (0x1014) = SetOrGetAirportOccupantLostLuggage
    Function 21 (0x1015) = SetOrGetSeaportOccupantSeaTrafficVolume
    Function 22 (0x1016) = SetOrGetWaterPollutionVolume
    Function 23 (0x1017) = SetOrGetSchoolGrade
    Function 24 (0x1018) = SetOrGetSchoolLocalStaffFunding
    Function 25 (0x1019) = SetOrGetSchoolLocalBusFunding
    Function 26 (0x101a) = SetOrGetSchoolTeacherCount
    Function 27 (0x101b) = SetOrGetSchoolDeskCount
    Function 28 (0x101c) = SetOrGetSchoolStudentCount
    Function 29 (0x101d) = SetOrGetMuseumExhibitTicketsAvailable
    Function 30 (0x101e) = SetOrGetLibraryBooksBorrowedCount
    Function 31 (0x101f) = SetOrGetLibraryBooksInCollectionCount
    Function 32 (0x1020) = SetOrGetHospitalGrade
    Function 33 (0x1021) = SetOrGetHospitalLocalStaffFunding
    Function 34 (0x1022) = SetOrGetHospitalLocalAmbulanceFunding
    Function 35 (0x1023) = SetOrGetHospitalDoctorCount
    Function 36 (0x1024) = SetOrGetHospitalBedCount
    Function 37 (0x1025) = SetOrGetHospitalPatientCount
    Function 38 (0x1026) = NULL
    Function 39 (0x1027) = NULL
    Function 40 (0x1028) = NULL
    Function 41 (0x1029) = SetOrGetIncineratorEfficiency
    Function 42 (0x102a) = SetOrGetIncineratorPercentCapacity
    Function 43 (0x102b) = SetOrGetIncineratorTrashIncinerated
    Function 44 (0x102c) = SetOrGetAirPollutionVolume
    Function 45 (0x102d) = SetOrGetWasteToEnergyEfficiency
    Function 46 (0x102e) = SetOrGetWasteToEnergyPercentCapacity
    Function 47 (0x102f) = SetOrGetWasteToEnergyMaxPowerOutputCapacity
    Function 48 (0x1030) = SetOrGetWasteToEnergyCurrentPowerOutputCapacity
    Function 49 (0x1031) = SetOrGetWasteToEnergyPowerUsed
    Function 50 (0x1032) = SetOrGetWasteToEnergyCostPerUnit
    Function 51 (0x1033) = SetOrGetWasteToEnergyTrashIncinerated
    Function 52 (0x1034) = SetOrGetPowerPlantEfficiency
    Function 53 (0x1035) = SetOrGetPowerPlantPercentCapacity
    Function 54 (0x1036) = SetOrGetPowerPlantMaxPowerOutputCapacity
    Function 55 (0x1037) = SetOrGetPowerPlantCurrentPowerOutputCapacity
    Function 56 (0x1038) = SetOrGetPowerPlantPowerUsed
    Function 57 (0x1039) = SetOrGetPowerPlantCostPerUnit
    Function 58 (0x103a) = SetOrGetWaterBuildingEfficiency
    Function 59 (0x103b) = SetOrGetWaterBuildingUsagePercent
    Function 60 (0x103c) = SetOrGetWaterBuildingMaxCapacity
    Function 61 (0x103d) = SetOrGetWaterBuildingCurrentCapacity
    Function 62 (0x103e) = SetOrGetWaterBuildingWaterUsed
    Function 63 (0x103f) = SetOrGetWaterBuildingCostPerUnit
    Function 64 (0x1040) = SetOrGetWaterBuildingPumpCondition
    Function 65 (0x1041) = SetOrGetTransitStationServiceQuality
    Function 66 (0x1042) = SetOrGetTransitStationUsagePercent
    Function 67 (0x1043) = SetOrGetTransitStationMaintenanceCost
    Function 68 (0x1044) = SetOrGetTransitStationActualUsage
    Function 69 (0x1045) = SetOrGetTransitStationMaxCapacity
    Function 70 (0x1046) = SetOrGetTransitStationGlobalFunding
    Function 71 (0x1047) = SetOrGetLandmarkFunding
    Function 72 (0x1048) = NULL
    Function 73 (0x1049) = SetOrGetLandmarkMaintenance
    Function 74 (0x104a) = SetOrGetLandmarkHomage
    Function 75 (0x104b) = NULL
    Function 76 (0x104c) = NULL
    Function 77 (0x104d) = NULL
    Function 78 (0x104e) = NULL
    Function 79 (0x104f) = NULL
    Function 80 (0x1050) = NULL
    Function 81 (0x1051) = SetOrGetRCIBuildingCurrentOccupancy
    Function 82 (0x1052) = SetOrGetRCIBuildingMaxOccupancy
    Function 83 (0x1053) = SetOrGetRCIBuildingWealthLevel
    Function 84 (0x1054) = SetOrGetRCIBuildingPollution
    Function 85 (0x1055) = SetOrGetRCIBuildingCrime
    Function 86 (0x1056) = SetOrGetRCIBuildingLandValue
    Function 87 (0x1057) = SetOrGetResidentialBuildingCommute
    Function 88 (0x1058) = SetOrGetResidentialBuildingMayorApproval
    Function 89 (0x1059) = SetOrGetResidentialBuildingEQ
    Function 90 (0x105a) = SetOrGetResidentialBuildingHQ
    Function 91 (0x105b) = SetOrGetResidentialBuildingMySimicon
    Function 92 (0x105c) = SetOrGetCommercialServiceBuildingCustomers
    Function 93 (0x105d) = NULL
    Function 94 (0x105e) = SetOrGetRecyclingCenterEfficiency
    Function 95 (0x105f) = SetOrGetRecyclingCenterPercentCapacity
    Function 96 (0x1060) = SetOrGetRecyclingCenterTrashRecycled
    Function 97 (0x1061) = SetOrGetWasteToEnergyPercentCondition
    Function 98 (0x1062) = SetOrGetPowerPlantPercentCondition
    Function 99 (0x1063) = SetOrGetPowerPlantLocalFunding
    Function 100 (0x1064) = NULL
    Function 101 (0x1065) = NULL
    Function 102 (0x1066) = NULL
    Function 103 (0x1067) = NULL
    Function 104 (0x1068) = NULL
    Function 105 (0x1069) = NULL
    Function 106 (0x106a) = NULL
    Function 107 (0x106b) = SetOrGetOccupantGoofyStat
    Function 108 (0x106c) = SetOrGetOccupantCost
    Function 109 (0x106d) = SetOrGetWaterTreatmentPlantEfficiency
    Function 110 (0x106e) = NULL
    Function 111 (0x106f) = NULL
    Function 112 (0x1070) = NULL
    Function 113 (0x1071) = NULL
    Function 114 (0x1072) = NULL
    Function 115 (0x1073) = SetOrGetWaterBuildingPercentCondition
    Function 116 (0x1074) = SetOrGetRCIBuildingTraffic
    Function 117 (0x1075) = SetOrGetRCIBuildingGarbage
    Function 118 (0x1076) = SetOrGetOccupantIsPowered
    Function 119 (0x1077) = SetOrGetOccupantIsWatered
    Function 120 (0x1078) = SetOrGetSeaportOccupantMaintenanceCost
    Function 121 (0x1079) = SetOrGetWhyOccupantAbandoned
    Function 122 (0x107a) = SetOrGetOccupantIsHistorical
    Function 123 (0x107b) = SetOrGetAirportOccupantUsage
    Function 124 (0x107c) = SetOrGetAirportOccupantCapacity
    Function 125 (0x107d) = SetOrGetSeaportOccupantUsage
    Function 126 (0x107e) = SetOrGetSeaportOccupantCapacity

    Despite the names being SetOrGet*, most if not all of the functions can only get values.

     

    • Like 1

    Share this post


    Link to post
    Share on other sites
  • Original Poster
  • Posted:
    Last Online:  
     
    12 minutes ago, Null 45 said:

    It is similar to 0x106c, but unlike that function it can handle buildings that have mixed income and expense budget items.

    Does it report an cost of zero for those that have zero costs (or, worse, missing exemplar properties)?  I can't seem to use a native Function to display a zero cost for the Resort Hotel.  (I misspoke earlier and edited my post - the Resort Hotel has zero cost and its query doesn't display a cost, still - using the landmark ID of 1049 will CTD).  

    I think your function, if it applies globally to all types of landmarks, rewards, and parks, etc, would be a massive improvement.  I didn't realize that this Cost item would be such a pain in the ass to display properly, especially since I thought it was native to the game so it'd be easily done.  Not so at all!

    18 minutes ago, Null 45 said:

    The hex suffix is the Budget Item: Purpose Type value. The ones Maxis defined are listed in Ingred.ini, but DLLs can also define their own (e.g. my Custom Budget Departments DLL).

    Do I need to specify "0xaa59670c" (aka: Budget Purpose Type - Landmark Effect)?  I'm trying to be as universal as I can here.  For Landmarks that have a Budget Purpose type of 0x4a5a495e (Business Deal Income), like the Army base or Toxic Waste Dump, I suppose that would be taken care of by the replacement Army Base query or Toxic Waste Query and I can code that suffix directly into their queries....  And Park queries would use the Budget Purpose Type - Park Effect.  Hmmm..   I'm trying to think if this is  going to be an issue or not.  Maybe not?

    Share this post


    Link to post
    Share on other sites
    Posted:
    Last Online:  
     
    16 minutes ago, Kel9509 said:

    Does it report an cost of zero for those that have zero costs (or, worse, missing exemplar properties)?

    Yes. 

    16 minutes ago, Kel9509 said:

    Do I need to specify "0xaa59670c" (aka: Budget Purpose Type - Landmark Effect)?

    Yes, you need to specify which purpose type you want to query. AFAICT the Budget Purpose Type is like an IID, they uniquely identify a specific budget purpose.

    As I hinted at in my previous post, the game allows buildings to have multiple Budget Item values. Those properties are arrays, but the base game uses a single item for everything other than schools and hospitals. In theory, you could, for example, have a building that uses both Budget Purpose Type - Landmark Effect and Budget Purpose Type - Park Effect. Plus any number of other combinations.

    • Like 1

    Share this post


    Link to post
    Share on other sites
  • Original Poster
  • Posted:
    Last Online:  
     
    11 hours ago, Null 45 said:

    Yes, you need to specify which purpose type you want to query. AFAICT the Budget Purpose Type is like an IID, they uniquely identify a specific budget purpose.

    As I hinted at in my previous post, the game allows buildings to have multiple Budget Item values. Those properties are arrays, but the base game uses a single item for everything other than schools and hospitals. In theory, you could, for example, have a building that uses both Budget Purpose Type - Landmark Effect and Budget Purpose Type - Park Effect. Plus any number of other combinations.

    Hmmm.

    This is definitely an improvement over the existing Maxis ID system of describing cost, which causes CTD if you use them in the "incorrect" query.  

    However, I was hoping for a universal item that could easily describe the cost (or income) of the building, no matter its budget type.  But I see that this might be difficult given what you've described about the multiple budget item values.  So technically you could create a building that falls into the Landmark cost, as well as Police and Park costs, and each with different values.  Who'd have thought that the actual budget gimmicks of real Mayors would actually extend to a simulation!  But is there a practical reason why that'd be desired for any building?  

    Moreover, given that your other Budget DLL mod allows you to create new purpose types, it seems that I can't make a universal query that's future-proof because in the future, if someone creates a new budget type for a series of new Reward buildings like "Airport Expenses" then that won't be picked up at all.  The purpose type suffix would be new and there's no way it'd be accounted for.  

    So at best, I can account for Landmark costs, Park costs, and Business Deal Income types.  Unless I'm missing something?  I noticed the update allows a LUA code to pick up any exemplar category you haven't addressed.  Would it be possible to pick up just the Budget Item: Cost property?  And is there a reason you didn't select that one to begin with? (I must be missing something)

    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