MT1.3b87.02 Campaign Framework

Discussion concerning lmarkus' campaign framework for D&D3.x and Pathfinder.

Moderators: dorpond, trevor, Azhrei, giliath, Gamerdude, jay, Mr.Ice, lmarkus001

Forum rules
Discussion regarding lmarkus001's framework only. Other posts deleted without notice! :)
dragon86413
Kobold
Posts: 8
Joined: Tue Sep 28, 2010 10:06 pm

Re: MT1.3b87.02 Campaign Framework (LATEST VERSION)

Post by dragon86413 »

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).

User avatar
aliasmask
RPTools Team
Posts: 9024
Joined: Tue Nov 10, 2009 6:11 pm
Location: Bay Area

Re: MT1.3b87.02 Campaign Framework (LATEST VERSION)

Post by aliasmask »

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.

User avatar
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)

Post by lmarkus001 »

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).
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
Kobold
Posts: 8
Joined: Tue Sep 28, 2010 10:06 pm

Re: MT1.3b87.02 Campaign Framework (LATEST VERSION)

Post by dragon86413 »

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.

User avatar
wolph42
Winter Wolph
Posts: 9999
Joined: Fri Mar 20, 2009 5:40 am
Location: Netherlands
Contact:

Re: MT1.3b87.02 Campaign Framework (LATEST VERSION)

Post by wolph42 »

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.
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 :mrgreen: and click on my referal in my signature :wink:. But seriously dropbox really is a great gift, if not only for the repository function and the public share...
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)]
that should not be it.

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))]

!! 
which is more likely. Path2Pads() is used in 2 occasions both ONLY when the map is initialized through the alternative method and that is the case when the following token is on the map: "lib:Coords"+getCurrentMapName().

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)] 
just paste in the chat and click enter. 0 is not alternatively initialized, 1 is alternatively initialized. Let me know.

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.

dragon86413
Kobold
Posts: 8
Joined: Tue Sep 28, 2010 10:06 pm

Re: MT1.3b87.02 Campaign Framework (LATEST VERSION)

Post by dragon86413 »

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

User avatar
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)

Post by lmarkus001 »

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
Ah, thanks for posting this.

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.
Comments:
  • 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 :-)

dragon86413
Kobold
Posts: 8
Joined: Tue Sep 28, 2010 10:06 pm

Re: MT1.3b87.02 Campaign Framework (LATEST VERSION)

Post by dragon86413 »

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! :D 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.

dragon86413
Kobold
Posts: 8
Joined: Tue Sep 28, 2010 10:06 pm

Re: MT1.3b87.02 Campaign Framework (LATEST VERSION)

Post by dragon86413 »

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?

User avatar
wolph42
Winter Wolph
Posts: 9999
Joined: Fri Mar 20, 2009 5:40 am
Location: Netherlands
Contact:

Re: MT1.3b87.02 Campaign Framework (LATEST VERSION)

Post by wolph42 »

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! :D 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.
dragon86413 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?
- 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 menu
- 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 :D . 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).

Elorebaen
Dragon
Posts: 365
Joined: Sat Dec 22, 2007 5:37 pm

Re: MT1.3b87.02 Campaign Framework (LATEST VERSION)

Post by Elorebaen »

lmarkus001 wrote:
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!
I am able to reproduce this, so it is clearly a bug! I will work on fixing it...

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
LM, I don't see anything in the code spoiler?

THanks.

Elorebaen
Dragon
Posts: 365
Joined: Sat Dec 22, 2007 5:37 pm

Re: MT1.3b87.02 Campaign Framework (LATEST VERSION)

Post by Elorebaen »

LM,

It would be the BOMB, if we could save "Target Area" tokens we have created. =) Loving the mechanism btw.

Best.

User avatar
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)

Post by lmarkus001 »

Elorebaen wrote:LM,

It would be the BOMB, if we could save "Target Area" tokens we have created. =) Loving the mechanism btw.

Best.
Ah that is a good idea! I will think on that a bit...


I re-added the LibMoveTokensToMap macro code above where it had mysteriously vanished!

Elorebaen
Dragon
Posts: 365
Joined: Sat Dec 22, 2007 5:37 pm

Re: MT1.3b87.02 Campaign Framework (LATEST VERSION)

Post by Elorebaen »

lmarkus001 wrote:
Elorebaen wrote:LM,

It would be the BOMB, if we could save "Target Area" tokens we have created. =) Loving the mechanism btw.

Best.
Ah that is a good idea! I will think on that a bit...


I re-added the LibMoveTokensToMap macro code above where it had mysteriously vanished!
Thanks on both accounts!

Post Reply

Return to “D&D 3.5/Pathfinder 1e Campaign Macros”