[b91] ATTENTION: rudimentary change in macro script!

New build announcements plus site news and changes.

Moderators: dorpond, trevor, Azhrei, Craig

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

[b91] ATTENTION: rudimentary change in macro script!

Post by wolph42 »

Edit: for none coders: basically this is a good thing as it allows more freedom in the macros. It might however effect existing frameworks, fixing those however isn't really hard and I can help with that if need be.

In this topic the 'token layer filter' is discussed and its decided to remove it. The intention was about Wiki: getTokens() only, but when this was posted, I realized that (probly) ALL 'getXXXXXTokenXXX()' were changed (like Wiki: getExposedTokens() is for sure). And alas, not all these functions have build in filters.

So here a method to return the 'original' functionality of these functions. I'll use getXXXTokenXXX() as 'substitute' function, just replace that with the one you're using.

Code: Select all

[h:result    = json.intersection(getTokenNames("json",'{layer:["TOKEN"]}'), getXXXTokenXXX("json"))]

<!-- and in case you were not using the 'json' delimiter but lets say this one "," -->

[h:result    = json.toList(json.intersection(getTokenNames("json",'{layer:["TOKEN"]}'), getXXXTokenXXX("json")),",")] 
you can also consider setting this as a user defined function, redefining the function to behave like this.

another thing. Some of these functions have their OWN FILTER, e.g. Wiki: getTokens() you can just add the filter internally, see the examples given in the wiki.

note that this is NOT fully confirmed for ALL getXXXTokenXXX functions, only for getExposedTokens and getTokens, but its a safe assumption.
Last edited by wolph42 on Fri Oct 31, 2014 2:57 am, edited 2 times in total.

User avatar
Jagged
Great Wyrm
Posts: 1306
Joined: Mon Sep 15, 2008 9:27 am
Location: Bristol, UK

Re: [b91] ATTENTION: rudimentary change in macro script!

Post by Jagged »

This explains changes in the behaviour of my RoboRally game


dorpond
RPTools Team
Posts: 5534
Joined: Thu Jun 01, 2006 2:05 pm
Location: Buffalo, NY

Re: [b91] ATTENTION: rudimentary change in macro script!

Post by dorpond »

Question, Friend. I don't know what all this means exactly, but our group just uses Maptool for the most part and does very little with intense macros. Is this that you mention, a deal breaker?

I was going to have the guys use B91 next session, but should I wait?

Let me know in layman's terms. :)

Thanks man, and thanks for taking note on the 'issues' and addressing them!
How to use my bundled artwork (MT1.3B60+): http://forums.rptools.net/viewtopic.php?f=8&t=11759

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

Re: [b91] ATTENTION: rudimentary change in macro script!

Post by wolph42 »

No not at all. It's actually a good thing. Before it was not possible with some functions to select tokens on the background, now it is. However with some frameworks this might lead to strange behaviour.

I've actually asked NOT to change this back. So if you don't use many macros it most likely won't effect your game. And if it does, post here. I can vouch for b91 as its one of the most stable (bug free ) versions in a long time.

dorpond
RPTools Team
Posts: 5534
Joined: Thu Jun 01, 2006 2:05 pm
Location: Buffalo, NY

Re: [b91] ATTENTION: rudimentary change in macro script!

Post by dorpond »

wolph42 wrote: I can vouch for b91 as its one of the most stable (bug free ) versions in a long time.
Great bud! Glad to hear that! Thanks again for all your heart and dedication to our cause here! If people haven't told you lately, you are the bomb! Thanks again!
How to use my bundled artwork (MT1.3B60+): http://forums.rptools.net/viewtopic.php?f=8&t=11759


User avatar
Jagged
Great Wyrm
Posts: 1306
Joined: Mon Sep 15, 2008 9:27 am
Location: Bristol, UK

Re: [b91] ATTENTION: rudimentary change in macro script!

Post by Jagged »

dorpond wrote:Question, Friend. I don't know what all this means exactly, but our group just uses Maptool for the most part and does very little with intense macros. Is this that you mention, a deal breaker?

I was going to have the guys use B91 next session, but should I wait?

Let me know in layman's terms. :)

Thanks man, and thanks for taking note on the 'issues' and addressing them!
Just to add to Wolph's comments, I have been using Rumble's Slim 4E framework, under b91 without issue. So I think its safe to upgrade :)

User avatar
Sereptus
Giant
Posts: 123
Joined: Tue Jun 07, 2011 12:08 pm
Location: Canada

Re: [b91] ATTENTION: rudimentary change in macro script!

Post by Sereptus »

Thanks Wolph42, I thought I was going crazy! This bit of code was working fine....and then not....

Code: Select all

[h:allToks    = getTokenNames("json",'{layer:["TOKEN"]}')]
[h:allVis    = getVisibleTokenNames("json")]
[h:allNpc    = getNPCNames("json")]
[h:allExp    = getExposedTokenNames("json")]
[h:tokExp    = json.intersection(allToks, allExp, allVis,allNpc)]

[h: assert(json.length(tokExp), "No visible NPC", 0)]
The getExposedTokenNames still doesn't work unless I start a server (no client need be connected). I think (unless I missed something as usual) this still needs to be investigated further. That bit of code taken from the Wiki will work on my Library Map but not on any other map that I've created. So when I went to test it on a token on a map I created it suddenly wouldn't work, or any other map I created but when I started the server to investigate it worked! I've ran other tests using the Lib map FOW on/off, Vision Off/Day/Night and cant figure out why it would work on that map without a server running and not on others. In any case this is just what I've recently ran into. I'm still doing some experimentation on it.
No not at all. It's actually a good thing. Before it was not possible with some functions to select tokens on the background, now it is. However with some frameworks this might lead to strange behaviour.
I'm really looking forward to experimenting with selecting "background, etc" tokens!!
Last edited by Sereptus on Tue Jan 06, 2015 10:44 am, edited 1 time in total.
OOOHH RegEx....YOU BITTER-SWEET BEAST!!!


Post Reply

Return to “Announcements”