From one running program to another (maptools of course)

Talk about whatever topic you'd like, RPG related or not. (But please discuss things related to our software in the Tools section, below.)

Moderators: dorpond, trevor, Azhrei

Archeic
Kobold
Posts: 22
Joined: Thu Jan 12, 2012 6:15 am

From one running program to another (maptools of course)

Post by Archeic »

Hey everyone. I've got a bit of a stumper for ya'll. Well, it's got me at least.

I've been working on an inventory system (Which is the #1 neglected tabletop hassle IMHO). It's visual, and without boasting, it's kinda rad. The functionality will eventually look like say, a diablo window.

The inventory will be open, and a master token will rest underneath the picture. It will read things, like total weight, value (of identified goods, of course) and other totals. This will get reflected on a player token, and the equipment will work this way as well. All equipment will be allocatable simply by the equipment slot on the inventory window it occupies. This will make trading for players VERY easy, as well as dickish things like stealing from party members.

Now, it's all pretty cool so far, though the code needs completion. I'm confident that I'll get it in working order more on the soon side than the never side.

But here's where the trouble comes in. All of this is super cool, but this isn't the maptools screen where the action happens! This has to be the mainmap and inventory campaign file. I can't go around tacking this onto ever campaign file, nor would I want to out of size constraints. That means that I need to have 2 maptools open simultaniously to handle the gaming needs that an inventory manager creates.

So, how do I easily import the info (such as all the loot in token form) Quickly from one running maptool to the other? I can't copy/paste, since they both have their own clipboard, it seems. I could save, then drop them, but this creates a ton of problems on it's own. (Unless.. could I write a macro that saves them into the file, then another that retrieves all tokens from the file and empties it?)

I've been working on this issue for a while, but nothing I've tried has yet overcome this challenge. It's the crux of my issue. Is there a way to merge all the clipboards of running maptools.. or..? I dunno... I'm asking here because I don't know.

User avatar
wolph42
Winter Wolph
Posts: 9999
Joined: Fri Mar 20, 2009 5:40 am
Location: Netherlands
Contact:

Re: From one running program to another (maptools of course)

Post by wolph42 »

AFAIK MT is shielded from the outside world for security reasons. (except of course the interaction with another client).
Thus: you cannot exchange any info between two standalone MT interfaces.
that said: I know that jamz has worked on some interface to retrieve basic html from the web to use it in game, this is still a one way road. I also know that one of the persons that used to help me with my framework was well on the was in creating an online token support/management tool, where you could store and retrieve tokens from the web. He however dissappeared... and as for Jamz' contact him. These two however are modification of MT core code itself which means at best that people would need to run a non-default version of MT.

Thus: the only way of dealing with this is working with a player client on the side, but that will have quite an impact on the traffic required as it doubles the number of clients per player... at least if you want to run it on a 'separate' client.

However from what I read I can't see why its an issue to have this embedded into one campaign. If you want to emulate equipment with actual tokens (as I suspect you want to) you can still do that on a e.g. 'equipment' map. That keeps track of what goes where. At worst you have one extra client open that is always on that map (which means you can't use the 'force players to current map button') that does the bookkeeping. with a remote autoexec command from other clients send to that one to do what needs to be done.

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

Re: From one running program to another (maptools of course)

Post by aliasmask »

In my delusions of grandeur I also thought of tackling a similar project and have put a lot of forethought in to it. The bulk of the "managing" part is simply just text and that really isn't a bloat on your system (1 meg for 1000 items depending on data structures). So, the crux of the problem is image management. In MT each client has its own cache of image assets to draw from and once the image is loaded the first time, then all it ever needs is the asset id from then on.

So, depending on how dynamic you want your inventory image database to be will define some of the coding aspects. One way is to have a separate campaign as you do and have all the images on one map. On another map have a lib token that scans through that map building your item database based on token name, gm name, label or properties on the token along with the image asset id. Once your indexes are built you can use that lib or have it create another token for export to other campaigns. The one token will have all the needed data, including image asset ids to display data about an item. Now create a campaign image repository which is just a zip file of all the images and their asset ids. Assuming the images are fairly small you get like a 1000 items for about 10 megs. Upload this file to web storage and include the direct link in the campaign repositories of a campaign.

So, all you need is one token to drop in to campaign and the link to the repository to add this to any campaign. To make it more dynamic, you can include a map in your current campaign as an image drop location that will add to the existing database. The lib file with the current data will have the option to build or update from map. Since those new image assets are a part of that campaign, if tokens are saved and imported to a new campaign those image assets may not work if any of the players have never loaded images before, so I would check the campaign id with getInfo and if different warn the user that some of the existing inventory items may not be compatible with new campaign. If your data structure notes which ones those are, you can problem just have them removed.

Updating core data base requires you to rebuild repository under the same name and dropping the token from there in to new campaign. For the clients, if the repository is updated from when they last loaded it, then they will download it again automatically, otherwise they will have all the assets cached from the last time.

Hope that makes sense.

Archeic
Kobold
Posts: 22
Joined: Thu Jan 12, 2012 6:15 am

Re: From one running program to another (maptools of course)

Post by Archeic »

I caught most of what you said, Aliasmask. I must say, that gives me a lot more versatility than my original idea of a long series of tables. It doesn't yet figure out the primary problem though, which is the importing/exporting of tokens on the fly to and from the inventory.

I should go ahead and come clean about something else.. It's been a top secret project of mine for a bit; but I've coded a perfectly working token grouping system. That means that no matter what size you switch a token to, (or layout size for that matter), it tethers to the group.

The ultimate goal of this is to make tokens completely modular. So, if you make a char, you choose the details... From the hair down to the shoes, and equipment added automatically adjusts to the char it's equipped to. This project isn't really an ambition so much as done, with some code cleaning needed, and further polishing.

I suppose a claim like this requires some proof, so I'll add my current file along with this post. I owe some credit to a lot of the people here on the forums, and I intend to give credit where it's due when I finish my work, (or have time to do a proper write-up. You will no doubt recognize some code snippets here and there. Wolf's been a big inspiration for a big chunk of my code, as taking his stuff apart is how I've learned to do what I do for the most part.)

For now, I am in the middle of making the pieces change in proper sequence, so, the master token that controls the skeleton, for instance.. will require no more than 3 presses per pose to get him in the proper pose. This is an easy fix, but will take time to hammer out. The point is, I've got tokens and poses down; but it means more than a single, easily defined and moved piece from one instance of maptools to the next. To use the poses on the skeleton, just click the circle around it and choose a pose. The macros below regading the neck work, but the others don't. It's an easy fix, but this is the rough version, not really meant for display.

The trouble is, in relation to my inventory screen, this becomes troublesome. If I modify the master token to a char, and attach all manner of new equipment to that char, new arms, scars, new gloves, etc.. well, to bring that token to the next screen means that I embed this info in the master token and only move it over, or I find a way to copy/paste the whole group (way, way easier, if it can be done). A lot of my items will be multi-pieced too, like magic weapons.

I am looking for a solution that helps the master plan come together, so to speak. It's got to be elegant, and preferably, automated.
Attachments
Grouptethering.cmpgn
(4.26 MiB) Downloaded 74 times

User avatar
JamzTheMan
Great Wyrm
Posts: 1872
Joined: Mon May 10, 2010 12:59 pm
Location: Chicagoland
Contact:

Re: From one running program to another (maptools of course)

Post by JamzTheMan »

As Wolf said i do have a custom jar/patch that allows external access to data via macro, although it actually is two way, you can pass data to and get data back from an URL. It does not have to be html. I pass a json array of data with name and file id to a php file that grabs a stat block from inside a hero labs portfolio stored on google drive, and another that gets text data from a google spreadsheet (which generates random magic items for stores weekly for me on a schedule).

You could send data back and forth to an online database if you wanted. But it IS a custom JAR build.
-Jamz
____________________
Custom MapTool 1.4.x.x Fork: maptool.nerps.net
Custom TokenTool 2.0 Fork: tokentool.nerps.net
More information here: MapTool Nerps! Fork

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

Re: From one running program to another (maptools of course)

Post by aliasmask »

Actually, my suggestion would work for on-the-fly, more or less. I imagine you would just drop a token on a dedicated map in that campaign. Lets say the token is called Longsword +1, GM name is Weapons and Label is 1d8+1 and you drop it on the map ~Item Library.

You would either have a macro on lib or in campaign window called update items. When clicked it will get a list of token names on the ~Item Library map, compare to master list on lib resulting in only the new items dropped (use json.difference). Then add an entry for Longsword +1 in the weapons group and give it a value of 1d8+1 damage. Now, there may/could be more data you want to add when can be done many different ways (input screen, string or string prop list in label field, manually updated properties on token... whatever. Obviously the more detail you provide for the token, the less build on the fly it will be.

Archeic
Kobold
Posts: 22
Joined: Thu Jan 12, 2012 6:15 am

Re: From one running program to another (maptools of course)

Post by Archeic »

I'm pretty interested in both methods mentioned here. Jamz, Yours seems the most pertinant to my situation, though, the need for internet is a bit limiting (I do mostly face to face gaming; maptools on a projector). But, I will examine all the methods mentioned here.

As for jar patches.. Well, that is a little intimidating. I've just mastered macros (though, I'm sure sloppily by most people's standards). If you could link me to your patch, I'd be grateful, and I suppose It'll be on me to look into how to patch.

Archeic
Kobold
Posts: 22
Joined: Thu Jan 12, 2012 6:15 am

Re: From one running program to another (maptools of course)

Post by Archeic »

Alias, do you have an example of this in action that I could see? I've got my head wrapped around most of what you're saying, because I use a method similar to this in my example file.. Basically, I have a spiral of tokens ranging from the sizes 0.1 to 3.0 (the 40 different offsets possible), and call those, and update them in order to grow or shrink an item's size without changing it's actual "size".

The trouble is, in the perfect update. I can get a crude mock up of a token, (replace it's properties, picture, sight, gm name, etc..), but I am having trouble with the finer details. I tend to accidently wipe fields due to the NULL status of the default token. I end up giving it a "", rather than NULL, which is wrecking my transposition. All the default numbers and macros in those fields go "poof", and the token is not useful any more. Attempts to fix it have not gone too well.

I imagine I would run into a similar problem with your suggested method, since they would be achieving the same end, if not through different avenues.

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

Re: From one running program to another (maptools of course)

Post by aliasmask »

Lindsay's 3.5/Pathfinder framework kind of does this for the summoning of tokens. But instead of a database, the tokens reside on a monster map. But instead of just copy one token from that map to current map, you can copy a blank token and update the properties with the data from database including image asset id.

I have a mock createToken function I use in my "libplayers" drop-in (code is in the thread). But, is that what you want to do.. create tokens from database? Or have a frame with images and info, or both?

Archeic
Kobold
Posts: 22
Joined: Thu Jan 12, 2012 6:15 am

Re: From one running program to another (maptools of course)

Post by Archeic »

Ah, Yes, I'm familiar with the 3.5 summoning macro. I've hijacked it for part of my loot generator. It's close to what I'm looking for, but not quite.

I want to summon a blank token.. well, scratch that.. order of operations here...

I want to alter a blank token elsewhere, then summon that token to the current map. (so I can bypass all the things that I can't do with the token update command)

Then I want to wipe that token clean again for future use.

The info is the key, because, best case scenario, I want to inject a current token with that info.

So, an example would be, a dresser. The dresser has an item in it. This item is represented by a json array, or several items in the array.

So, if this is a silver brush, I will click a "search" macro, which confirms that the item is found. Then it pulls the info out of the dresser, and puts it into one of my blank tokens at an appropriate offset, so that the correct physical size of the brush is represented. The json array in the dresser is amended so that the brush no longer exists within it.

Later, the thief thinks better of stealing from this room, so he puts it back in the dresser. This new macro decodes any info that the brush contains, including all properties, token macros, gm notes, player notes, etc.. then it once more amends the json array in the dresser, putting the brush into the dresser.

That's the idea there. The same info method would be used to transport an item from the inventory screen onto the battle map. Only superficial changes would exist that determine whether the item is a creature, or a body part, or a usable item, or what have you.

Archeic
Kobold
Posts: 22
Joined: Thu Jan 12, 2012 6:15 am

Re: From one running program to another (maptools of course)

Post by Archeic »

This same method would exist with monsters. So, the grouping macros that I've showcased in my previously attached campaign file..

The skeleton is made up of parts. This is overly elaborate, but I made it to stress test my idea.

Ideally, I could "zip" all the parts of a monster into a single master token. This token could be saved, and then "unzipped" on the fly. It would seek out the appropriate tokens with the offsets it needs from the library map. It would then "assemble" itself. Each part would become locked to the core token, and become a part of the monster. Each token would also have it's own stats and what have you. So.. off the top of my head, a stone golem might have severe damage to it's right arm.

Well, I need it for another map, so I hit the "zip" macro. All the parts save themselves into the master token in a special property field. They self delete too. So, there is only one token left from the golem. The arrows that players shot into him have become part of him, so those get saved too, He has an internal inventory as well, for loot or usable items, but that's not what we're talking about here.

Here, we are putting all his "parts". His head, his left arm, right arm, equipped giant stone sword, which if taken can be equipped to a player token in it's appropriate spot, legs.. each of these is a single token with it's own stats and it's own picture, which, when combined makes up the whole golem. After the "zip" occurs, those vanish, leaving only the master token, which now contains the blueprints to restore himself to his multiple parts. The token is now ready for transport.

On the new map, I drop the master token and "unzip" him.

All the parts reassemble, including the damaged arm. By making this macro, I can create all kinds of insane things. Giant battle ship made out of multiple tokens? Yeah, easy. A specific ship made of parts, including battle damage from the last fight? No prob really. A fully articulated human skeleton that can be put into any pose you wish? Yeah, that already exists. It's in my example campaign.

That's the magnitude of what I'm going for here.

But, really it's all quite simple to do, as long as I can manufacture any token from a json array. The issue so far has been to get that array from one instance of maptools to the next, and the encoding/decoding process of that array.

User avatar
wolph42
Winter Wolph
Posts: 9999
Joined: Fri Mar 20, 2009 5:40 am
Location: Netherlands
Contact:

Re: From one running program to another (maptools of course)

Post by wolph42 »

I understand what you want to do, the part however that I don't understand is why from another instance (or at least from outside MT)?
All the stuff you describe you can do *within* one instance of maptool, in the worst case you'll need to import a map in a running campaign to get it running, but it might even be limited to a single lib:token.

Archeic
Kobold
Posts: 22
Joined: Thu Jan 12, 2012 6:15 am

Re: From one running program to another (maptools of course)

Post by Archeic »

Mainly, It's the switch time.

Players are an unruly lot, and they want to covet their gems and arrange equipment.

Having a maptools open elsewhere allows them to do this mid-battle and the like. That's when they go looking for the aces up their sleeves the most. But it's also the time when switching back and forth between maps is most inconvenient.

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

Re: From one running program to another (maptools of course)

Post by aliasmask »

You can still have all that stuff, but why not do it virtually instead of creating a token for it. Having a token is nifty and all, but I imagine it may become a logistic problem. Creating monsters from a db would be a different issue than inventory.

Archeic
Kobold
Posts: 22
Joined: Thu Jan 12, 2012 6:15 am

Re: From one running program to another (maptools of course)

Post by Archeic »

I can see what you mean there, about databases, but it runs contrary to the overall.. objective (I suppose might be the word) of what I'm trying to do.

It's about customization, and creating an individual token. It becomes it's own creature, and the story moves with it. If you call it up later, it still has it's old wounds, the story you put in the gm notes.. even the arrows that got plunked into it.

If I could manage that with a table, I suppose I would. But it seems to me that I'd have to add a myriad of updates to each monster or char after generating it from the table, so I might as well just make the whole thing into a handheld token.

Post Reply

Return to “General Discussion”