Skip to content
This repository has been archived by the owner on Oct 28, 2022. It is now read-only.

behaviorNames.json missing #1

Closed
Frittenfett opened this issue May 5, 2019 · 11 comments
Closed

behaviorNames.json missing #1

Frittenfett opened this issue May 5, 2019 · 11 comments

Comments

@Frittenfett
Copy link

Hey,

when I'm trying to generate a ROM via CLI or GUI, I get the following exception.

Command:
C:\Users\[...]\python.exe.lnk D:\git\sm64-randomizer\main.py D:\git\sm64-randomizer\Super_Mario_64_(U)_[!].z64 --shuffle-levels --shuffle-mario-color --shuffle-paintings match --shuffle-dialog --shuffle-colors --shuffle-objects --shuffle-music

Output:
Super Mario 64 Randomizer (Version: 0.2.0)

Traceback (most recent call last):
File "D:\git\sm64-randomizer\main.py", line 25, in
import CLI
File "D:\git\sm64-randomizer\CLI.py", line 9, in
from Rom import ROM
File "D:\git\sm64-randomizer\Rom.py", line 9, in
from Parsers.LevelScript import LevelScriptParser
File "D:\git\sm64-randomizer\Parsers\LevelScript.py", line 5, in
from Constants import LVL_MAIN
File "D:\git\sm64-randomizer\Constants.py", line 227, in
with open("./Data/behaviorNames.json", "r") as behavior_file:
FileNotFoundError: [Errno 2] No such file or directory: './Data/behaviorNames.json'

In addition, python module pyperclip is required. Please write it in the README.md for noobs like me :D

Thank you <3

@Frittenfett
Copy link
Author

The file itself exist, but I guess there is a problem with ./ on Windows cmd.

@andre-meyer
Copy link
Collaborator

Thank you so much for trying out the project. This might be a case sensitivity issue, is the folder/filename maybe a different case? if so, rename it. I’ll fix it in the repo as soon as possible. Same with the dependencies! Again, thank you!

Just a hint to get you up and running quicker: Check the releases for prebuilt CLI/GUI Applications.

@andre-meyer
Copy link
Collaborator

@Frittenfett Did you manage to solve it? :)

@Frittenfett
Copy link
Author

Well, it's seems that this problem also exists on Linux. You only have to call main.py not on the same folder.

pyhton3 main.py WORKS
python3 sm64-randomizer/main.py DOES NOT WORK

I hate windows, I hate python and pip on Windows. I just started a Ubuntu VM on Windows and it worked.

But there are still some small errors:
python3-tkinter is missing in requirements.
Small trap for SM64 noobs like me. You have to generate the rom with the .ext.z64 file, but the README said sometimes the normal version works as well -> The GUI picture does have it, but not the command line. You may update the line for noobs :D

I try to make it work with a Dockerfile. Maybe I will make a pull request to add this to this repository. If I am able to make this work xD

@Frittenfett
Copy link
Author

Guess I still make some mistakes. The generaded Rom is always like the original NotLikeThis

@andre-meyer
Copy link
Collaborator

Great points! I'll try to fix those in errors in an upcoming version. Can you elaborate on your last comment? Did it not create the right ROM for you?

@andre-meyer
Copy link
Collaborator

andre-meyer commented May 11, 2019

Okay, the latest commits should all solve the behaviourNames.json problem now, because I switched all path stuff to use os.path.join.

Let's figure out the other issues too:

python3-tkinter is missing in requirements.

Hmm, python tkinter is included by default all python versions I thought. I will change that in the next days.

Small trap for SM64 noobs like me. You have to generate the rom with the .ext.z64 file, but the README said sometimes the normal version works as well -> The GUI picture does have it, but not the command line. You may update the line for noobs :D

Can you elaborate on this? It should work without an extended ROM too, it will simply use less options. The newest version now includes auto-extending the ROM on Mac and Windows. Hopefully that works nicely 😬

In addition, python module pyperclip is required

I added that to the requirements.txt, you should be able to add those with pip install -r requirements.txt

@Frittenfett
Copy link
Author

Frittenfett commented May 12, 2019

Still get the same Error on Windows. But I don't have all pip requirements on Windows. I'm just to stupid for pip and windows.

`C:\Users\Fritte>C:\Users\Fritte\AppData\Local\Programs\Python\Python37-32\python.exe D:\git\sm64-randomizer\main.py D:\git\sm64-randomizer\Super_Mario_64_(U)_[!].z64 --shuffle-levels --shuffle-mario-color --shuffle-paintings match --shuffle-dialog --shuffle-colors --shuffle-objects --shuffle-music
Super Mario 64 Randomizer (Version: 0.3.0)

Traceback (most recent call last):
File "D:\git\sm64-randomizer\main.py", line 25, in
import CLI
File "D:\git\sm64-randomizer\CLI.py", line 9, in
from Rom import ROM
File "D:\git\sm64-randomizer\Rom.py", line 10, in
from Parsers.LevelScript import LevelScriptParser
File "D:\git\sm64-randomizer\Parsers\LevelScript.py", line 6, in
from Constants import LVL_MAIN
File "D:\git\sm64-randomizer\Constants.py", line 228, in
with open(os.path.join("Data", "behaviorNames.json"), "r") as behavior_file:
FileNotFoundError: [Errno 2] No such file or directory: 'Data\behaviorNames.json'`

I will try making a new rom on my VM. If I get the same error on the rom, I may PM you.

@Frittenfett
Copy link
Author

Okey, the Exceptions which you can see in the main.py will not been shown in the gui. So as user, you though everything was ok. But nope xD

It seems that I was stupid. My Ext Rom was not an Ext Rom xD

`python3 main.py 'Super_Mario_64_(U)_[!].ext.z64' --shuffle-mario-color --shuffle-paintings match --shuffle-music --shuffle-objects --shuffle-entries --shuffle-colors --shuffle-dialog
Super Mario 64 Randomizer (Version: 0.3.0)

------------------------------Your Settings------------------------------
Input ROM Super_Mario_64_(U)_[!].ext.z64
Disable automatic extending False
Output ROM None
RNG Seed 398762425114968
Enable Painting Randomizer match
Random Level Entries True
Enable Random Color for Mario True
Enables random music in all levels True
Randomize object positions in levels True
Randomizes colors of various things True
Random Dialog Texts (Cutscenes, Signs, etc). True

The specified ROM file is not extended yet, we'll try to extend it for you
Creating Extended ROM as Super_Mario_64_(U)[!].ext.ext.z64
Unfortunately, the ROM could not be extended. Please see the log below to figure out why. The Randomizer will continue using the vanilla rom. Please note not all functionality is available in this mode.
Sorry, no sm64extend is available for your OS. Please raise an issue on our github, and we'll try to add it!
------------------------------ROM Properties-----------------------------
Loaded ROM Super_Mario_64
(U)[!].ext.z64
Output ROM Super_Mario_64
(U)_[!].ext.out.z64
ROM Endianness BIG
ROM Region NORTH_AMERICA
ROM Type VANILLA

Unfortunately, the randomizer encountered an error, seen below:
This ROM file is not extended, and thus can't modify textures (atleast right now)
--------------Stacktrace:---------------
Traceback (most recent call last):
File "/home/fritte/git/sm64-randomizer/CLI.py", line 95, in run_with_args
warp_random.shuffle_level_entries(opt_args.shuffle_paintings)
File "/home/fritte/git/sm64-randomizer/RandomModules/Warps.py", line 145, in shuffle_level_entries
TextureAtlas.copy_texture_from_to(self.rom, from_code, 'painting_unknown')
File "/home/fritte/git/sm64-randomizer/RandomModules/Textures.py", line 34, in copy_texture_from_to
raise ValueError(f'This ROM file is not extended, and thus can't modify textures (atleast right now)')
ValueError: This ROM file is not extended, and thus can't modify textures (atleast right now)`

Now I was able to generate working Roms.

In the Readme, you still have --shuffle-levels in it. I guess you removed it.

@andre-meyer
Copy link
Collaborator

andre-meyer commented May 13, 2019

In the Readme, you still have --shuffle-levels in it. I guess you removed it.

Yeah, I did remove that! :( The name was confusing between shuffle-objects and shuffle-entries.

Damn, I'm sorry you're having that many problems with it. I'll investigate if the error reporting can be improved for the GUI, I thought it output a message when the statuscode of the CLI returned a non-zero exit code. Guess that didn't work out

@andre-meyer
Copy link
Collaborator

Please check the newest release. It should include all fixes, as well as a new README and the Data/ thing should always be included.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants