CalamariAce / hoiiiicheats

Cheats for Hearts of Iron III: Their Finest Hour
5 stars 1 forks source link

How to run it? #1

Open ghost opened 7 years ago

CalamariAce commented 7 years ago

The readme shows an example of how you can run the scripts on Linux.

If you are running Windows, you would need to install a Python 2.x release. Ex: https://www.python.org/ftp/python/2.7.13/python-2.7.13.amd64.msi Open a command prompt, run "python" without quotes to make sure this is installed and working. Then Ctrl+Z+Enter to exit the Python interpreter.

Download the .py files from this github repository and save to: %USERPROFILE%\Documents\Paradox Interactive\Hearts of Iron III\save games (Or wherever you keep your save game files. This should be the default location for Windows 7.)

From a windows command prompt, change directories to the save games folder mentioned above. Then run the desired script from the command prompt. Ex: neutrality.py my_saved_game_Austrailia.hoi3 AST 0.000 (i.e., we are making changes in game save file "my_saved_game_Austrailia.hoi3" for country "AST" to set its neutrality to 0.000. If you don't know the country code for your nation, you can open up any save game file to find the list of all the countries and their three letter codes.) See the readme for example of how to use the other scripts. Most scripts take the same first two arguments (game file and country flag). Additional arguments vary depending on the script.

Note, if you are running on Windows, you will get "Error 183: Cannot create a file when that file already exists". The script actually is working aside from the final step of replacing the original save file with the modified one. So just look for "outFile.hoi3" as the new save game file that has the modifications.

ghost commented 7 years ago

thanks

LilNextGen commented 5 years ago

I know this thread is old but I'm new to modding, I got error syntax everything , could you make a video on how to run these scripts?

CalamariAce commented 4 years ago

Can you post the specific error message, and confirm what operating system you're using? Thanks

CalamariAce commented 4 years ago

I made some updates to the readme and the previous Error 183 issue should be fixed, give it another try and let me know how it goes.

skud38000 commented 3 years ago

Hey I know this thread il very old but I have the same error syntax everytime. (I am on Windows 10) Thank you for your help if you are still consulting this topic

C:\Users\lchan\OneDrive\Bureau\save games>"C:\Users\lchan\OneDrive\Bureau\save games\hoiiiicheats-master\industry.py" Allemagne C.hoi3 GER 10" Traceback (most recent call last): File "C:\Users\lchan\OneDrive\Bureau\save games\hoiiiicheats-master\industry.py", line 3, in import utility File "C:\Users\lchan\OneDrive\Bureau\save games\hoiiiicheats-master\utility.py", line 16 print "Usage: " + sys.argv[0] + " save.hoi3 NAT 10" ^ SyntaxError: Missing parentheses in call to 'print'. Did you mean print("Usage: " + sys.argv[0] + " save.hoi3 NAT 10")?

peace-dove commented 2 years ago

My command line is neutrality.py input.hoi3 CHC 0.000 just like neutrality.py my_saved_game_Austrailia.hoi3 AST 0.000 but it goes error.

The Error information just like @skud38000 , can you help, plz.

craiganderson commented 2 years ago

@peace-dove @skud38000 You get this error because you have Python3 installed instead of Python2. One way to resolve this is to uninstall Python3 and install Python2 on your system.

Alternatively you can delete any of these "print" lines that it complains about from the script and it may still work with Python3 (haven't tested it). Python3 uses a different syntax for "print" statements than Python2 but it is just giving some user feedback in this case and not essential to the running of the script.

peace-dove commented 2 years ago

Yes I have tested the solution to change "print" to python3-version, it works.(I only test some *.py) Really thanks. And I recommend this be added to README. @craiganderson @skud38000

TheoklitosFountoulakis commented 3 months ago

I am on python3, i have commented all the print commands, but i am getting an other issue now. i execute the command manpower.py savegame1936_01.hoi3 GRE 3 and it gives me error :

Traceback (most recent call last): File "D:\Steam\steamapps\common\Hearts of Iron 3\save games\manpower.py", line 4, in utility.changeNationSingleLine('manpower=', True, 3) File "D:\Steam\steamapps\common\Hearts of Iron 3\save games\utility.py", line 180, in changeNationSingleLine whole_thing = text_file.read() ^^^^^^^^^^^^^^^^ File "C:\Users\Theo\AppData\Local\Programs\Python\Python311\Lib\encodings\cp1252.py", line 23, in decode return codecs.charmap_decode(input,self.errors,decoding_table)[0] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ UnicodeDecodeError: 'charmap' codec can't decode byte 0x81 in position 10582244: character maps to

Any ideas?