RPTools.net

Discussion and Support

Skip to content

It is currently Mon Sep 25, 2017 1:39 pm 




Forum rules


Discussion regarding lmarkus001's framework only. Other posts deleted without notice! :)



Reply to topic  [ 5 posts ] 

Previous topic | Next topic 

  Print view

Author Message
User avatar  Offline
Deity
 
Joined: Tue Nov 10, 2009 6:11 pm
Posts: 7861
Location: Bay Area
 Post subject: [STAT SHEET] Alternate View (update 3/25/13)
PostPosted: Thu Mar 21, 2013 7:00 pm 
I tweaked the stat sheet properties for DnD35 to be more compact and added a couple of extras in there. All you have to do is put this at the top and then go through the rest of properties and remove the * and *@. Also, delete any duplicates like Languages,MoveRemain,AC,AllSaves and SaveMisc (basically anything that doesn't start with "sheet.". When fiddling with the token type variables, I would save a backup first before committing to the changes just in case something is messed up or you don't like it.

The same can be done for the Pathfinder token type with a minor adjustment to AC name.

Code:
*@sheet.creature (Creature):[r: strformat("%{CreatureType} (%{LevelsInfo})")]
*@Languages:[R: json.get(getProperty("Race"), "notes")]
*@sheet.hpstatus (Hit Points):[r: strformat("%s/%s%s",HP+HPtemp-HPNonLethalDMG,HPmax,if(HPtemp || HPNonLethalDMG," (+"+HPtemp+"/-"+HPNonLethalDMG+")",""))]
*sheet.distance (Distance):[R: distanceStatSheet(currentToken())]
*sheet.appearance (Appearance)
*sheet.moveReach (Tactical):[r: strformat("Move:%{Movement} Reach:%{Reach} Elev:%{Elevation}")]
*@MoveRemain
*AC (AC/TH/FF)
*@sheet.specialA (Attacks):[r, if(SpecialATK == "NA" || SpecialATK == ""): ""; substring(SpecialATK,0,min(length(SpecialATK),50))]
*@sheet.specialD (Defenses):[r, if(SpecialQual == "NA" || SpecialQual == ""):""; substring(SpecialQual,0,min(length(SpecialQual),50))]
*@sheet.resistances (Resistances):[r, if(! json.isEmpty(spellResistance)): "SR: "+spellResistance+" "][r, if(! json.isEmpty(DR)): "DR: "+DR]
*@sheet.physical (Body):[R: strformat("Str:%s(%+d) Dex:%s(%+d) Con:%s(%+d)",Strength+StrMod,StrB,Dexterity+DexMod,DexB,Constitution+ConMod,ConB)]
*@sheet.mental (Mind):[R: strformat("Int:%s(%+d) Wis:%s(%+d) Chr:%s(%+d)",Intelligence+IntMod,IntB,Wisdom+WisMod,WisB,Charisma+ChaMod,ChaB)]
*@AllSaves (Saves):[R: strformat("Fort:%+d Ref:%+d Will:%+d",Fort+ConB+FortBonus,Reflex+DexB+ReflexBonus,Will+WisB+WillBonus)]
*@SaveMisc


Add this function to your Lib:libDnD35Pathfinder token as "distanceStatSheet" and make sure to uncheck "Player Editable" in options.
Code:
<!-- distanceStatSheet(currentToken): distance token list -->
<!-- created by AM, modified by W42 -->
[H: sheet.target        = arg(0)]
[H: sheet.source        = getSelected()]
[H: sheet.doDistance    = if(listCount(sheet.source) > 0 && sheet.target != sheet.source,1,0)]
[h: sheet.output        = ""]

[H, if(sheet.doDistance), CODE:{
    [foreach(tok, sheet.source): sheet.output = listAppend(sheet.output,strformat("%s (%s)",getName(tok),getDistance(sheet.target,1,tok)))]
};{}]

[H: macro.return        = sheet.output]

Code:
<!-- onCampaignLoad -->
[H: defineFunction("distanceStatSheet","distanceStatSheet@"+getMacroLocation(),1)]

*Updated Above Code - Apparently there was a permissions problem with players for distance macro, so I created a UDF on the core token.

The main reason I did this is to avoid the statsheet from covering up the majority of the screen when special abilities are too long. The above limits the output to 50 characters. If that line is really important to you and you would like to list more, then I have an update for additional lines for special abilities and special defenses upon request.

I put a line in there for appearance, in case gm wants to list token's armor type, weapon and shield. I added a Distance tool. If you select a token, any other token will tell you the distance to the selected token. I combined the reach, movement and elevation in to one line called Tactical. HP are displayed as "current/max (temp/nonlethal)" where current is your effective hit points (+temp,-nonlethal). The rest is just formatting preference for me.

edit: Modified by Wolph42 to actually work :| and list all selected token distances on moused over targets.

_________________
Downloads:


Top
 Profile  
 
User avatar  Offline
Deity
 
Joined: Fri Mar 20, 2009 4:40 am
Posts: 9388
Location: Netherlands
 Post subject: Re: [STAT SHEET] Alternate View
PostPosted: Mon Mar 25, 2013 10:45 am 
you made a small mistake in the macro:

this line:
Code:
[H: sheet.doDistance   = if(listCount(sheet.target) == 1 && sheet.target != sheet.source && sheet.source != "",1,0)]

should be:
Code:
[H: sheet.doDistance   = if(listCount(sheet.source) == 1 && sheet.target != sheet.source,1,0)]


you *can* select multiple targets, but you *can't* hover over multiple targets

also the name of the 'hovered' token is shown, my guess is that you should show the name of the selected token... and while I was at it, this works with multiple selected tokens:

Code:
[h:'<!-- ------------------------------- distanceStatSheet --------------------------------------------- -->']
<!--
 created by AM, improved by W42 -->
[
H: sheet.target        = arg(0)]
[
H: sheet.source        = getSelected()]
[
H: sheet.doDistance    = if(listCount(sheet.source) > 0 && sheet.target != sheet.source,1,0)]
[
h: sheet.output        = ""]

[
H, if(sheet.doDistance), CODE:{
    [foreach(tok, sheet.source): sheet.output = listAppend(sheet.output,strformat("%s (%s)",getName(tok),getDistance(sheet.target,1,tok)))]
};{}]

[
H: macro.return        = sheet.output]
 

_________________
GETTING STARTED WITH MAPTOOLS - TUTORIALS, DOCS, VIDEOS, TOOLS, ETC

My stuff
Excel Tools: Table and Light editors
MT Tools: Bag of Tricks: Tools for Maptool, Dungeon Builder I, Dungeon Builder II,onMouseOverEvent and
DPI.
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


Top
 Profile  
 
User avatar  Offline
Deity
 
Joined: Tue Nov 10, 2009 6:11 pm
Posts: 7861
Location: Bay Area
 Post subject: Re: [STAT SHEET] Alternate View
PostPosted: Mon Mar 25, 2013 12:37 pm 
The first one was when I was selecting multiple tokens and needed to have a blank check, but that's not needed in the second version, so it's okay to remove that check. The name is also from when I had multiple tokens selected, so that's not needed either. After changing the mechanic of the code from the 1st incarnation, those 2 bits didn't really matter.

_________________
Downloads:


Top
 Profile  
 
User avatar  Offline
Deity
 
Joined: Fri Mar 20, 2009 4:40 am
Posts: 9388
Location: Netherlands
 Post subject: Re: [STAT SHEET] Alternate View
PostPosted: Mon Mar 25, 2013 1:31 pm 
aliasmask wrote:
The first one was when I was selecting multiple tokens and needed to have a blank check, but that's not needed in the second version, so it's okay to remove that check. The name is also from when I had multiple tokens selected, so that's not needed either. After changing the mechanic of the code from the 1st incarnation, those 2 bits didn't really matter.


It was not only the check. You also checked the wrong variable and it resulted in an error. If you implement your code as Is it renders an error when two tokens are selected.

_________________
GETTING STARTED WITH MAPTOOLS - TUTORIALS, DOCS, VIDEOS, TOOLS, ETC

My stuff
Excel Tools: Table and Light editors
MT Tools: Bag of Tricks: Tools for Maptool, Dungeon Builder I, Dungeon Builder II,onMouseOverEvent and
DPI.
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


Top
 Profile  
 
User avatar  Offline
Deity
 
Joined: Tue Nov 10, 2009 6:11 pm
Posts: 7861
Location: Bay Area
 Post subject: Re: [STAT SHEET] Alternate View
PostPosted: Mon Mar 25, 2013 1:36 pm 
I see. Thanks for the update. I actually do like listing the selected targets better. That could be useful to determine who in a group is 30ft apart or more.

_________________
Downloads:


Top
 Profile  
 
Display posts from previous:  Sort by  
Reply to topic  [ 5 posts ] 

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:

Who is online

In total there are 2 users online :: 0 registered, 0 hidden and 2 guests (based on users active over the past 5 minutes)
Most users ever online was 243 on Sun Nov 04, 2012 6:14 am

Users browsing this forum: No registered users and 2 guests





Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group

Style based on Andreas08 by Andreas Viklund

Style by Elizabeth Shulman