[Nerps!] MapTool Fork based on 1.4.1.x

Notes on testing the latest builds of MapTool

Moderators: dorpond, trevor, Azhrei

Tielc
Cave Troll
Posts: 25
Joined: Wed Jul 16, 2014 10:41 pm

Re: [Nerps!] MapTool Fork based on b89

Post by Tielc »

Unfortunately, I get the launcher issues when using this version. Where I get the message, Error: Unable to access jarfile maptool-*.jar. Now I've manually gotten the the settings changed in the .cfg file, so I think I'm good. My next question, is I don't appear to be able to load the html files created by hl2mt (mentioned in this post http://forums.rptools.net/viewtopic.php ... 3&start=45) The frames launch, but the content is just empty. I am accessing these HTML files locally off from my D drive. Does this present an issue? I run my games off from my machine with my group, and the second instance off from a television. So I'm trying to avoid the whole hosting his files elsewhere. Another issue I get is I get stack size errors a lot when trying to run his macros. I know this isn't your doing, but I was hoping you might be able to provide some insight? Thanks for getting back by the way, I really appreciate it!

User avatar
JamzTheMan
Great Wyrm
Posts: 1872
Joined: Mon May 10, 2010 12:59 pm
Location: Chicagoland
Contact:

Re: [Nerps!] MapTool Fork based on b89

Post by JamzTheMan »

You can try this batch file, it's what I use to launch MT every Sunday ok. I prefer bat files over the launcher anyway. If you have a mt.cfg in the same directory, it will use those values otherwise it will default to what is in the bat file (which is aggressive but fine on my machine).

I'm not sure if having the html files locally works or not? I haven't tested that, it was meant for web traffic (did the hl2mt maker test/suggest that use?)

As far as stack size errors, I'm not sure how you are launching it but I suspect you are not setting the stacksize properly... Try my bat file and see what happens. Note, you may need to change the JVM parameter depending where your Java is installed.
launch_maptool.bat

Code: Select all

cls
REM This batch file will find the latest MapTool JAR and launch it using win.cfg values if existing

REM Sets MapTool path to path of this batch file, needed for UNC paths as windows will run batch under C: otherwise
set mtpath=%~dp0
set mtconfig=%mtpath%mt.cfg

PUSHD %mtpath%

REM call :launch >debug.log 2>&1
call :launch
exit /b

:launch
echo Launching MapTool from %mtpath%

REM Set Default values, assumes java is in PATH
set MAXMEM=4096
set MINMEM=512
set STACKSIZE=6
set JVM=C:\Program Files\Java\jre7\bin\javaw

REM Read values from mt.cfg, setting them as variables (or create custom a file).
for /f "delims=" %%x in ("%mtconfig%") do (set "%%x")

IF [%1]==[] GOTO EndSetParameters
set MAXMEM=%1

:EndSetParameters

REM Set prompt back to default vs prompt=false from win.cfg
prompt

REM Retrieve the last MapTool JAR file sorted alphabetically
for /f "tokens=*" %%F in ('dir /o:-n /b "%mtpath%maptool-*.jar"') do (
	set "maptool_JAR=%%F"
	goto :done
)

REM Finally, launch MapTool
:done
start "MapTool" "%JVM%" -Xmx%MAXMEM%M -Xms%MINMEM%M -Xss%STACKSIZE%M -jar "%mtpath%%maptool_JAR%" run
POPD

exit /b
-Jamz
____________________
Custom MapTool 1.4.x.x Fork: maptool.nerps.net
Custom TokenTool 2.0 Fork: tokentool.nerps.net
More information here: MapTool Nerps! Fork

Tielc
Cave Troll
Posts: 25
Joined: Wed Jul 16, 2014 10:41 pm

Re: [Nerps!] MapTool Fork based on b89

Post by Tielc »

Thanks again for getting back. I created the .bat file but I get an error when it tried to launch Java using the path C:\Program Files\etc.etc. I just changed my cfg file to use 2048 max, 512min and 8 for the stack size.

As for the HTML files being local, it was my own decision. He recommended hosting them on a webserver, which I don't have, nor the time to learn to use. He also showed a method using Dropbox, but unfortunatelty, Dropbox doesn't support common folders when linking to subfiles anymore. Every file get's it's own unique URL now.

I do have IIS on my machine, but it's been so long since I've done anything with it. I play, what I guess is referred to Headless, where I just run two sessions off from my single machine. One for the GM, and one for the players on a television.


So I just tested putting one of the reference HTML files in Dropbox, and manually capturing the public link as well as modifying the macro made by his application. It works. So apparently I can't load HTML from local content. Is this something already available from MapTool by chance?

User avatar
JamzTheMan
Great Wyrm
Posts: 1872
Joined: Mon May 10, 2010 12:59 pm
Location: Chicagoland
Contact:

Re: [Nerps!] MapTool Fork based on b89

Post by JamzTheMan »

that's actually good news. I didnt want a security hole anyway ;) (imagine bad macro's reading your local files and sending them off to where ever)

Your best bet is to use a simple web server to serve up content from a folder. You can do it with python or several freebies, eg https://code.google.com/p/mongoose/

You can then just use http://localhost

you can get fancy, set up names in you etc host file or use machine names, etc but looks like you run from one machine so should be fine.
-Jamz
____________________
Custom MapTool 1.4.x.x Fork: maptool.nerps.net
Custom TokenTool 2.0 Fork: tokentool.nerps.net
More information here: MapTool Nerps! Fork

Tielc
Cave Troll
Posts: 25
Joined: Wed Jul 16, 2014 10:41 pm

Re: [Nerps!] MapTool Fork based on b89

Post by Tielc »

I got it working with IIS. I had one stupid setting I was missing keeping me from accessing the files. So it all appears to be working now. Aside from the Error: Stack Overflow's I'm getting from HL2MT (<html>A stack overflow has occurred.<p>This is commonly because a macro being used has exceeded the stack space specified when MapTool was executed.<br>Please run MapTool again and specify a larger stack size.) I have the stack size in the .cfg file set to 16 now and still getting this. I'm looking at re-writing the hl2mt myself using .NET to see if I can make some adjustments where necessary to avoid this. It looks like he puts every feat in one macro, which overloads it on a Mythic Character.

EDIT: I got it working, and fixed the Stack Overflow errors. My machine was pointing to the wrong version of Java. I have both 32 and 64bit. I noticed this when using your bat file. I've fixed it, and modified the bat file accordingly. No issues anymore. Thanks a million for all the help! I've added some comments to the creator of hl2mt over on his thread, which you've participated in as well. I'm still debating just using Hero Lab in parallel with MapTool as opposed to having all of the content in MapTool. But this means running two separate applications during game time, which I'm not particularly fond of.

Tielc
Cave Troll
Posts: 25
Joined: Wed Jul 16, 2014 10:41 pm

Re: [Nerps!] MapTool Fork based on b89

Post by Tielc »

Hey there. I found an issue that appears to be exclusive to the NERPS version of Maptool. I was wondering if you might be able to provide any insight as to what might be causing this.

When I run the following macro code (generated automatically from HeroLab2MapTool)

Code: Select all

<table border='1' cellpadding='0' cellspacing='0' style='width:200px'>
<tr bgcolor='red'>
<td><span style='color:white'><b>+1 dwarven waraxe(×3)</b></span></td>
<td><span style='color:white'><b>Damage</b></span></td>
</tr>
<tr>
<td>[e:d20 + 11]</td>
<td>[e:1d10+6]</td>
</tr>
</table>
I get a double display of the first value (To Hit roll) as shown here
NERPS Macro.jpg
NERPS Macro.jpg (17.77 KiB) Viewed 3268 times
However, when I run this same macro in the latest b91 build, I get the proper results as shown here
b91 Macro.jpg
b91 Macro.jpg (13.43 KiB) Viewed 3268 times
Any thoughts as to why this is happening in the NERPS version and not the b91 or b90 builds?

User avatar
JamzTheMan
Great Wyrm
Posts: 1872
Joined: Mon May 10, 2010 12:59 pm
Location: Chicagoland
Contact:

Re: [Nerps!] MapTool Fork based on b89

Post by JamzTheMan »

hmm ya, that was a bug that was discovered in b89 after my build was done.
-Jamz
____________________
Custom MapTool 1.4.x.x Fork: maptool.nerps.net
Custom TokenTool 2.0 Fork: tokentool.nerps.net
More information here: MapTool Nerps! Fork


Tielc
Cave Troll
Posts: 25
Joined: Wed Jul 16, 2014 10:41 pm

Re: [Nerps!] MapTool Fork based on b89

Post by Tielc »

wolph42 wrote:Turn Off smileys in the settings.
Worked like a charm, thanks!

User avatar
JamzTheMan
Great Wyrm
Posts: 1872
Joined: Mon May 10, 2010 12:59 pm
Location: Chicagoland
Contact:

Re: [Nerps!] MapTool Fork based on 1.4.0.0

Post by JamzTheMan »

Wow, has it been 2 years? Well, work and personal life can do that I suppose...

TL;DR; new version of my custom fork at http://maptool.nerps.net/


Ok Peeps, i've been busy the last month or so cranking out some stuff that has been nagging me in the back of the head... So here you go, a new version of my custom fork for use or testing...

It's "stable" in the fact that I use it weekly for my own games, but there could be a "bug" and I will update the link/version as I see fit to fix said bugs. But I'd appreciate any feedback as I plan to submit all said enhancements for merge for an upcoming official MT release soon(tm) (hopefully by this summer).

This version is built off 1.4.0.0. I don't have Jagged's Isometric enhancements in it yet but otherwise it's mostly up to date. It does include my "lumens" patch so campaigns are not directly backwards compatible but there will be a "save as 1.4.x" option to make it so.

There's just to many things to list but off the top of my head you will see:

o OK, the big one, MapTool/Launcher now combined into single JAR's. No more zip/lib directories. It's also bundled with a Java 1.8 JRE! So this means when you go to http://maptool.nerps.net/ you have options to download installers for 32/64 bit for Windows/Linux/Mac. It will be an .exe for Windows, TAR/shell launcher for Linux, and DMG for mac. You will get an Icon in your Start menu (or equivalent for Linux/Mac) with uninstall options as well. You will see the MT launcher as usual which launches MT in a self contained JRE. This should help keep people on the version of Java we code for without forcing users to jump through "installation" hoops/issues. (For those curious, I'm using a free tool called jWrapper, which happens to be the same one MOTE uses)

o New FoW vision enhancments including "Custom views" which lets you see FoW for PC's, NPC's, Both, Or "GM" view (or "My" view) which for GM's is only FoW for Tokens with NO ownership or owned by the GM's username. For players it only shows FoW for tokens "you" own by your username. These are driven by buttons and are dynamic.

o Restore FoW menu option, macro, and shortcut (meta+shift+r). This basically resets FoW just as if you imported a Map and choose to restore existing FoW. Handy for that quick "oops you guys shouldn't see that! Click to black...)

o New exposeAllOwnedArea() macro to supplment exposeAllPCArea(). I'm moving FoW to be more "Ownership" based vs GM/PC/NPC based. This means GM's can own a "PC" but not expose FoW for players. And Players can own an "NPC" token and see it's FoW (like a summon monster of cohort or temporary NPC helping the party).

o FoW server option "expose FoW on token movement" now follows "Ownership" vs PC/NPC so yes, a NPC token "Owned" by a PC can be moved freely about the cabin.

o Auto-VBL creation for a token/stamp menu option (called "Block Vision"). This will create VBL for a token generated using any non-transparent pixels. It attempts to "smooth" it out but it's work in progress so a complicated tree could result in complicated VBL. Currently it just applies the VBL to the normal VBL layer (and removes it) but greater things are "planned". Stay tuned!

o Save Token menu option now accepts Multiple tokens! Yea! SO yes, grab every token on a map and save them off in one go! You have the option of using the Save dialog for every token OR selecting a directory and saving all tokens to it using either the Name or GM Name. There is also a "Don't show me this again" checkbox for Overwriting existing tokens. (coming in a new build this week)

o Ever want to see how much cache space you are using? Now you can! Status bar now has 3 new boxes, one showing Asset Cache size, one for Image Thumbnail cache size, and one showing Free Disk space for your user directory. Also, double-clicking on said areas will clean out the cache for you! (plans for auto-clear-cache-based-on-date later)

o Asset window images can be zoomed in/out using control+mousewheel. Thumbnails have been enlarged to take advantage zoomed in images to prevent pixelization (increased what gets saved as an thumbnail to match new size). Will need to clear cache to take advantage of old thumbs and resave tokens (token now includes a largeThumb for display)

o Fixed bug that sometimes caused campaign file save over existing file in google drive/drop box folders to fail under java 1.8.

o Couple of other minor bug fixes and probably more things I forgot

You can download it at: http://maptool.nerps.net/

Feel free to post installation issues, questions, or comments here.
Last edited by JamzTheMan on Thu Apr 07, 2016 5:58 pm, edited 3 times in total.
-Jamz
____________________
Custom MapTool 1.4.x.x Fork: maptool.nerps.net
Custom TokenTool 2.0 Fork: tokentool.nerps.net
More information here: MapTool Nerps! Fork

Cederien
Kobold
Posts: 18
Joined: Wed Apr 06, 2016 3:05 am
Location: Germany

Re: [Nerps!] MapTool Fork based on b89

Post by Cederien »

I've had serious troubles getting the Linux version of your Maptool fork to run.
Getting it to unpack and 'install' was easy enough (I don't like the folder created and used though, especially a hidden maptool folder makes no sense IMHO). The launcher started just fine and then silently failed to start maptool. At least the logs allowed me to find out what's going on and fix it for me.
Let's start with, you can't rely on xterm being available. Nor do you need it. The command that calls xterm already requires a shell, xterm is just a different shell. Then the command issued looks like this:

Code: Select all

xterm, -T, MapTool, -e, java, -Xms128M, -Xmx4096M, -Xss4M, -ea, -DMAPTOOL_DATADIR=../../../.maptool, -jar, MapTool-1.4.0.2-fat.jar, run
No idea how those commas got in there, but they have no business there and the command just fails due to them, even if xterm is available.

You also pack your own java engine but the above command just calls java without a path to the version you included, hence the locally installed one is started. In my case that is: OpenJDK-7-JRE Version 7u95-2.6.4-0ubuntu0.15.10.2. That version failed failed with the following error:

Code: Select all

Exception in thread "main" java.lang.UnsupportedClassVersionError: net/rptools/maptool/client/LaunchInstructions : Unsupported major.minor version 52.0
        at java.lang.ClassLoader.defineClass1(Native Method)
        at java.lang.ClassLoader.defineClass(ClassLoader.java:803)
        at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
        at java.net.URLClassLoader.defineClass(URLClassLoader.java:449)
        at java.net.URLClassLoader.access$100(URLClassLoader.java:71)
        at java.net.URLClassLoader$1.run(URLClassLoader.java:361)
        at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
        at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
        at sun.launcher.LauncherHelper.checkAndLoadMain(LauncherHelper.java:482)
I will try later if it works with the OpenJDK-8 from the Ubuntu Repositories.
Anyway since you already go through the trouble to include your own java engine (which works fine with your maptool fork) actually using it seems in order, i.e. call java with the path to the directory.

So assuming the current directory is set correctly (that much worked) the call to maptools from the launcher should be like this:

Code: Select all

eval ~$USER/.JWrapper/JWrapper-MapTool/JWrapper-Linux64JRE-00042893902-complete/bin/java -Xms128M -Xmx4096M -Xss4M -ea -DMAPTOOL_DATADIR=../../../.maptool -jar MapTool-1.4.0.2-fat.jar run
The eval is probably not necessary, but doesn't hurt and might come in handy on some installs.

User avatar
JamzTheMan
Great Wyrm
Posts: 1872
Joined: Mon May 10, 2010 12:59 pm
Location: Chicagoland
Contact:

Re: [Nerps!] MapTool Fork based on 1.4.0.0

Post by JamzTheMan »

Interesting, thanks for the feedback!

The xterm launch command is from the Launcher, so that should be the same for 1.4.0.0? Can you run the normal 1.4.0.0 build without issue? jWrapper has a command to launch embedded virtual apps as well so looks like I may need to give that a try and see if it's more intelligent than what we currently have.

The "hidden" folders is unavoidable, it's a product of jWrapper. If/when we move to that we will most likely also offer the individual JAR's but you will have to supply your own JRE. This isn't usually an issue for Linux users. If you are on Linux chances are you are ahead of the curve...

And I'm surprised it didn't launch with the JRE supplied? That's the whole point. (Oh course it works for Windows just fine). It's probably having to do with the Launcher butchering the start command.

BTW, what flavor/version of linux are you using? I have a Debian wheezy fileserver I may be able to test on but not sure how different all the various flavors of Linux are...
-Jamz
____________________
Custom MapTool 1.4.x.x Fork: maptool.nerps.net
Custom TokenTool 2.0 Fork: tokentool.nerps.net
More information here: MapTool Nerps! Fork

Cederien
Kobold
Posts: 18
Joined: Wed Apr 06, 2016 3:05 am
Location: Germany

Re: [Nerps!] MapTool Fork based on 1.4.0.0

Post by Cederien »

Interesting question, seems I never tested that as I've a direct link to the maptool jar in my menu. The 1.4.0.0 launcher wasn't even marked as executable. Without xterm installed it fails though. With xterm it works fine. Guess I should add thatto the 1.4.0.0 bug reports then.

I'm runing Kubuntu 15.10.2 with the Plasma 5.5.3 and Frameworks 5.18.0 backports in place. Given Ubuntu has Debian rules your system should not behave to different from mine (it might come with xterm preinstalled however, no inkling there).

OpenJDK-8 can run your fork just fine. Actually after installing it (and removing the .jwrapper and .maptools folders) a few interesting changes took place. First the installer now throw a warning that the .maptool folder does not exist and will be created (it didn't do that before).
After that the launcher opened and could start maptool despite xterm NOT being present (the Vanilla 1.4.0.0 launcher still fails with xterm missing).
Obviously the launcher filters out the comma in the launch command (I retrieved the command from the logs), no idea on the xterm issue though.
The launcher still employs the locally installed JRE instead of the packaged one however (I removed the JRE you included to make 100% certain).

Now some of those changes may be due to OpenJDK-8 comming with some addtional components (it sure installed some odd dependencies) or it may be due to my original OpenJDK-7 JRE comming preinstalled (and possibly missing some components of a full manual install). I will create a fresh install in a virtual machine to test that, will have to wait till the weekend though.

User avatar
JamzTheMan
Great Wyrm
Posts: 1872
Joined: Mon May 10, 2010 12:59 pm
Location: Chicagoland
Contact:

Re: [Nerps!] MapTool Fork based on 1.4.0.0

Post by JamzTheMan »

OK, we have a few things going on. When using the launcher, it only uses xterm if you have the "Launch with console" checked on the "Advanced" tab. Uncheck that and give it a go.

Also, if you click the "Set Java Version (select directory)" button after a fresh install, does it default to the jWrapper JRE? It looks like the launcher is just doing a "java -jar ...." command relying on the JRE set in the path which jWrapper is adding when you launch the launcher. I'm adding a check in there to set the JRE specifically so it uses jWrappers JRE (you can still override/choose your own JRE, but it will be a YMMV).

I have a new test version I'll put out tonight, it has a second launch button "Launch MapTool using jWrapper Command" vs the default which builds using ProcessBuilder. This will be for testing only. It won't use any memory settings from the launcher as it does NOT let you specify JVM parameters (stupid right?) hence the need for the Launcher still.

There will be a new Icon as well. One starts the Launcher which can start MapTool, the other starts MapTool directly using jWrapper config (I have it set to -Xmm4096M -Xss4m).

Code: Select all

private static final String[][] invocationCommands = new String[][] {
new String[] { }, // empty array means nothing to add as a command line prefix when Console option enabled
new String[] { "cmd", "/k", "start" }, // Windows
new String[] { "xterm", "-T", "MapTool", "-e" }, // Linux, Unix !OSX
new String[] { "osascript", "-e", "tell application ''Terminal'' to do script \"cd ''{0}''; {1}\"" }, // OSX (doesn't work -- use #1) };
-Jamz
____________________
Custom MapTool 1.4.x.x Fork: maptool.nerps.net
Custom TokenTool 2.0 Fork: tokentool.nerps.net
More information here: MapTool Nerps! Fork

Cederien
Kobold
Posts: 18
Joined: Wed Apr 06, 2016 3:05 am
Location: Germany

Re: [Nerps!] MapTool Fork based on 1.4.0.0

Post by Cederien »

Hmm, yes that seems to be the problem. On a fresh install the path set is:

Code: Select all

/home/<my user directory>/.JWrapper/JWrapper-MapTool/JWrapper-MapTool-00042894078-complete
while it should be

Code: Select all

/home/<my user directory>/.JWrapper/JWrapper-MapTool/JWrapper-Linux64JRE-00042893902-complete/bin
With the above path set manually the launch command is then issued correct as:

Code: Select all

../JWrapper-Linux64JRE-00042893902-complete/bin/java -Xms128M -Xmx4096M -Xss4M  -DMAPTOOL_DATADIR=../../../.maptool   -jar MapTool-1.4.0.2-fat.jar run
So if you get that fixed in jWrapper you should be golden there.

xterm you are also correct, though I don't understand why it was set in the 1.4.0.0 launcher, it's not the default I gather and while I probably set it in the jWrapper version while trying to find out what goes wrong I certainly didn't with the 1.4.0.0 launcher. <scratches head> Well nothing to loose sleep over I guess.
xterm will remain a problem though, it's not likely to be installed (it's kinda old and a real pita to use), in most cases only on console will be installed and that tend to depend on the desktop. The command will is "konsole" in KDE, "gnome-terminal" in Gnome, xfce4-terminal in (you guessed it) Xfce and console in Unity for example. So that's one of the point where the the differences in Linux flavours matter. You will either have to allow for a way to input the console command or at least need to mention that xterm is required (as long as that stays around, with X11 seemingly on it's way out these days).

Post Reply

Return to “Testing”