remance / Masendor

Open source educational and historical battle action game, All helps accepted
MIT License
142 stars 31 forks source link

eRROR #28

Closed Hamster-lord closed 1 year ago

Hamster-lord commented 1 year ago

!! Traceback (most recent call last): !! File "/Users/Emma/PycharmProjects/Madendor/Masendor-0.6.3.5 2/main.py", line 12, in runmenu = game.Game(main_dir, error_log) !! File "/Users/Emma/PycharmProjects/Madendor/Masendor-0.6.3.5 2/gamescript/game.py", line 218, in init os.makedirs("/profile") !! File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/os.py", line 221, in makedirs mkdir(name, mode) !! OSError: [Errno 30] Read-only file system: '/profile'

remance commented 1 year ago

Seem like the issue is that the game folder (Masendor-0.6.3.5 2) is in read only, so the game cannot create folder inside it. Can you check if that is the case?

remance commented 1 year ago

Or maybe you can try moving the game folder to another location that does not have permission locked.

Hamster-lord commented 1 year ago

ok

Hamster-lord commented 1 year ago

now this is happening !! Traceback (most recent call last): !! File "/Users/Emma/PycharmProjects/Masendor 2.0/Masendor-0.6.3.5/main.py", line 12, in runmenu = game.Game(main_dir, error_log) !! File "/Users/Emma/PycharmProjects/Masendor 2.0/Masendor-0.6.3.5/gamescript/game.py", line 640, in init self.genre_ui_dict = make_genre_specific_ui(self.main_dir, self.screen_scale, self.genre) !! File "/Users/Emma/PycharmProjects/Masendor 2.0/Masendor-0.6.3.5/gamescript/common/game/setup/make_genre_specific_ui.py", line 8, in make_genre_specific_ui genre_battle_ui_image = load_images(main_dir, screen_scale, [genre, "ui", "battle_ui"], load_order=False) !! File "/Users/Emma/PycharmProjects/Masendor 2.0/Masendor-0.6.3.5/gamescript/common/utility.py", line 63, in load_images load_order_file = [f for f in os.listdir(dir_path) if f.endswith("." + "png")] # read all file !! FileNotFoundError: [Errno 2] No such file or directory: '/users/emma/pycharmprojects/masendor 2.0/masendor-0.6.3.5/gamescript/common/ui/battle_ui'

remance commented 1 year ago

This is very weird, this issue does not happen to me even if I download from the release. Would it be possible for you to add print(self.main_dir) to around line 160 of game.py file? Then it should be print out if this is the issue I am thinking of.

remance commented 1 year ago

Or if you are using text editor with no line indication put that after def init(self, main_dir, error_log): pygame.init() # Initialize pygame pygame.mouse.set_visible(False) # set mouse as not visible, use in-game mouse sprite self.main_dir = main_dir (Put print here)

Hamster-lord commented 1 year ago

I got this: /Users/Emma/PycharmProjects/Masendor 2.0/Masendor-0.6.3.5

remance commented 1 year ago

Well this look to be correct. I have no idea why it put gamescript folder on your version. I will keep having a look to see if this happen in other computer as well. Just to make sure, this is the download from the last release version, correct?

Hamster-lord commented 1 year ago

yes It says 0.6.3.5

Hamster-lord commented 1 year ago

In the main.py file it also says "/Users/Emma/PycharmProjects/Masendor 2.0/venv/bin/python" "/Users/Emma/PycharmProjects/Masendor 2.0/Masendor-0.6.3.5/main.py" pygame 2.1.2 (SDL 2.0.18, Python 3.8.0) Hello from the pygame community. https://www.pygame.org/contribute.html /Users/Emma/PycharmProjects/Masendor 2.0/Masendor-0.6.3.5 Traceback (most recent call last): File "/Users/Emma/PycharmProjects/Masendor 2.0/Masendor-0.6.3.5/main.py", line 12, in runmenu = game.Game(main_dir, error_log) File "/Users/Emma/PycharmProjects/Masendor 2.0/Masendor-0.6.3.5/gamescript/game.py", line 641, in init self.genre_ui_dict = make_genre_specific_ui(self.main_dir, self.screen_scale, self.genre) File "/Users/Emma/PycharmProjects/Masendor 2.0/Masendor-0.6.3.5/gamescript/common/game/setup/make_genre_specific_ui.py", line 8, in make_genre_specific_ui genre_battle_ui_image = load_images(main_dir, screen_scale, [genre, "ui", "battle_ui"], load_order=False) File "/Users/Emma/PycharmProjects/Masendor 2.0/Masendor-0.6.3.5/gamescript/common/utility.py", line 63, in load_images load_order_file = [f for f in os.listdir(dir_path) if f.endswith("." + "png")] # read all file FileNotFoundError: [Errno 2] No such file or directory: '/users/emma/pycharmprojects/masendor 2.0/masendor-0.6.3.5/gamescript/common/ui/battle_ui'

remance commented 1 year ago

Can't seem to replicate the issue even on other computer. Can you instead try print(main_dir) in make_genre_specific_ui.py? it should be in common/game/setup/.

Hamster-lord commented 1 year ago

I got /Users/Emma/PycharmProjects/Masendor 2.0/Masendor-0.6.3.5

Hamster-lord commented 1 year ago

Also there is no battle_ui in /users/emma/pycharmprojects/masendor 2.0/masendor-0.6.3.5/gamescript/common/ui/battle_ui

remance commented 1 year ago

Yeah the issue is that it use gamescript folder path for no reason when no part of the code should make it do that. Even weirder that the prior loading works fine before this error occur.

remance commented 1 year ago

I add a new release version. Not sure if this error will be fixed properly though.

Hamster-lord commented 1 year ago

!! Traceback (most recent call last): !! File "/Users/Emma/PycharmProjects/Masendor 2.0/Masendor-0.6.3.16/main.py", line 12, in runmenu = game.Game(main_dir, error_log) !! File "/Users/Emma/PycharmProjects/Masendor 2.0/Masendor-0.6.3.16/gamescript/game.py", line 686, in init self.change_game_genre(self.genre) !! File "/Users/Emma/PycharmProjects/Masendor 2.0/Masendor-0.6.3.16/gamescript/game.py", line 860, in change_game_genre genre_setting = importlib.import_module("gamescript" + new_genre + "genre_setting") !! File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/importlib/init.py", line 127, in import_module return _bootstrap._gcd_import(name[level:], package, level) !! File "", line 1014, in _gcd_import !! File "", line 991, in _find_and_load !! File "", line 961, in _find_and_load_unlocked !! File "", line 219, in _call_with_frames_removed !! File "", line 1014, in _gcd_import !! File "", line 991, in _find_and_load !! File "", line 961, in _find_and_load_unlocked !! File "", line 219, in _call_with_frames_removed !! File "", line 1014, in _gcd_import !! File "", line 991, in _find_and_load !! File "", line 961, in _find_and_load_unlocked !! File "", line 219, in _call_with_frames_removed !! File "", line 1014, in _gcd_import !! File "", line 991, in _find_and_load !! File "", line 961, in _find_and_load_unlocked !! File "", line 219, in _call_with_frames_removed !! File "", line 1014, in _gcd_import !! File "", line 991, in _find_and_load !! File "", line 973, in _find_and_load_unlocked !! ModuleNotFoundError: No module named 'gamescript/users/emma/pycharmprojects/masendor 2'

remance commented 1 year ago

For reference, what OS are you using? I may try to use virtual box to replicate your system as much as possible to see what is wrong.

remance commented 1 year ago

by the way did you edit some parts of the code? The error that say genre_setting = importlib.import_module("gamescript" + new_genre + "genre_setting") is genre_setting = importlib.import_module("gamescript." + new_genre + ".genre_setting"). It miss two dots in there for some reason. Maybe you can check if the dot still in the game.py file?

Hamster-lord commented 1 year ago

Oh I did delete the two dots

Hamster-lord commented 1 year ago

now this is happening

Hamster-lord commented 1 year ago

!! Traceback (most recent call last): !! File "/Users/Emma/PycharmProjects/Masendor 2.0/Masendor-0.6.3.16/main.py", line 12, in runmenu = game.Game(main_dir, error_log) !! File "/Users/Emma/PycharmProjects/Masendor 2.0/Masendor-0.6.3.16/gamescript/game.py", line 686, in init self.change_game_genre(self.genre) !! File "/Users/Emma/PycharmProjects/Masendor 2.0/Masendor-0.6.3.16/gamescript/game.py", line 860, in change_game_genre genre_setting = importlib.import_module("gamescript." + new_genre + ".genre_setting") !! File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/importlib/init.py", line 127, in import_module return _bootstrap._gcd_import(name[level:], package, level) !! File "", line 1014, in _gcd_import !! File "", line 991, in _find_and_load !! File "", line 961, in _find_and_load_unlocked !! File "", line 219, in _call_with_frames_removed !! File "", line 1014, in _gcd_import !! File "", line 991, in _find_and_load !! File "", line 961, in _find_and_load_unlocked !! File "", line 219, in _call_with_frames_removed !! File "", line 1014, in _gcd_import !! File "", line 991, in _find_and_load !! File "", line 961, in _find_and_load_unlocked !! File "", line 219, in _call_with_frames_removed !! File "", line 1014, in _gcd_import !! File "", line 991, in _find_and_load !! File "", line 961, in _find_and_load_unlocked !! File "", line 219, in _call_with_frames_removed !! File "", line 1014, in _gcd_import !! File "", line 991, in _find_and_load !! File "", line 961, in _find_and_load_unlocked !! File "", line 219, in _call_with_frames_removed !! File "", line 1014, in _gcd_import !! File "", line 991, in _find_and_load !! File "", line 973, in _find_and_load_unlocked !! ModuleNotFoundError: No module named 'gamescript./users/emma/pycharmprojects/masendor 2'

Hamster-lord commented 1 year ago

macOS monterey version 12.1

remance commented 1 year ago

ok if I have to guess the issue is that importlib.import_module work differently in macOS. So what I will try next is trying to test the game on both virtual macOS and Ubuntu. Even if I delete the dots the error is still different for yours (ModuleNotFoundError: No module named 'gamescriptarcadegenre_setting'). OR maybe I just have to compile the game in the appropriate OS to make it compatible.

Hamster-lord commented 1 year ago

ok

Hamster-lord commented 1 year ago

Please tell me when you are finished

remance commented 1 year ago

Sure, so far I have finished with Linux testing and going to do macOS next.

Hamster-lord commented 1 year ago

ok

Hamster-lord commented 1 year ago

any luck>

remance commented 1 year ago

Working on it. Having a bit of trouble installing some python module in macOS for some reason.

remance commented 1 year ago

ok I manage to make it work. MacOS 12 version is in the release with the name Mac_Dream.Decision.0.6.3.16.zip. Let me know if it does not work on your system.

Hamster-lord commented 1 year ago

how do you use the package

Hamster-lord commented 1 year ago

also still no work

Hamster-lord commented 1 year ago

!! Traceback (most recent call last): !! File "/Users/Emma/PycharmProjects/Masendor 2.0/Masendor-0.6.3.16m7/main.py", line 12, in runmenu = game.Game(main_dir, error_log) !! File "/Users/Emma/PycharmProjects/Masendor 2.0/Masendor-0.6.3.16m7/gamescript/game.py", line 704, in init self.create_unit_slot(0, 0, range(0, 64), start_pos) # make player custom unit slot !! File "/Users/Emma/PycharmProjects/Masendor 2.0/Masendor-0.6.3.16m7/gamescript/common/game/create_unit_slot.py", line 7, in create_unit_slot dummy_subunit = subunit.EditorSubunit(troop_id, game_id, self.unit_build_slot, !! File "/Users/Emma/PycharmProjects/Masendor 2.0/Masendor-0.6.3.16m7/gamescript/subunit.py", line 702, in init self.image = self.block !! AttributeError: 'EditorSubunit' object has no attribute 'block'

remance commented 1 year ago

It is quite bizarre that you keep getting new error. I just use pyinstaller to compile the game on MacOS in virtual machine and test it in there. This error used to happen to me but I fixed it before, I will have a look.

remance commented 1 year ago

As usual I can't seem to replicate this problem on my MacOS even with clean download from release. How did you run them game in your system, main.py on pycharm or main.exec directly?

Hamster-lord commented 1 year ago

I ran main.py

Hamster-lord commented 1 year ago

what am I supposed to download anyways?

remance commented 1 year ago

If you download Mac_Dream.Decision.0.6.3.16.zip, then it is correct. Can you try run main.exec?

remance commented 1 year ago

actually how come there is main.py in the release download? I don't think it is in there.

remance commented 1 year ago

Ah I guess you didn't download the game from release but rather from the front page but still it is weird that it still give you error when it not on mine. What I refer to is from here: https://github.com/remance/Masendor/releases/tag/0.6.3.16m7

remance commented 1 year ago

Oh I think there may be another possible cause for the error. It seem you are using python 3.8 to run the game. Can you try update it to 3.10 and install modules with the exact version as in requirements?

Hamster-lord commented 1 year ago

ok

Hamster-lord commented 1 year ago

How to get the exact version of the requirements

Hamster-lord commented 1 year ago

also I'm getting this: !! Traceback (most recent call last): !! File "/Users/Emma/PycharmProjects/Masendor 2.0/Masendor-main/main.py", line 12, in runmenu = game.Game(main_dir, error_log) !! File "/Users/Emma/PycharmProjects/Masendor 2.0/Masendor-main/gamescript/game.py", line 702, in init self.create_unit_slot(0, 0, range(0, 64), start_pos) # make player custom unit slot !! File "/Users/Emma/PycharmProjects/Masendor 2.0/Masendor-main/gamescript/common/game/create_unit_slot.py", line 7, in create_unit_slot dummy_subunit = subunit.EditorSubunit(troop_id, game_id, self.unit_build_slot, !! File "/Users/Emma/PycharmProjects/Masendor 2.0/Masendor-main/gamescript/subunit.py", line 698, in init self.image = self.block !! AttributeError: 'EditorSubunit' object has no attribute 'block'

remance commented 1 year ago

Look like the same as previous error to me. To install requirement use command “pip install -r requirements.txt” either in pycharm terminal or mac terminal depend ming on how you run the game. You may also need to setup configuration in pycharm to use python 3.10 instead of 3.8 too if you did not do that yet.

remance commented 1 year ago

The terminal for requirements installation need to be in the game directory too by the way.

Hamster-lord commented 1 year ago

I already got the all the requirements

Hamster-lord commented 1 year ago

but it still no work

remance commented 1 year ago

Can you check if your pycharm project still use python 3.8 to run the game or not? If nothing really work, can you try launch the game from main.exec in mac release instead? It would help me know if the problem come from module issue or os related.

Hamster-lord commented 1 year ago

Also when you go to Customize does the thing below keymap say macOS copy?