RPTools.net

Discussion and Support

Skip to content

It is currently Sun Jun 25, 2017 2:05 pm 




Forum rules


PLEASE don't post images of your entire desktop, attach entire campaign files when only a single file is needed, or generally act in some other anti-social behavior. :)



Reply to topic  [ 11 posts ] 

Previous topic | Next topic 

  Print view

Author Message
User avatar  Offline
Cave Troll
 
Joined: Tue Jun 07, 2011 11:08 am
Posts: 79
Location: Canada
 Post subject: putting a formula inside a table
PostPosted: Fri Feb 03, 2017 10:06 pm 
Is it possible to put code/formula inside the value section of a table? I've looked everywhere on the forums with no luck. (maybe I was asking the wrong thing in the search bar) :?

Attachment:
Table_coding.png
Table_coding.png [ 21.36 KiB | Viewed 344 times ]


I realize the above doesn't work but is there a way to put something like "You take (1d4) dexterity damage!" but have the 1d4 calculated?

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


Top
 Profile  
 
User avatar  Offline
Demigod
 
Joined: Sun Feb 25, 2007 11:53 am
Posts: 3610
Location: MD
 Post subject: Re: putting a formula inside a table
PostPosted: Sat Feb 04, 2017 1:23 am 
Sereptus wrote:
Is it possible to put code/formula inside the value section of a table? I've looked everywhere on the forums with no luck. (maybe I was asking the wrong thing in the search bar) :?

Attachment:
Table_coding.png


I realize the above doesn't work but is there a way to put something like "You take (1d4) dexterity damage!" but have the 1d4 calculated?

Why don't you just eval the table value in the macro?

Range would be 1-52. Value would be 1d4.

Code:
[eval(table("table name", 1))]

_________________
Maptool is the Millennium Falcon of VTT's -- "She may not look like much, but she's got it where it counts."


Top
 Profile  
 
User avatar  Offline
Great Wyrm
 
Joined: Mon May 10, 2010 11:59 am
Posts: 1579
Location: Chicagoland
 Post subject: Re: putting a formula inside a table
PostPosted: Sun Feb 05, 2017 2:53 am 
I suppose he may have just wanted to double click the table for a random table result with random effect for each table entry.

But I don't believe that's possible and you will have to create a macro to do it as Full Bleed suggests.

_________________
-Jamz
____________________
Custom MapTool 1.4.x.x Fork: maptool.nerps.net
More information here: MapTool Nerps! Fork | TokenTool Nerps! Fork
Custom TokenTool (version 1.0b33): TokenTool.exe


Top
 Profile  
 
User avatar  Offline
Cave Troll
 
Joined: Tue Jun 07, 2011 11:08 am
Posts: 79
Location: Canada
 Post subject: Re: putting a formula inside a table
PostPosted: Sun Feb 05, 2017 11:41 pm 
Yes Jamz, that's what I was looking for. I suppose I'll just have to use the switch() CASE: for all the outputs if I want things calculated inside of text. Ugh! :? Thats a lot of writing for fumble and crit charts! LOL!! I'll post the macro when I find the time but for now this campaign is keeping me too busy. Thanks for the input guys! I also wanted the output of the charts in <font color=red size=+2> to make sure I wouldn't miss a fumble but haven't figured out how to do that either! :oops: Anyway! Back to the Orcs! :twisted:

P.S. Jamz, I switched over to your awesome NERPS version and am pretty impressed by certain functionality, although I have Herolab and Syrinscape I've been unable to get Herolab working at all, although I suspect it's because I'm using 5E. message me if you have any tips. :wink:

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


Top
 Profile  
 
User avatar  Offline
Demigod
 
Joined: Sun Feb 25, 2007 11:53 am
Posts: 3610
Location: MD
 Post subject: Re: putting a formula inside a table
PostPosted: Mon Feb 06, 2017 4:04 am 
Sereptus wrote:
Yes Jamz, that's what I was looking for.

You wanted to just click on the table from the table window and not use a macro for output?

Your example did not show a table that would display the output in the text you illustrated...

And why would just clicking on the table be easier/better than having a table macro? Guess I'm not seeing the problem here.

_________________
Maptool is the Millennium Falcon of VTT's -- "She may not look like much, but she's got it where it counts."


Top
 Profile  
 
User avatar  Offline
Cave Troll
 
Joined: Tue Jun 07, 2011 11:08 am
Posts: 79
Location: Canada
 Post subject: Re: putting a formula inside a table
PostPosted: Mon Feb 06, 2017 7:12 am 
Sorry Full Bleed, I wasn't being very specific or clear. I do use a macro to call crit and fumble charts that I got from a Pathfinder campaign file, I don't know who did all the work for the original charts.

Attachment:
Piercing_chart.png
Piercing_chart.png [ 147.41 KiB | Viewed 299 times ]


My output to chat currently looks like this

Attachment:
Output.png
Output.png [ 16.95 KiB | Viewed 299 times ]


I just was wondering if there was any way to have the expression evaluated when sending to chat,( GUT SLASH: Double damage and 3 bleed. Target cannot swallow whole.) also I wanted to make the text in BOLD RED for the fumble chart just to make sure I didn't miss that if I was busy looking something else up up when the player rolled. It seems this kind of functionality is not supported or maybe it is with the right coding when I call the macro?

Thanks again

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


Top
 Profile  
 
User avatar  Offline
Great Wyrm
 
Joined: Mon May 10, 2010 11:59 am
Posts: 1579
Location: Chicagoland
 Post subject: Re: putting a formula inside a table
PostPosted: Mon Feb 06, 2017 4:04 pm 
I believe you will have to grab the table value and then parse it and format it. The easiest way may be to use regular expression to find "[0-9]+d[0-9]+" to find dice expressions and eval those and then put it together and format the string. Otherwise eval will try and evaluate the whole string in the table...

_________________
-Jamz
____________________
Custom MapTool 1.4.x.x Fork: maptool.nerps.net
More information here: MapTool Nerps! Fork | TokenTool Nerps! Fork
Custom TokenTool (version 1.0b33): TokenTool.exe


Top
 Profile  
 
User avatar  Offline
Deity
 
Joined: Tue Nov 10, 2009 6:11 pm
Posts: 7731
Location: Bay Area
 Post subject: Re: putting a formula inside a table
PostPosted: Mon Feb 06, 2017 4:31 pm 
For the tables, if you surround the random values with [r: XX ] then when you get the string you can use evalMacro. I like that better than eval because if there is no code, it just returns it as a string. Basically, it looks for any [] and runs it with in the string. Also, there is no confusion as to what is code and what is not unlike with the eval function.

_________________
Downloads:


Top
 Profile  
 
User avatar  Offline
Great Wyrm
 
Joined: Mon May 10, 2010 11:59 am
Posts: 1579
Location: Chicagoland
 Post subject: Re: putting a formula inside a table
PostPosted: Mon Feb 06, 2017 4:44 pm 
Ah, forgot about evalMacro. Man, it seemed like there would have been an easy way but it wasn't coming to me either.

Alias, can you also use {1d4} instead of [r: 1d4] ? Just curious.

Edit: Tested and yea, that works perfectly!

Table Test Entry 1: Double damage and {1d4} bleed!
[r: evalMacro(table("Test", 1))]

_________________
-Jamz
____________________
Custom MapTool 1.4.x.x Fork: maptool.nerps.net
More information here: MapTool Nerps! Fork | TokenTool Nerps! Fork
Custom TokenTool (version 1.0b33): TokenTool.exe


Top
 Profile  
 
User avatar  Offline
Cave Troll
 
Joined: Tue Jun 07, 2011 11:08 am
Posts: 79
Location: Canada
 Post subject: Re: putting a formula inside a table
PostPosted: Tue Feb 07, 2017 7:20 am 
Awesome! :mrgreen: Thanks guys! Now to edit all the tables to reflect this! :roll: BTW, who wrote all those fumble/crit tables for the Pathfinder framework?
Thanks again guys!

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


Top
 Profile  
 
User avatar  Offline
Great Wyrm
 
Joined: Mon May 10, 2010 11:59 am
Posts: 1579
Location: Chicagoland
 Post subject: Re: putting a formula inside a table
PostPosted: Tue Feb 07, 2017 10:27 pm 
Sereptus wrote:
Awesome! :mrgreen: Thanks guys! Now to edit all the tables to reflect this! :roll: BTW, who wrote all those fumble/crit tables for the Pathfinder framework?
Thanks again guys!


If they are the ones I'm thinking of, they were taking from the Critial Hit/Fumble decks from paizo. They are pretty fun, we use them at our table (physical cards).

_________________
-Jamz
____________________
Custom MapTool 1.4.x.x Fork: maptool.nerps.net
More information here: MapTool Nerps! Fork | TokenTool Nerps! Fork
Custom TokenTool (version 1.0b33): TokenTool.exe


Top
 Profile  
 
Display posts from previous:  Sort by  
Reply to topic  [ 11 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 9 users online :: 1 registered, 0 hidden and 8 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: Google [Bot] and 8 guests





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

Style based on Andreas08 by Andreas Viklund

Style by Elizabeth Shulman