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

User avatar
aliasmask
Deity
Posts: 8650
Joined: Tue Nov 10, 2009 6:11 pm
Location: Bay Area

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

Post by aliasmask »

We've had this problem in a recent game with a certain macro using 1.4.1.8. cut/paste was the general fix.

User avatar
Full Bleed
Demigod
Posts: 4553
Joined: Sun Feb 25, 2007 11:53 am
Location: MD
Contact:

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

Post by Full Bleed »

aliasmask wrote:
Thu Dec 20, 2018 3:08 am
I'll see if I can work around the MT bug.

edit: Here's what I came up with.
Thanks for the fix... unfortunately, I can't drop this token into 1.4.0.5 without it throwing an error:
rpedit token error 1405.jpg
rpedit token error 1405.jpg (46.42 KiB) Viewed 1192 times

Ultimately, I was just surprised how many of my lib token IDs were bad. I guess once they go bad they stay bad.
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
Deity
Posts: 8650
Joined: Tue Nov 10, 2009 6:11 pm
Location: Bay Area

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

Post by aliasmask »

Go ahead and download again. I saved it under b91 for compatibility.

User avatar
Full Bleed
Demigod
Posts: 4553
Joined: Sun Feb 25, 2007 11:53 am
Location: MD
Contact:

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

Post by Full Bleed »

aliasmask wrote:
Thu Dec 20, 2018 5:55 pm
Go ahead and download again. I saved it under b91 for compatibility.
So I was able to drop the new tptok file in...

But I'm still running into problems.

1) When trying to run Edit Token I get "Undefined function: am.rpe.mtIdBugFix"
2) Silly me, run the rpedit onCampaignLoad after dropping the new token...
3) Try again. No dice. Same error.
4) Look for "mtIdBugFix" function. It's not there.
5) Add the function using the code you posted above to the rpEdit lib.
6) Run rpedit onCampaignLoad again.
7) Test on busted token and get the following error:
Error executing "copyToken": the token name or id "00000000000000000000007302695320" is unknown on map "null".
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
Deity
Posts: 8650
Joined: Tue Nov 10, 2009 6:11 pm
Location: Bay Area

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

Post by aliasmask »

Okay, not sure how the function didn't make it on the token, but I fixed that.

Does the id listed match the id of the token? My worry is if the bad id looks like a hex number and strformat converts it to decimal. Another possibility is if the token is not on the token layer copyToken won't copy it without using other parameters. I don't have a "bad" token to test on, so I'm relying on your feedback.

User avatar
Full Bleed
Demigod
Posts: 4553
Joined: Sun Feb 25, 2007 11:53 am
Location: MD
Contact:

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

Post by Full Bleed »

aliasmask wrote:
Fri Dec 21, 2018 6:14 am
Okay, not sure how the function didn't make it on the token, but I fixed that.

Does the id listed match the id of the token? My worry is if the bad id looks like a hex number and strformat converts it to decimal. Another possibility is if the token is not on the token layer copyToken won't copy it without using other parameters. I don't have a "bad" token to test on, so I'm relying on your feedback.
It's not working. But it's a different error than the one I got when I created the missing function myself... back to the original error.

On a bad token I get the following error:
Error executing "getName": the token name or id "7302695320" is unknown.
Using getSelected() the ID of the token is: 0000000007302695320E000000000000

Couple other bad IDs:
0000000008302695640E000000000000
0000000007302695420E000000000000

All of the tokens are on the Token layer.
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
Deity
Posts: 8650
Joined: Tue Nov 10, 2009 6:11 pm
Location: Bay Area

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

Post by aliasmask »

Yeah, the E00... is the problem. Since it's a valid number format. It's going to remove all those ending 0's and there's no way to know how many are supposed to be there. You'll have to manually cut/paste those tokens to get a workable token id.

Merudo
Giant
Posts: 228
Joined: Wed Jun 05, 2019 7:06 am

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

Post by Merudo »

Sorry this may be a dumb question, but once I "load" the code and it shows up in Edit Token window, how do I select & copy all of it without having to scroll through the whole window?

User avatar
aliasmask
Deity
Posts: 8650
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 just use ctrl-A to select all. I think you can triple click the text as well. Then you use ctrl-c to copy.

normen
Kobold
Posts: 11
Joined: Mon Dec 28, 2020 6:57 am

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

Post by normen »

Hey, noob MapTool coder here. This is a fantastic tool, thanks a lot.

I don't know if it came up already but one thing I found a bit annoying was the ordering of the macro "headers" (@@macroName.*\[email protected]@.*) properties. In my code editor I always see the font color of a method very prominently :) May I suggest a default ordering like this in reformatMacroOutput: "tooltip,group,applyToSelected,autoExecute,playerEditable,sortBy,color,fontColor,fontSize,minWidth".

This way its easy to see what a macro does in an external editor:

Image

Thanks again for this!

P.S. I know theres backwards compatibility issues with this - I just thought I'd mention this coming from the perspective of a new user

User avatar
aliasmask
Deity
Posts: 8650
Joined: Tue Nov 10, 2009 6:11 pm
Location: Bay Area

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

Post by aliasmask »

Oh, I see. I thought you meant the order in which macros appear in full document. You're just talking about the PROPS line. Having the tooltip first makes the most sense. I've thought about removing the props line and just include it in the comments of function instead. Something like

Code: Select all

<!--- Macro: macroName(arg1,arg2|arg3);
   Tooltip: ...
-->

<!-- Your code here -->

<!-- Special Macro Ender --->
And removing the @@ @macroName completely. The trick will be in the formatting. Using <!--- (3 dashes) will signify and generate the needed options for the special header and would be compatible with putting in to the macro. The header and ender will/can post macro data to the debugger.

But those are just thoughts I have and aren't really being worked on. I'll keep your suggestion in mind if I do make some changes. It looks like you made the changes yourself for the PROPS header, so I don't need to go in to how to do it (ie change 1 or 2 lines of code).

Thanks for your input.

normen
Kobold
Posts: 11
Joined: Mon Dec 28, 2020 6:57 am

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

Post by normen »

aliasmask wrote:
Wed Jan 13, 2021 8:17 pm
Oh, I see. I thought you meant the order in which macros appear in full document. You're just talking about the PROPS line. Having the tooltip first makes the most sense. I've thought about removing the props line and just include it in the comments of function instead. Something like

Code: Select all

<!--- Macro: macroName(arg1,arg2|arg3);
   Tooltip: ...
-->

<!-- Your code here -->

<!-- Special Macro Ender --->
And removing the @@ @macroName completely. The trick will be in the formatting. Using <!--- (3 dashes) will signify and generate the needed options for the special header and would be compatible with putting in to the macro. The header and ender will/can post macro data to the debugger.

But those are just thoughts I have and aren't really being worked on. I'll keep your suggestion in mind if I do make some changes. It looks like you made the changes yourself for the PROPS header, so I don't need to go in to how to do it (ie change 1 or 2 lines of code).

Thanks for your input.
Hey, thanks for the info!

Yes, its a very simple change, really just one array string where the props are sorted. I was quite happy with it though so I thought I'd mention.

An even more advanced "proper" header as you suggest would be even better of course - but might also increase the file size (number of lines) quite a lot, no? Also I found the @@name quite practical as its easy/unique to search for.

I am just starting out and hacking in one framework, editing everything in one file, idk if thats "normal". It just seemed easiest to me as you basically get "free" code completion from just the one file itself.

Cheers!

User avatar
aliasmask
Deity
Posts: 8650
Joined: Tue Nov 10, 2009 6:11 pm
Location: Bay Area

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

Post by aliasmask »

"Lines of code" shouldn't really matter. I usually put a detailed header on most of work anyway. I would be changing one key word for another, but instead of macro: maybe I'll keep @@ since it's in the comments and it doesn't really matter other than readability. For Notepad++ the block will be changed from @@,!! to <!---,--->. That way, when sharing code, it won't confuse people and interfere with them entering a macro. I will include other new tools with RPEdit including UDFMaker and output() so sending html comments to the chat won't be an issue with stack size.

Post Reply

Return to “Drop-In Macro Resources”