Resolved Help with help command in console

woodspeople

Member
Contributor
Design
On our Mac laptop typing the help command in the console has no result. TS says it can't find the help.json file (nor the error.json file). Here is the error message:

Code:
org.terasology.rendering.gui.menus.UIDebugConsole processConsoleString
INFO: .\data\console\help.json (No such file or directory)
java.io.FileNotFoundException: .\data\console\error.json (No such file or directory)
Might be a mac thing? Tried copying the data folder to a few places that might be considered the "." location on a Mac (Users/<my-user-name>/System, just plain old System) but this did not help. Perhaps "." finds the "current working directory" on Windows but does not on the Mac? Maybe there is another way to get at the program directory in Java?

Typing giveBlock and giveItem does work. Typing help blockList does not work (same error).
 

Cervator

Org Co-Founder & Project Lead
Contributor
Design
Logistics
SpecOps
Hmm, is this with build #170 that just came out about 50 minutes ago? I tried it locally via source and just now again via the zip and both work, but then I'm on Windows. We might indeed need to review some path stuff for Macs there
 

Immortius

Lead Software Architect
Contributor
Architecture
GUI
Well, those slashes are wrong for a non-windows system. And ideally the console help system should either be using the path manager to determine the root path, or the asset manager which takes care of the pathing issues and allows files to be in either the jar, classpath or a mod/package. :)
 

woodspeople

Member
Contributor
Design
In Python at least it is a no-no to ever use the literal slash in a file name, you are supposed to use os.sep which supplies the correct path-level separator. Is there something similar in Java?
 

overdhose

Active Member
Contributor
Design
World
GUI
ach right kinda lost track of that little "TODO"

use path manager or root path... will check that this evening when i get back
 

Immortius

Lead Software Architect
Contributor
Architecture
GUI
In Java there's File.seperator. But file is supposed to handle the conversion for you as well, I believe.
 

overdhose

Active Member
Contributor
Design
World
GUI
small update available in my console branch : strings look like this now, hope this is universal now.
String helpFile = PathManager.getInstance().getDataPath() + File.separator + "data" + File.pathSeparator + "console" + File.pathSeparator + "consolelog.json";
 

Cervator

Org Co-Founder & Project Lead
Contributor
Design
Logistics
SpecOps
Integrated! Need somebody with a Mac to test please :)

Works normally for me, although I'm not sure if I got this error on bad commands - I expect an error to be thrown, but this one explicitly fails to find a json file (and has a pathing quirk in it):

Code:
java.io.FileNotFoundException: E:\Dev\GitProjects\develop\Terasology\.\data;console;error.json (The system cannot find the file specified)
        at java.io.FileInputStream.open(Native Method)
        at java.io.FileInputStream.<init>(FileInputStream.java:106)
        at java.io.FileInputStream.<init>(FileInputStream.java:66)
        at java.io.FileReader.<init>(FileReader.java:41)
        at org.terasology.rendering.gui.components.UITextWrap.loadError(UITextWrap.java:141)
        at org.terasology.rendering.gui.menus.UIDebugConsole.processConsoleString(UIDebugConsole.java:167)
 

overdhose

Active Member
Contributor
Design
World
GUI
woops, wrong version pushed

please integrate the correct version, I used File.pathseperator in my first try, but had to be File.seperator
 

Cervator

Org Co-Founder & Project Lead
Contributor
Design
Logistics
SpecOps
Done! Getting a more appropriate malformed groovy/JSON error now, as expected :)
 

overdhose

Active Member
Contributor
Design
World
GUI
huh? more errors? how come?
 

Cervator

Org Co-Founder & Project Lead
Contributor
Design
Logistics
SpecOps
expected errors - when you enter a junk command like "sdfghsegd" :)
 

woodspeople

Member
Contributor
Design
Just tested on my PowerMac desktop - works!! Have not tested on the laptop but not necessary.

(Though the PowerMac still has the <1FPS problem. It's a powerful dual-core system with 10GB memory, so it should be fast; but it's super slow... no idea why... however it does not crash on "fancy" graphics as the MacBook Pro does (and still does))

BTW for testing purposes we have four working Macs at the moment: two PowerMac desktops (both work machines so not very available, but we could try a few things on them); a MacBook Pro laptop and an old slow MacBook. Some have Leopard, some have Snow Leopard. The old MacBook is not an Intel Mac so that could be useful. The desktops and the MacBook are about 4-5 years old, the MacBook Pro is 2 yrs old.
 

overdhose

Active Member
Contributor
Design
World
GUI
Hey that's nice... whatever doesn't work, complain a lot... it's easy to lose track of the importance of issues like these soemtimes.
 

Cervator

Org Co-Founder & Project Lead
Contributor
Design
Logistics
SpecOps
Great to hear - and yeah, those Macs could be very useful for testing, maybe we could throw the last develop build before a master build at those machines real quick to get any error reports raised :)

As for the FPS issues on a machine that should be able to handle it - we do seem to have those. Could you dig up the video card stats on that thing? We eventually need to dig into those issues more closely.
 
Top