November 15 - It's Friday, so what do I have for you? A Friday Highlight - here!
November 12 - Everyone ready for November Maxis Monthly? Details here

Can python access the F5 key's quarter/half-tile object-snapping setting?

Felice_EnellenFelice_Enellen Posts: 72 Member
As the subject says: Can python access the F5 key's quarter/half-tile object-snapping setting?

I want to write a script that sets it always to quarter-tile snapping, but I couldn't spot anything by searching through the source files for appropriate words. Googling just keeps landing me on pages talking about quarter-tile floor texture placement, which isn't what I'm looking for.

I'm hoping someone else has run across it, either as a python function or a runnable script command.

Thanks! :)

Comments

  • Felice_EnellenFelice_Enellen Posts: 72 Member
    Side note for an EA guru: It'd be awesome if the game options simply let us choose a default, or if the game remembered what we last set it to. Same for toggling quarter-tile placement for floor textures, too.
  • TURBODRIVERTURBODRIVER Posts: 51 Member
    Hey! As to if such function could be accessed can only be confirmed by a SimGuru, but it is only relevant to the client-side, so I would say no.

    The only way I could see an attempt to make it a reality is making a mod that includes ctypes and trying to simulate the F5 keypress (Windows only). This might be impossible to do on Mac OS as I don't think the necessary libraries are included to manipulate input.

    Another possibility might be that there is simply just a config file somewhere in the game files that lets you alter it to be enabled by default. Wishful thinking.
    Sorry, but not sorry tumblr_paqcr5LaDB1vwgrfio1_r1_75sq.png
  • Felice_EnellenFelice_Enellen Posts: 72 Member
    edited September 1
    Oh hey, a wild TURBODRIVER appeared. :D I dig your work.

    Anyway, I guess simulating input is technically a possible solution. I wonder if I could arrange for AutoHotKey to spot the exe launching and then do some screen-scraping to watch for the first time it's able to hit F5, then hit it once and forget until the next launch. Hmmm.

    Or maybe I'll wait until Monday and see if a wild SimGuru appears too and suggests an easier solution. ;)

    Thanks!
  • VieraRedMageVieraRedMage Posts: 42 Member
    Hmm. This sounds like something up TwistedMexi's alley - have you considered reaching out? (I have no idea how one would reach TwistedMexi apart from joining his Patreon, though). I mean, there's already the re-enabled devcheats, Always TestingCheatsTrue, Always MOO, and Always CAS.FullEditMode mods, so perhaps there's a similar way to do that here.... and if not, he might be able to point you in a helpful direction?

    If there isn't a way to do this by the method you describe, what about a roundabout method that gives the same end result? Perhaps a script that looks not for the F5 keypress, but instead looks for/targets the (presumed) boolean changed by that keypress and changes it to ON whenever it detects its state is OFF? If monitoring the on/off state at all times isn't possible (or if it would be too demanding/impractical), perhaps have the script check the quarter/half-tile placement state whenever the player enters Build Mode or loads a lot?

    Alternately, if a guru does wind up in this thread, this would be really nice to have in the vanilla Settings/Game Options menu. I can't imagine it being difficult or time-consuming on Maxis' end to add it as a checkbox option in the settings; I always forget that this isn't already a setting until I pop into build mode for something & then have to google what button I have to push to enable it. :/
  • Felice_EnellenFelice_Enellen Posts: 72 Member
    edited October 8
    Hmm. This sounds like something up TwistedMexi's alley - have you considered reaching out? (I have no idea how one would reach TwistedMexi apart from joining his Patreon, though).
    I'd be down for joining his Patreon to get in touch with him, but somehow I feel like it would be uncool to join and then ask him to tell me how to do what he does to get Patreon donations. XD
    I mean, there's already the re-enabled devcheats, Always TestingCheatsTrue, Always MOO, and Always CAS.FullEditMode mods, so perhaps there's a similar way to do that here.... and if not, he might be able to point you in a helpful direction?
    Those are basically the same as what I was planning to do, but they have the advantage that there's a known console command or python function to do those things. I'm not aware of any python-side flags for the quarter-tile snap. It could be entirely on the (presumably) C++ side.
    but instead looks for/targets the (presumed) boolean changed by that keypress
    That's basically what I'm looking for. I don't know where that boolean lives. It may not even exist on the python side. It could be over in C++, or maybe in what I assume is some ActionScript for the Flash Scaleform UI.
    Alternately, if a guru does wind up in this thread, this would be really nice to have in the vanilla Settings/Game Options menu.
    Yeah, that would be ideal. It really just feels like an oversight, and maybe at this point the people who did that part of the UI are doing other things and there's no one confident to muck with it for what is basically a non-essential QoL fix. :/

    Oh well, I'll try to be positive and hope it happens anyway. :)

    Thanks for the feedback!
  • TSZChEeTaHTSZChEeTaH Posts: 1 New Member
    Apologies for hijacking this thread (can't post a new one yet myself :( ), but I'm facing a similar problem: for a mod I'm working on, it'd be nice to track the state of the bb.moveobjects and headlineeffects cheats. I can toggle them as client commands, but it doesn't seem to be possible to determine if they're currently on or off.

    If you or anybody else finds/knows of a solution, that would be very helpful :) It would definitely help if Maxis would expose some of those UI settings (even if read-only) to the Python side.
Sign In or Register to comment.
Return to top