This tool is not working for me even after I managed to fix the error with the window name using the tips from 1berliner's comment. The tool launches, finds the game window, but the OCR stuff is not working correctly, reading some gibberish instead of actual trait names on screen. Please, don't waste your time with this tool, just start the game with random characters and edit their traits with the Community Editor.
So, I thought I'd quickly share how to get this up and running again. But quite honestly, this might just be too much of a hassle for most of you.
To quickly explain why it's no longer working: this script is using OCR to evaluate survivors, therefore it must capture the game window. Since the initial release of this script the games window name has been changed, which is why it can no longer find any window(s) to capture.
Here are the steps you'll need to follow to get the script up and running again:
1. Start the game 2. Open a PowerShell window 3. List currently active windows and their process ids: Get-Process | Where-Object {$_.mainWindowTitle} | Format-Table Id, Name, mainWindowtitle -AutoSize 4. Get the exact window name (it contains whitespace), from the output copy everything in between the single quotes (replace 9400 with your games process id): "'$((Get-Process -id 9400 -ErrorAction SilentlyContinue).MainWindowTitle)'" 5. Download and start Recaf, a Java bytecode editor 6. Load the "SoD2_ideal_community.jar" 7. In the toolbar: "Search" -> "Strings", in the search field type "State of Decay 2", click search 8. Within "<init>()V" find 'LDC "State of Decay 2"', right click and "Edit with assembler" 9. Make out the "GameWindowName" reference and change the value (line 35) to the output from step 4 (remember: everything in between the single quotes, not including the single quotes) 10. In the toolbar: "File" -> "Export program" and overwrite the existing file. In case something went wrong you can download the original file again.
Now you can go ahead, configure the script to your liking and successfully start it.
Personally I had a lot of issues with the script not resolving coordinates correctly, it seems to center the game window, but what it actually seems to need is the game window to be in the very top left corner.
Interesting, I tried this and still couldn't get it to recognize the window, I tried different things but it never would work. Window name in powershell is StateOfDecay2, also tried StateOfDecay2-Win64-Shipping. Dang
I followed your instructions perfectly, but it's still not working. Keeps saying it can't find the window, even though the error message states the correct window name.
It would be great if someone could get in contact with the author, and either request the file be updated, or get permission to upload an updated version.
This program sounds like a really cool idea, would save a lot of headache and time.
I was able to get past this error message using you suggestion as a guideline. The version of Recaf I used needed to save the changes made to the LDC entry before exporting. This was done with a CTRL+S, then I could export the file. The window name for me had to be "StateOfDecay2 " (without quotes and with a space at the end).
If this is not working, be sure to save the changes and include a space at the end of the window name in the LDC value.
Hey, so beign completly honest, I'm lazy af, so of you want to make it work, you will need to do some steps, I recommend to use chat gpt along the way and you will be able to complete it in like 5 mins (+ the time to download the tools if you don't have it)
This is a python script that will take a screen shot of your screen, if it's not the right Community Skill, It will press T, if It's the right skill it presses right arrow until if finds the 3 community skills that you want.
To make it work you will need: python 3, pip, and install some pip libraries (as a said, seems to be much, but really with chat gpt it will be 5 minutes)
Then here's basic the tutorial:
Put your game on windowed mode, resolution 1280x960
The default 3 skills are my favorite set: lichenology, Recycling, Mechanics, If you want different ones, just go to the varible expected_word and edit it, don't worry about the order of the skills, the script will try to find them on any position
Open the game, create a new community, skip tutorial, generate you first 3 survivors
Run the program, then you have 2 seconds to select the game window and the program will start to randomize
Common tips and mistakes:
If 2 seconds is too quick for you, just adjust on line 44 "time.sleep(2)" put how many seconds you want
If your pc is weaker and it's randomizing too fast, just edit line 64 for a longer time (current is 0.2 seconds)
If you want to run it on a different resolution, you will need to fin the right pixel position, I used this other python script with same libraries for it: https://pastebin.com/m0r47LE4
If your window name is not "StateOfDecay2" just go on line 39 and put the right window name, for me I just put the one that shows when you hover the game when it's open, but I play on windows store, so Steam can be a different name
If you are having any weird behaviour, try to look for the terminal feedback, It pritns every word read, also you can open the fold on VS Code and inside VS Code, open the screenshot that is beign saved, see if it's cropping the right spot. I recommend open the image on VS Code becasue it refreshes automatically the image when the program is running, awsome for debug.
If you are a developer and want to make it a full program, feel free to use it, and if you want to contact me my discord is bolo422 It's easy to add more stuff and more flexibility, but as I said, I'm lazy, maybe sometime in the future I will do.
If I see that more people are looking for this, I will consider making a full software and making it available for the community, but If it's just for me, this is enough really, because I already have the development tools at hand, so making an executable, parametrized, scalable program would be waste of time, but if more people want, I can do it for yall.
I don't think this mod is working anymore. Check out the community editor mod in the coming days. It will be updated for the current version soon and can do the same as this mod and more.
It is not working I have Java and Microsoft Visual C runtime both installed and updated I only get message like the " SoD2_ideal_community has terminated " , which then it asked me to close the console window lol
Hi everyone, I operate this mod on pc and I see the problem. This trait is not write by English, so whenever I set up the trait by English in notepad, Batch File could not read it.
160 comments
Please, don't waste your time with this tool, just start the game with random characters and edit their traits with the Community Editor.
To quickly explain why it's no longer working: this script is using OCR to evaluate survivors, therefore it must capture the game window. Since the initial release of this script the games window name has been changed, which is why it can no longer find any window(s) to capture.
Here are the steps you'll need to follow to get the script up and running again:
1. Start the game
2. Open a PowerShell window
3. List currently active windows and their process ids:
Get-Process | Where-Object {$_.mainWindowTitle} | Format-Table Id, Name, mainWindowtitle -AutoSize
4. Get the exact window name (it contains whitespace), from the output copy everything in between the single quotes (replace 9400 with your games process id):"'$((Get-Process -id 9400 -ErrorAction SilentlyContinue).MainWindowTitle)'"
5. Download and start Recaf, a Java bytecode editor6. Load the "SoD2_ideal_community.jar"
7. In the toolbar: "Search" -> "Strings", in the search field type "State of Decay 2", click search
8. Within "<init>()V" find 'LDC "State of Decay 2"', right click and "Edit with assembler"
9. Make out the "GameWindowName" reference and change the value (line 35) to the output from step 4 (remember: everything in between the single quotes, not including the single quotes)
10. In the toolbar: "File" -> "Export program" and overwrite the existing file. In case something went wrong you can download the original file again.
Now you can go ahead, configure the script to your liking and successfully start it.
Personally I had a lot of issues with the script not resolving coordinates correctly, it seems to center the game window, but what it actually seems to need is the game window to be in the very top left corner.
It would be great if someone could get in contact with the author, and either request the file be updated, or get permission to upload an updated version.
This program sounds like a really cool idea, would save a lot of headache and time.
If this is not working, be sure to save the changes and include a space at the end of the window name in the LDC value.
Hey, so beign completly honest, I'm lazy af, so of you want to make it work, you will need to do some steps, I recommend to use chat gpt along the way and you will be able to complete it in like 5 mins (+ the time to download the tools if you don't have it)
This is a python script that will take a screen shot of your screen, if it's not the right Community Skill, It will press T, if It's the right skill it presses right arrow until if finds the 3 community skills that you want.
Here's the pastebin with the script: https://pastebin.com/DGkUWRGw
To make it work you will need: python 3, pip, and install some pip libraries (as a said, seems to be much, but really with chat gpt it will be 5 minutes)
Then here's basic the tutorial:
Common tips and mistakes:
If you are a developer and want to make it a full program, feel free to use it, and if you want to contact me my discord is bolo422
It's easy to add more stuff and more flexibility, but as I said, I'm lazy, maybe sometime in the future I will do.
If I see that more people are looking for this, I will consider making a full software and making it available for the community, but If it's just for me, this is enough really, because I already have the development tools at hand, so making an executable, parametrized, scalable program would be waste of time, but if more people want, I can do it for yall.
Tutorial: https://youtu.be/fwD98bRiQ5E?si=jdnyTNDg9jdRV_uC
- Bolo
Alguien sabe ???????
but I still...want this mod too
I only get message like the " SoD2_ideal_community has terminated " , which then it asked me to close the console window lol
I operate this mod on pc and I see the problem. This trait is not write by English, so whenever I set up the trait by English in notepad, Batch File could not read it.
As the image below, you can see it in cmd.exe
Please help me!
https://imgur.com/a/Ip1OPP5