Problem with encode(), forms and umlauten
Moderators: dorpond, trevor, Azhrei, giliath, jay, Mr.Ice
- CoveredInFish
- Demigod
- Posts: 3104
- Joined: Mon Jun 29, 2009 10:37 am
- Location: Germany
- Contact:
Re: Problem with encode(), forms and umlauten
Plus ... usually learning a new syntax isnt all that hard - and thats (mostly) all you have to do. Programming and designing a framework will work very similar. Much easier to learn a new programming language than learn programming at all. At least it always felt so for me ...
Sure your knowledge of quirks, workarounds and hacks special to MTscript will be obsolete - but while that is somewhat sad - its actually A Good Thing(tm).
Sure your knowledge of quirks, workarounds and hacks special to MTscript will be obsolete - but while that is somewhat sad - its actually A Good Thing(tm).
Re: Problem with encode(), forms and umlauten
+1booga wrote:I guess I just missed the memo .jfrazierjr wrote: Well.. you could have always stayed with just the simple macros without any complex scripting as it was around b50 or so.... It has always been know and communicated that the MTScript language was nothing more than a stop gap and would absolutely not be the long term approach for MapTool's future versions.
Well, that's no big deal. I love Maptool, I'm sure I'll keep using it in the future and promote it to my former countrymen.
and i'll most likely too retire, that is ill stick with 1.3. It serves my purpose. I will always commend on progress and i surely understand the need to go with a new parser, but for me too, just too many hours have been spend on the current script.
GETTING STARTED WITH MAPTOOLS - TUTORIALS, DOCS, VIDEOS, TOOLS, ETC
DISCORD (the new MT forum!)
My stuff
Excel Tools: Table and Light editors
MT Tools: Bag of Tricks: Tools for Maptool, Dungeon Builder I, Dungeon Builder II,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
DISCORD (the new MT forum!)
My stuff
Excel Tools: Table and Light editors
MT Tools: Bag of Tricks: Tools for Maptool, Dungeon Builder I, Dungeon Builder II,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
Re: Problem with encode(), forms and umlauten
wolph42 wrote:+1booga wrote:I guess I just missed the memo .jfrazierjr wrote: Well.. you could have always stayed with just the simple macros without any complex scripting as it was around b50 or so.... It has always been know and communicated that the MTScript language was nothing more than a stop gap and would absolutely not be the long term approach for MapTool's future versions.
Well, that's no big deal. I love Maptool, I'm sure I'll keep using it in the future and promote it to my former countrymen.
well... I did now this would happen around build 70 or so, but by then i already had spent too many hours in what i had, wasn't planning to wait a year or 2 for the new parser and had some hopes that maybe there would be a way to convert the old script to the new
if not then i'll most likely too retire, that is ill stick with 1.3. It serves my purpose. I will always commend on progress and i surely understand the need to go with a new parser, but for me too, just too many hours have been spend on the current script.
GETTING STARTED WITH MAPTOOLS - TUTORIALS, DOCS, VIDEOS, TOOLS, ETC
DISCORD (the new MT forum!)
My stuff
Excel Tools: Table and Light editors
MT Tools: Bag of Tricks: Tools for Maptool, Dungeon Builder I, Dungeon Builder II,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
DISCORD (the new MT forum!)
My stuff
Excel Tools: Table and Light editors
MT Tools: Bag of Tricks: Tools for Maptool, Dungeon Builder I, Dungeon Builder II,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
Re: Problem with encode(), forms and umlauten
Lee is working on a patch to address this lack of unicode support in MT 1.2 (my apologies if that's not the proper way to describe the symptoms of this issue). If you are using foreign characters (such as umlaut, french accens, special characters from other languages) and it is causing problems within your macros, please contact Lee my PM to provide him with specific examples of code that is causing problem.
Re: Problem with encode(), forms and umlauten
I suppose I am digging this up now too. I am writing a tool that pulls data out of hero lab to populate my tokens with properties and macros (similar to HL2MT). I have been running into issues when bringing over some of the text directly (from the character sheet) into a macro (form). It works as suggested by putting it into a property. However, I'm trying to understand, and to avoid other cases where I need to put them into properties how to properly resolve this.
Is this something I can modify in the launcher in 1.3b91 or b90? I don't see a specific setting there. Or do I have to modify the mt.cfg file? Likewise, while writing in .net and opening the file stream, I can chose an encoding method, is there one I should specify?
Finally, is there any disadvantage to keeping the character sheet in a Property and calling it from a Macro in terms of performance or filesize? Another alternative is also to use the NERPS version and save out the HTML file, and load it externally. Though, for some reason, I'm set on trying to make this all work within the standard builds.
Edit: I've since learned after digging into this a little more, my issue is actually the sequential characters "n't" is any text. So the words doesn't, wasn't, etc. cause the issue where the frame will not show. Here's a very simple example
or
Is this something I can modify in the launcher in 1.3b91 or b90? I don't see a specific setting there. Or do I have to modify the mt.cfg file? Likewise, while writing in .net and opening the file stream, I can chose an encoding method, is there one I should specify?
Finally, is there any disadvantage to keeping the character sheet in a Property and calling it from a Macro in terms of performance or filesize? Another alternative is also to use the NERPS version and save out the HTML file, and load it externally. Though, for some reason, I'm set on trying to make this all work within the standard builds.
Edit: I've since learned after digging into this a little more, my issue is actually the sequential characters "n't" is any text. So the words doesn't, wasn't, etc. cause the issue where the frame will not show. Here's a very simple example
Code: Select all
[frame("Test Frame"): {<html> <body>don't</body></html>}]
[frame("Test Frame"): {don't}]
Re: Problem with encode(), forms and umlauten
With the b91 launcher opened (haven't tried with b90, could be the same), click on the Advanced tab. There is a small line that says "advanced java parameter." That's where you'd add the UTF information for example:Is this something I can modify in the launcher in 1.3b91 or b90? I don't see a specific setting there. Or do I have to modify the mt.cfg file? Likewise, while writing in .net and opening the file stream, I can chose an encoding method, is there one I should specify?
Code: Select all
-Dfile.encoding="UTF-8"
Saving the encoded cs in a token property works very well in my experience, and save loading time on complex character sheets. The only drawback is that it makes the token size larger, which could make upload/download time longer if the connected server and players do not have a fast internet connection. The reason behing that is when there is any change on a token (state, light, movement, orientation, propety, anything really), Maptool update the whole token on all the connected clients.Finally, is there any disadvantage to keeping the character sheet in a Property and calling it from a Macro in terms of performance or filesize? Another alternative is also to use the NERPS version and save out the HTML file, and load it externally. Though, for some reason, I'm set on trying to make this all work within the standard builds.
Re: Problem with encode(), forms and umlauten
Try holding your output in a variable. One trick I use with funky raw text is to put it all in a macro and use getMacroCommand(getMacroIndexes(macroName)). Then I don't have to worry about messing with quotes or special characters to put the data in to a variable. Then use [r: output] to dump it to chat.
In your example, I would do this:
The benefit of doing it this way also saves on stack size.
In your example, I would do this:
Code: Select all
[frame("Test Frame"): {[r: "<html> <body>don't</body></html>"]}]
Downloads:
- Notepad++ MapTool addon
- RPEdit details (v1.3)
- Coding Tips: Modularity and Design
- Videos: Macro Writing Tools
Re: Problem with encode(), forms and umlauten
Thanks, for the response. Any chance you saw my edit to what was causing the issue? The n't in the body of a macro causes it to just output to the chat window and not launch a frame.
Re: Problem with encode(), forms and umlauten
Sorry, reply came in before I was finished writing mine I like the idea of storing the macro itself. I'll definitely look into that.
Re: Problem with encode(), forms and umlauten
IMO, this is a bug. The single quote shouldn't break the frame roll option, but it does. That's why the output should be put in to a statement rather than outside of one. The way the parser is looking at it is the open quote, in the statement (frame) is never closed. So, it just dumps it to the chat treating the whole thing a string.Tielc wrote:Thanks, for the response. Any chance you saw my edit to what was causing the issue? The n't in the body of a macro causes it to just output to the chat window and not launch a frame.
Downloads:
- Notepad++ MapTool addon
- RPEdit details (v1.3)
- Coding Tips: Modularity and Design
- Videos: Macro Writing Tools
Re: Problem with encode(), forms and umlauten
I'm not quite sure I get what you meant by putting it into a Macro? Like create one macro button, then call that macro button from another?aliasmask wrote:Try holding your output in a variable. One trick I use with funky raw text is to put it all in a macro and use getMacroCommand(getMacroIndexes(macroName)). Then I don't have to worry about messing with quotes or special characters to put the data in to a variable. Then use [r: output] to dump it to chat.
In your example, I would do this:The benefit of doing it this way also saves on stack size.Code: Select all
[frame("Test Frame"): {[r: "<html> <body>don't</body></html>"]}]
Also, I'm still having issues with this text, by assigning it to a variable within the macro and using [r: Output], or using [r:"I put a lot of text here"].
This is some sample code from a character sheet I am pulling out of HeroLab
Code: Select all
[frame("Thorim Stonebreaker"): {[r:"<html><body>He has a long braided brown beard, flowing from his very unkempt hair. It's as though he could care little for his outward appearance, save his beard. The scale mail he wears, bears the mark of his clan, as does his Dwarven War Axe. They were gifts from his father, when he grew out of adolescent and joined the ranks of the other Dwarfs in the Clan’s Tunnel Watch.<br/></body></html>"]}]
Re: Problem with encode(), forms and umlauten
Drop this in to your campaign to see what I'm talking about. Also, the above code when I put the getMacroIndexes inside getMacroCommand doesn't like that, so I separated those two.
The parser doesn't like the unicode single quote in the string when parsing the frame roll option.
The parser doesn't like the unicode single quote in the string when parsing the frame roll option.
View wrote:Code: Select all
[H: name = "Thorim Stonebreaker"] [H: index = getMacroIndexes(name,",")] [H: output = getMacroCommand(index)] [frame(name): {[r: output]}]
Thorim Stonebreaker wrote:Code: Select all
<html><body>He has a long braided brown beard, flowing from his very unkempt hair. It's as though he could care little for his outward appearance, save his beard. The scale mail he wears, bears the mark of his clan, as does his Dwarven War Axe. They were gifts from his father, when he grew out of adolescent and joined the ranks of the other Dwarfs in the Clan’s Tunnel Watch.<br/></body></html>
- Attachments
-
- lib.Example.rptok
- (52.07 KiB) Downloaded 37 times
Downloads:
- Notepad++ MapTool addon
- RPEdit details (v1.3)
- Coding Tips: Modularity and Design
- Videos: Macro Writing Tools
Re: Problem with encode(), forms and umlauten
I know I'm coming back to this way later in life. However, today I learned that apostrophes (') can be replaced with their html code equivalents, ie. ' (for single quote) or ’ (for apostrophe). I was putting everything in properties, but I will probably pull a lot of those now that I know this works.