Jump to content
Kel9509

Custom Queries for Custom Buildings

318 posts in this topic Last Reply

Highlighted Posts

Posted:
Last Online:  
Currently: Viewing Forums Index
 
3 minutes ago, Kel9509 said:

That is exactly what it was! ... Thank you very much!

Yay! *:)  And you're welcome.

Now do you recall this post and a couple or three after it? Maybe try:

   return math.floor((game.l_elevated_station_utilization_pl * 100) + 0.5) / 100 .. "%"

Ofc, it'll be best to have a test city where there is some usage of that network so you can see the numbers in all their glory. *;)

 

2 minutes ago, Kel9509 said:

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.

Well, you could. *;) (Edit your background PNG image to have the labels.)

  • Like 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
Posted:
Last Online:  
 
34 minutes ago, Kel9509 said:

@Jidan let me know if you think the new headers are ok.

That's all ok to me. And you can definitely make it bigger and bolder using custom font settings. But I don't think it's practical to be included in a census mod. So, this is a nice compromise.

Also, if you can, a custom logo would be nice, since the UI is a bit bland.

Share this post


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

    Now do you recall this post and a couple or three after it? Maybe try:

       return math.floor((game.l_elevated_station_utilization_pl * 100) + 0.5) / 100 .. "%"

    I tried that in an existing city and it did show 6% as a low number.  And I think this is supposed to add decimal places, right?   But I cannot figure out how it actually works (I am NOT a math person at alll).  I don't know why you'd add a half (a percent?) value to something, wouldn't that end up distorting the number?  

    EDIT: Also, would the percentage work properly?  It automatically shows the percentage using your new function, but if it's zero would it still show it?

     

    56 minutes ago, CorinaMarie said:

    Well, you could. *;) (Edit your background PNG image to have the labels.)

    I've leave the fancy schmancy stuff to you and Cyclone Boom.  I know you did that with your City Hall query and it's very, very nice (and I'm so glad that CAM 2.5 is incorporating that because it really needs to be downloaded by everyone).  But it is a heck of a lot of work to get juuuuuuuust right.

    25 minutes ago, Jidan said:

    Also, if you can, a custom logo would be nice, since the UI is a bit bland.

    This I was thinking of even when editing the Census Repository, which I hope can be published soon.  I might want to add a custom logo here because I'll probably add a bunch of these types of buildings to a submenu and that'll need a picture for that too.  Now I just gotta find one or make one up.

    • Like 1

    Share this post


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

    I can't make them any bigger or bolded

    uh .. no no, you can *:P... In fact, you have several dozen text styles at your disposal ... Their names are more or less associated with their use in SC4 windows/panels.

    For your panel, you can take inspiration from the windows in the UI : [ 0x00000000,0x96a006b0,0xaa3acdfe ] -> I'd suggest using "BdgtLedgerHeader" as the section title (bold and with a stronger body!). and for each line of information, I'd recommend using :  BdgtLedgerLineHeavy - or a little smaller : GenBodyMedium !!

    It would be a little less "pasty" over the entire panel.. o.O! .. Why GenBodyMedium -> because I see that some entries are cut off (too long to fit in the width of the column). So we need to either change the text - which in any case may be too long in languages such as French or German ...- or give yourself more space with a less cumbersome font style !! As a DTP layout artist, I often opt for this second choice! And for an SC4 window, it seems like a good choice!  *:D

    Ah .. you're going to find me super boring (yes yes I can see it) *:rofl: ... but I swear, the colon ":" at the end of a line, even in English typography, is not necessary! On the holy bible of typography rules ... I swear - or not ! :O ...

    I'd also lighten the header text on the panel.. I find a certain redundancy ! -> Remove: "welcome..." .. [On the .. summary ].. And remove : "Please ...". And/Or add a humorous phrase ... Maxis style! -> On the laziness of the head of department, who only produces the statistics on the 28th of the month!

    • Like 2
    • Thanks 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:  
    Currently: Viewing Forums Index
     
    11 hours ago, Kel9509 said:

    I tried that in an existing city and it did show 6% as a low number.  And I think this is supposed to add decimal places, right? 

    EDIT: Also, would the percentage work properly?  It automatically shows the percentage using your new function, but if it's zero would it still show it?

    Yes, that is the way to get two decimal places, but if they are both zero it needs another function to force them to show.

    However, I've now tested and the game.l_elevated_station_utilization_pl variable is pre-shortened to an integer value so there isn't any information to the right of the decimal point.

    As such, just return the variable and don't worry about any of the fancy formatting with decimal places. My original code checking for the station count should prevent the 100% with 0 stations and then give the actual percent used if there are some plopped.

     

    11 hours ago, Kel9509 said:

    I know you did that with your City Hall query

    That was 100% CB's work with the PNG image. (I was the Lua specialist for that mod.)

    • Like 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:  
     
    15 hours ago, hugues aroux said:

    I'd suggest using "BdgtLedgerHeader" as the section title (bold and with a stronger body!). and for each line of information, I'd recommend using :  BdgtLedgerLineHeavy - or a little smaller : GenBodyMedium !!

    I appreciate the criticism, since I'm still new at all of this.  I'll take a look at the budget ones as I hadn't even thought of those to be honest.  But the entire query as it is now, except for the Building Name itself, is entirely GenBodyMedium.  Maybe it's hard to tell from the screenshots?  I wanted to avoid a small font and that's why I went with GenBodyMedium.  If the budget fonts look nice I'll use them but to be honest I'd hate to play with the sizing on this thing any more than absolutely necessary, since every minor edit can result in a half hour or more of tweaks with the sizes.  Although you can take consolation in the idea that now that I'm familiar with horizontal items in queries, I might re-do my RCI query for yet another option to make it more horizontal (eventually....).  I'm even thinking of a larger-font version of the Census Repository itself (not sure how to do the tooltips bigger, though).

    As for the cutoffs, I might abbreviate "High Speed Rail" since it replaced "Monorail."  I tested the size of the columns using the largest phrase at the time (which was the Monorail section), but replacing Monorail with High Speed Rail is even lengthier and obviously results in a cutoff.  The cutoff isn't so bad, though, so I might experiment a bit with some more room before I try an abbreviation.

    @Jidan, this is what I came up with for a logo. I am SO BAD at this so don't be too harsh.  Frankly I don't like it myself though.  But I'm not an artist at all so this is difficult.

    677dd8cb466ef_Kel9509Logov6-30x116.png.44c9128afe96b1d6f90cb0f781926e35.png

    10 hours ago, CorinaMarie said:

    As such, just return the variable and don't worry about any of the fancy formatting with decimal places. My original code checking for the station count should prevent the 100% with 0 stations and then give the actual percent used if there are some plopped.

    Thank you, I appreciate the deep dive into that variable.  

    • Like 2
    • Thanks 1

    Share this post


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

    That was 100% CB's work with the PNG image. (I was the Lua specialist for that mod.)

    I gotta say, that was very impressive @Cyclone Boom.  I didn't really appreciate it at first but once I got into making queries and saw what you did with that background image and using it for the headers (and separating the rows by color too) that was just perfection.  Frankly I don't have the patience or skill for that thing.  

    • Like 1
    • Thanks 1

    Share this post


    Link to post
    Share on other sites
  • Original Poster
  • Posted:
    Last Online:  
     
    18 hours ago, hugues aroux said:

    I'd also lighten the header text on the panel..

    I took your suggestions and reworked things.  The budget font looks good.  I'm not good with humor, but fortunately ChatGPT is better at it than me (after multiple suggestions).  Here's the query for now.  I consider it mostly done (except for my crappy logo), now I've gotta do the tooltips which may take some time.  If I can, I might also change the font for the intro back to GenBodyMedium because the point here was to make it friendly for larger resolutions.  

    677dfd3972ef7_GDriverWindow--DirectX1_7_202511_17_13PM.jpg.ff4e81a6ce27958684a3a7b2a59b4440.jpg

    • Like 7

    Share this post


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

    Well crap.  I did some further testing.

    It turns out that the game counts ALL light rail pieces as road pieces.  I have no idea why it does this but in testing this query, every time I place a regular elevated rail track, or ground light rail track, it's counted in the road section as well as being counted in the Light Rail section.  I don't know if this also extends to the items like the Light Rail usage or Congestion, so I'll need to test that.  Even though the Network Query correctly indicates the network type as Light Rail, the road variable still includes it.  Obviously, this would be incorrect data and would over-inflate the roads tiles (and usage?) incorrectly.

    The game also doesn't count one-way roads at all.  They are in zero of the variables, despite being a unique network type.  So those are completely out and frankly absent some new variable magic there's nothing I can do to count those.

    I'm not sure how to address this.  I was thinking maybe a function might help whereby if the variable for light rail tiles > 0, then we could subtract it from the roads tile variable (and possibly any usage or congestion variables also).  But one-way roads are just out at this point.

    • Like 1

    Share this post


    Link to post
    Share on other sites
    Posted:
    Last Online:  
    Currently: Viewing Forums Index
     
    9 hours ago, Kel9509 said:

    I was thinking maybe a function might help whereby if the variable for light rail tiles > 0, then we could subtract it from the roads tile variable (and possibly any usage or congestion variables also).

    Yes indeed. Such coding can be done for the straightforward case of all light rail is added to roads so we subtract them.

    For congestion tile counts, that might be out of our league as we'd really have no way to tell which are contributing to the count if they are both added in because it wouldn't be all or nothing like the regular count.


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

    It turns out that the game counts ALL light rail pieces as road pieces.  I have no idea why it does this

    GLR doesn't natively exist in the game. Since it's part of the NAM, there's likely some weird coding logic behind it to get it to work properly. Cause the closest you can get with it, is the Elevated Rail, or Subway Rail (these are native to the game). But it's likely that the NAM team had to give it a road flag to get the textures and such to work properly so that the GLR could be a viable option. So it's likely showing up as both road and elevated rail in the system. And there's technically no real limitation to this, due to the fact that they're programmed to be able to cross in the base game.

    @Ulisse Wolf, @Lucario Boricua, or @Tarkus (and probably a couple more) could easily explain what's going on. Mine's purely guessing, due to the limitations of the game, and the evidence you've provided.

    • Thanks 1

    I'm the guy who leaves 5 page essays as comments >.<

    "I thought of the tornado as a huge, eager, but destructive dog." ---Ocean Quigley

    Share this post


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

    Could not help but notice that Streets, Roads, Avenues, and Maxis Highways are counted as x2. Why? My best guess is that this is just the way the in game code counts them? If this is so would it be possible, via said coding, to simply divide the final result by 2 thereby giving the actual number in existence instead of making the player jump through mental math or forcing them to haul out a calculator to get a true result. Like Kel9509 math is not my strong point so having an actual number without the x2 would be the optimum way to go.

    Very much like the concept and the horizontal look. My only criticism would be to go with a small a building in all instances, both urban and rural. Perhaps a 2x2 with no more than five to seven stories for urban and something of the same size but with less stories for rural. Parking lots increasing the size beyond 2x2 would be optional.

    • Like 2

    Humor is the second most subjective thing on the planet

    Brevity is the soul of wit and vulgarity is wit's downfall

    Good Night and Good Luck - Read You Soon

    Share this post


    Link to post
    Share on other sites
    Posted:
    Last Online:  
    Currently: Viewing Forums Index
     
    2 minutes ago, Nite Owl said:

    If this is so would it be possible, via said coding, to simply divide the final result by 2 thereby giving the actual number in existence instead...

    Yep. That can certainly be done via the coding for any where the count is known to be exactly double reality. And it can be done right within the tokenized variable without needing a fancy Lua function.

    The ones that get tricky are station counts because those are also the number of cells covered and because of custom modding we can't say all are exactly 3 or 6 or whatever cells.

    • 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
    Posted:
    Last Online:  
     

    are lookup tables an option? Like, if we already know the size of a lot, maybe we could store that somewhere so that the code could just count the number of a type of building and then multiply that by the number of tiles it uses.

    So like, if we used a modified bus stop that's 2x2 tiles for example, we could have say that there's 13 large bus stops, and the table would tell it that it's 4 tiles in size, and then immediately run the math (13 x 4 = 52). Theoretically, this could reduce the time to run the math significantly, since it wouldn't be attempting to count every individual tile of all lots. Though, this also assumes that the game does that to begin with, and I have no clue what it actually does in regards to tracking everything, lol

    Spoiler

    And, honestly, i feel like just general look up tables probably wouldn't hurt for a lot of things regarding this game. Might be a bit extensive, but at least we could periodically update them over time as needed since we know what we're dealing with at that point.

     


    I'm the guy who leaves 5 page essays as comments >.<

    "I thought of the tornado as a huge, eager, but destructive dog." ---Ocean Quigley

    Share this post


    Link to post
    Share on other sites
  • Original Poster
  • Posted:
    Last Online:  
     
    9 hours ago, Ryuu Tenno said:

    But it's likely that the NAM team had to give it a road flag to get the textures and such to work properly so that the GLR could be a viable option.

    Actually, it appears to be base game behavior.  Like I said, I tested it with regular Maxis elevated rail as well.  Here's a screenshot of a brand-new city with just a bus station and some regular elevated rail (after a month's worth of time to get the variables loaded up past the 28th of the month):

    677f440bd663c_GDriverWindow--DirectX1_8_202510_31_28PM.jpg.9339cfbc6f16603ca674120ddb0ff16e.jpg

    Notice the bus station says "Road Tile Count x2" and it lists 4?  That's basically the same behavior shown in my Query.  

    Did anyone else know of this?  I was surprised to see it.  It's pretty well hidden unless you see things side-by-side.  But now that I know of it, I'll be able to fix it for my building query and probably for the other NAM queries as well if at all possible.

    12 hours ago, CorinaMarie said:

    Such coding can be done for the straightforward case of all light rail is added to roads so we subtract them.

    For congestion tile counts, that might be out of our league as we'd really have no way to tell which are contributing to the count if they are both added in because it wouldn't be all or nothing like the regular count.

    Yes, and I'm hopeful that the road tile count fix is as easy as you say, and I can merely subtract the "game.g_elevated_rail_tile_count" from the"game.g_road_tile_count" variable.

    I'll test congestion to see if it's affected also.  If it is, that one might just be too hard to fix.

    4 hours ago, Nite Owl said:

    Could not help but notice that Streets, Roads, Avenues, and Maxis Highways are counted as x2. Why? My best guess is that this is just the way the in game code counts them? If this is so would it be possible, via said coding, to simply divide the final result by 2 thereby giving the actual number in existence instead of making the player jump through mental math or forcing them to haul out a calculator to get a true result.

    I thought about that as well and am still considering it.  There are several things that made me pause in dividing it by 2.  First, it's like that in the NAM queries and it's for a good reason.  Look what happens when you plop one piece of single road:

    677f4ae45c46e_SC4Fixr71_8_202510_53_44PM.jpg.7917ca897defe8c8e04a1a33a94d59d8.jpg

    So a single piece of road is counted as 2 already.  This double-counting of tiles extends to most Road-type transportation in the game.  For instance, here's a single piece of Maxis highway:

    677f4b241c11e_SC4Fixr71_8_202510_58_30PM.jpg.ae3b088bc40e84db431eab3e824db0b7.jpg

    But look what happens when I use the network eraser on it to remove half of it:

    677f4b39504a9_SC4Fixr71_8_202510_59_13PM.jpg.fb9d7d10508c3b71e4a4f521503b3724.jpg

    Now it's down to 1.  So I'm not sure if I want to divide things.  It might be better to explain this behavior in the tooltips.  One other reason is particular to highways: the RealHighway tiles count is the dirtroad variable, from which the Real Highways were created from legacy dirt roads in the game.  But those are not doubled whereas the Maxis highways are.  And it makes sense a bit that the Maxis highways are doubled, because you always get an opposite traveling side road when creating them.  Not so in the RealHighways - for the most part lanes can be separate or combined depending on what type of RealHighway you build. Also, one plop of a Maxis highway took up approximately 4 tiles but it only showed as 2.  And when I erased half of it to only show the remaining 2 tiles, it counted it as 1.  So in reality Maxis highways are under-represented even when "doubled", and should really be "quadrupled" (or the double amount should be doubled again) to get the right number of tiles used up, in theory.  But aligning that count with the NAM Realhighways is even more problematic because the numbers can get pretty crazy when you start dealing with 6-lane highways or 8-lange highways that have a center divider, as that center divider is occupied and so counts as a "tile".  So the RHW-6C piece counts as 3 tiles.  And when you use curves or turning lanes, or even diagonal roads, the tile count starts to get very crazy because each occupied tile is counted and in something as simple as a diagonal road or a curve, that can mean up to 8 or 12 tiles when it doesn't look like that at all.  

    Anyway, it's not so easy as merely dividing it by 2.  I'm really trying to think what might be the right approach here.

    Oddly enough, if you plop only 1 subway tile the tile count will be zero.  You need to have at least one more tile for it to show as "2."  Subways aren't double-counted but for an odd reason it ignores only 1 subway tile.  I haven't seen that behavior at all with rail or monorail, which can count 1 tile.

    Share this post


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

    Further testing strongly suggests that usage and congestion from light rail do not overlap with roads.  I built a residential neighborhood on one side of a river, and an industrial neighborhood on another side of a river, and connected them with an elevated rail bridge and 2 Maxis stations.  Everyone who wanted to work in the industry was forced to walk to the station and commute across the elevated rail bridge to get to their jobs.  So Elevated Rail traffic and pedestrian traffic skyrocketed and road use collapsed.  The query showed this high use of elevated rail and low road use (there was 1 house that drove to the elevated station, probably the guy running the train!):

    677f5aba2dbd3_SC4Fixr71_9_202512_05_12AM.jpg.0e86a0498cbcb850c135e9dd719a7687.jpg

    677f5ad3ede4c_SC4Fixr71_9_202512_05_25AM.jpg.dbb0dcfdf7d0b97429d555db1760d457.jpg

    So thankfully the light rail/road overlap only appears to affect the tile count, making this an easy fix.

    Share this post


    Link to post
    Share on other sites
    Posted:
    Last Online:  
    Currently: Viewing Forums Index
     
    10 hours ago, Kel9509 said:

    ... in something as simple as a diagonal road or a curve, that can mean up to 8 or 12 tiles when it doesn't look like that at all.  

    I have a feeling even with DLL magic this'll be impossible to solve. :lost:

    So, perhaps, for any where the counts can be wildly off due to curves and middle lanes and so on, you could label them as Right of Way Usage?

    Streets Right of Way Usage.: 117
    Roads Right of Way Usage...:  32
    Avenue Right of Way Usage..: 240
    Etc...

    • Like 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
    Posted:
    Last Online:  
     

    Upon reflection the amount of cells used by a specific network in a given city tile really does not matter for anything other than a love of statistics. The true worth is that such networks function properly connection wise, are not overly congested, and are visually pleasing. The x2 thing caught my non math eye and left it wanting a solution. Cori's suggestion of renaming such things as "Right of Way" as opposed to it being a definitive number of cells would seem the proper solution for the moment. 

    • Like 1

    Humor is the second most subjective thing on the planet

    Brevity is the soul of wit and vulgarity is wit's downfall

    Good Night and Good Luck - Read You Soon

    Share this post


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

    So, perhaps, for any where the counts can be wildly off due to curves and middle lanes and so on, you could label them as Right of Way Usage?

    I'll do something like that in the tooltips, I think.  I don't want to get too complicated in the actual query itself (which is already pretty complicated).  I'm also thinking that keeping the "x2" in the query might encourage people to use the tooltips, in a backwards sort-of-logic.  They see that and go, "what the heck is that?" and then they might read more.  Also, I hope to have others on the NAM team review a close-to-final version to scrub any issues or errors in the tooltip explanations themselves.

    Unfortunately it's been a bit slow going for the last several days since I've been busy with certain things (why the nuns decided to have a second grade math test the week back from Christmas vacation requiring a lot of studying, I'll never understand).  I'm hopeful I'll be able to make some more progress this weekend on the under-the-hood things.

    • Like 2

    Share this post


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

    I'm also thinking that keeping the "x2" in the query might encourage people to use the tooltips, ...

    I'd prolly opt for: +/-

    The "x2" is going to be inaccurate more times than not whereas "give or take" would almost never be wrong. *:P

    • Like 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:  
     
    On 1/10/2025 at 7:00 AM, CorinaMarie said:

    I'd prolly opt for: +/-

    Either something like this, or "Approximate".  The tile count is directly tied to the expense incurred by the budget.  I've got expense amounts in the tooltips, based on 1,000 tiles of transit type.  For instance, 1,000 tiles of roads costs $100.  So I think I'll keep the way the game "counts" but I'll describe it as approximate or something, and in the tooltips I'll explain how they operate.

    In other news, I unfortunately found another variable that doesn't seem to display anything: #game.g_transit_strike_chance# doesn't show anything even when I apparently have a transit strike:

    67873d49b1f28_SC4Fixr71_14_202511_36_25PM.jpg.d95ffebdc51cb8950bbc283a1673f794.jpg

    I'm actually not sure what triggers a transit strike, though.  I lowered mass-transit funding to 0%, but I also replaced all my high-capacity subway stations with older ones that had a 2,000 capacity.  I raised the funding back up a bit because I wasn't sure if Sims just stopped using the stations due to low funding or not.  I figured that overcapacity might also trigger a strike.  Anyway, I got one.  According to Simcity_1.DAT, the transit strike variable is used to display the news about the transit strike shown in my screenshot.  So the variable works for the Advice setting.  But it doesn't appear to show up in the Query at all.

    If it's really an empty variable, then I'll have to remove it because it'd be useless to show.  I might try replacing that line with #game.g_car_zot_count# instead, once I test to see if that works.

    I'm making steady progress on the tooltips, trying to cram as much info in there as I can from the Prima Strategy Guide.  I noticed though that the Guide is incorrect about some items (at least with the NAM installed).  For instance, Rail Expense is $12 per 1,000 tiles.  Not the $30 that the Strategy Guide says.  

    EDIT: Car Zots works, so I'll probably go with that unless there's someone who has any luck with Mass Transit Strike Chance.  

    • Like 3

    Share this post


    Link to post
    Share on other sites
    Posted:
    Last Online:  
    Currently: Viewing Forums Index
     
    On 1/14/2025 at 11:52 PM, Kel9509 said:

    Either something like this, or "Approximate".

    Sure. "Approximate" will work fine.

     

    On 1/14/2025 at 11:52 PM, Kel9509 said:

    #game.g_transit_strike_chance# doesn't show anything

    Agreed. I've run several tests and it stays at zero. Additionally, #game.g_power_strike_chance# and #game.g_power_strike# will also always show zero.

    Here's a little pop up message mod I made for you: Kel's Strike Chances Popup Message Lua Code v0.01.dat

     

    On 1/14/2025 at 11:52 PM, Kel9509 said:

    I'm actually not sure what triggers a transit strike, though.

    Underfunding. I believe the threshold is less than 66.67%. Overuse doesn't bother it except if a station gets to around 400% and then that one shuts down for a Sim Day, but there's no strike.

     

    On 1/14/2025 at 11:52 PM, Kel9509 said:

    According to Simcity_1.DAT, the transit strike variable is used to display the news about the transit strike shown in my screenshot.  So the variable works for the Advice setting.

    Are you basing that on the fact you've seen that exact pop up message in the game or simply that you've seen Maxis's intentions in the Lua code? The popup message you show is from a.trigger = "game.g_transit_strike > 0" and not based on the strike chance.

     

    On 1/14/2025 at 11:52 PM, Kel9509 said:

    I might try replacing that line with #game.g_car_zot_count# instead,

    Good plan.

     

    On 1/14/2025 at 11:52 PM, Kel9509 said:

    I noticed though that the Guide is incorrect about some items (at least with the NAM installed).

    Yep. NAM does change some things like that.

    • Like 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:  
     
    15 hours ago, CorinaMarie said:

    Agreed. I've run several tests and it stays at zero. Additionally, #game.g_power_strike_chance# and #game.g_power_strike# will also always show zero.

    Here's a little pop up message mod I made for you: Kel's Strike Chances Popup Message Lua Code v0.01.dat

    Wow, my own specialized dat file!  Yay!  Thanks!  But I'm not sure what to do with that.  I put it in one of my existing cities but nothing immediately came up.

     

    15 hours ago, CorinaMarie said:

    Are you basing that on the fact you've seen that exact pop up message in the game or simply that you've seen Maxis's intentions in the Lua code? The popup message you show is from a.trigger = "game.g_transit_strike > 0" and not based on the strike chance.

    I saw it in the code.  I think you're right that it's not used, though.  I guess those code sections are just obsolete?  I'll try to look more closely at it when I get a chance.

    In other news, I'm nearly done with the tooltips.  @Ulisse Wolf, maybe sometime after this weekend I'd like to send the file to some NAM members to review all my tooltips and other items.  There's a lot of detail there and I was wondering if I should include some more that's not really documented anywhere, like certain network speeds.

    Here's an example of how I describe Roads so far, in the tooltips of Road tiles: 

    Quote

    Roads include all roads, pedestrian mall tiles, certain multi-radius curve FLEX roads (including Turning Lane Avenues), any Network Widening Mod road, road-based avenue roundabouts,  and certain avenue roundabouts with intersections (despite also being avenues), single-tile roundabouts, draggable subway-based Flexible Underpass tiles (even if they look like RHW), Flexible Underpass ramps, and some but not all Flexible Underpass tiles (despite no road appearance), road viaducts and overpasses, all network widening mod pieces (tiles, curves, neighbor connectors, transition pieces,), road-based FLEX turning lanes, road-based quickturns, Fractional Angled Roads, certain rural roads, and as parts for certain specialized Maxis Highway pieces.

    DOES NOT INCLUDE ONE-WAY ROADS.  ONE-WAY ROAD NETWORKS ARE NOT COUNTED, INCLUDING ALL ONE-WAY ROAD FLEX RAMPS.

    All of that is from actual testing in-game.  Roads was the most complicated.  For comparison, here's RealHighway:

    Quote

    RealHighway tiles include all RealHighway pieces in the Highway menu.
    RealHighway tiles also includes parts of onslope road/avenue viaduct transition pieces, diagonal road/avenue viaduct ramps, alternative viaduct ramps, and RHW FLEX turning lanes or specialized interchanges.

     

    Share this post


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

    I saw it in the code.  I think you're right that it's not used, though.  I guess those code sections are just obsolete?  I'll try to look more closely at it when I get a chance.

    It looks like the game sets game.g_transit_strike to 1 when the kMsgTransitStrikeBegin message fires, and then sets it back to 0 when the kMsgTransitStrikeFinished message fires. You can use the SC4 Message Viewer DLL to log when those messages fire.

    The game.g_transit_strike_chance message doesn't appear to be implemented on the C++ side, so it is probably something that Maxis abandoned at some point during SC4's development.

    • Thanks 2

    Share this post


    Link to post
    Share on other sites
    Posted:
    Last Online:  
    Currently: Viewing Forums Index
     
    11 hours ago, Kel9509 said:

    But I'm not sure what to do with that.  I put it in one of my existing cities but nothing immediately came up.

    Well, with as much as you've done with UIs and some Lua tweaking, I sort of assumed you'd peek inside. *:P

    Here's the key part:

    a.trigger   = [[game.g_fire_strike_chance    > 0 or
                    game.g_fire_strike           > 0 or
                    game.g_police_strike_chance  > 0 or
                    game.g_police_strike         > 0 or
                    game.g_power_strike_chance   > 0 or
                    game.g_power_strike          > 0 or
                    game.g_transit_strike_chance > 0 or
                    game.g_transit_strike        > 0 or
                    game.g_health_strike_chance  > 0 or
                    game.g_health_strike         > 0 or
                    game.g_school_strike_chance  > 0 or
                    game.g_school_strike         > 0]]

    And that essentially says: Don't pop up unless there's a greater than zero strike chance (or an actual strike) in progress. *;)

    Then in the game you'd need to tweak the budgets to annoy your Sims and maybe see something like this when running time:

    imgW10-3587.jpg

    ^ And yes, we could add the % sign if we wanted. (This is just bare code to get things to show.)

     

    11 hours ago, Kel9509 said:

    I guess those code sections are just obsolete?

    Not obsolete, but broken. The peeps coding the Lua were relying on the C++ team to update that strike chance variable and said team failed. The Lua code is fine in the two places they intend for there to be popup messages.

    Here's the first one:

    --------- Advice record ----
    --Transit Workers Ticked Off; Strike Looms
    a = create_advice_transportation('aa5e3f71')
    a.trigger  = "game.g_transit_strike_chance > tuning_constants.STRIKE_HIGH"
    a.frequency = tuning_constants.ADVICE_FREQUENCY_MEDIUM
    a.timeout = tuning_constants.ADVICE_TIMEOUT_MEDIUM
    a.title   = [[text@8a50e8fb]]
    a.message   = [[text@2a50e8ff Mayor, you know I play it straight--I know the difference between budget need and budget greed. The severely low <a href="#link_id#game.window_budget(budget_window_types.TRANSPORT1)">transit funding</a> is going to topple our whole system, and our loyal workers are talking strike. There's more than smoke here Mayor--smother this fire with some transit dollars, or we'll all burn.]]
    a.priority  = tuning_constants.ADVICE_PRIORITY_HIGH
    a.mood = advice_moods.BAD_JOB

     

    And the second one:

    --------- Advice record ----
    --No Roads To Hit--Driven Sims Can't Drive
    a = create_advice_transportation('ea5e632d')
    a.trigger  = "game.g_transit_strike_chance > tuning_constants.STRIKE_HIGH"
    --transit strike probability >x
    a.frequency = tuning_constants.ADVICE_FREQUENCY_MEDIUM
    a.timeout = tuning_constants.ADVICE_TIMEOUT_MEDIUM
    a.title   = [[text@8a50e9d9]]
    a.message   = [[text@aa50e9dd Mayor, you know me as a man who doesn't play games--and I'm here to tell you that our transit workers might just walk out, and that's a game nobody wins. It's all a <a href="#link_id#game.window_budget(budget_window_types.TRANSPORT1)"> matter of money</a>: if they get a little more jingle in their jangle, they'll stick to the job. How 'bout it? ]]
    a.priority  = tuning_constants.ADVICE_PRIORITY_MEDIUM
    a.mood = advice_moods.BAD_JOB

     

    So, as an aside, let's force the first one to pop up in the game so we can get a s/s of it. Copy the whole thing into the Lua under the advice record I created. Then add:

    delete_advice('aa5e3f71')

    above the

    a = create_advice_transportation('aa5e3f71')

    And comment out the existing trigger by adding two dashes in front of it like this:

    --a.trigger  = "game.g_transit_strike_chance > tuning_constants.STRIKE_HIGH"

    Now create a new one like this:

    a.trigger  = "1"

    So the revised code looks like:

    --------- Advice record ----
    --Transit Workers Ticked Off; Strike Looms
    delete_advice('aa5e3f71')
    a = create_advice_transportation('aa5e3f71')
    a.trigger  = "1"
    --a.trigger  = "game.g_transit_strike_chance > tuning_constants.STRIKE_HIGH"
    a.frequency = tuning_constants.ADVICE_FREQUENCY_MEDIUM
    a.timeout = tuning_constants.ADVICE_TIMEOUT_MEDIUM
    a.title   = [[text@8a50e8fb]]
    a.message   = [[text@2a50e8ff Mayor, you know I play it straight--I know the difference between budget need and budget greed. The severely low <a href="#link_id#game.window_budget(budget_window_types.TRANSPORT1)">transit funding</a> is going to topple our whole system, and our loyal workers are talking strike. There's more than smoke here Mayor--smother this fire with some transit dollars, or we'll all burn.]]
    a.priority  = tuning_constants.ADVICE_PRIORITY_HIGH
    a.mood = advice_moods.BAD_JOB
    

     

    And now when you open a live city, it'll pop up fairly quickly:

    imgW10-3597.jpg

    ^ Notice how the verbiage is indicating a potential strike rather than an already started one?

     

    Here's the updated file: Kel's Strike Chances Popup Message Lua Code v0.02.dat

    And an assignment for you (if you choose to accept it)...

    Do the same thing for the 2nd strike chance popup and post a pic of it. *;)

    • Like 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
    Posted:
    Last Online:  
     
    11 hours ago, CorinaMarie said:

    The peeps coding the Lua were relying on the C++ team to update that strike chance variable and said team failed.

    As far as I can tell, SC4 tracks the transit strike chance as part of the traffic simulator data, and only the Lua portion was left unimplemented. Unfortunately, the traffic simulator structure that I suspect contains that data hasn't been decoded yet. It appears to be a massive nested C struct, but I can't determine the size of that structure much less what the original field names would have been.

    Share this post


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

    @CorinaMarie, I'll try your assignment when I get a chance tonight.  I'm sorry I've been a bit busy, and frankly I've been trying to finish the tooltips and other "internal" documentation up.  And there's been lots of testing.  I'll see what I can do though!  In my real life work, I'm about the farthest thing from a programmer at all.  But I'm hopeful to learn a bit!

    Speaking of which, does anyone know if there's a way to change the size of the box of the hover tooltips?  I mean, they always seem to be a fixed width (although the vertical length increases depending on how much text there is).  And even more radically - is there a way to change the font? 

    • Like 1

    Share this post


    Link to post
    Share on other sites
  • Original Poster
  • Posted:
    Last Online:  
     
    On 1/17/2025 at 11:52 AM, CorinaMarie said:

    Do the same thing for the 2nd strike chance popup and post a pic of it. *;)

    Well, I tried to do this but unfortunately it didn't work for me.  I'd like to understand what I did incorrectly.

    Here's my code.  I replaced the one you made on v.02 of the file with the following:

    Quote

    --------- Advice record ----
    --No Roads To Hit--Driven Sims Can't Drive
    delete_advice('ea5e632d')
    a = create_advice_transportation('ea5e632d')
    a.trigger  = "1"
    --a.trigger  = "game.g_transit_strike_chance > tuning_constants.STRIKE_HIGH"
    --transit strike probability >x
    a.frequency = tuning_constants.ADVICE_FREQUENCY_MEDIUM
    a.timeout = tuning_constants.ADVICE_TIMEOUT_MEDIUM
    a.title   = [[text@8a50e9d9]]
    a.message   = [[text@aa50e9dd Mayor, you know me as a man who doesn't play games--and I'm here to tell you that our transit workers might just walk out, and that's a game nobody wins. It's all a <a href="#link_id#game.window_budget(budget_window_types.TRANSPORT1)"> matter of money</a>: if they get a little more jingle in their jangle, they'll stick to the job. How 'bout it? ]]
    a.priority  = tuning_constants.ADVICE_PRIORITY_MEDIUM
    a.mood = advice_moods.BAD_JOB
     

    However, when I dropped it into my game it never showed up, unlike the v.02 you posted which showed up basically right away.  I thought it might be an error with cutting-and-pasting from this forum, so I even tried copying the original code from Simcity_1.  But that only produced the same result. 

    • Like 1

    Share this post


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

    In other news, I believe I've finished up this query.  I don't know if I'll even try making a vertical version of it anymore since the horizontal one looks so much better. 

    I also will apply it to two buildings, in case people would like to use it with different styles.  The first is for larger cities, using the Reynolds Building from @Diego Del Llano.  I'm still looking for a second, smaller building for those who have smaller or rural cities.  Any suggestions will be appreciated.

    Also, it'd be nice if someone else on the NAM team would take a look at things.  I've embedded a lot of NAM documentation in the tooltips, based on my testing as well as what I've read in the NAM Feature Guides@Tarkus, any suggestions perhaps?

    Share this post


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

    I also will apply it to two buildings, in case people would like to use it with different styles.  The first is for larger cities, using the Reynolds Building from @Diego Del Llano.  I'm still looking for a second, smaller building for those who have smaller or rural cities.  Any suggestions will be appreciated.

    Just a heads up. @Diego Del Llano's buildings have a small annoying problem. Maxis Nite and Dark Nite buildings do not have the same IID so you have to create two lots to add Maxis Nite and Dark Nite support.

    I agree with creating a rural version for small towns that serves as a civilian DMV center while for big cities you can opt for skyscrapers.


    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

    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