RPedit - Macro Importer/Exporter and Editor [4/19/13]

These are tools and utilities that make it easier to run games. This includes Lib: macro tokens dropped into MapTool to manage the game, a conversion file for CharacterTool to allow use in MapTool, or just about anything else you can think of -- except graphics with macros and anything specific to a particular campaign framework. Those are already covered by the Tilesets subforum and the Links and External Resources forum.

Moderators: dorpond, trevor, Azhrei, giliath, Gamerdude, jay, Mr.Ice

Lee
Dragon
Posts: 958
Joined: Wed Oct 19, 2011 2:07 am

Re: RPedit - Macro Importer/Exporter and Editor [4/19/13]

Post by Lee »

I believe it's something else, specifically with eval. Drilling down to the error, I did pass by those 2 other macros you mentioned.

To isolate, I transferred in all the data retrieval calls (e.g, for indexes, macroGroups, token id etc) into selectMacroIndexes. What I'm puzzled about is that line I quoted on my previous post; it keeps throwing that prompt on all MT versions I used the isolated code on. This would certainly break execution, but with all the people using your library, it seems this problem doesn't occur. Again, just running that one line on chat will trigger the prompt, and it looks like it will trigger the prompt in any macro code that has something similar to it within.

User avatar
aliasmask
RPTools Team
Posts: 9024
Joined: Tue Nov 10, 2009 6:11 pm
Location: Bay Area

Re: RPedit - Macro Importer/Exporter and Editor [4/19/13]

Post by aliasmask »

So, what exactly are you doing when you get the error? Loading, Saving...?

Lee
Dragon
Posts: 958
Joined: Wed Oct 19, 2011 2:07 am

Re: RPedit - Macro Importer/Exporter and Editor [4/19/13]

Post by Lee »

Loading, specifically "Macro Select". Though I believe, "All Macros" utilizes the code in question as well?

User avatar
aliasmask
RPTools Team
Posts: 9024
Joined: Tue Nov 10, 2009 6:11 pm
Location: Bay Area

Re: RPedit - Macro Importer/Exporter and Editor [4/19/13]

Post by aliasmask »

Well, I don't get that error with build b89. I know I have a version that had problems with certain group names, but the way you describe the problem (ie group_1 doesn't exist). Run this code against that token (impersonate it)...

Code: Select all

[H: macroGroups = getProperty("rpe.macroGroups")]
[dialog("D"):{<pre>[R: json.indent(replace(macroGroups,"<","<"))]</pre>}
<br>
[R: encode(macroGroups)]
]
And post your results here, or PM me. Be sure to put in BB <code> tags to keep formatting.

Lee
Dragon
Posts: 958
Joined: Wed Oct 19, 2011 2:07 am

Re: RPedit - Macro Importer/Exporter and Editor [4/19/13]

Post by Lee »

Thanks A.M. I finally found the heart of the problem and got it fixed.

Edit: just to head off confusion, the problem had to do with the actual Java code and not A.M.'s RPedit.

User avatar
jckrbbt
Cave Troll
Posts: 41
Joined: Sun Jun 13, 2010 10:10 pm

Re: RPedit - Macro Importer/Exporter and Editor [4/19/13]

Post by jckrbbt »

It appears that the links to graphics and such were lost during the host migration. I was able to find the files I needed, but it's difficult with the broken image links. Not sure if this is something that needs to be fixed in each post.

This may not be the place to mention it, but it feels like it's getting more difficult to find things than it used to be. I have pages of bookmarks for files that I grab each time I make a new install. It might be easier to have a file repository instead of needing to bookmark several different forum pages with links that may be on expired file hosting sites. Perhaps a DropBox account or another free system like Google Drive? I know with all the contributors its difficult to maintain a standard, but I also know that ease-of-use is one of the biggest drawbacks to using MapTools, which is a fantastically powerful system. I've been a dedicated user for many years, and it's frustrating even for me.

User avatar
celestian
Dragon
Posts: 276
Joined: Mon May 17, 2010 3:29 pm

Re: RPedit - Macro Importer/Exporter and Editor [4/19/13]

Post by celestian »

Is there any chance you'll do a video on how/uses of RPEdit?

I've installed it and not really sure the best way/benefits of the tool are. I did a quick search on youtube but didnt get any hits.

Looks interesting but I'm confused on how it makes things easier is all. I'm guessing if I saw someone using it that I would find it more useful.

User avatar
aliasmask
RPTools Team
Posts: 9024
Joined: Tue Nov 10, 2009 6:11 pm
Location: Bay Area

Re: RPedit - Macro Importer/Exporter and Editor [4/19/13]

Post by aliasmask »

Sure, I can do that.

User avatar
Mrugnak
Dragon
Posts: 745
Joined: Mon Jul 21, 2008 7:38 pm

Re: RPedit - Macro Importer/Exporter and Editor [4/19/13]

Post by Mrugnak »

I'm having trouble finding a download link, and there's no attachments to the first two posts. Halp?

User avatar
aliasmask
RPTools Team
Posts: 9024
Joined: Tue Nov 10, 2009 6:11 pm
Location: Bay Area

Re: RPedit - Macro Importer/Exporter and Editor [4/19/13]

Post by aliasmask »


User avatar
Full Bleed
Demigod
Posts: 4736
Joined: Sun Feb 25, 2007 11:53 am
Location: FL

Re: RPedit - Macro Importer/Exporter and Editor [4/19/13]

Post by Full Bleed »

Was trying to use this recently and ran into a whole bunch of my lib tokens that throw the following error(s):
Error executing "getName": the token name or id "8302695660" is unknown.
Error executing "getName": the token name or id "7302695520" is unknown.
Error executing "getName": the token name or id "9302695720" is unknown.
Error executing "getName": the token name or id "7302695400" is unknown.
Error executing "getName": the token name or id "8302695620" is unknown.
Error executing "getName": the token name or id "7302695500" is unknown.
Error executing "getName": the token name or id "7302695440" is unknown.
Error executing "getName": the token name or id "7302695400" is unknown.
Error executing "getName": the token name or id "7302695460 "is unknown.
Etc.

I guess that this is the MT id bug... but it's affecting more than 90% of my Lib files at this point and I have to copy>paste>delete old lib files to make them usable in rpedit again. :/
Maptool is the Millennium Falcon of VTT's -- "She may not look like much, but she's got it where it counts."

User avatar
aliasmask
RPTools Team
Posts: 9024
Joined: Tue Nov 10, 2009 6:11 pm
Location: Bay Area

Re: RPedit - Macro Importer/Exporter and Editor [4/19/13]

Post by aliasmask »

I'll see if I can work around the MT bug.

edit: Here's what I came up with.

Code: Select all

<!-- mtIdBugFix(id): abort()
   id - id of token
   
   This function will replace token with a copy of itself and abort if it has a bad id
-->
[H: id = arg(0)]
[H, if(length(id) != 32), code: {
   [H: newId = copyToken(string(strformat("%032d",id)))]
   [H, if(length(newId) == 32): removeToken(string(strformat("%032d",id)))]
   [H: assert(0,"<b>Macro Aborted and token replaced with a copy<br>of itself to generate a new token id. Try again.</b>",0)]
};{}]

Token updated below to be compatible with B91 or higher.
Attachments
Starter - RPEdit B91+ 12-20-18.rptok
(217.5 KiB) Downloaded 53 times

taustinoc
Dragon
Posts: 516
Joined: Mon Aug 03, 2015 6:30 pm

Re: RPedit - Macro Importer/Exporter and Editor [4/19/13]

Post by taustinoc »

While it's probably better to use aliasmask's method of replacing the token with the bogus ID with a copy of itself, my quick and dirty workaround is to substitute an if statement for the variable containing the ID, to force it to be a string and pad it with leading zeros. Thus:

Code: Select all

[h:switchToken(id)]
becomes

Code: Select all

[h,if(isNumber(id)): switchToken(strformat("%032d", id));switchToken(id)]
(where id is the variable name).

This has always worked very reliably for me.

User avatar
aliasmask
RPTools Team
Posts: 9024
Joined: Tue Nov 10, 2009 6:11 pm
Location: Bay Area

Re: RPedit - Macro Importer/Exporter and Editor [4/19/13]

Post by aliasmask »

Good to know. I was looking to do something similar with RPEdit, but there are specific uses of id in my code where I need the value over just using switchToken. It definitely can be done, but due to this being one of my early coding endeavors and the use of id 263 times in the code I found it easier to fix the token rather than fixing my code.

taustinoc
Dragon
Posts: 516
Joined: Mon Aug 03, 2015 6:30 pm

Re: RPedit - Macro Importer/Exporter and Editor [4/19/13]

Post by taustinoc »

Yeah, I agree it's better to fix the token, but it never hurts to have a workaround. And I got to feel clever for a few minutes. :D

Hasn't this issue been addressed in newer versions? I haven't seen it in quite some time.

Post Reply

Return to “Drop-In Macro Resources”