MT1.3b87.02 Campaign Framework
Moderators: dorpond, trevor, Azhrei, giliath, Gamerdude, jay, Mr.Ice, lmarkus001
Forum rules
Discussion regarding lmarkus001's framework only. Other posts deleted without notice!
Discussion regarding lmarkus001's framework only. Other posts deleted without notice!
-
- Kobold
- Posts: 8
- Joined: Tue Sep 28, 2010 10:06 pm
Re: MT1.3b87.02 Campaign Framework (LATEST VERSION)
I have no idea about programming, just an end user. I love the framework, but ran into a problem. I started getting the following error on token movement:
Error running onTokenMove on lib:OnTokenMove : Got but "json.intersection" only accepts JSON Arrays or Objects.
The first couple of times I deleted the old token and just made a new one. Now all tokens do it. I tried exporting the map and starting a fresh campaign, and found if I imported tokens, they worked fine, except on the map that I imported that still continues to give the error.
Any help would be appreciated. I really don't want to have to re-make the entire set of maps that are having this problem (it's a Kingmaker campaign and I have everything from the first three books done).
Error running onTokenMove on lib:OnTokenMove : Got but "json.intersection" only accepts JSON Arrays or Objects.
The first couple of times I deleted the old token and just made a new one. Now all tokens do it. I tried exporting the map and starting a fresh campaign, and found if I imported tokens, they worked fine, except on the map that I imported that still continues to give the error.
Any help would be appreciated. I really don't want to have to re-make the entire set of maps that are having this problem (it's a Kingmaker campaign and I have everything from the first three books done).
Re: MT1.3b87.02 Campaign Framework (LATEST VERSION)
Have you tried using the latest lib:OnTokenMove from wolph42's Bag of Tricks? You may need to run onCampaignLoad again when dropping in new token.
Downloads:
- Notepad++ MapTool addon
- RPEdit details (v1.3)
- Coding Tips: Modularity and Design
- Videos: Macro Writing Tools
- lmarkus001
- Great Wyrm
- Posts: 1867
- Joined: Sat Mar 29, 2008 12:30 am
- Location: Layfayette Hill, PA
Re: MT1.3b87.02 Campaign Framework (LATEST VERSION)
Can you get me access to your campaign file? The onTokenMove event is managed by Wolf42's library, but I do have a couple of plug-in macro mods in the current framework implementation. I have not experienced what you are describing, so seeing it happen myself would help immensely. As Aliasmask mentions, there is an upgrade to the Wolf42 library, but I have not tested it yet so I cannot speak to any integration issues. I do plan to integrate it and release a framework update in the not too distant future as I think his tool is well worth it.dragon86413 wrote:I have no idea about programming, just an end user. I love the framework, but ran into a problem. I started getting the following error on token movement:
Error running onTokenMove on lib:OnTokenMove : Got but "json.intersection" only accepts JSON Arrays or Objects.
The first couple of times I deleted the old token and just made a new one. Now all tokens do it. I tried exporting the map and starting a fresh campaign, and found if I imported tokens, they worked fine, except on the map that I imported that still continues to give the error.
Any help would be appreciated. I really don't want to have to re-make the entire set of maps that are having this problem (it's a Kingmaker campaign and I have everything from the first three books done).
Re: MT1.3b87.02 Campaign Framework (LATEST VERSION)
if you drop the campaign file here,then I'll have a look as well.
GETTING STARTED WITH MAPTOOLS - TUTORIALS, DOCS, VIDEOS, TOOLS, ETC
DISCORD (the new MT forum!)
My stuff
Excel Tools: Table and Light editors
MT Tools: Bag of Tricks: Tools for Maptool, Dungeon Builder I, Dungeon Builder II,onMouseOverEvent.
Frameworks: Dark Heresy, Rogue Trader, Deathwatch, Black Crusade, Only War, SET Card Game, RoboRally
Wiki: Debugging Tutorial, Speed Up Your Macros, Working With Two CODE Levels, Shortcut Keys, Avoiding Stack Overflow, READ THIS
DISCORD (the new MT forum!)
My stuff
Excel Tools: Table and Light editors
MT Tools: Bag of Tricks: Tools for Maptool, Dungeon Builder I, Dungeon Builder II,onMouseOverEvent.
Frameworks: Dark Heresy, Rogue Trader, Deathwatch, Black Crusade, Only War, SET Card Game, RoboRally
Wiki: Debugging Tutorial, Speed Up Your Macros, Working With Two CODE Levels, Shortcut Keys, Avoiding Stack Overflow, READ THIS
-
- Kobold
- Posts: 8
- Joined: Tue Sep 28, 2010 10:06 pm
Re: MT1.3b87.02 Campaign Framework (LATEST VERSION)
I can't even upload the map. The file limit is 5MB. Is there an email address I can send the campaign (135MB) or the map (18.8MB)? I tried importing the map into the MT1.3.87.02_DnD35_Pathfinder.cmpgn and had the same problem. I looked at the bag of tricks, but didn't see anything called lib:Ontokenmove. The toggle token move box in the bag of tricks didn't change anything.
Re: MT1.3b87.02 Campaign Framework (LATEST VERSION)
put the file in the public dir of dropbox and post the link, thats how most peeps do it. If you don't have dropbox (or anything similar) then go slap yourself and click on my referal in my signature . But seriously dropbox really is a great gift, if not only for the repository function and the public share...dragon86413 wrote:I can't even upload the map. The file limit is 5MB. Is there an email address I can send the campaign (135MB) or the map (18.8MB)? I tried importing the map into the MT1.3.87.02_DnD35_Pathfinder.cmpgn and had the same problem. I looked at the bag of tricks, but didn't see anything called lib:Ontokenmove. The toggle token move box in the bag of tricks didn't change anything.
If that goes to far, then pm me your email address and Ill send you a mail adress where you can post the file.
edit: in the mean time I had a look and could only find 2 occasions of json.intersection():
in oncampaignLoad
Code: Select all
[H: newGmNames = json.intersection(lower(getAllPlayerNames("json")),newGmNames)]
and in
path2pads
Code: Select all
@@ @path2pads
@PROPS@ fontColor=black ; autoExecute=true ; fontSize=1.00em ; sortBy=13 ; color=default ; playerEditable=false ; applyToSelected=false ; group=2. onTokenMove ; tooltip= ; minWidth=90 ;
[h:'<!-- PATH2PADS -->']
<!-- NO NEW SCOPE, IGNORE OUTPUT -->
<!-- this macro is fed by the path of the token and returns all the pads the token walked over in chronological order -->
[h:'<!-- turn lastpath, e.g.: [{"x":-1,"y":0},{"x":-1,"y":1},{"x":-1,"y":2}] into an array, with - replaced for _, e.g.: ["X_1Y0","X_1Y1","X_1Y2"] -->']
[h:lastPathJson = replace(arg(0), '-', '_')]
[h:lastPathJson = replace(lastPathJson, '\\{"x":(.*?),"y":(.*?)\\}', '"X\$1Y\$2"') ]
<!-- then extract only the coords from the lastpath where a special pad is mapped -->
[h:pathIntersect = json.intersection(allCoordsArray, lastPathJson)]
[h:'<!-- turn the json arrary path (pathIntersection) into an executable json object e.g. ["X_1Y0","X_1Y1","X_1Y2"] into ["[r:X_1Y0]","[r:X_1Y1]","[r:X_1Y2]"] -->']
[h:pathResult = replace(pathIntersect, '"(.*?)"', '[r:\$1]')]
[h:pathResult = replace(pathResult, '\\[\\[(.*?)\\]\\]', '["[\$1]"]')]
<!-- execute json and filter out any double found special pads -->
[h:pathResult = json.evaluate(pathResult)]
[h:pathResult = replace(pathResult, ',', '","')]
[h:macro.return = json.toList(json.unique(pathResult))]
!!
and whether that is the case can be easily found out by running this:
Code: Select all
[h: map = getCurrentMapName()]
[h: libCoordName = strformat("lib:Coords %{map}")]
[r: isAltInit = if(findToken(libCoordName) == "",0,1)]
If it IS alt. initilized, then let me know if you did this on purpose and if so why. If not, then let me know whether you're using 'special tokens' at all. If not then delete the lib:coords... file from the map and it should be fixed. If so then then run alt.init map again from the bag of tricks.
GETTING STARTED WITH MAPTOOLS - TUTORIALS, DOCS, VIDEOS, TOOLS, ETC
DISCORD (the new MT forum!)
My stuff
Excel Tools: Table and Light editors
MT Tools: Bag of Tricks: Tools for Maptool, Dungeon Builder I, Dungeon Builder II,onMouseOverEvent.
Frameworks: Dark Heresy, Rogue Trader, Deathwatch, Black Crusade, Only War, SET Card Game, RoboRally
Wiki: Debugging Tutorial, Speed Up Your Macros, Working With Two CODE Levels, Shortcut Keys, Avoiding Stack Overflow, READ THIS
DISCORD (the new MT forum!)
My stuff
Excel Tools: Table and Light editors
MT Tools: Bag of Tricks: Tools for Maptool, Dungeon Builder I, Dungeon Builder II,onMouseOverEvent.
Frameworks: Dark Heresy, Rogue Trader, Deathwatch, Black Crusade, Only War, SET Card Game, RoboRally
Wiki: Debugging Tutorial, Speed Up Your Macros, Working With Two CODE Levels, Shortcut Keys, Avoiding Stack Overflow, READ THIS
-
- Kobold
- Posts: 8
- Joined: Tue Sep 28, 2010 10:06 pm
Re: MT1.3b87.02 Campaign Framework (LATEST VERSION)
Umm...I have no idea what you said about alternatively initialized. I copied and pasted what you said to, but no change. I have some special macros on tokens, and I added a couple properties, but I'm not sure of what you are calling special macros. I did join up with dropbox like suggested, so hopefully this file will come through. I think this is the link:
https://dl.dropbox.com/u/90877203/Trial.cmpgn
https://dl.dropbox.com/u/90877203/Trial.cmpgn
- lmarkus001
- Great Wyrm
- Posts: 1867
- Joined: Sat Mar 29, 2008 12:30 am
- Location: Layfayette Hill, PA
Re: MT1.3b87.02 Campaign Framework (LATEST VERSION)
Ah, thanks for posting this.dragon86413 wrote:Umm...I have no idea what you said about alternatively initialized. I copied and pasted what you said to, but no change. I have some special macros on tokens, and I added a couple properties, but I'm not sure of what you are calling special macros. I did join up with dropbox like suggested, so hopefully this file will come through. I think this is the link:
https://dl.dropbox.com/u/90877203/Trial.cmpgn
Initial Debug:
- It appears the "failure" map is only "Greenbelt". Everything else seems to be working at a quick glance.
- Greenbelt does indeed have a lib:coords Greenbelt token on it. I deleted that token and basic functionality seemed to resume.
- This is using my 1.3b86.03 framework code (so different from this threads code), and Bag of Tricks 6.5d.
- You have hidden some key maps from the players, I am not certain how that will impact library functionality. Specifically ~~ Libraries & Utils, ~ PF Summoned Critters, BASE. I know the Summon macros will hiccup with those maps hidden, and I have never tested running the campaign with the libraries on a hidden map (I place the libraries on the hidden layer of a visible map).
- Your campaign file is quite large. 138MB makes for a very slow save time, so expect your players to experience shutdown lag if they try to do things while the campaign file saves.
- It looks like you have tons of fun content and your players are going to have a great time
-
- Kobold
- Posts: 8
- Joined: Tue Sep 28, 2010 10:06 pm
Re: MT1.3b87.02 Campaign Framework (LATEST VERSION)
I was also having the problem in the "Varnhold Vanishing" map. I'll unhide the maps and just put the tokens on the hidden layer. We do get disconnects & occasional lags, I never thought of it possibly being due to the auto save time.
I never saw a lib:coords Greenbelt token, how did you detect it so I can watch for it if this problem happens again?
Thanks much for all the help! I wish I could learn this programming better so I can troubleshoot my own problems (especially ones I accidentally create). Love these forums and all the helpful people.
I never saw a lib:coords Greenbelt token, how did you detect it so I can watch for it if this problem happens again?
Thanks much for all the help! I wish I could learn this programming better so I can troubleshoot my own problems (especially ones I accidentally create). Love these forums and all the helpful people.
-
- Kobold
- Posts: 8
- Joined: Tue Sep 28, 2010 10:06 pm
Re: MT1.3b87.02 Campaign Framework (LATEST VERSION)
LOL, my mistake the error on the "Varnhold Vanishing" map is a little different:
Error running onTokenMove on lib:OnTokenMove : Error executing "movedOverToken": the token name or id "Pit 1" is unknown.
I found the lib token on the "Greenbelt" map and removed it. That cured the movement error on that map, but I'm not finding any lib tokens on the other map
How do I tell which Bag Of Tricks version I have? If I need to update it, do I just find the latest download then drag & drop after deleting the original one in the framework?
Error running onTokenMove on lib:OnTokenMove : Error executing "movedOverToken": the token name or id "Pit 1" is unknown.
I found the lib token on the "Greenbelt" map and removed it. That cured the movement error on that map, but I'm not finding any lib tokens on the other map
How do I tell which Bag Of Tricks version I have? If I need to update it, do I just find the latest download then drag & drop after deleting the original one in the framework?
Re: MT1.3b87.02 Campaign Framework (LATEST VERSION)
dragon86413 wrote:I was also having the problem in the "Varnhold Vanishing" map. I'll unhide the maps and just put the tokens on the hidden layer. We do get disconnects & occasional lags, I never thought of it possibly being due to the auto save time.
I never saw a lib:coords Greenbelt token, how did you detect it so I can watch for it if this problem happens again?
Thanks much for all the help! I wish I could learn this programming better so I can troubleshoot my own problems (especially ones I accidentally create). Love these forums and all the helpful people.
- a particular token (like lib:coords...) can always be found on a map through the map explorer panel. You can turn it on in the menudragon86413 wrote:LOL, my mistake the error on the "Varnhold Vanishing" map is a little different:
Error running onTokenMove on lib:OnTokenMove : Error executing "movedOverToken": the token name or id "Pit 1" is unknown.
I found the lib token on the "Greenbelt" map and removed it. That cured the movement error on that map, but I'm not finding any lib tokens on the other map
How do I tell which Bag Of Tricks version I have? If I need to update it, do I just find the latest download then drag & drop after deleting the original one in the framework?
- the version of the BoT can be found by selecting lib:OnTokenMove going to the macro selection panel and scroll waaaaay down to a black button where it states the version.
- to update, follow the link to the bag of tricks in my signature and read: how to upgrade . Though in your case I would advise to read the 'how to implement' and do that.
- its funny that you have all these lib:coords on your maps cause the only way to get them is to hit the 'alt init map' button either on the campaign panel (if its there). As you don't know what it does Im gathering that either you got your maps from others or you or one of your player (not sure if the latter is possible) hit the button once in a while... I would check all your maps for lib:coords and remove them, then update lib:ontokenmove and then hit the 'initialize maps' OR 'turn off the ontokenmove' whichever tickles your fancy. Also note that lib:coords ONLY exists if you ever pressed 'alt.init map' for that map. It will NOT be automatically on every map. Also if you press 'initiate map' no new tokens will be created, but all your maps will be checked for special tokens, certain links between teleports will be laid etc.
edit: I checked and the only lib:coords I could find is: the one on greenbelt and the 'base' one (found on BASE map) but the latter you should not touch!!
and I noticed I wasn't entirely clear: the vanderholt map issue is solved by clicking 'initialize maps' on the bag of trick. In my searching I found several special tokens on several maps, after you initialized them you will get a list. 'Special tokens' are 'Teleports, interteleports, wards, etc' check the post on the bag of tricks for a full list.
Note that interTeleports (of with you have quite a few) are linked by their number so e.g 7 is connected with 7, 8 with 8 etc.
edit2: I also have to mention that I get an 'java heap space' (cg overhead limit exceeded) memory error after initializing the maps. Basically this means: too much!!
In the settings you can turn of maps so they are NOT scanned. If you do that you prevent this (fatal!!) error. (I turned off the following: Creatures,BASE,~ D&D35 Summoned Critters,~ PF Summoned Critters,~~ Libraries & Utils).
GETTING STARTED WITH MAPTOOLS - TUTORIALS, DOCS, VIDEOS, TOOLS, ETC
DISCORD (the new MT forum!)
My stuff
Excel Tools: Table and Light editors
MT Tools: Bag of Tricks: Tools for Maptool, Dungeon Builder I, Dungeon Builder II,onMouseOverEvent.
Frameworks: Dark Heresy, Rogue Trader, Deathwatch, Black Crusade, Only War, SET Card Game, RoboRally
Wiki: Debugging Tutorial, Speed Up Your Macros, Working With Two CODE Levels, Shortcut Keys, Avoiding Stack Overflow, READ THIS
DISCORD (the new MT forum!)
My stuff
Excel Tools: Table and Light editors
MT Tools: Bag of Tricks: Tools for Maptool, Dungeon Builder I, Dungeon Builder II,onMouseOverEvent.
Frameworks: Dark Heresy, Rogue Trader, Deathwatch, Black Crusade, Only War, SET Card Game, RoboRally
Wiki: Debugging Tutorial, Speed Up Your Macros, Working With Two CODE Levels, Shortcut Keys, Avoiding Stack Overflow, READ THIS
Re: MT1.3b87.02 Campaign Framework (LATEST VERSION)
LM, I don't see anything in the code spoiler?lmarkus001 wrote:I am able to reproduce this, so it is clearly a bug! I will work on fixing it...Jazlizard wrote:I get the following error when I try the move token macro:
Invalid condition in IF(hasProperty( "SizeM", tToken )) roll option. Statement options (if any): H, IF( hasProperty( "SizeM", tToken ) ) Statement Body : setSize( "CUSTOM", tToken, SizeM )
Any ideas on why that might be?
I'm trying to move a token from one map to another as a GM. I have the coordinates and maps set in the globals.
Appreciate any help!
EDIT: Ah ha! I found the issue and will incorporate in the next patch. If you want it resolved now, replace LibMoveTokensToMap macro with:
LibMoveTokensToMap
Code: Select all
THanks.
Re: MT1.3b87.02 Campaign Framework (LATEST VERSION)
LM,
It would be the BOMB, if we could save "Target Area" tokens we have created. =) Loving the mechanism btw.
Best.
It would be the BOMB, if we could save "Target Area" tokens we have created. =) Loving the mechanism btw.
Best.
- lmarkus001
- Great Wyrm
- Posts: 1867
- Joined: Sat Mar 29, 2008 12:30 am
- Location: Layfayette Hill, PA
Re: MT1.3b87.02 Campaign Framework (LATEST VERSION)
Ah that is a good idea! I will think on that a bit...Elorebaen wrote:LM,
It would be the BOMB, if we could save "Target Area" tokens we have created. =) Loving the mechanism btw.
Best.
I re-added the LibMoveTokensToMap macro code above where it had mysteriously vanished!
Re: MT1.3b87.02 Campaign Framework (LATEST VERSION)
Thanks on both accounts!lmarkus001 wrote:Ah that is a good idea! I will think on that a bit...Elorebaen wrote:LM,
It would be the BOMB, if we could save "Target Area" tokens we have created. =) Loving the mechanism btw.
Best.
I re-added the LibMoveTokensToMap macro code above where it had mysteriously vanished!