Closed ugsusu closed 1 year ago
@ugsusu good to know you had to adjust cursor positions π€ can I ask if you were playing fullscreen/windowed, maximized/not, and what resolution? I'll see if I can make it more robust, admittedly I did not test much of that π
I will try and comment the code better for when things are happening; right now what should happen is it image matches (ImageSearch) for the buttons on the victory window and then the result window to go back home and then restarts, and it should also cover losses as well by going home then restarting. I used ImageSearch since the buttons are in different locations on loss and win, and I want to be sure of where the script is taking me- but ImageSearch can be finnicky especially with different size windows and such. I'll see what I can do π
I was able to reproduce the issue, unsure if it is what caused you to have it though. Any resolution other than 1920x1080 causes the image to not be able to be located and thus likely getting stuck on one of the menu buttons. Any resolution in windowed causes the clicks to be not placed correctly.
A fixed (hopefully for you too) version for mouse locations is on this branch so far, will merge to main and close issue once I figure out or have a way around ImageSearch.
Thanks for the quick replies!! I did a bit of troubleshooting myself and found out from searches online that ImageSearch sometimes has issues finding images. The solution seems to be replacing the images with images taken from your own screenshots. Could you tell me which of the PNGs is for the victory screen, I could give that a test then and see if that fixes it.
Also gonna check out that branch later today! Thank you so much :)
@ugsusu good to know you had to adjust cursor positions π€ can I ask if you were playing fullscreen/windowed, maximized/not, and what resolution? I'll see if I can make it more robust, admittedly I did not test much of that π
Ah also Fullscreen at 1920x1080 however my monitor is 1920x1200 so it's scaled a bit - that might be part of the issue?
A fixed (hopefully for you too) version for mouse locations is on this branch so far, will merge to main and close issue once I figure out or have a way around ImageSearch.
This branch gets stuck at "waiting..." with the very first popup that explains how deflation mode works. Probably also an ImageSearch problem I assume
Edit.
I replaced the ok.png with one I took from a screenshot I did and the first popup works now again
Also the tower placement is fixed!
Thanks for the quick replies!! I did a bit of troubleshooting myself and found out from searches online that ImageSearch sometimes has issues finding images. The solution seems to be replacing the images with images taken from your own screenshots. Could you tell me which of the PNGs is for the victory screen, I could give that a test then and see if that fixes it.
Also gonna check out that branch later today! Thank you so much :)
If you still need them, it would be ok.png (also used for starting) and home.png I believe (home2.png is for the fail screen, that home button was acting different lol).
Ah also Fullscreen at 1920x1080 however my monitor is 1920x1200 so it's scaled a bit - that might be part of the issue?
Ahhh yeah, that'd do it lol
This branch gets stuck at "waiting..." with the very first popup that explains how deflation mode works. Probably also an ImageSearch problem I assume
Yeah, that'd be an ImageSearch issue π
I replaced the ok.png with one I took from a screenshot I did and the first popup works now again
Interesting! I'm glad you were able to get it working, I have no clue how to make it more reliable for new people in general though, at least with ImageSearch. Planning on looking into a more timing-based version instead of ImageSearch-ing events - won't be as fast, but should be more portable.
Also the tower placement is fixed!
Woooo! Thanks for letting me know. Gonna be honest, I only planned for it adjusting for less than 1920x1080 not higher, but good to know that works too π―
Did some more tests with replacing the images, however I can't get the ImageSearch to recognize the victory screen somehow. Gonna try to do some more troubleshooting next weekend when I have a bit more time to figure out how to get it to work.
sorry for the delay @ugsusu! I've re-written the stuff to use PixelGetColor
instead of ImageSearch
, which should be a lot easier on the window scaling. Let me know if it works (now on main)! It did for me, but I can't test your situation exactly π
Itβs fixed! Thank you so much for your help
First of all thanks for the great script, it does work quite well! I just had to adjust some of the cursor positions to work with my game.
However: The script gets stuck on "waiting" once the victory screen pops up. I looked at the file and couldn't really find a check for the victory screen, though admittedly I am not really knowledgeable about this.