Hello, I am a long time Java developer, and I have no problem with the GIT repos or running the VASSAL Java code in Eclipse.
My goal is to build a computer opponent, so I would like to be able to read the vmod file, or one of the vsav scenario files, build a valid GameModule and GameState, and then add my code to analyze the board and make an action. However I am having trouble loading a vsav module (from Commands and Colors Ancients).
I’ve seen this pattern in one of the unit test files:
final GameModule module = new GameModule( new DataArchive(Path.of(modFile).toString()));
module.build();
However, when I attempt to load a vmod file with this pattern, there is an error in GameModule before the module is read or built.
Exception in thread "main" java.lang.IllegalStateException
at VASSAL.tools.menu.MenuManager.getInstance(MenuManager.java:38)
at VASSAL.launch.PlayerWindow.setupMenubarAndActions(PlayerWindow.java:78)
at VASSAL.launch.PlayerWindow.<init>(PlayerWindow.java:70)
at VASSAL.build.GameModule.<init>(GameModule.java:298)
at VASSAL.build.module.GameState.main(GameState.java:1317)
Can anyone point me to how to read vmod or vsav files, with the goal of building a GameState object so that I can query the pieces and the cards? Ideally no connected GUI, It is ok if a GUI is instantiated and remains hidden.
Thanks, Dan Becker