RPTools.net

Discussion and Support

Skip to content

It is currently Sat Feb 24, 2018 1:19 pm 






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

Previous topic | Next topic 

  Print view

Author Message
User avatar  Offline
Deity
 
Joined: Fri Mar 20, 2009 4:40 am
Posts: 9485
Location: Netherlands
 Post subject: TABLES, everything you always wanted to do with them
PostPosted: Wed Jun 30, 2010 9:14 am 
This topic is derived from the accumulation from this topic

The last couple of days a discussion has started about some way to easily get lists into Maptool and to acces them in a friendly way. This has boosted the discussion about 'Tables' in general in MT and before you knew it the basis was created for dynamic transferable tabels with more then one column.

What I created with help of biodude is VERY rudimentary, but at least it works AND is now available in the bottom left corner.

If you view my work as a Beetle (the car) then in analogue you could say that biodude has the plans laid out to create a Hummer en aliasmask has already constructed a Ferrari, but he still needs to check the engine.

The main purpose of this function is to
1. easily store lists/tables onto a token (so you can transfer them)
2. easily access these tables to retrieve info
3. being able to create tables with more then two columns

The retrieval is no longer limited to 'list' functionality (e.g. store 100 names, click on a button and 1 name randomly pops up).
- It has now rudimentary tools for a name generator (have a look inside)
- the ability to retrieve data from a 'normal' table, that is without an index
And I've added raodan's properties editorto the campaign file so you can actually edit tables.

1. run attached campaign (in MT70) or drop the token in you existing campaign (don't forget to run oncampaignload when you do this)
2. select the Lists:Lib token (wolf)
3. run ListBuilderFrame (red button)
4. open excel file
5. copy your data from excel
6. paste them into the textbox
7. enter title of the table
8. press save
8. depending on the size it can take a while to process...
9. a frame will pop up with a json object, which confirms that the operation was succesfull
10 click the blue button, a lists of lists is given (there are a few, very bad, examples in there) select one and clik ok will produce a random outcome.

I've added more functionality. Beside an index number you can now also give a string and column number as input for the tables function. The usage is [r:Tables("nameOfTable",numberOfColumn,"nameOfRow")]. The 2nd and 3rd argument are optional. Booga's weapons tables is an example of this, I've added this table to the excelsheet and the campaign.
Note
- if you run [Tables("weapons")], that is a table without an indexnumber and without arguments, you'll get an error
- that weapons will also appear in the 'lists' macro (blue button) and selecting it will also not work.


Here's a linkto a thread where you can 'dump' your lists.

Stuff to do...: loads especially what biodude has in mind is beyond my capabilities and intention. But for now I'll work on this in collaboration with whomever wishes to join in.

I guess this is actually a 'drop in resource' but I have no clue how to start this topic over there...

Download v0.9
TablesPlus.cmpgn
TablesPlus.rptok
TablesPlus ExampleTable.zip

_________________
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


Last edited by wolph42 on Fri Jun 10, 2011 3:36 pm, edited 5 times in total.

Top
 Profile  
 
User avatar  Offline
Dragon
 
Joined: Fri Dec 14, 2007 9:00 am
Posts: 417
 Post subject: Re: TABLES, everything you always wanted to do with them
PostPosted: Fri Jul 02, 2010 10:48 am 
Very interesting !

I'm dong a bit of testing, using 1.3 b70. Following your instructions, I took the following data from excel and tried to use it with your campaign (red button, paste the data straight from Excel, selected a name and hit save).

Code:
Name   Class   Damage   Type   Range   Reload   Pen   Special   tHander   Enc
Buckler   Melee, Parrying   SB-4   I            Balanced,  Defensive,      10
Dagger   Melee, Ordinary   SB-3   R            None      10
Demilance (Cavalry Spear)   Melee, Cavalry   SB   I            Fast, Impact, Tiring      75
Flail   Melee, Flail   SB+1   I            Impact, Tiring   1   95
Foil   Melee, Fencing   SB-2   R            Fast, Precise      40
Gauntlet/Knuckle-duster   Melee, Ordinary   SB-3   I            Pummelling      1
Great Sword   Melee, Two-handed   SB   I            Impact, Slow   1   200
Great Hammer   Melee, Two-handed   SB   I            Impact, Slow   1   200
Great Axe   Melee, Two-handed   SB   I            Impact, Slow   1   200
Great Mace   Melee, Two-handed   SB   I            Impact, Slow   1   200
Great Pick   Melee, Two-handed   SB   I            Impact, Slow   1   200
Great Club   Melee, Two-handed   SB   I            Impact, Slow   1   200
Halberd   Melee, Two-handed   SB   R            Special   1   175
Sword   Melee, Ordinary   SB   R            None      50
Hammer   Melee, Ordinary   SB   R            None      50
Axe   Melee, Ordinary   SB   R            None      50
Mace   Melee, Ordinary   SB   R            None      50
Pick   Melee, Ordinary   SB   R            None      50
Club   Melee, Ordinary   SB   R            None      50
Improvised   Melee, Ordinary   SB-4   I            None      35
Lance   Melee, Cavalry   SB+1   I            Fast, Impact,  Tiring      100
Main Gauche   Melee, Parrying   SB-3   I            Balanced,  Defensive      15
Morning Star   Melee, Flail   SB   I            Impact, Tiring      60
Quarter Staff   Melee, Ordinary   SB-2   I            Defensive, Pummelling   1   50
Rapier   Melee, Fencing   SB-1   R            Fast      40
Shield   Melee, Ordinary   SB-2   I            Defensive, Special      50
Spear   Melee, Ordinary   SB   I            Fast      50



I name it WFRP, it gives me this fine looking json:

Code:
{"Buckler":{"Class":"Melee, Parrying","Damage":"SB-4","Type":"I","Range":"","Reload":"","Pen":"","Special":"Balanced, Defensive,","tHander":"","Enc":10},"Dagger":{"Class":"Melee, Ordinary","Damage":"SB-3","Type":"R","Range":"","Reload":"","Pen":"","Special":"None","tHander":"","Enc":10},"Demilance (Cavalry Spear)":{"Class":"Melee, Cavalry","Damage":"SB","Type":"I","Range":"","Reload":"","Pen":"","Special":"Fast, Impact, Tiring","tHander":"","Enc":75},"Flail":{"Class":"Melee, Flail","Damage":"SB+1","Type":"I","Range":"","Reload":"","Pen":"","Special":"Impact, Tiring","tHander":1,"Enc":95},"Foil":{"Class":"Melee, Fencing","Damage":"SB-2","Type":"R","Range":"","Reload":"","Pen":"","Special":"Fast, Precise","tHander":"","Enc":40},"Gauntlet/Knuckle-duster":{"Class":"Melee, Ordinary","Damage":"SB-3","Type":"I","Range":"","Reload":"","Pen":"","Special":"Pummelling","tHander":"","Enc":1},"Great Sword":{"Class":"Melee, Two-handed","Damage":"SB","Type":"I","Range":"","Reload":"","Pen":"","Special":"Impact, Slow","tHander":1,"Enc":200},"Great Hammer":{"Class":"Melee, Two-handed","Damage":"SB","Type":"I","Range":"","Reload":"","Pen":"","Special":"Impact, Slow","tHander":1,"Enc":200},"Great Axe":{"Class":"Melee, Two-handed","Damage":"SB","Type":"I","Range":"","Reload":"","Pen":"","Special":"Impact, Slow","tHander":1,"Enc":200},"Great Mace":{"Class":"Melee, Two-handed","Damage":"SB","Type":"I","Range":"","Reload":"","Pen":"","Special":"Impact, Slow","tHander":1,"Enc":200},"Great Pick":{"Class":"Melee, Two-handed","Damage":"SB","Type":"I","Range":"","Reload":"","Pen":"","Special":"Impact, Slow","tHander":1,"Enc":200},"Great Club":{"Class":"Melee, Two-handed","Damage":"SB","Type":"I","Range":"","Reload":"","Pen":"","Special":"Impact, Slow","tHander":1,"Enc":200},"Halberd":{"Class":"Melee, Two-handed","Damage":"SB","Type":"R","Range":"","Reload":"","Pen":"","Special":"Special","tHander":1,"Enc":175},"Sword":{"Class":"Melee, Ordinary","Damage":"SB","Type":"R","Range":"","Reload":"","Pen":"","Special":"None","tHander":"","Enc":50},"Hammer":{"Class":"Melee, Ordinary","Damage":"SB","Type":"R","Range":"","Reload":"","Pen":"","Special":"None","tHander":"","Enc":50},"Axe":{"Class":"Melee, Ordinary","Damage":"SB","Type":"R","Range":"","Reload":"","Pen":"","Special":"None","tHander":"","Enc":50},"Mace":{"Class":"Melee, Ordinary","Damage":"SB","Type":"R","Range":"","Reload":"","Pen":"","Special":"None","tHander":"","Enc":50},"Pick":{"Class":"Melee, Ordinary","Damage":"SB","Type":"R","Range":"","Reload":"","Pen":"","Special":"None","tHander":"","Enc":50},"Club":{"Class":"Melee, Ordinary","Damage":"SB","Type":"R","Range":"","Reload":"","Pen":"","Special":"None","tHander":"","Enc":50},"Improvised":{"Class":"Melee, Ordinary","Damage":"SB-4","Type":"I","Range":"","Reload":"","Pen":"","Special":"None","tHander":"","Enc":35},"Lance":{"Class":"Melee, Cavalry","Damage":"SB+1","Type":"I","Range":"","Reload":"","Pen":"","Special":"Fast, Impact, Tiring","tHander":"","Enc":100},"Main Gauche":{"Class":"Melee, Parrying","Damage":"SB-3","Type":"I","Range":"","Reload":"","Pen":"","Special":"Balanced, Defensive","tHander":"","Enc":15},"Morning Star":{"Class":"Melee, Flail","Damage":"SB","Type":"I","Range":"","Reload":"","Pen":"","Special":"Impact, Tiring","tHander":"","Enc":60},"Quarter Staff":{"Class":"Melee, Ordinary","Damage":"SB-2","Type":"I","Range":"","Reload":"","Pen":"","Special":"Defensive, Pummelling","tHander":1,"Enc":50},"Rapier":{"Class":"Melee, Fencing","Damage":"SB-1","Type":"R","Range":"","Reload":"","Pen":"","Special":"Fast","tHander":"","Enc":40},"Shield":{"Class":"Melee, Ordinary","Damage":"SB-2","Type":"I","Range":"","Reload":"","Pen":"","Special":"Defensive, Special","tHander":"","Enc":50},"Spear":{"Class":"Melee, Ordinary","Damage":"SB","Type":"I","Range":"","Reload":"","Pen":"","Special":"Fast","tHander":"","Enc":50}}


when I try to use the blue button and bit fro the newly built json I get:

macro.function.general.macro.function.number.invalid

What could I be doing wrong ? I'm attaching the excel data I used.

Also when I try to find the json created with your macro in the Lib token, I am unable to see its properties (I assue that's where the json is created right ?).

Thanks !


File comment: Excel file I used for the test
test.7z [3.79 KiB]
Downloaded 103 times
Top
 Profile  
 
User avatar  Offline
Deity
 
Joined: Fri Mar 20, 2009 4:40 am
Posts: 9485
Location: Netherlands
 Post subject: Re: TABLES, everything you always wanted to do with them
PostPosted: Sun Jul 04, 2010 5:05 pm 
i havent had time to look into it, but as soon as I do Ill let you know (and fix it if necessary)

_________________
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: Fri Mar 20, 2009 4:40 am
Posts: 9485
Location: Netherlands
 Post subject: Re: TABLES, everything you always wanted to do with them
PostPosted: Mon Jul 12, 2010 2:37 am 
booga wrote:
Very interesting !

I'm dong a bit of testing, using 1.3 b70. Following your instructions, I took the following data from excel and tried to use it with your campaign (red button, paste the data straight from Excel, selected a name and hit save).
(...)
when I try to use the blue button and bit fro the newly built json I get:

macro.function.general.macro.function.number.invalid

What could I be doing wrong ? I'm attaching the excel data I used.

Also when I try to find the json created with your macro in the Lib token, I am unable to see its properties (I assue that's where the json is created right ?).

Thanks !


Allright, I've finally have found some time to look at this and had I looked a bit better at your question I could have answered it immediately. Anyway:
1. the error: currently what this function (blue button) does is give you a random entry of a list. For this to work the list MUST start with an numeric index e.g.
1 Axe
2 Sword
3 Pike
etc.
the blue button just rolls a d[highest number in the index] and returns the entry of the second column. You can also create your own function but it will still (currently) require an index number and optionally a column number: e.g. [Tables("myTestTable",3,5)]
will look up the entry that starts with '5' in the first column and returns the value found in the 3rd column.
Basically it works exactly the same as the standard 'table' function of MT only there are more columns available. (and its easier to put stuff in). I think however that I can rewrite the function to check whether the second argument (row index number) is a string (e.g. 'Axe') and lookup that value in the table.

_________________
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: Fri Mar 20, 2009 4:40 am
Posts: 9485
Location: Netherlands
 Post subject: Re: TABLES, everything you always wanted to do with them
PostPosted: Mon Jul 12, 2010 4:07 am 
ok I've updated the function to handle none-numeric-index as well. I've added the macro 'testWeapons' based on Booga's weapons table to show how it works.

and i've added raodan's token properties editorso you can have a look how that works.

_________________
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  
 
 Offline
Cave Troll
 
Joined: Mon May 23, 2011 9:35 pm
Posts: 49
Location: Baltimore, MD
 Post subject: Re: TABLES, everything you always wanted to do with them
PostPosted: Thu Jun 09, 2011 8:51 pm 
Is this tool still in use?

I tried to make a list with it and get the following error:
Code:
java.lang.IndexOutOfBoundsException: Index: 5, Size: 5 error executing expression item = json.get( row , i ).


Top
 Profile  
 
User avatar  Offline
Deity
 
Joined: Fri Mar 20, 2009 4:40 am
Posts: 9485
Location: Netherlands
 Post subject: Re: TABLES, everything you always wanted to do with them
PostPosted: Fri Jun 10, 2011 1:54 am 
man this thing is ancient.... but yes if you use it then it must still be alive. This version should work however I've found that hardly anyone uses it (among which myself) so I stopped with it. Still Im willing to take a look, but need a bit more info than what you gave me. Can you describe what you tried to do?

_________________
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  
 
 Offline
Cave Troll
 
Joined: Mon May 23, 2011 9:35 pm
Posts: 49
Location: Baltimore, MD
 Post subject: Re: TABLES, everything you always wanted to do with them
PostPosted: Fri Jun 10, 2011 7:01 am 
Basically I received that error when trying to create a table. I added my table information from an Excel spreadsheet, gave it a name, and hit the button. then I received that error.

I am attaching the table in excel format (change it from .zip to .xlsx) that I was trying to convert in case there is an error in the table or something.


also another question for you. i know you use Json a lot and there is one thing that is irritating me with them.

Where are json arrays and objects stored?

on a token ? in a macro?

are they dynamic meaning that i have to have a macro to build them every time they are called? I know you can store some in a porperty, but I don't know how to initialize a property to accept a json array or object.


weaponList.zip [14.76 KiB]
Downloaded 120 times
Top
 Profile  
 
User avatar  Offline
Deity
 
Joined: Fri Mar 20, 2009 4:40 am
Posts: 9485
Location: Netherlands
 Post subject: Re: TABLES, everything you always wanted to do with them
PostPosted: Fri Jun 10, 2011 7:38 am 
you're right, there is a bug. It seems that it has been always there as I don't receive an error report (no clue why) however wading through the log I noticed it. Ill have a look later and upload a fix.

The json objects are stored on the lib:token (the wolf), using the Wiki: setLibProperty() and the Wiki: getLibProperty() function. You can also initialize properties by defining them in the campaign properties. Then you can access them by just selecting the token and using e.g.
[h:Strength = 5]
[r:Strength]
(Strength is defined by default on the token properties set)

Since I don't know which names you are going to use up front I can't define them up front.
For normal tokens you use Wiki: setProperty() and Wiki: getProperty()

_________________
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  
 
 Offline
Cave Troll
 
Joined: Mon May 23, 2011 9:35 pm
Posts: 49
Location: Baltimore, MD
 Post subject: Re: TABLES, everything you always wanted to do with them
PostPosted: Fri Jun 10, 2011 9:03 am 
Thank you, I look forward to seeing the new fix.


Top
 Profile  
 
User avatar  Offline
Deity
 
Joined: Fri Mar 20, 2009 4:40 am
Posts: 9485
Location: Netherlands
 Post subject: Re: TABLES, everything you always wanted to do with them
PostPosted: Fri Jun 10, 2011 3:36 pm 
ok fixed the bug. It seems that if you end a row with empty columns they aren't changed into cells, which I expected it would. Fixed this.

_________________
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  
 
 Offline
Cave Troll
 
Joined: Mon May 23, 2011 9:35 pm
Posts: 49
Location: Baltimore, MD
 Post subject: Re: TABLES, everything you always wanted to do with them
PostPosted: Fri Jun 10, 2011 3:56 pm 
Excellent, so do I just redownload the files at the top again?


Top
 Profile  
 
User avatar  Offline
Deity
 
Joined: Fri Mar 20, 2009 4:40 am
Posts: 9485
Location: Netherlands
 Post subject: Re: TABLES, everything you always wanted to do with them
PostPosted: Fri Jun 10, 2011 4:13 pm 
Yup

_________________
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  
 
 Offline
Cave Troll
 
Joined: Mon May 23, 2011 9:35 pm
Posts: 49
Location: Baltimore, MD
 Post subject: Re: TABLES, everything you always wanted to do with them
PostPosted: Fri Jun 10, 2011 7:19 pm 
Just got home and wanted to give this a try, now I am getting the error:

Code:
java.lang.IndexOutOfBoundsException: Index: 6, Size: 6 error executing expression item = json.get( row , i ).


Disregard this,

I got it to work.

Thanks a bunch.


Top
 Profile  
 
 Offline
Cave Troll
 
Joined: Thu Dec 25, 2008 8:47 am
Posts: 40
 Post subject: Re: TABLES, everything you always wanted to do with them
PostPosted: Mon Jun 27, 2011 9:04 am 
A very basic question about tables I have edited with the maptool basic Table Editor... how do you hide the result from the players?

Thnx
Byez


Top
 Profile  
 
Display posts from previous:  Sort by  
Reply to topic  [ 23 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