Macro Panel FRAME

Show off your RPG maps, campaigns, and tokens. Share your gaming experiences and stories under General Discussion and save this forum for things you've created that may help others run their own games. Use the subforums when appropriate.

Moderators: Azhrei, dorpond, trevor, Gamerdude

User avatar
wolph42
Deity
Posts: 9706
Joined: Fri Mar 20, 2009 5:40 am
Location: Netherlands
Contact:

Macro Panel FRAME

Post by wolph42 »

This serves as a replacement of MT's 'token selection panel'. Why!. The short version: "It improves token movement time considerably": 20 tokens with each 40 token-macros will take roughly 50 :!: seconds to move. With this panel (and thus with no macros on the token) approximately 1s.
The drawback: a bit more hassle to make and token selection takes about 1s for the panel to build.
Other advantages: cleaner look. Other disadvantages: less slick buttons.

Here a screenshot:
Screenshot Macro Panel.jpg
Screenshot Macro Panel.jpg (76.2 KiB) Viewed 5302 times

Here's the code for the panel

Code: Select all

@@MacroButtonsManagement
@PROPSautoExecute=true color=red fontColor=yellow group=3. Combat Macros includeLabel=false sortBy=12 index=808 fontSize=1.00em minWidth=200 playerEditable=true maxWidth= ; tooltip= ; applyToSelected=false 
[
h:'<!-- HTMLMacroButton(cellWidth, cellColor, textColor, text, macroName, arguments) -->']

[
h:me getSelectedNames()]
[
h,if( inStr(me,"Lib:") || me=="" || listCount(me)>):abort(0)]
[
h:switchToken(me)]

[
hmacroGroup =    "<table width=100% cellpadding=3 color='white' bgcolor='black'><td align=center><b>%{groupTitle}</b></td></table>" 
                    
"<table width=100% cellpadding=1 color='white' bgcolor='black'>" +
                    
"<table width=100% cellpadding=2 color='black' bgcolor='white'>" +
                    
"<table width=100%><tr>"
]
[
hmacroNewLine  "</tr></table><table width=100%><tr>"]
[
hmacroGroupEnd "</tr></table></table></table></tr></td><tr></tr><tr><td>"]

[
frame("Macros""width=330; height=520; temporary=0"): {
    <
html><body bgcolor='white' style='font-size:8.5px;text-align:center'>
    <
link rel='onChangeSelection' type='macro' href='[r:macroLinkText("[email protected]", "none", "", "")]'></link>
    <
table width='100%' cellpadding='1'><tr><td>

        <
table width='100%'><tr><td align='center' style='font-size:10px'><b>[r:token.name]</b></td></tr></table>

        [
h:groupTitle "Manage Character"]
        [
r:strformat(macroGroup)]
                [
r:HTMLMacroButton(33,"lime","black","Healing""Healing""[]")]
                [
r:HTMLMacroButton(33,"blue","yellow","Full Sheet""Show Sheet""[]")]
                [
r:HTMLMacroButton(34,"blue","yellow","Quick Sheet""quickSheet""[]")]
            [
r:macroNewLine]
                [
r:HTMLMacroButton(23,"#EEEEEE","blue","Skills""Edit Skills""[]")]
                [
r:HTMLMacroButton(23,"#EEEEEE","black","Talents""Edit Talents""[]")]
                [
r:HTMLMacroButton(54,"#EEEEEE","teal","Edit Characters""Edit Characteristics""[]")]
            [
r:macroNewLine]
                [
r:HTMLMacroButton(23,"#EEEEEE","fuchsia","Powers""Edit Psychic""[]")]
                [
r:HTMLMacroButton(23,"#EEEEEE","black","Traits""Edit Traits""[]")]
                [
r:HTMLMacroButton(54,"#EEEEEE","teal","Edit Bonus Chars""Edit Bonus Characteristics""[]")]
            [
r:macroNewLine]
                [
r:HTMLMacroButton(46,"#EEEEEE","fuchsia","Edit Psy Powers""Adjust Psychic Powers""[]")]
                [
r:HTMLMacroButton(54,"#EEEEEE","black","Set States""States""[]")]
            [
r:macroNewLine]
                [
r:HTMLMacroButton(46,"#EEEEEE","blue","Set Skill adjustm.""EditSkillAdjustment""[]")]
                [
r:HTMLMacroButton(54,"#EEEEEE","gray","Set char adjustment""Set char adjustment""[]")]
            [
r:macroNewLine]
                [
r:HTMLMacroButton(46,"#EEEEEE","blue","Show Skill adjustm.""showSkillAdjustment""[]")]
                [
r:HTMLMacroButton(54,"#EEEEEE","gray","Show Char adjustm.""Edit tmpStats""[]")]
        [
r:macroGroupEnd]
            
        [
h:groupTitle "Manage Equipment"]
        [
r:strformat(macroGroup)]
                [
r:HTMLMacroButton(46,"#EEEEEE","black","Manage My Wpns""Manage My Weapons""[]")]
                [
r:HTMLMacroButton(54,"#EEEEEE","black","Manage My Armour""Manage My Armour""[]")]
            [
r:macroNewLine]
                [
r:HTMLMacroButton(46,"#EEEEEE","black","Equip Weapons""Show Weapon List""[]")]
                [
r:HTMLMacroButton(54,"#EEEEEE","black","Upgrade Weapon""Upgrade Weapon""[]")]
            [
r:macroNewLine]
                [
r:HTMLMacroButton(46,"#EEEEEE","black","Choose Gear""Edit Gear""[]")]
                [
r:HTMLMacroButton(54,"#EEEEEE","black","Show/Delete Gear""ShowGear""[]")]
            [
r:macroNewLine]
                [
r:HTMLMacroButton(46,"#EEEEEE","black","Ammo""Ammo""[]")]
                [
r:HTMLMacroButton(54,"#EEEEEE","black","Create Att Macro""Create Custom Attack""[]")]
    </
tr></table></table></table></tr></td></table>
}]
  

and here the code for the supporting macro "HTMLMacroButton"

Code: Select all

@@HTMLMacroButton
@PROPSautoExecute=true color=default ; fontColor=black group=aUtils includeLabel=false sortBy=50 index=803 fontSize=1.00em minWidth= ; playerEditable=false maxWidth= ; tooltip= ; applyToSelected=false 
<
td width='[r:arg(0)]%'><table width=100bgcolor='black' cellpadding='1'><table width=100bgcolor='[r:arg(1)]'><td align='center'><span  style='text-decoration:none;color:[r:arg(2)]'>[r:macroLink(arg(3),arg(4)+"@this","all",arg(5),token.name)]</span></td></table></table></td>  


Note that this is NOT drop-in code, the above code is an example which results in the screenshot. If you would litterally drop this in then the buttons would look for macro's like "ammo" which obviously don't work

User avatar
jfrazierjr
Deity
Posts: 5175
Joined: Tue Sep 11, 2007 7:31 pm

Re: Macro Panel FRAME

Post by jfrazierjr »

What happens if you cache the HTML result output in a property and then just grab that data on token selection. In that case, you would not have to recalc all the macro/html each time. Of course, when a new macro is created, you would need some method of updating the html in the frame.
I save all my Campaign Files to DropBox. Not only can I access a campaign file from pretty much any OS that will run Maptool(Win,OSX, linux), but each file is versioned, so if something goes crazy wild, I can always roll back to a previous version of the same file.

Get your Dropbox 2GB via my referral link, and as a bonus, I get an extra 250 MB of space. Even if you don't don't use my link, I still enthusiastically recommend Dropbox..


User avatar
wolph42
Deity
Posts: 9706
Joined: Fri Mar 20, 2009 5:40 am
Location: Netherlands
Contact:

Re: Macro Panel FRAME

Post by wolph42 »

jfrazierjr wrote:What happens if you cache the HTML result output in a property and then just grab that data on token selection. In that case, you would not have to recalc all the macro/html each time. Of course, when a new macro is created, you would need some method of updating the html in the frame.


what a cool idea indeed... though I've come to learn that the big time usurper is in the 'frame' function, not in the html, so I don't think much time will be saved (currently it takes <=1 second to build)

Edit: I take that back. Just did a test (used encode, decode voor the html storage) and 1. works like a charm, 2. its fast!

User avatar
CoveredInFish
Demigod
Posts: 3104
Joined: Mon Jun 29, 2009 10:37 am
Location: Germany
Contact:

Re: Macro Panel FRAME

Post by CoveredInFish »

Yes caching html content is totally effective. I used this with good efforts in the movepad and in a unpublished sw framework. Building html with lots of token accessing (eg skill lists) does take serious time.

User avatar
jfrazierjr
Deity
Posts: 5175
Joined: Tue Sep 11, 2007 7:31 pm

Re: Macro Panel FRAME

Post by jfrazierjr »

wolph42 wrote:
jfrazierjr wrote:What happens if you cache the HTML result output in a property and then just grab that data on token selection. In that case, you would not have to recalc all the macro/html each time. Of course, when a new macro is created, you would need some method of updating the html in the frame.


what a cool idea indeed... though I've come to learn that the big time usurper is in the 'frame' function, not in the html, so I don't think much time will be saved (currently it takes <=1 second to build)

Edit: I take that back. Just did a test (used encode, decode voor the html storage) and 1. works like a charm, 2. its fast!

:roll: :P
I save all my Campaign Files to DropBox. Not only can I access a campaign file from pretty much any OS that will run Maptool(Win,OSX, linux), but each file is versioned, so if something goes crazy wild, I can always roll back to a previous version of the same file.

Get your Dropbox 2GB via my referral link, and as a bonus, I get an extra 250 MB of space. Even if you don't don't use my link, I still enthusiastically recommend Dropbox..


User avatar
skester
Giant
Posts: 213
Joined: Mon May 04, 2009 3:44 pm

Re: Macro Panel FRAME

Post by skester »

I've been using a Frame, well actually several frames since I started making my own framework. Don't keep any macros on the character tokens. Didn't know it'd speed things up though.

I find it a lot easier since it doesn't have to just have the macros only. Using different buttons, tooltips and such you can easily display a variety if information.

Plus using a form for combat allows much more flexibility and customization than an input.

The only problem I have is the links don't always fire the first time you click it. But it's a small price to pay.

I actually have it display information relative to the token stat. Have it set to change on selection, and it usually doesn't take to long to switch between tokens.

The PCs use a similar one that is actually set to change in impersonation. That way if something happens to the character (take damage for instance), it automatically updates.

The following is all the same macro. One for a Pathfinder Monk, one for a Bard and the last for my library (blank) token.

There's 20 static macros in each one, plus the Skills and Combat section.

NPCWindow.png
NPCWindow.png (142.03 KiB) Viewed 5257 times


Skester

User avatar
wolph42
Deity
Posts: 9706
Joined: Fri Mar 20, 2009 5:40 am
Location: Netherlands
Contact:

Re: Macro Panel FRAME

Post by wolph42 »

I have those too. Not as fancy as yours but certainly as functional (screenshots). I do/did however also have quite a few token macros that didn't really belong on a sheet and also not in the campaign macros section. They are really meant for specific tokens for which the token selection panel is ideal (at least so I thought) until I found out about the insane amount of delay you run when dragging a couple of token over a map. So they had to go, but I DO have a need for a token selection macro panel... hence this thread.

User avatar
skester
Giant
Posts: 213
Joined: Mon May 04, 2009 3:44 pm

Re: Macro Panel FRAME

Post by skester »

I wondering now, since I use 'onChangeImpersonated' for my frames, and it tends to fire multiple times whenever there is a change to the token. When you drag a token around, does it reload the macro for every square moved - and can that slow it down as well?

Skester

User avatar
wolph42
Deity
Posts: 9706
Joined: Fri Mar 20, 2009 5:40 am
Location: Netherlands
Contact:

Re: Macro Panel FRAME

Post by wolph42 »

skester wrote:I wondering now, since I use 'onChangeImpersonated' for my frames, and it tends to fire multiple times whenever there is a change to the token. When you drag a token around, does it reload the macro for every square moved - and can that slow it down as well?

Skester


yes and no: yes it rebuilds the frame every time you click on the token TWICE ?!?! even if it was already selected.
no: it does not impair the speed, at least not with caching method I now use, and hardly without the caching.

User avatar
jfrazierjr
Deity
Posts: 5175
Joined: Tue Sep 11, 2007 7:31 pm

Re: Macro Panel FRAME

Post by jfrazierjr »

skester wrote:I wondering now, since I use 'onChangeImpersonated' for my frames, and it tends to fire multiple times whenever there is a change to the token. When you drag a token around, does it reload the macro for every square moved - and can that slow it down as well?

Skester


I would say no. I have no idea what the event is listening for, but I expect it will fire when the token is modified. For movement, this would only happen after the movement is completed.
I save all my Campaign Files to DropBox. Not only can I access a campaign file from pretty much any OS that will run Maptool(Win,OSX, linux), but each file is versioned, so if something goes crazy wild, I can always roll back to a previous version of the same file.

Get your Dropbox 2GB via my referral link, and as a bonus, I get an extra 250 MB of space. Even if you don't don't use my link, I still enthusiastically recommend Dropbox..

User avatar
wolph42
Deity
Posts: 9706
Joined: Fri Mar 20, 2009 5:40 am
Location: Netherlands
Contact:

Re: Macro Panel FRAME

Post by wolph42 »

jfrazierjr wrote:
skester wrote:I wondering now, since I use 'onChangeImpersonated' for my frames, and it tends to fire multiple times whenever there is a change to the token. When you drag a token around, does it reload the macro for every square moved - and can that slow it down as well?

Skester


I would say no. I have no idea what the event is listening for, but I expect it will fire when the token is modified. For movement, this would only happen after the movement is completed.


its a better way of putting it, indeed the tokemovement is not slowed but the total process is.

This whole 'issue' has its advantages though, thanks to your post my frames are waaaay faster (some took 10s) AND I've found a neat trick to keep them dynamical: if you want to add a row to say a skill list where it sais if the token has the skill, you would have to cache on each token individually, but I succeeded in creating one central cache for the list and being able to adapt it when a token calls for it. Ill give the details later, though its a bit complicated (at least for my standards)

User avatar
skester
Giant
Posts: 213
Joined: Mon May 04, 2009 3:44 pm

Re: Macro Panel FRAME

Post by skester »

How do you cache stuff? I'm very interested in that. With the amount of frames my players use for their game, that may help out with some speed issues we've been having (though it may be mostly network - works fine at home)

Thanks,

Skester.

User avatar
wolph42
Deity
Posts: 9706
Joined: Fri Mar 20, 2009 5:40 am
Location: Netherlands
Contact:

Re: Macro Panel FRAME

Post by wolph42 »

skester wrote:How do you cache stuff? I'm very interested in that. With the amount of frames my players use for their game, that may help out with some speed issues we've been having (though it may be mostly network - works fine at home)

Thanks,

Skester.


I just edited a piece CIF wrote on the subject in the wiki so have a look there.
To answer the rest of you question: no it won't even worse it might increase the network delays. The caching helps you to quickly construct a form, like a charactersheet, by storing the whole construct in a token property. This will make fast loading times, but will also make your tokens 'heavier' which might influence network speeds.

Post Reply

Return to “User Creations”