RPTools.net

Discussion and Support

Skip to content

It is currently Fri Mar 24, 2017 1:10 am 




Forum rules


Posting now open to all registered forum users.



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

Previous topic | Next topic 

  Print view

Author Message
 Offline
Giant
 
Joined: Thu Jul 28, 2011 12:06 pm
Posts: 164
 Post subject: Tables and images
PostPosted: Thu Jan 12, 2017 9:54 am 
Hi, so I was trying to programmatically change the image in a table .. and a quick search turned up this thread:

viewtopic.php?f=86&t=26612&hilit=addTableEntry

but didn't find anything there.

However, I noticed this:

setTableEntry
http://lmwcs.com/rptools/wiki/setTableEntry

Allows you to change/update the String "value" in the table .. however, it doesn't allow you to change/update the image id ?
Any reason for that?

Best I can figure, in order to update the image, I need to create a new row, and delete the old ... so:

Code:
[h: img = tableImage ( "Misc", 7 )]

[h: deleteTableEntry( "Place",10)]

[h: addTableEntry ( "Place", 10, 10, "Place 10 Alt", img ) ]


However, when I do that, the image in the table comes out as a big red "X" .. O.o
How do I change/add an entry in a table along with the image for it ?


Top
 Profile  
 
User avatar  Offline
Deity
 
Joined: Fri Mar 20, 2009 4:40 am
Posts: 9160
Location: Netherlands
 Post subject: Re: Tables and images
PostPosted: Thu Jan 12, 2017 11:11 am 
you could have better replied in jagged's thread, that way he gets a notification, now he doens't and most likely will it take longer to respond. AFAIK he's the only one who can answer your questions.

_________________
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 and onMouseOverEvent
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: 7640
Location: Bay Area
 Post subject: Re: Tables and images
PostPosted: Thu Jan 12, 2017 12:30 pm 
If the table image shows a red X, can you display the image either on a token or in chat?

I know table images have to load in to memory to be seen properly and that doesn't happen until you try to output one. So, not seeing the table image in the new table entry may just be a memory buffer thing.

_________________
Downloads:


Top
 Profile  
 
 Offline
Giant
 
Joined: Thu Jul 28, 2011 12:06 pm
Posts: 164
 Post subject: Re: Tables and images
PostPosted: Thu Jan 12, 2017 1:03 pm 
wolph42 wrote:
you could have better replied in jagged's thread, that way he gets a notification, now he doens't and most likely will it take longer to respond. AFAIK he's the only one who can answer your questions.


Oh sorry, it was an old thread, and I'm used to necro-threading being frowned upon .. so I started a new thread :(

@alias:
Yes, the image displays fine everywhere else ...

it's just after I use the addTableEntry .. :(

hmm .. yeah, so the table itself doesn't show .. but if I just "trust it" and let her rip, seems to be fine ... very odd ..
[edit] sorry, I spoke too soon, it was still displaying the old image .. the new image won't show ... :( [/edit]

So, that's the Delete row + create row.

Is there any way to update an image on a row? rather than dropping and re-creating ?


Top
 Profile  
 
User avatar  Offline
Deity
 
Joined: Tue Nov 10, 2009 6:11 pm
Posts: 7640
Location: Bay Area
 Post subject: Re: Tables and images
PostPosted: Thu Jan 12, 2017 2:36 pm 
Hmm, maybe the image asset itself isn't saved with the addTableEntry, just the asset identifier. ie the name, but not the actual image (that would be a bug). The asset should be the same if you have it in one table and move to another. Caching should take care of the rest.

_________________
Downloads:


Top
 Profile  
 
 Offline
Giant
 
Joined: Thu Jul 28, 2011 12:06 pm
Posts: 164
 Post subject: Re: Tables and images
PostPosted: Thu Jan 12, 2017 3:01 pm 
aliasmask wrote:
Hmm, maybe the image asset itself isn't saved with the addTableEntry, just the asset identifier. ie the name, but not the actual image (that would be a bug). The asset should be the same if you have it in one table and move to another. Caching should take care of the rest.


Tried a stripped down test: (following the code sample on wiki: http://lmwcs.com/rptools/wiki/addTableEntry

v1.4.0.5

Create new table (manually).
named; "test"
create rows 1, 2, 3, 4.

Create a new token, named "elf".
Use default token image for an Elf.

Create lib:Utility token.
create macro "test"
(uncheck "Allow Players to Edit Macro"


add following logic to "test":

[r: switchToken ( "elf" )]
[r:addTableEntry("test",5,5,"alf", getTokenImage())]

Checked the table: Yep, big red "X".
:(


Top
 Profile  
 
User avatar  Offline
Deity
 
Joined: Tue Nov 10, 2009 6:11 pm
Posts: 7640
Location: Bay Area
 Post subject: Re: Tables and images
PostPosted: Thu Jan 12, 2017 11:25 pm 
alf the elf?

_________________
Downloads:


Top
 Profile  
 
 Offline
Giant
 
Joined: Thu Jul 28, 2011 12:06 pm
Posts: 164
 Post subject: Re: Tables and images
PostPosted: Fri Jan 13, 2017 4:13 pm 
aliasmask wrote:
alf the elf?


hey, it's from the wiki .. *shrug* .. who am I to argue? 8)


Top
 Profile  
 
User avatar  Offline
Deity
 
Joined: Tue Nov 10, 2009 6:11 pm
Posts: 7640
Location: Bay Area
 Post subject: Re: Tables and images
PostPosted: Mon Jan 16, 2017 7:16 pm 
Fyi, I figured out the problem. Seems to be a bug. It adds "asset://" to the beginning, but when getting an image id, it already has that on the beginning so it doubles it. This is my fix.

Code:
[deleteTableEntry("players",1)]
[addTableEntry("players",1,1,"",substring(getImage("DM"),8))]


I also tried setTableImage(tableName,image) which has the same problem.
Code:
[setTableImage("players",substring(getImage("image:Unknown"),8))]

_________________
Downloads:


Top
 Profile  
 
User avatar  Offline
Demigod
 
Joined: Sun Feb 25, 2007 11:53 am
Posts: 3573
Location: MD
 Post subject: Re: Tables and images
PostPosted: Tue Jan 17, 2017 12:55 am 
aliasmask wrote:
Fyi, I figured out the problem. Seems to be a bug.

Nice catch... you should bug report it. I updated the original table macros thread on the issue (pointing back to here) and PM'd Jagged to make him aware of the issue... but you've isolated the issue and it sounds like there is pathway to fix that wouldn't require the function's creator to address.

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


Top
 Profile  
 
 Offline
Giant
 
Joined: Thu Jul 28, 2011 12:06 pm
Posts: 164
 Post subject: Re: Tables and images
PostPosted: Fri Jan 20, 2017 12:03 pm 
aliasmask wrote:
Fyi, I figured out the problem. Seems to be a bug. It adds "asset://" to the beginning, but when getting an image id, it already has that on the beginning so it doubles it. This is my fix.

Code:
[deleteTableEntry("players",1)]
[addTableEntry("players",1,1,"",substring(getImage("DM"),8))]


I also tried setTableImage(tableName,image) which has the same problem.
Code:
[setTableImage("players",substring(getImage("image:Unknown"),8))]


Sweet! I'll try that ... thanks!

:)


Top
 Profile  
 
 Offline
Giant
 
Joined: Thu Jul 28, 2011 12:06 pm
Posts: 164
 Post subject: Re: Tables and images
PostPosted: Fri Jan 20, 2017 8:46 pm 
aliasmask wrote:
I also tried setTableImage(tableName,image) which has the same problem.
Code:
[setTableImage("players",substring(getImage("image:Unknown"),8))]


hey ..wait .. what ?

setTableImage isn't on the wiki page!! :)
Cheater!! :P

What's the full syntax of that sucker ?


Top
 Profile  
 
User avatar  Offline
Deity
 
Joined: Tue Nov 10, 2009 6:11 pm
Posts: 7640
Location: Bay Area
 Post subject: Re: Tables and images
PostPosted: Fri Jan 20, 2017 10:25 pm 
I actually tried it not knowing it wasn't there. I use setTableImage(tableName,image).

_________________
Downloads:


Top
 Profile  
 
User avatar  Offline
Great Wyrm
 
Joined: Mon May 10, 2010 11:59 am
Posts: 1544
Location: Chicagoland
 Post subject: Re: Tables and images
PostPosted: Fri Jan 20, 2017 11:09 pm 
FYI: since i have the code open, looks like the current list of functions are:
Code:
"tbl", "table", "tblImage", "tableImage", "getTableNames", "getTableRoll", "setTableRoll", "clearTable", "addTableEntry", "deleteTableEntry", "createTable", "deleteTable", "getTableVisible", "setTableVisible", "getTableAccess", "setTableAccess", "getTableImage", "setTableImage", "copyTable", "setTableEntry")
(sorry, list is "as is" from code, not alphabetic)

FWIW, Looks like we have the following in the wiki:
Code:
addTableEntry
clearTable
createTable
deleteTable
deleteTableEntry
getTableAccess
getTableNames
getTableRoll
getTableVisible
setTableAccess
setTableEntry
setTableRoll
setTableVisible
table
tableImage
tbl
tblImage

_________________
-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  
 
 Offline
Giant
 
Joined: Thu Jul 28, 2011 12:06 pm
Posts: 164
 Post subject: Re: Tables and images
PostPosted: Sat Jan 21, 2017 11:45 am 
JamzTheMan wrote:
FYI: since i have the code open, looks like the current list of functions are:
Code:
"tbl", "table", "tblImage", "tableImage", "getTableNames", "getTableRoll", "setTableRoll", "clearTable", "addTableEntry", "deleteTableEntry", "createTable", "deleteTable", "getTableVisible", "setTableVisible", "getTableAccess", "setTableAccess", "getTableImage", "setTableImage", "copyTable", "setTableEntry")
(sorry, list is "as is" from code, not alphabetic)

FWIW, Looks like we have the following in the wiki:
Code:
addTableEntry
clearTable
createTable
deleteTable
deleteTableEntry
getTableAccess
getTableNames
getTableRoll
getTableVisible
setTableAccess
setTableEntry
setTableRoll
setTableVisible
table
tableImage
tbl
tblImage



Cool, so I'm not going crazy :) sweet.

however, seems that setTableImage doesn't touch images on the individual rows, it's just the 1 larger image for the full table ... :(


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





cron

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

Style based on Andreas08 by Andreas Viklund

Style by Elizabeth Shulman