Simple Auto Targeting Mode [New Lib and Video]

Threads specific to teaching (or step-by-step resources) for writing macros and scripts for use in MapTool.

Moderators: dorpond, trevor, Azhrei, giliath, Gamerdude, jay, Mr.Ice

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

Re: Simple Auto Targeting Mode [New Lib and Video]

Post by aliasmask »

Rumble wrote:No, no - those are the things I did to make it work with the specifics of my framework. Not recommendations for your basic structure.

What you created is sort of like a "plugin"; it has to be adapted to specific needs, is all, and that's what I did to make it work just like I wanted.


With the exception of 4 and 5, I think I should add that functionality anyway to make it easier to integrate/use. 4 and 5 I'll be doing separately in my own framework mod.

Yeah, it's a plug-in. And if nothing else, it'll at least show the GM who you're targeting with an attack (rather than automating everything).

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

Re: Simple Auto Targeting Mode [New Lib and Video]

Post by Full Bleed »

Looking forward to the updates, AM. This is a slick tool and I certainly want to use it. I'm looking at things from a framework independent point of view. I play Pathfinder, but back when I was looking into using Lmarkus' framework, it didn't have good documentation and seemed a little like overkill. I'm trying to balance the amount of automation in my framework against having some oldskool organics action at play.


Rumble's Dialog pop-up showing a list of targets sounds pretty interesting... Maybe you should share that bit of code, Rumble, so AM can see how it might work with what he's got planned. I don't really want a bunch of pop-ups, but if it allows you to more easily execute macros against specific targets in the list it might be worth it.


@FB: I missed your comment about how an attack macro uses the target information. One thing you need to set up is a place to store the collected targets - I just made a property called "CurrentTargetList", which holds a JSON Array of targets selected (and updates if you de-select them). Then, when the power is executed, I grab that property, and do a foreach() through the list so I can grab the proper defense, and output the target's name, my roll, and whether it beat the defense or not. I'll post some code if you like.


I'd love to see how you're doing this. Thanks.
Maptool is the Millennium Falcon of VTT's -- "She may not look like much, but she's got it where it counts."

User avatar
Rumble
Deity
Posts: 6235
Joined: Tue Jul 01, 2008 7:48 pm

Re: Simple Auto Targeting Mode [New Lib and Video]

Post by Rumble »

Full Bleed wrote:Looking forward to the updates, AM. This is a slick tool and I certainly want to use it. I'm looking at things from a framework independent point of view. I play Pathfinder, but back when I was looking into using Lmarkus' framework, it didn't have good documentation and seemed a little like overkill. I'm trying to balance the amount of automation in my framework against having some oldskool organics action at play.


Rumble's Dialog pop-up showing a list of targets sounds pretty interesting... Maybe you should share that bit of code, Rumble, so AM can see how it might work with what he's got planned. I don't really want a bunch of pop-ups, but if it allows you to more easily execute macros against specific targets in the list it might be worth it.


@FB: I missed your comment about how an attack macro uses the target information. One thing you need to set up is a place to store the collected targets - I just made a property called "CurrentTargetList", which holds a JSON Array of targets selected (and updates if you de-select them). Then, when the power is executed, I grab that property, and do a foreach() through the list so I can grab the proper defense, and output the target's name, my roll, and whether it beat the defense or not. I'll post some code if you like.


I'd love to see how you're doing this. Thanks.



No problem. I'll start a new thread for it instead of the hijack.

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

Re: Simple Auto Targeting Mode [New Lib and Video]

Post by Full Bleed »

Here are some cleaner Circular targeting states. I broke them into four versions so that the number of attacks against the target could be illustrated with the state if someone wanted to do that. It only goes to four though because it gets too crowded with more.

I made Red, Green, Blue, Yellow, Cyan, and Magenta versions.

It would probably be best to set these with at least 25% transparency.
Attachments
Circle Target Samples.png
Circle Target Samples.png (58.9 KiB) Viewed 2373 times
Circle Target States-FB.zip
(586.1 KiB) Downloaded 88 times
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: 8731
Joined: Tue Nov 10, 2009 6:11 pm
Location: Bay Area

Re: Simple Auto Targeting Mode [New Lib and Video]

Post by aliasmask »

Thanks. I wasn't going to worry about graphics until I get ready to finalize v1.0. I just used some mark states I downloaded. They weren't very big and I just deleted the white filler leaving some white specs. These look much nicer and I really like the triangle ones Rumble had demo'd.

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

Re: Simple Auto Targeting Mode [New Lib and Video]

Post by Full Bleed »

aliasmask wrote:Thanks. I wasn't going to worry about graphics until I get ready to finalize v1.0. I just used some mark states I downloaded. They weren't very big and I just deleted the white filler leaving some white specs. These look much nicer and I really like the triangle ones Rumble had demo'd.


Here are a couple of the triangle states I made.
Attachments
Triangle Target.png
Triangle Target.png (9.42 KiB) Viewed 2370 times
Triangle Target 2.png
Triangle Target 2.png (13.87 KiB) Viewed 2370 times
Maptool is the Millennium Falcon of VTT's -- "She may not look like much, but she's got it where it counts."

User avatar
Rumble
Deity
Posts: 6235
Joined: Tue Jul 01, 2008 7:48 pm

Re: Simple Auto Targeting Mode [New Lib and Video]

Post by Rumble »

Aliasmask, have you tried this in a server-client arrangement? I've been working with it and discovered that it works quite well on the server, but the mouseover is very sensitive on connected clients (targeting will flicker on and off unless you pass the mouse over the target at the right speed). Thoughts? Is that maybe just on my particular connection?

It works, but it's tough for clients to get targeting to work solidly.

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

Re: Simple Auto Targeting Mode [New Lib and Video]

Post by aliasmask »

I'll be testing that in my game today, stating in the next hour and I'll get feedback then. It's based on the stat sheet, so if there is lag with that I can see that causing a problem.

User avatar
Rumble
Deity
Posts: 6235
Joined: Tue Jul 01, 2008 7:48 pm

Re: Simple Auto Targeting Mode [New Lib and Video]

Post by Rumble »

aliasmask wrote:I'll be testing that in my game today, stating in the next hour and I'll get feedback then. It's based on the stat sheet, so if there is lag with that I can see that causing a problem.


Likewise, I hope to test it today. I think that's what's happening - the lag between client and server causes targeting to turn on, but the network speed is just enough to detect a second mouseover event before the client can get the mouse off the token, and targeting switches back off.

I'm not sure there's much to be done about it, though (although locking the targets would work - in my particular application, a link that sets a property called 'targetLocked' and prevents updates or changes would be perfectly adequate. So you might have minor trouble getting them set, but you can lock them once they are.

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

Re: Simple Auto Targeting Mode [New Lib and Video]

Post by aliasmask »

In real world use, selecting targets may be "too" easy. But I dumped it on my players with very little explanation and they got the hang of it real quick. I think my mousing around the board as GM cause more problems than anything and I'll address that in version 1.0 I'll put out next. The one thing that I did like, is the targeting getting turned on at their initiative. It tells me they know it's their turn. When I didn't see the green square, I would mention it's their init and then they would get on with their attacks.

I ran across a few oddities but I think it was related to latency and having 2 people (me and player) mousing over tokens at the same time. Resetting the Targeting fixed those problems. I'm going to focus on one player having control to prevent this. The GM will be able to steal and release control at some point though. I'm going to redo how multiple targets can be selected and I was thinking of using the onSelect event along with a dialog/frame to show Targeting control. The popup is necessary for the event to work.

But overall, I think the use of it in my game was a success. It doesn't take long to figure out the mechanics of selecting a target, but I do think some refinements will make it more intuitive and have targets selected more definitive rather than "oops, I didn't mean to mouse over that".

User avatar
Rumble
Deity
Posts: 6235
Joined: Tue Jul 01, 2008 7:48 pm

Re: Simple Auto Targeting Mode [New Lib and Video]

Post by Rumble »

Cool. I didn't get a chance to test it but I'd done some things to lock down targeting so accidental mouse-everywhere stuff probably won't happen.

Latency...well, it's a fact of life; I doubt there's anything we can do. I did implement a lock-targeting option so once they had the targets they wanted, they could lock the list so no matter what they did it wouldn't change. Some day, I may even get to test it!

newtim
Kobold
Posts: 5
Joined: Sat Oct 02, 2010 3:59 am

Re: Simple Auto Targeting Mode [New Lib and Video]

Post by newtim »

Noticed that download to campaign files and video is broken.

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

Re: Simple Auto Targeting Mode [New Lib and Video]

Post by aliasmask »

Yeah, it expired. I figured no one was downloading it anyway. Personally, after using it, it was kind of cumbersome anyway. I have another way of doing it now with mouse clicks rather than mouseover. But I still have the code if anyone wants to look at it.

notbono
Cave Troll
Posts: 61
Joined: Sun Oct 24, 2010 4:44 pm

Re: Simple Auto Targeting Mode [New Lib and Video]

Post by notbono »

aliasmask wrote:Yeah, it expired. I figured no one was downloading it anyway. Personally, after using it, it was kind of cumbersome anyway. I have another way of doing it now with mouse clicks rather than mouseover. But I still have the code if anyone wants to look at it.


How does one do it with mouse clicks? Can that be done with "Strict token ownership" flag set on server?

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

Re: Simple Auto Targeting Mode [New Lib and Video]

Post by aliasmask »

Yes, now you can. Before you couldn't click tokens you don't own. Now you can click them, but you don't have the normal access. You have to be careful though to check for ownership if you use the getSelected method of determining target. In the 3.5/Pathfinder framework, you can actually make skill rolls for NPCs because there is no check.

Post Reply

Return to “Drop-In Macros and Scripts”