Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Victoria 2] [0.9.7 beta 2] Unable to load definition.csv from mods on Linux #29

Closed
mikoxyz opened this issue Jul 28, 2021 · 4 comments
Closed

Comments

@mikoxyz
Copy link

mikoxyz commented Jul 28, 2021

On Linux, you are unable to load a mod's definition.csv. This seems to be because the path gets mangled up somewhere in the process, which results in a .. being added between the path to the game folder and the path to the mod itself.

Jul 28, 2021 9:27:55 PM editor.Main main
INFO: Java version: 16.0.2
Jul 28, 2021 9:27:55 PM editor.Main main
INFO: Editor version: 0.9.6
Jul 28, 2021 9:27:55 PM editor.Main listMods
INFO: Checking for mods in /home/miko/Victoria 2/mod
Jul 28, 2021 9:27:55 PM editor.Main listMods
INFO: Mod: Historical Project Mod 0.4.6; file path: /home/miko/Victoria 2/mod/HPM.mod; mod path: /home/miko/Victoria 2/mod/HPM
Jul 28, 2021 9:27:55 PM editor.Main listMods
INFO: Mod: Shatter 0.1.0; file path: /home/miko/Victoria 2/mod/shatter.mod; mod path: /home/miko/Victoria 2/mod/shatter
Jul 28, 2021 9:27:55 PM editor.Main listMods
INFO: Mod: Wild West submod for HPM/HFM (0.1.0); file path: /home/miko/Victoria 2/mod/wild_west.mod; mod path: /home/miko/Victoria 2/mod/wild-west
Jul 28, 2021 9:27:55 PM editor.Main listMods
INFO: Mod: Greater Flavor Mod; file path: /home/miko/Victoria 2/mod/GFM.mod; mod path: /home/miko/Victoria 2/mod/GFM
Jul 28, 2021 9:27:55 PM editor.Main listMods
INFO: Checking for mods in /home/miko/Paradox Interactive/Victoria 2/mod
Jul 28, 2021 9:27:58 PM editor.Main$4 actionPerformed
INFO: **************************************************
Jul 28, 2021 9:27:58 PM editor.Main$4 actionPerformed
INFO: Loading A House Divided. Mod: Greater Flavor Mod
Jul 28, 2021 9:27:58 PM editor.Main$4 actionPerformed
INFO: Game path: /home/miko/Victoria 2
Jul 28, 2021 9:27:58 PM editor.Main$4 actionPerformed
INFO: Mod path: /home/miko/Victoria 2/mod/GFM
Loading /home/miko/Victoria 2/mod/GFM.mod.
Loading took 270173 ns.

Loading /home/miko/Victoria 2/mod/GFM.mod.
Loading took 203798 ns.

Jul 28, 2021 9:27:58 PM editor.ProvinceData <init>
SEVERE: /home/miko/Victoria 2/../mod/GFM/map/definition.csv (No such file or directory)
java.io.FileNotFoundException: /home/miko/Victoria 2/../mod/GFM/map/definition.csv (No such file or directory)
	at java.base/java.io.FileInputStream.open0(Native Method)
	at java.base/java.io.FileInputStream.open(FileInputStream.java:211)
	at java.base/java.io.FileInputStream.<init>(FileInputStream.java:153)
	at java.base/java.io.FileInputStream.<init>(FileInputStream.java:108)
	at java.base/java.io.FileReader.<init>(FileReader.java:60)
	at editor.ProvinceData.parseDefs(ProvinceData.java:65)
	at editor.ProvinceData.<init>(ProvinceData.java:44)
	at editor.EditorUI.<init>(EditorUI.java:81)
	at editor.Main.startEditor(Main.java:342)
	at editor.Main.access$300(Main.java:42)
	at editor.Main$4.actionPerformed(Main.java:290)
	at java.desktop/javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1972)
	at java.desktop/javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2313)
	at java.desktop/javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:405)
	at java.desktop/javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:262)
	at java.desktop/javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:279)
	at java.desktop/java.awt.Component.processMouseEvent(Component.java:6617)
	at java.desktop/javax.swing.JComponent.processMouseEvent(JComponent.java:3342)
	at java.desktop/java.awt.Component.processEvent(Component.java:6382)
	at java.desktop/java.awt.Container.processEvent(Container.java:2264)
	at java.desktop/java.awt.Component.dispatchEventImpl(Component.java:4993)
	at java.desktop/java.awt.Container.dispatchEventImpl(Container.java:2322)
	at java.desktop/java.awt.Component.dispatchEvent(Component.java:4825)
	at java.desktop/java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4934)
	at java.desktop/java.awt.LightweightDispatcher.processMouseEvent(Container.java:4563)
	at java.desktop/java.awt.LightweightDispatcher.dispatchEvent(Container.java:4504)
	at java.desktop/java.awt.Container.dispatchEventImpl(Container.java:2308)
	at java.desktop/java.awt.Window.dispatchEventImpl(Window.java:2773)
	at java.desktop/java.awt.Component.dispatchEvent(Component.java:4825)
	at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:772)
	at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:721)
	at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:715)
	at java.base/java.security.AccessController.doPrivileged(AccessController.java:391)
	at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:85)
	at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:95)
	at java.desktop/java.awt.EventQueue$5.run(EventQueue.java:745)
	at java.desktop/java.awt.EventQueue$5.run(EventQueue.java:743)
	at java.base/java.security.AccessController.doPrivileged(AccessController.java:391)
	at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:85)
	at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:742)
	at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:203)
	at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:124)
	at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:117)
	at java.desktop/java.awt.WaitDispatchSupport$2.run(WaitDispatchSupport.java:190)
	at java.desktop/java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:316)
	at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:770)
	at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:721)
	at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:715)
	at java.base/java.security.AccessController.doPrivileged(AccessController.java:391)
	at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:85)
	at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:740)
	at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:203)
	at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:124)
	at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:113)
	at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:109)
	at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
	at java.desktop/java.awt.EventDispatchThread.run(EventDispatchThread.java:90)```
@mikoxyz mikoxyz changed the title [Victoria 2] Unable to load definition.csv from mods on Linux [Victoria 2] [0.9.7 beta 2] Unable to load definition.csv from mods on Linux Jul 28, 2021
@mmyers
Copy link
Owner

mmyers commented Jul 28, 2021

I am looking at https://github.com/Historical-Expansion-Mod/Greater-Flavor-Mod/blob/master/GFM/map/default.map. If that is the map file used for GFM, then the .. is present in the file and was not added by the editor.

The real problem seems to be that the editor is treating the filename as relative to the game folder, while the game apparently treats it as relative to the map folder. At least on my Windows machine, having two dots in the path is perfectly valid as long as it results in a file that exists. But in your case the two dots drops us clear out of the Victoria 2 folder.

I'm not sure why the path has to be constructed that way. Doesn't it simply direct to the definition.csv in the mod's map folder? Why can't it just be "definition.csv"?

@mikoxyz
Copy link
Author

mikoxyz commented Jul 29, 2021

I am looking at https://github.com/Historical-Expansion-Mod/Greater-Flavor-Mod/blob/master/GFM/map/default.map. If that is the map file used for GFM, then the .. is present in the file and was not added by the editor.

The real problem seems to be that the editor is treating the filename as relative to the game folder, while the game apparently treats it as relative to the map folder. At least on my Windows machine, having two dots in the path is perfectly valid as long as it results in a file that exists. But in your case the two dots drops us clear out of the Victoria 2 folder.

I'm not sure why the path has to be constructed that way. Doesn't it simply direct to the definition.csv in the mod's map folder? Why can't it just be "definition.csv"?

Good question; it seems to break the mod in-game (seems to load the definitions from vanilla, instead), but I'm not really sure why. Removing the ../ from the definitions does seem to resolve my issue in the editor, but then it's unable to load the definitions in-game during loadtime.

@mmyers
Copy link
Owner

mmyers commented Aug 1, 2021

Further research indicates that this is limited to just the definitions file, just in Victoria 2. Probably a game bug. I can special-case the parsing to account for files with .. in their paths.

@mmyers mmyers closed this as completed in 2b8a5c9 Aug 6, 2021
@mikoxyz
Copy link
Author

mikoxyz commented Aug 7, 2021 via email

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

No branches or pull requests

2 participants