Jump to content
Kel9509

Custom Queries for Custom Buildings

318 posts in this topic Last Reply

Highlighted Posts

Posted:
Last Online:  
 

So now that I'm basically nearly done with fixing the Census Repository Building query, I thought I'd  try to make a custom query for some custom buildings to show some game data that might be useful.  I started with a "Department of Transportation" building.  However, I'm seeing that some of the Maxis variables that I'd like to show don't really work in the game to display variables.  They seem to be variables to trigger Advisor pop-ups, but they don't actually display any data.

For instance, I've got a test custom Query for my Department of Transportation building that can show several variables:

67743d96db953_GDriverWindow--DirectX12_31_20241_23_12PM.jpg.3eea2a6a3e1edbf41dadf8fe9e1aa4aa.jpg

Those variables are:

Mass Transit Funding: #game.g_masstransit_funding_p#
Transit Strike: #game.g_transit_strike#
Strike Chance: #game.g_transit_strike_chance#
Average Freight Trip Length: #game.ga_freight_trip_length#

But when I select some other ones to try out, they don't work and only show my caption instead:

67743e035c880_GDriverWindow--DirectX12_31_20241_28_06PM.jpg.b86abe3c25f8f3eac2d7bad54ab52443.jpg

The one I was trying out were:

Bus Station Count: #game.g_bus_station_count#
BS utilization percentage: #game.ga_bus_station_utilization_p#
utilization pl: #game.l_bus_station_utilization_pl#
utilization subject: #game.l_bus_station_utilization_pl_subject#

Does anyone know why some variables don't display data?  Is there a way for me to tell which ones work?  

I thought that it might have something to do with the building type so I made the building into a bus stop in PIM-X, but it still didn't show anything.

EDIT: I think that this is a coding issue.  I looked at the Cori Reports coding that @CorinaMarie made and saw the reference to Lua formatting of numbers, like here: http://lua-users.org/wiki/FormattingNumbers

I suppose I'll have to learn a bit of that or try to adapt some existing coding to see if I can get it to output into the Query, if that's still even possible.

EDIT2: Well this is disappointing.  The Ministry of Garbage uses similar variables (like the # of recycling stations) but there's no problem displaying them there without any fancy coding.  I have no idea what's going on here.  Even when I literally copy and paste the file from Reader into my test building and adjust the group/instance IDs to show up in the query UI properly, it won't display.

Share this post


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

    This is silly but apparently I made an error in my UI and had " winflag_ignoremouse=no" when it should've been set to "yes", and that ended up messing everything up.

    Still, I wonder if my original question stands and if some of these variables need special coding to display at all?

    Share this post


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

    Still, I wonder if my original question stands and if some of these variables need special coding to display at all?

    Trial and error should work for that. *:P

    (I have peeked at your v4.0 Census a wee bit and will try to get back to it soon.)

    One thing I know for certain (which I didn't know during my Cori Reports coding days) is that any variables with with _subject tacked on the end is a locality so it's actually a table of co-ordinates which you cannot display. Those are used as the target of game.camera_jump() and game.camera_jump_and_zoom() functions in an advisor popup linky.

    For your Bus Station ones, I believe they should work. If you load a well established city and run a Me Report, does it have those with data?

    Others like El Train stations returns the number of occupied cells. So like if you run it in the Rush Hour Tutorial city after completion the two stations are reported as 6 quantity.


    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:  
     
    4 minutes ago, CorinaMarie said:

    One thing I know for certain (which I didn't know during my Cori Reports coding days) is that any variables with with _subject tacked on the end is a locality so it's actually a table of co-ordinates which you cannot display. Those are used as the target of game.camera_jump() and game.camera_jump_and_zoom() functions in an advisor popup linky.

    Yeah I just tested the "subject" ones and that broke the coding entirely.  Those don't display at all and cause everything else to get messed up.  I figured that variable was linked to the popups that move the camera to a specific location (or allow clicking to move to a location?).

    Anyway, I'll continue to test the rest out to see which ones are useful for gaming purposes.

    6 minutes ago, CorinaMarie said:

    For your Bus Station ones, I believe they should work. If you load a well established city and run a Me Report, does it have those with data?

    They're working now, and yes your Reports work perfectly and show all the data.  It made me realize that the variables work at a minimum, so I had an error somewhere which turned out to be in the UI.

    7 minutes ago, CorinaMarie said:

    Others like El Train stations returns the number of occupied cells.

    That's interesting, and frankly unfortunate.  There'll probably be a lot of narrowing down of these variables to find useful data for a Query.  

    I'm planning on a Department of Transportation, Department of Education, maybe a Port Authority type building if the transportation one is too large (to separate it out), etc.  Deadwoods' Ministry of Garbage was really the inspiration for it all.  I also might augment the default Fire station query and other default queries too if possible.

    • Like 1

    Share this post


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

    I also might augment the default Fire station query and other default queries too if possible.

    Any which have a funding or coverage slider (or both), please consider making them wider as it gives finer control of the budget amount.

    For instance, it's impossible to set a standard Medical Clinic's funding to exactly $14 (which is often a good number for my tiny rural villages), but when CB stretched the control, that then made it possible.


    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:  
     
    3 minutes ago, CorinaMarie said:

    Any which have a funding or coverage slider (or both), please consider making them wider as it gives finer control of the budget amount.

    For instance, it's impossible to set a standard Medical Clinic's funding to exactly $14 (which is often a good number for my tiny rural villages), but when CB stretched the control, that then made it possible.

    That's definitely a good idea.  I'll try to do that.  

    One other idea I was thinking of was making these HD friendly.  Meaning, should I assume that more people are playing the game in higher resolutions and try to make them use large fonts, etc?

    • Yes 1

    Share this post


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

    Meaning, should I assume that more people are playing the game in higher resolutions and try to make them use large fonts, etc?

    I like that. While I don't have HD, I've worn glasses most of my life and so this is a case where I'll go on record saying: Bigger is better. *:ninja:

    I believe the key thing is to be sure they will still fit for peeps with the 768 vertical pixel screens.


    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:  
     
    1 hour ago, CorinaMarie said:

    I like that. While I don't have HD, I've worn glasses most of my life and so this is a case where I'll go on record saying: Bigger is better. *:ninja:

    I believe the key thing is to be sure they will still fit for peeps with the 768 vertical pixel screens.

    It's something I've been thinking of for a while, but it's down on my list of priorities.  I'd probably want to finish up with the new items I'm working on first before I start making bigger versions of things.

    So I'm working on my new building(s) for transportation and some of the variables are definitely curious.

    Does anyone know what the variables that have "utilization_pl" mean, like "game.l_bus_station_utilization_pl"?  In your report they're there but there's no context, and at least in my cities the amounts are at 100 for items not built, or a 1 for items that are built..  It's an advisor trigger to build things but the variable doesn't really say much.  It might be a variable that has little value to a player.

    Also, I assume that dirt road tile count (#game.g_dirtroad_tile_count#) with the NAM installed really refers to RealHighways, right?  Maybe someone on the NAM team can provide more info.  There's probably a lot of things that the Network Addon Mod does that might need particular information tweaks.

    Share this post


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

    In your report they're there but there's no context, ...

    Indeed. Back then I was at the same stage you are now. I found a whole bunch of variables and I also found I could display their content, but I had mostly no clue about their exact details.

    However, if you peek in 0xFFBF9CCF you'll find:

    ----------------------------------------------------------------------------------
    -- Abbreviations

    -- prefixes ---------------------------------------------
    --          g  -- Global value (city-wide).
    --          l  -- Local  value value that has location object associated with it.
    --          a  -- Average value.
    --          t  -- Trend value.

    -- suffixes ---------------------------------------------
    --          p  --  Values representing a percentages.
    --          h  --  The highest value in its domain.
    --          l  --  The lowest value in its domain.
    --         subject -- Used for objects associated with variables using
    --                     'l' (local) prefix. This object holds the locality
    --                      data related to that variable. Hence
    --                      game.l_air_pollution_h_subject is a locality
    --                      object for the cell with the highest air pollution value.

    ----------------------------------------------------------------------------------

    So the pl one'll be a percentage and the lowest of its kind. *;)

    • Like 2

    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:  
     
    On 12/31/2024 at 7:05 PM, CorinaMarie said:

    However, if you peek in 0xFFBF9CCF you'll find:

    Thanks for that, it's very helpful.  And it led me to thinking about some things:

    Many of the networks have a variable to display the highest congestion amount.  There's "game.l_rail_congestion_h" and "game.l_subway_congestion_h".  But I noticed that there wasn't a similar variable for Monorails or Elevated Rails. If  you search in that 0xFFBF9CCF, there is nothing there.  That seemed pretty odd.  I've always found that internal table of application data in OxFFBF9CCF to be pretty sloppy.  They don't describe what many items mean, for instance.  It also appears to show monorail variables twice in a row.  Overall, it's not exactly as robust as I'd expect it to be.  

    Anyway, I did a search in Simcity1.Dat to see if I overlooked something in the Adviser triggers that wasn't listed in 0xFFBF9CCF, but there was nothing else there.

    So on a whim, I tried some variables that I just typed  up: "game.l_monorail_congestion_h" and "game.l_elevated_congestion_h".  And they worked!  At least, they didn't crash the game.  They both reported zero, but then again I was merely testing in a city with no monorail or elevated rails at all anyway. 

    So now at least there is verification that there are undocumented variables that exist in the game.  Did you know of this and do you know if there's a way to find all of the rest of them?

    • Like 1

    Share this post


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

    I found 2 more undocumented variables relating to congestion tile count.  So far, these are what I've found:

    game.l_elevated_congestion_h
    game.l_monorail_congestion_h
    game.g_monorail_congestion_tile_count
    game.g_elevated_congestion_tile_count

    I wonder if there's any more?

    Share this post


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

    So on a whim, I tried some variables that I just typed  up: "game.l_monorail_congestion_h" and "game.l_elevated_congestion_h".  And they worked!  At least, they didn't crash the game.  They both reported zero, but then again I was merely testing in a city with no monorail or elevated rails at all anyway. 

    Wow! Cool. *:party:

    Try: "game.g_cori_castle_walls_count" too. *;)

    • Like 2

    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:  
     
    19 hours ago, CorinaMarie said:

    Try: "game.g_cori_castle_walls_count" too.

    That one didn't work!  

    And unfortunately, there are other documented variables that don't appear to work either, showing zero no matter what I did. Here's the list so far of variables that show zero despite plopping items that'd seem to count:

    game.g_train_freight_depot_count
    game.g_num_tollbooths
    game.g_car_ferry_count (this is in an advice trigger though)
    game.g_passenger_ferry_count  (this is also in an advice trigger)

    But strangely enough, "game.g_seaport_count" did work, and it didn't count the tiles occupied by the entire seaport, but instead listed the entire item as "1".  That was different behavior than all other stations, which resulted in tile counts.

    Also, despite building every type of bridge imaginable in the game, using streets, rail, monorail, highway, Real Highway, roads, etc., the variable "game.g_bridge_tile_count" didn't show any result other than zero either.  Every time I queried a bridge, for instance, with the Network Query that @Null 45 made it always said what type of network it originally was and never said "bridge", leading me to believe that bridge tile counts aren't used ever. Strangely enough, though, "game.l_bridge_congestion_h" still exists as an advice trigger.

    I wonder if  @memo or @Null 45 might be able to peek inside the executable to see if these variables actually work or if I'm just doing something wrong, particularly for the variables that appear broken but have advice triggers like the ferry count items.

    Once I nail down which variables actually work, I'll build out the UI for the query.  Not sure if it should be mostly vertical, or mostly horizontal, or both.

    • Like 1

    Share this post


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

    That one didn't work!

    I didn't have an easy way to test when I said that as I'm about three levels removed from the plugins I use for such. What I was wondering was if the game was returning zero for any variable regardless of its name. *;)


    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:  
     
    On 1/3/2025 at 4:03 AM, Kel9509 said:

    That one didn't work!  

    lol *:rofl:

    On 1/3/2025 at 4:03 AM, Kel9509 said:

    Here's the list so far of variables that show zero despite plopping items that'd seem to count:

    ...
    game.g_car_ferry_count (this is in an advice trigger though)
    game.g_passenger_ferry_count  (this is also in an advice trigger)

    Are they superseded by city and region instance count? I mean, when you plopped a ferry, there will be a limit of 16 terminals in a single city tile. Not to mention that the game literally renders all ferry terminals in the region view. I think the game will still count those terminals, especially against the limit and in regards to region view, but by ferry controller and instance counter instead of general variables. And Maxis forgot to port those changes to the general variables. So, what you see is just zero, despite how hard you plop ferry terminals.

    On 1/3/2025 at 4:03 AM, Kel9509 said:

    game.g_seaport_count

    Because Maxis had a time to port the value from the seaport controller to the general variable. And in a controller, you don't need number of tiles since it's completely irrelevant. What you need is the instance number and that can be referenced by the controller. Then, you iterate from zero to a certain number and you'll get the max amount of seaports. Or, assuming the list of seaports is maintained in an array, get a max value.

    On 1/3/2025 at 4:03 AM, Kel9509 said:

    with the Network Query that @Null 45 made it always said what type of network it originally was and never said "bridge", leading me to believe that bridge tile counts aren't used ever.

    Pretty interesting despite Maxis clearly said bridges are bridges. Maybe, it's not saying bridge because bridge is indeed not a type of network. Think of it as a status owned by every single network tiles. If the tile status is a normal road, it'd be considered to fall under NetworkOccupants. If the tile's a bridge, it'll be under NetworkBridgeOccupants regime. So does for the tunnels. There's a reason why you can't build road under a bridge. Aside of the normal road being higher priority than bridges and road under bridge isn't a type of intersection, the reason is tile conflict since a normal road and a bridge is the same thing, just with different status. It's not like tunnel where the path are automatically created in a separate layer by the game. Originally, Maxis may had tried to make bridges as a type of network, or maybe a pseudonetwork. The intention was bridges were automatically built like in SC3k. So they pursued the path, especially with the fact that the OG SC4 also followed the same logic. When Rush Hour was planned, Maxis probably changed their mind and make the bridge to be just a status of the network. This was probably done to simplify the development process. And they did it. But, Maxis forgot to match the code obtaining the number of bridge tiles with the current bridge regime. So, the value is always zero, again no matter how much bridge you make.

    On 1/3/2025 at 4:03 AM, Kel9509 said:

    game.l_bridge_congestion_h

    Probably for a scrapped mission. Remember, SC4 is full of scrapped ordinances and missions. At one point, Maxis even tried to port SC3k ordinances. But, here we are.

    Share this post


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

    I didn't have an easy way to test when I said that as I'm about three levels removed from the plugins I use for such. What I was wondering was if the game was returning zero for any variable regardless of its name.

    No, the game will not display anything except the caption placeholder if it doesn't understand a variable.  I tried testing numerous formats to try to find undocumented variables and except for the ones I found, everything else would break the code and merely show the placeholder.  When a variable works, it reports back a result like "0".  So for instance, if you try "#game.g_train_freight_depot_count#", it will report back a "0" result.  But no amount of plopping train freight stations, and running enough time, will ever change it to 1, or 2, etc.  In that sense, the variable "works" but it doesn't seem tied to anything a player can do. 

    I'm still hopeful that we may be able to get a list of working variables from the executable one day.

    20 minutes ago, Jidan said:

    Are they superseded by city and region instance count? I mean, when you plopped a ferry, there will be a limit of 16 terminals in a single city tile. Not to mention that the game literally renders all ferry terminals in the region view.

    This is interesting.  I'll test this in a brand new region, and will save and re-load.  So far, my testing has been only in cities that are new and running without saving.  So maybe the region view is important for the game to "count" these items and it only registers them as valid once the city/region is saved.  I'll report back my findings.

    • Like 1

    Share this post


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

    I tried a new region and a new city with ferries.  Saving and exiting to region showed the ferry route in the region view, but upon re-entering the city, the variable still reported zero ferries.  

    The Prima guide says that only 16 of each type of ferry are possible in a city.  I tested that by plopping 16 car/passenger ferries and after the 16th the icon was greyed out and not selectable anymore.  So the game is counting somehow, with something like a reverse reward trigger.  But I suspect that it's not counting with this variable, but probably using the Occupant Group from the building exemplar (which is probably more accurate).  So Maxis probably discarded this variable.

    Anyway, I'm narrowing things down with the useful variables and am primarily trying to figure out how to display things.  Here's my rough working draft so far, just to see how much space I need.  I'll move things around a bit to be more user-friendly once I know how much info I need to display:

    67775e8c3c539_DepartmentofTransportationUI-beta7.txt-UIEditor1_2_202510_48_12PM.jpg.bdc5ddd01fac1649c0830ae61152c1c3.jpg

    • Like 1
    • Thanks 1

    Share this post


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

    I wonder if  @memo or @Null 45 might be able to peek inside the executable to see if these variables actually work or if I'm just doing something wrong, particularly for the variables that appear broken but have advice triggers like the ferry count items.

    Only g_train_freight_depot_count  is present as a string in the executable. the others are probably for features that were abandoned before anyone exported the data on the C++ side. The g_train_freight_depot_count data is pulled from a TrafficStats structure provided by the traffic simulator, but I don't know that structure's size or field layout.

    Here is a zipped text file containing a list of all the Lua game.nnn strings I found in the Mac binary. SC4LuaStrings.zip

    • Like 1

    Share this post


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

    Only g_train_freight_depot_count  is present as a string in the executable. the others are probably for features that were abandoned before anyone exported the data on the C++ side. The g_train_freight_depot_count data is pulled from a TrafficStats structure provided by the traffic simulator, but I don't know that structure's size or field layout.

    Here is a zipped text file containing a list of all the Lua game.nnn strings I found in the Mac binary. SC4LuaStrings.zip

    Thanks, this is very helpful.  I wonder if the freight depot variable isn't working because the NAM traffic simulator is messing it up somehow?  I'll see if it works without the NAM installed temporarily.  And in any event, I see from this list you provided the "undocumented" variables that I found, as well as some others I suspected existing (like street and avenue congested tile counts).

    Now I just need to figure out how big this query will get...

    • Like 1

    Share this post


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

    I am such a glutton for punishment.

    I couldn't decide whether a large vertical query was better than a horizontal query.  So I decided to make them both.  And not only that, since they're basically using the same underlying code, I'll provide both of them as an option in the eventual download and moreover I'll try to make it so that they don't overwrite each other.  Here's how things look so far.  I'm working on the tooltips now, which will probably involve a lot of summarizing things like traffic volume amounts from the NAM documentation.  Still thinking of using the Reynolds Building for the "larger" version of these and will have to pick a "smaller" building as well.  

    Both the large and small buildings will use the same query, but the large one will provide more civic jobs as well as greater Cap Relief than the smaller building.

    Vertical Query:

    677b7c4b1c663_GDriverWindow--DirectX1_6_20251_33_43AM.jpg.825a1b9b34bb22675d335f5d8fd82af1.jpg

    Horizontal Query:

    677b7c5c7dcbe_GDriverWindow--DirectX1_6_202512_50_00AM.jpg.c05cf3adcd1bdd4e3e2c395528920762.jpg

    Let me know what you think and if these can be better organized in any way.  For instance, I'm not sure if I should add horizontal lines in the horizontal query under each header or not.

    There are some slight errors in the screenshots that I've already fixed.  Also, one thing to note that you can see in the Vertical query screenshot is that Low Station usage is at 100% when you have no stations plopped.  Then, once you plop one of them it goes to 0% or whatever the lowest amount would be.  

    • Like 4

    Share this post


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

    Hello, ..  the horizontal version is much more readable, and not only because our screens are oriented in "landscape"! *;) ..My graphic designer opinion! All that is missing is the highlighting of the group title (Funding, Hevy Rail, ...) by increasing the character size by 2 or 3 points, or other .... I think the " : " on each line are not useful, and the "%" since the latter appears after the value... Personally, I would add an icon to each group of information, for reading comfort.

    • Like 3
    • Yes 1

    What is good when you have nothing to say is that you can always pretend to listen. Anyway it does not prevent to think!

    >> My little plugins contribution << -- >> Depot | Fabrik | Testing <<

    Share this post


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

    because our screens are oriented in "landscape"!

    If only SimCity 4 is popular enough on TikTok that we have to make contents vertically. If only, if only. But seriously, horizontal is objectively way better and I do agree with Hugues' suggestions. Also, I think the section headers should be well, headers. Make them bolder, bigger, and preferably centered to differentiate between contents and headings.

    • Like 2

    Share this post


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

    The only thing I might suggest is to create a version that replaces Monorali with High Speed Rail

     

    • Like 1

    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
    Posted:
    Last Online:  
     
    12 hours ago, Kel9509 said:

    Horizontal Query:

    Count me in for this layout. *:ohyes:

     

    12 hours ago, Kel9509 said:

    Also, one thing to note that you can see in the Vertical query screenshot is that Low Station usage is at 100% when you have no stations plopped.

    We could do some simple programming to handle that. *;)


    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, Ulisse Wolf said:

    The only thing I might suggest is to create a version that replaces Monorali with High Speed Rail

    Perhaps I'll just change the terminology of Monorail to High Speed Rail?  Since "Light Rail" replaced "Elevated Rail" anyway, a similar evolution of this that seems appropriate.  Also, the tooltips will be important since basically they'll explain that some of these networks cover other items that aren't so obvious.  Like Light Rail can also include Canals, Subway also includes any network designed to use the subway system like Flexible Underpasses as Underground Roads.

    3 hours ago, CorinaMarie said:

    We could do some simple programming to handle that. *;)

    Oh?  That would be a neat trick.  

    Share this post


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

    Oh?  That would be a neat trick.

    Are these the two variables?

    game.g_train_station_count
    game.l_train_station_utilization_pl

    If so, create a Lua Function:

    -- Fix Maxis lowest Light Rail Station Utilization Bug --
    function lowestLRSU()
      if game.g_train_station_count == 0 then
        return 0
      else
        return game.l_train_station_utilization_pl
      end
    end

    Then in your LText to display it make a token of the function like this:

    #lowestLRSU()#

     

    And remember, you can name your functions anything you want (within reason). Like they cannot start with a number iirc.

    Note: I'm typing from memory. If need be I could test in the game if I've made any mistakes. *;)


    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:  
     
    36 minutes ago, Kel9509 said:

    Perhaps I'll just change the terminology of Monorail to High Speed Rail?  Since "Light Rail" replaced "Elevated Rail" anyway, a similar evolution of this that seems appropriate.  Also, the tooltips will be important since basically they'll explain that some of these networks cover other items that aren't so obvious.  Like Light Rail can also include Canals, Subway also includes any network designed to use the subway system like Flexible Underpasses as Underground Roads.

    Back in 2015, a survey was done to find out how Monorail tool was used, and High Speed Railway won in the end.

    The only thing I might have doubts about is HRW as a hybrid network will appear on both Railway and Monorail/ High Speed Railway section


    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:  
     
    1 hour ago, CorinaMarie said:

    Note: I'm typing from memory. If need be I could test in the game if I've made any mistakes. *;)

    Well, I tried doing it on my own but unfortunately LUA is something that always seems to give me a bit of trouble.  I note that you called it "light rail" but used the variables for regular heavy rail.  But I tried using the variables for light rail and it still didn't work.

    I added the function properly in the query, like you noted, replacing my prior variable of "#game.l_elevated_station_utilization_pl#%" with "#lowestLRSU()#", and I basically took your coding and tried creating a new LUA file by copying an existing one (from your City Hall Upgrade) and editing it with a new package signature.  I also generated a new Group ID and IID.

    677c7f57a1de2_PLOP_3x4_DepartmentofTransportation_84f962d6-Horizontal-beta18.SC4Lot-Reader1_6_20258_06_45PM.jpg.926f4801daa96f8866c6a54790b31a00.jpg

    I also rebuilt the directory ID and reindexed everything too.  Not sure what's wrong here.

    1 hour ago, Ulisse Wolf said:

    The only thing I might have doubts about is HRW as a hybrid network will appear on both Railway and Monorail/ High Speed Railway section

    That is exactly what will happen and it's unavoidable.  Same thing happens with multi-mode stations that operate as many different types, like a subway + bus station.  Those will all be counted in their appropriate sections.

    Share this post


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

    I note that you called it "light rail" but used the variables for regular heavy rail.

    Yeah, I've been away from it too long to remember which is what. *:blush: I just grabbed the first two I found.

     

    1 hour ago, Kel9509 said:

    But I tried using the variables for light rail and it still didn't work.

    Good plan. And in what way doesn't it work? Is it still returning 100% when there are no stations plopped?

     

    1 hour ago, Kel9509 said:

    I added the function properly in the query,

    Yep. That looks good.

     

    1 hour ago, Kel9509 said:

    editing it with a new package signature

    Good, but I see the first digit of your package signature is greater than 7 since hex "d" is 13. That makes it a negative as a sign bit. Try 7 or lower for the first digit in the Lua code for the package signature.

     

    1 hour ago, Kel9509 said:

    I also generated a new Group ID and IID.

    A new IID is good, yes. However, I've never changed the Group ID as I want it to stay in the Lua category. Afaik, there are two valid GIDs for Lua and I've used the same one since it's worked for me. (Or maybe that doesn't matter at all. I've just never tried any others.)

     

    1 hour ago, Kel9509 said:

    Not sure what's wrong here.

    My guess is the GID and then the first digit of the package signature in the green text.

    When your random IID is 2,147,483,648 or greater (as it the decimal equivalent) you want to change the first digit to one of 0 thru 7. (You can tell it's too high if it's 8, 9, A, B, C, D, E, or F.) That's for the package signature.

    The IID of the full TGI can stay whatever you generated.

    • Thanks 1

    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:

    My guess is the GID and then the first digit of the package signature in the green text.

    That is exactly what it was!  It's crazy how there are all these little rules and details you need to know to get things working right!  Only 2 valid GID for LUA?  Seriously?  Anyway, now it's working properly.  Previously it was just showing my caption placeholder.  Here it is now, with Light rail working fine:

    677c921cd66b5_GDriverWindow--DirectX1_6_20259_28_15PM.jpg.2e67820b44dffe85b47d9d2a53313114.jpg

    I'll do the same thing for all the others.  Thank you very much!

    @hugues aroux and @Jidan let me know if you think the new headers are ok.  I can't make them any bigger or bolded unless I make them the same size font as the name of the building, which is overkill.  But I centered them and added a line underneath.  I can also add a line above if you think it's necessary.

    • Like 4

    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