Token grouping (and so much more)

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

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

Token grouping (and so much more)

Post by Archeic »

Ok maptools community; I've been working on a pet project of mine for some time, and I think it's developed enough to pass on for some further development and whatnot.

Basically, I consider token grouping to be the holy grail of maptools. No joke, it's the coolest thing ever if it gets implemented. I've piggy backed off of some folks, and reprogrammed a lot, but I'm not tech savy. I don't have any idea what "clean" code looks like. I just go for results.

So, here's my results. I've created a campaign that has perfect token grouping. Test pieces include a crossbow wielding orc, which actually shoots arrows at a location.

A lizardman mounted on a giant frog, made of multiple parts

And the Skull Walker death mech, with shooting cannons and a lightning cannon on the back. (all of which operate and function)

It has joints as well, which, while clunky now, can be written in to provide different poses.

There's also a boat in there. You can turn it using the token on the steering wheel. It can also furl and unfurl the sails, you know, for funsies.

I've already spoken with Devin Knight, and he'll be giving me some token pieces of broken humanoids broken down into their parts. This means interchangable parts!

to group tokens, you need a master token. For some reason it must face 180 degrees. Put it where you like, select all the tokens you want attached, and push the "Create Group" macro button.

That's pretty much it.. Though, the technical details get pretty in depth. I'll go into it in a later post.


Special thanks for this work in progress go to Wolph42, Kaylakaze (Who did a lot of the groundwork that I took over), and aliasmask (Who provided basically wholesale the animations I use.)

These guys are incredible, and it's mostly through interpreting their past work that I was even able to approach this project.
GroupingShowcase1.cmpgn
(3.93 MiB) Downloaded 117 times

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

Re: Token grouping (and so much more)

Post by Archeic »

And the ship.. I had to remove the cannon animations and sail furl/unfurl due to file size limitations.
GroupingShowcase2.cmpgn
(4.35 MiB) Downloaded 101 times

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

Re: Token grouping (and so much more)

Post by Archeic »

Oh! i almost forgot! To move the group, select the master token and click the "fall in" macro.

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

Re: Token grouping (and so much more)

Post by wolph42 »

Archeic wrote:Oh! i almost forgot! To move the group, select the master token and click the "fall in" macro.
And with that remark I know that you did not use my latest code concerning grouping. We're you unaware or was this a conscious choice?
With 'latest code' I mean the code in my bag of tricks concerning grouping. Here everything goes automatic so you do not need to select a master and click fall in. But I can see reasons for NOT wanting that, depending on how you want to use it.
I also perfected AM's animation trick in the bag and provided animation functions (but you still need to code it)

Anyway, I'm curious what you made of it especially the rotation part, as thats really a female dog to program and I still have issues with it. Finally I agree with you that grouping should be a core element of MT.

Thank you for your contribution, going to check it out now.

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

Re: Token grouping (and so much more)

Post by wolph42 »

ok had a look and it looks good.

Some remarks:
- You might wanna clean up the campaign panel as its rather cluttery and a LOT of the macro there give all kinds of errors.
- It also took me a while to figure out how it works, so anyone after me: on the TOKEN level there is an overlay token with a triangle (for the animation part) you can drag and point that one and it contains a couple of macros like fall in and shoot.
- I've tried to shoot an arrow by I get 'unknown macro animatemove@lib:animations error.
- the animation of the machine gun (only one is working the rest renders all kinds of errors) looks cool, however I have to warn you: animations over clients do not work or work badly. I've spend a great deal of time to 'fix' that by creating visible to owner only copies on each client and run the animation locally. This looks like crap for the gm but the players get a nice animation that *does* work. Still... sometimes there are issues with it which I suspect have to do with either java and/or mt that e.g. leaves locally animated doors behind (they should be deleted after animation). As I noticed that you are using my bot anyway (haven't checked for what exactly) I would suggest to use the animation macro from that as this has all the groundworks laid out. There is a manual which explains how the function works (like in the wiki).
- the ship fall-in macro renders an error (unknown table 'firepower')
- finally as for the group movement, I now see that the 'fall in' is a conscious choice as with the archer you want to give the choice to either shoot the arrow or fall in. To make a suggestion though, most of the time one will be moving the token and to constantly have to 'move and click macro to fall in' will become a pain, so here's a thought:
+ still use the overlay (nice idea) and have the archer and arrow on the object layer BUT
+ instead of two macros to either fall in or shoot, have one (or more) toggle(s) where you can set what should happen after you move the overlay e.g.;
o shoot weapon 1
o shoot weapon 2
o etc.
o automatically fire after movement
o automatically fall in after movement
+ these are all either checkboxex in one macro 'setup animation' or seperate macros that can be toggle on or off
+ you can still have the 'fall in' and 'shoot' macros in case the 'automatically' is turned off.
+ to automate it you 'simply' have to add some code to the onTokenMove macro on the BoT so its activated straight after the movement is done.
+ finally to keep compatibility with the BoT I suggest you get the latest version and move your specific onTokenMove code (after you get it working) to the lib:eventmacro and link it to the lib:ontokenmove (this sounds a bit cryptic but I can help you with that when you get there).

You have the rotation working for groups I noticed... and indeed just saying that the token MUST face at 180 is another way of dealing with that issue. It appears to work nicely

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

Re: Token grouping (and so much more)

Post by Archeic »

Yeah, the perfect rotation was a beast to handle. It needs a size, (small, medium, large, etc), it'll also do the layout size. That's handled on the token's "layout" property. That way you can make full use of abnormaly sized tokens..

It's all very rough as you have noted. I've been polishing this marble for about 6 months now, and I felt that the community should have it, since if you only use the grouping alone, it's a huge leap forward for us.

plus, you guys can probably see what I did and make it work way better than I can.

Post Reply

Return to “General Discussion”