[MOD] Mod Report (MT1.3b82 r01) [Last update: 12/05/11]

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! :)
Post Reply
User avatar
aliasmask
RPTools Team
Posts: 9024
Joined: Tue Nov 10, 2009 6:11 pm
Location: Bay Area

[MOD] Mod Report (MT1.3b82 r01) [Last update: 12/05/11]

Post by aliasmask »

Here's a new mod for Mod Report, which is actually the ConditionReport macro.
  • Output is sorted, shows the token state images in the tooltips.
  • The "conditions" have been reformatted an include a tool tip.
  • Everything is on it's own line and in a table.
  • Items or mods with states, if active, are set in case they get turned off manually or through some other method.
  • All mods appears in a thin border box with header.
||| ConditionReport |||

Code: Select all

@@ @ConditionReport
[H: output = "" ]
[H: gTok = "Lib:GlobalsSRDPF" ]
[H: jTM = getLibProperty( "TempModToggleSets", gTok ) ]
[H: atms = json.get( PrivateJSON, "ActiveTempModSets" ) ]
[H, IF( json.isEmpty( atms ) ): activeMSList = ""; activeMSList = json.toList( json.unique( atms ) ) ]
[H: jPTM= json.get( PrivateJSON, "CustomModSetValues") ]

[H, FOREACH( m, activeMSList ), CODE: {
   [IF( json.isEmpty( jPTM ) ): jPM = ""; jPM = json.get( jPTM, m ) ]
   [IF( json.isEmpty( jPM ) ): tTip = json.get( json.get( jTM, m ), "tip" );tTip = json.get( jPM, "tip" ) ]
   [ tCat = json.get( json.get( jTM, m ), "cat" )]
   [ tState = json.get( json.get( jTM, m), "state")]
   [H, if(tState != "NA"), code: {
      [H: setState(tState,1)]
      [H: stateImage = strformat("<img src='%s' width=50 height=50>",getStateImage(tState))]
   };{
      [H: stateImage = " "]
   }]      
   [IF(tCat == ""): tCat = "Mod"]
   [H: tTip = strformat('<span title="<html><table><tr valign=top><td>%{stateImage}</td><td>%{tTip}</td></tr></table></html>">%{m}</span>')]
   [H: output = json.append(output,strformat('<tr id="%s"><td style="padding: 0px 2px 0px 5px;text-align:right" NOWRAP><b>%{tCat}:</b></td><td style="padding-right: 5px">%{tTip}</td></tr>',replace(lower(tCat+m),"[^a-z0-9._]","")))]
}]
[H: aitems = json.get( PrivateJSON, "ActiveItems" ) ]
[H, IF( json.isEmpty( aitems ) ): activeMSList = ""; activeMSList = json.toList( json.unique( aitems ) ) ]

[H, FOREACH( m, activeMSList ), CODE: {
   [IF( json.isEmpty( jPTM ) ): jPM = ""; jPM = json.get( jPTM, m ) ]
   [IF( json.isEmpty( jPM ) ): tTip = json.get( json.get( BonusTypedItems, m ), "tip" );tTip = json.get( jPM, "tip" ) ]
   [ tCat = json.get( json.get( BonusTypedItems, m ), "cat" )]
   [ tState = json.get( json.get( BonusTypedItems, m), "state")]
   [H, if(tState != "NA"), code: {
      [H: setState(tState,1)]
      [H: stateImage = strformat("<img src='%s' width=50 height=50>",getStateImage(tState))]
   };{
      [H: stateImage = " "]
   }]      
   [IF(tCat == "" || tCat == "Misc"): tCat = "Item"]
   [H: tTip = strformat('<span title="<html><table><tr valign=top><td>%{stateImage}</td><td>%{tTip}</td></tr></table></html>">%{m}</span>')]
   [H: output = json.append(output,strformat('<tr id="%s"><td style="padding: 0px 2px 0px 5px;text-align:right" NOWRAP><b>%{tCat}:</b></td><td style="padding-right: 5px">%{tTip}</td></tr>',replace(lower(tCat+m),"[^a-z0-9._]","")))]
}]

[H: numConditions = tbl("Conditions",0)]
[H, for(i,0,numConditions), code: {
   [H: conditionStr = tbl("Conditions",i + 1)]
   [H: curState = listGet(conditionStr,0,";")]
   [H, if(getState(curState)), code: {
      [H: conditionText = replace(listGet(conditionStr,1,";"),"%","%%")]
      [H: stateImage = "'"+getStateImage(curState)+"'"]
      [H: tTip = strformat('<span title="<html><table><tr valign=top><td><img src=%{stateImage} width=50 height=50></td><td>%{conditionText}</td></tr></table></html>">%{curState}</span>')]
      [H: output = json.append(output,strformat('<tr id="state%s"><td style="padding: 0px 2px 0px 5px;text-align:right" NOWRAP><b>State:</b></td><td style="padding-right: 5px">%{tTip}</td></tr>',lower(curState)))]
   };{}]
}]

[H: output = json.sort(output,"a")]
[R,S: '<table style="background-color:black"><tr><td style="padding:1pt"><table style="background-color:white"><tr><th colspan=2 style="color:blue;text-align:center">Mod Report</th></tr>' + json.toList(output,"") + "</table></td></tr></table>"]

!!
- Updated (12/05/11)
Last edited by aliasmask on Sat Jul 16, 2011 7:32 pm, edited 3 times in total.

neofax
Great Wyrm
Posts: 1694
Joined: Tue May 26, 2009 8:51 pm
Location: Philadelphia, PA
Contact:

Re: [MOD] Mod Report (MT1.3b82 r01)

Post by neofax »

I so wish the states showed up in the header of the character sheet as images as well. Would really love them to show up on the mouse over sheet.

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

Re: [MOD] Mod Report (MT1.3b82 r01)

Post by aliasmask »

Character sheet wouldn't be a problem, but I don't think images work on mouseover sheet.

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

Re: [MOD] Mod Report (MT1.3b82 r01)

Post by Elorebaen »

Nice and neat, I like it!

User avatar
lmarkus001
Great Wyrm
Posts: 1867
Joined: Sat Mar 29, 2008 12:30 am
Location: Layfayette Hill, PA

Re: [MOD] Mod Report (MT1.3b82 r01)

Post by lmarkus001 »

Incorporated, thanks!

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

Re: [MOD] Mod Report (MT1.3b82 r01)

Post by aliasmask »

Cool.

I was looking at my code again and for a sec I couldn't understand why I put id= in the <tr> of the output... until I realized I did that for the sort feature so the beginning of the strings are always the same except the condition name. Also, the name had to be in quotes and as part of a option variable.

User avatar
lmarkus001
Great Wyrm
Posts: 1867
Joined: Sat Mar 29, 2008 12:30 am
Location: Layfayette Hill, PA

Re: [MOD] Mod Report (MT1.3b82 r01)

Post by lmarkus001 »

I was toying with the idea of a full mod table for the report, but then that might be better for an additional page on the character sheet.

Code: Select all

                STRmod DEXmod etc...
Modname (Shaken)  -2    -2    etc...
Modname2           1
etc...

TOTAL             -1    -2
Could show the type in a tool tip and only show columns for items that are actually modded.

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

Re: [MOD] Mod Report (MT1.3b82 r01)

Post by aliasmask »

lmarkus001 wrote:I was toying with the idea of a full mod table for the report, but then that might be better for an additional page on the character sheet.

Code: Select all

                STRmod DEXmod etc...
Modname (Shaken)  -2    -2    etc...
Modname2           1
etc...

TOTAL             -1    -2
What would the "Total" represent? Combat mods? Or will you list totals for things like stats, saves, AC...? I would say a new page on character sheet if doing it that way. But really, you could have it in both places. Just make one macro that builds the output, then you can output it as a tool tip or to its own page.

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

Re: [MOD] Mod Report (MT1.3b82 r01) [Last update: 12/05/11]

Post by aliasmask »

I made a minor update adding NOWRAP to the first column for the category names.

Post Reply

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