RPTools.net

Discussion and Support

Skip to content

It is currently Sun Nov 19, 2017 3:33 am 






Reply to topic  [ 4 posts ] 

Previous topic | Next topic 

  Print view

Author Message
 Offline
Kobold
 
Joined: Fri Jul 15, 2011 8:02 am
Posts: 2
 Post subject: Import Makro From Text Files (possibly function request?)
PostPosted: Fri Jul 15, 2011 8:19 am 
Hi there,

new to maptools and maybe there is a standard way to do this, so please appologize if this is a dumb question (I searched the forums&wiki already but couldnt find anything on the matter):

I want to be able to import makros from plain text files.

Thats all I need. So I figured: Write some sample Makros in Maptools, export them and try to deduce a sort of syntax from this.
Unfortunately when opening the exported files I only see strange symbols. So I assume, that maptools saves makros in some sort of binary code.
Is there a way to translate (aka compile?) makros into this code short of paste-copy them into the internal maptools editor?

The reason why I want to do this, you ask?
For my dnd campaign I want to create a short skript in python, that reads out the attacks including all relevant modifiers from the xml-character sheets provided by the official characterbuilder and produce makro code for them. The first part is easy (creating the makro code from the xml files). While the only option for the second part appears to be paste-copy.

Oh, and please don't tell me I should use char-tools or one of the campaign templates customized for dnd. I'm aware of this option, so don't bother telling me. I believe this feature would be useful for others as well.

Best,
Chilhelm


Top
 Profile  
 
User avatar  Offline
Demigod
 
Joined: Mon Jun 29, 2009 9:37 am
Posts: 3108
Location: Germany
 Post subject: Re: Import Makro From Text Files (possibly function request?
PostPosted: Fri Jul 15, 2011 5:16 pm 
There will not be an official maptool version anytime soon out there that supports this - if ever. The dev team sees severe security risks in handling files (and they're probably right). But you can never know what version 1.4 or 1.5 brings, but thats is long-term thinking.

So no other solution for your python hook in than somehow create some homebrew version of MT. Adding a macro function that could read or even write files would be no magic though, if you dont try to handle all potential risks -- if you do know any Java.

You should however check out the dropin RPEdit by aliasmask that lets you - like my outdated macroIO but way improved - import and export token macros to text that you can quickly copy and paste (all macros in one single pass). I'd say this is a must have at least for macro editing! So no total automated solution, but a very feasable one. And you find it in the user creation/dropins forum or if you follow the link in my sig (about my mt workings)

edit: man, third edit just to fix my stuff. I should go to bed :-P

_________________
HELP: GETTING STARTED WITH MAPTOOLS - TUTORIALS, DOCS, VIDEOS, TOOLS, ETC.

most complete list of my maptool stuff


Top
 Profile  
 
User avatar  Offline
Deity
 
Joined: Tue Sep 11, 2007 6:31 pm
Posts: 5412
 Post subject: Re: Import Makro From Text Files (possibly function request?
PostPosted: Fri Jul 15, 2011 6:35 pm 
chillhelm wrote:
The reason why I want to do this, you ask?
For my dnd campaign I want to create a short skript in python, that reads out the attacks including all relevant modifiers from the xml-character sheets provided by the official characterbuilder and produce makro code for them. The first part is easy (creating the makro code from the xml files). While the only option for the second part appears to be paste-copy.

Oh, and please don't tell me I should use char-tools or one of the campaign templates customized for dnd. I'm aware of this option, so don't bother telling me. I believe this feature would be useful for others as well.

Best,
Chilhelm


Another( and likely better long term) is to "parse" the powers down into meta data using your Python code and store this meta data as the macro.(ie, by default, it won't "do" anything since it's raw data). Then, write macros that PROCESS the data and spit out the results. Example:

Code:
Name=Foo
NumAttacks=2
Attack1Bonus=7
Attack2Bonus=2
Attack1Damage=1d8
Attack2Damage=1d6


I would suggest building that structure up as a JSON variable which you then pass to your "attack" macro as a variable input to the macro. Basically, you build the engine ONCE and then just plug data into it as needed. Granted, you may have to go back and tweak the engine when a new scenario comes along, but such should take fairly little work in "most" cases if you think ahead to start with. Most of the frameworks work in this type of manner, so you can check them out to see what I am talking about.

_________________
I save all my Campaign Files to DropBox. Not only can I access a campaign file from pretty much any OS that will run Maptool(Win,OSX, linux), but each file is versioned, so if something goes crazy wild, I can always roll back to a previous version of the same file.

Get your Dropbox 2GB via my referral link, and as a bonus, I get an extra 250 MB of space. Even if you don't don't use my link, I still enthusiastically recommend Dropbox..


Top
 Profile  
 
 Offline
Great Wyrm
 
Joined: Tue May 26, 2009 7:51 pm
Posts: 2060
Location: Philadelphia, PA
 Post subject: Re: Import Makro From Text Files (possibly function request?
PostPosted: Sat Jul 16, 2011 7:33 am 
You do know the *.mtmacro is just a zipped up XML file? As for the code to make them, go look at Jays Character Builder as he does exactly this, but with Java for Veggie's FW. You could probably see how he does it and go from there.


Top
 Profile  
 
Display posts from previous:  Sort by  
Reply to topic  [ 4 posts ] 

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