I was taking a GD break, playing Divinity: Original Sin 2 (D:OS2) and Conan Exiles (CE), but now I have so much stuff to play around with.
Iâm pretty sure my fairly simple use of â~â for CE wonât violate the rules, but good to know. I donât have any scripts for DOS:2 yet, although Iâve thought about it. GD is where I do all the complex stuff.
Something is still not working the way I expected it to work.
The toggle key and reset key interaction is working the way I expected (reset only works if toggle is on), but if I tab away from the game and then return a while later (game was paused), the toggle is turned off even though it was turned on when I paused and alt-tabbed away. I kind of expected the timer to just keep going or be paused when I alt-tabbed out and then continue when I returned to the game. Instead every time I alt-tab away, I have to turn the toggle back on and press reset.
Relevant part of my script:
[autocast by toggle]
key_native_function=true
delay=100
initial_delay=0
CMT= t toggles Word of Recall (on 5) going off every 17.5 seconds
cast1=t:q
delay1=17500
autocast_right_away1=True
reset_key1=q
Mmmm, When I start up or switch back the toggle is off, shouldnât it be on due to âautocast_right_away1=Trueâ?
Am I misunderstanding how this is all supposed to work again.
Just tested this precise config (toggle timer on, minimize the game, go back)
and it works for me, even with some errors I mentioned above.
How long do you wait for timer to start? Wait 18 seconds, not paused, donât do anything in the meantime
Maybe test with shorter delay.
[edit] autocast_right_away=false wonât work
if autocasting is saved and you minimize and go back
autocasting will be still working
The reason the way I program is kinda force_autocasting_if_not_working_already=true
I looked at my config and it was a mess from my having added and commented out all sorts of things for the various tests and fixes (my fixes and yours. ) that have occurred since I first created it. After cleaning up the mess and properly coding âautocast_right_away=trueâ as global to the section, it seems to be working properly. Not sure what I was doing in there that was messing it up.
If you want to see my cleaned up script, you are welcome to do so, but it does seem to all be working as it should now.
Ok but just making sure - now toggle will always start and you wonât be able to have them turned off
if you previously turned them off, minimize the game and then went back.
Bu the upside is the first time you start with a given GDAutocaster launch, the toggles are working automatically
whereas without autocast_right_away youâd have to start them manually (but it would then be maintained).
if (!autocast_right_away) <- only if you left autocasting OFF
{
this.SectionRead(autocast_right_away <- it's going to read config
, "autocast_right_away"
, _AUTOCAST_BY_TOGGLE_RIGHT_AWAY)
}
so since it only works when OFF
then it can only change state with autocast_right_away=true
so effectivelyautocast_right_away=false does nothing because it cannot prevent saved autocasting being on
Think of it as
force_autocasting_right_away
then
force_autocasting_right_away=false
doesnât really mean anything. Donât force it, just leave it as is.
Thatâs pretty interesting behavior. If you use auto-casting, you USE auto-casting, since the toggles arenât respected across a minimization! Only real way to turn it off is to reload with a config that doesnât have it coded. Thatâs doesnât seem very elegant or intuitive, You might want to at least just eliminate the auto_cast_right away keyword and document the toggle state not being respected across minimizing. in the doc in the OP.
The origin of this is my simply wanting to have autocasting started after launching for the first time.
Without using command line / shortcut with command line arguments just normal loading config.
Youâd think it would be better if I change it to precisely that - turned on for the first time
and then if you manually change it in-game itâs how you left it?
I must think how feasible would be such a change. Not sure if easy or not now.
Because you know - my program restarts after you go back to the game and rereads config
so it kinda starts from blank slate, well exluding command line arguments in which
I store information about Key Suspension / Autocast between restarts.
Maybe I need 3rd Bit / flag stored in command line argument.
Suppose you go back to game after 1 week - same launch of GDAutucaster / hibernation
Donât you want your autocasting to start right away
and donât have to remember how you left it?
This is kinda the purpose of this feature.
I cannot really make a difference between minimizing / relaunching the game
some time later (unless I add some process scanning / complicated logic).
If I change this feature to what I described earlier I kinda lose its purpose.
[EDIT] Actually I already scan if game is launched
because I have kill_on_exit option
so I have to differentiate between exit and minimize
MAYBE FORCE IF GAME WAS NOT LAUNCHED BEFORE?
Real launch / not minimize
There is clearly a difference between someone starting or forcing the restart vs. it happening under the covers when the game becomes a background task. Changes in behavior due to the later case (under the covers) are going to be unexpected and confusing. If possible, it would be best for the user to not even know it happened.
Do you need to or are perhaps forced to have that restart occur each time? It seems to make things a lot more difficult.
Sure, sure, Iâm a bit tired at the moment, donât think too quickly but I donât think I have (because thatâs my goal) any unexpected consequences of these restarts. It only complicates programming a little bit but it also has some bonus features like automatically reading changes in config. Also I need to have command line arguments of some sort anyway for different things.
Totally man. Of course I wouldnât have such a thing if I didnât have to.
It solves problems I had / one has since the beginning / if just having a simple script with few lines.
I tried a million ways and it never worked as well as when I just restart the program after 3 seconds.
Anyway, Iâm just about to make a new change / commit and I hope this time youâll find it ok.
@GaeanC Change autocast_right_away to be once per launch and rename it to autocast_on_launch
so now it doesnât disturb the state you left it with before minimize because minimize itâs always after.
Unless you minimize, turn off the game, turn on the game.
[autocast by toggle]
autocast_on_launch=true
cast1=F1:5
delay1=1000
Btw from now on in commits I usually post there are also documentation, OP changes (forum_thread file).
Thereâs also a history available for it: History for forum_thread - kowariantny/GDAutocaster ¡ GitHub
that you may check out just for documentation changes. For example you can see autocast_on_launch in the last change.