RPTools.net

Discussion and Support

Skip to content

It is currently Fri Nov 24, 2017 4:23 am 




Forum rules


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



Reply to topic  [ 16 posts ]  Go to page 1, 2  Next

Previous topic | Next topic 

  Print view

Author Message
User avatar  Offline
Deity
 
Joined: Tue Nov 10, 2009 6:11 pm
Posts: 7954
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: 9420
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: 7954
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: 9420
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: 7954
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  
 
User avatar  Offline
Cave Troll
 
Joined: Tue Jun 07, 2011 11:08 am
Posts: 90
Location: Canada
 Post subject: Re: [STAT SHEET] Alternate View (update 3/25/13)
PostPosted: Thu Nov 23, 2017 12:26 pm 
I realize this is an old post but I was wondering if there was a way to reduce the number of lettering (characters) in the stat sheet output on mouse over?

I tried this in my NPC properties but it didn't work;

*@Resistance:[min(length(Resistance),30)]

Because some of the NPCs have a LOT of resistances etc. and it takes up the whole screen, also, could I not have it continue on the next line to keep the mouse over more compact and not soooo wide?

Acid, cold, fire, lightning, thunder, bludgeoning, piercing, and slashing from nonmagical weapons.

Thanks guys!

_________________
OOOHH RegEx....YOU BITTER-SWEET BEAST!!!


Top
 Profile  
 
 Offline
Kobold
 
Joined: Thu Oct 19, 2017 11:36 am
Posts: 23
 Post subject: Re: [STAT SHEET] Alternate View (update 3/25/13)
PostPosted: Thu Nov 23, 2017 12:53 pm 
Try

Code:
*@dResistance (Resistance):{substring(Resistance, 0, 30)}


Top
 Profile  
 
User avatar  Offline
Cave Troll
 
Joined: Tue Jun 07, 2011 11:08 am
Posts: 90
Location: Canada
 Post subject: Re: [STAT SHEET] Alternate View (update 3/25/13)
PostPosted: Thu Nov 23, 2017 5:25 pm 
bobifle wrote:
Try

Code:
*@dResistance (Resistance):{substring(Resistance, 0, 30)}


That did not work, had to shut down for error loop. :?

Edit- I tried inserting it without the d before *@dResistance as I thought that might be a typo. Didn't cause a crash this time but didn't work either :?

Edit- This didn't work either :? *@Resistance (Resistance):{substring(Resistance, 0,min(length(Resistance), 30))}

_________________
OOOHH RegEx....YOU BITTER-SWEET BEAST!!!


Last edited by Sereptus on Thu Nov 23, 2017 5:44 pm, edited 1 time in total.

Top
 Profile  
 
User avatar  Offline
Deity
 
Joined: Tue Nov 10, 2009 6:11 pm
Posts: 7954
Location: Bay Area
 Post subject: Re: [STAT SHEET] Alternate View (update 3/25/13)
PostPosted: Thu Nov 23, 2017 5:42 pm 
dResistance is the variable name and Resistance is the alias for the stat sheet.

_________________
Downloads:


Top
 Profile  
 
User avatar  Offline
Cave Troll
 
Joined: Tue Jun 07, 2011 11:08 am
Posts: 90
Location: Canada
 Post subject: Re: [STAT SHEET] Alternate View (update 3/25/13)
PostPosted: Thu Nov 23, 2017 5:48 pm 
aliasmask wrote:
dResistance is the variable name and Resistance is the alias for the stat sheet.


Ok, but I'm no further ahead! :P

Sorry guys, haven't spent a lot of time fleshing out the stat sheet nuances but it looks like I'm about to get a learning curve. I'll look into it further.

_________________
OOOHH RegEx....YOU BITTER-SWEET BEAST!!!


Top
 Profile  
 
User avatar  Offline
Deity
 
Joined: Tue Nov 10, 2009 6:11 pm
Posts: 7954
Location: Bay Area
 Post subject: Re: [STAT SHEET] Alternate View (update 3/25/13)
PostPosted: Thu Nov 23, 2017 8:18 pm 
Code:
*@sheet.Resistance(Resistance):[r: if(! json.isEmpty(Resistance)): substring(Resistance,0,min(length(Resistance),30)); ""]


Where "Resistance" is the string where you hold the Resistance info. I use sheet.Resistance to hold the modified version of resistance where the max length is 30 characters. If it's empty, then nothing is shown.

_________________
Downloads:


Top
 Profile  
 
User avatar  Offline
Cave Troll
 
Joined: Tue Jun 07, 2011 11:08 am
Posts: 90
Location: Canada
 Post subject: Re: [STAT SHEET] Alternate View (update 3/25/13)
PostPosted: Thu Nov 23, 2017 9:17 pm 
aliasmask wrote:
Code:
*@sheet.Resistance(Resistance):[r: if(! json.isEmpty(Resistance)): substring(Resistance,0,min(length(Resistance),30)); ""]


Where "Resistance" is the string where you hold the Resistance info. I use sheet.Resistance to hold the modified version of resistance where the max length is 30 characters. If it's empty, then nothing is shown.


Ok thanks AM, I see now, I got it working but I had to change the r: to an r, and I've also decided that 30 is a little short and will bump it to 40 or 50.

It would be interesting to know if you could "expand" the line it's written into two lines. I suppose I could change the RegEx in my importer to separate the groups I'm capturing into separate properties i.e. Resist1, Resist2 etc. Come to think of it, there's probably a lot of ways of achieving this. Hope I won't have to go back and change the 100 or so tokens I've already done! :roll:

Thanks for clearing that up for me!

_________________
OOOHH RegEx....YOU BITTER-SWEET BEAST!!!


Top
 Profile  
 
User avatar  Offline
Deity
 
Joined: Tue Nov 10, 2009 6:11 pm
Posts: 7954
Location: Bay Area
 Post subject: Re: [STAT SHEET] Alternate View (update 3/25/13)
PostPosted: Thu Nov 23, 2017 9:24 pm 
Oops, my bad. I added the if in later as a second thought and didn't change the : to a ,.

Yeah, you can add more lines. I do this in my PF framework:

Code:
*@sheet.specialA (Attacks):[r, if(SpecialATK == "NA" || SpecialATK == ""): ""; substring(SpecialATK,0,min(length(SpecialATK),50))]
*@sheet.specialA2 (A -):[r, if(SpecialATK == "NA" || SpecialATK == "" || length(SpecialATK) <= 50): ""; substring(SpecialATK,50,min(length(SpecialATK),100))]
*@sheet.specialA3 (A --):[r, if(SpecialATK == "NA" || SpecialATK == "" || length(SpecialATK) <= 100): ""; substring(SpecialATK,100,min(length(SpecialATK),150))]

_________________
Downloads:


Top
 Profile  
 
User avatar  Offline
Cave Troll
 
Joined: Tue Jun 07, 2011 11:08 am
Posts: 90
Location: Canada
 Post subject: Re: [STAT SHEET] Alternate View (update 3/25/13)
PostPosted: Thu Nov 23, 2017 10:58 pm 
I'm now assuming that Maptool property values do not like a space,

Code:
Condition Immunities:()
*@sheet.Condition Immunities (Condition Immunities):[r, if(! json.isEmpty(Condition Immunities)): substring(Condition Immunities,0,min(length(Condition Immunities),50)); ""]


This does not work. and this does...

Code:
Resistance:()
*@sheet.Resistance (Resistance):[r, if(! json.isEmpty(Resistance)): substring(Resistance,0,min(length(Resistance),50)); ""]


It just ends up showing me; [r, if(! json.isEmpty(Condition Immunities)): substring(Condition Immunities,0,min(length(Condition Immunities),50)); ""]
in the stat sheet line.

_________________
OOOHH RegEx....YOU BITTER-SWEET BEAST!!!


Top
 Profile  
 
User avatar  Offline
Deity
 
Joined: Tue Nov 10, 2009 6:11 pm
Posts: 7954
Location: Bay Area
 Post subject: Re: [STAT SHEET] Alternate View (update 3/25/13)
PostPosted: Thu Nov 23, 2017 11:14 pm 
Yes, a token property is a variable and has to follow variable naming rules if you want to reference them as such. You can make the alias name with a space though because it's only for display.

_________________
Downloads:


Top
 Profile  
 
Display posts from previous:  Sort by  
Reply to topic  [ 16 posts ]  Go to page 1, 2  Next

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 is 1 user online :: 0 registered, 0 hidden and 1 guest (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 1 guest





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

Style based on Andreas08 by Andreas Viklund

Style by Elizabeth Shulman