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
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.
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!
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.
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.
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.
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!
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.