RPTools.net

Discussion and Support

Skip to content

It is currently Thu May 23, 2013 3:24 pm 




Forum rules


PLEASE don't post images of your entire desktop, attach entire campaign files when only a single file is needed, or generally act in some other anti-social behavior. :)



Reply to topic  [ 97 posts ]  Go to page 1, 2, 3, 4, 5 ... 7  Next

Previous topic | Next topic 

  Print view

Author Message
User avatar  Offline
Deity
 
Joined: Tue Jul 01, 2008 6:48 pm
Posts: 6235
 Post subject: D&D 4E Line of Sight Checker (for jfrazierjr!)
PostPosted: Thu Dec 02, 2010 10:20 pm 
This post is a spin off from a thread in General Discussion regarding line of sight checking tools. I developed a line of sight tool that does a quick visual check of LOS according to the rules of 4th Edition D&D. Note that because it's so game-specific, I don't expect this to be in MapTool proper, ever. However, jfrazierjr is building a custom version, and he might like this.

So, basically, it's a new tool on the toolbar, next to the ruler. Click on the button to activate the tool. Then, click on a source token - click near the corner you want to measure LOS from. Then, click the target token, and it will draw four lines to the corners of the target token's space, and a shaded box on the target token to show the true boundaries of the token space (in the event that the token extends outside the grid square, as top-down tokens often do).

Double-click to clear the measurement. If you check LOS to one token, and then select a different token, the visual indicator will move (as expected) to the other token.

This has NO macro code, or any other effect except to draw pretty pictures on the map :D

Here's a screenshot, using top-down tokens.
Attachment:
semifinal-los-tool.png
semifinal-los-tool.png [ 251.12 KiB | Viewed 722 times ]


Here is the patch file for Eclipse:
Attachment:
rumble_lostool_patch_december2.txt [9.1 KiB]
Downloaded 25 times


And here is the telescope icon to use for the buttons (this needs to go in net/rptools/maptool/client/image/tool).
Attachment:
los-tool-blue.png
los-tool-blue.png [ 1.5 KiB | Viewed 722 times ]

_________________

What I'm Working On

MapTool Tutorials:
Introduction to Tokens
Introduction to Properties
Introduction to Macro Writing
Introduction to Light and Sight


Top
 Profile  
 
User avatar  Offline
Dragon
 
Joined: Sat Oct 11, 2008 2:37 am
Posts: 733
Location: Limoges/Guéret, France
 Post subject: Re: D&D 4E Line of Sight Checker (for jfrazierjr!)
PostPosted: Fri Dec 03, 2010 4:16 am 
* drool *

_________________
ImageImage ImageImageImage


Top
 Profile  
 
User avatar  Offline
Deity
 
Joined: Tue Jul 01, 2008 6:48 pm
Posts: 6235
 Post subject: Re: D&D 4E Line of Sight Checker (for jfrazierjr!)
PostPosted: Fri Dec 03, 2010 7:53 am 
You know the funniest part? I'm happy with the fact that this works, but I'm most happy that the little telescope icon looks pretty good! :D


One thing that might be cool to add to it is an indication of the distance between source and target - so you click to check LOS, and it also says "5 squares" or whatever. Yes...that is not an original idea. ;)

Edit: like so -
Attachment:
los-with-distance.png
los-with-distance.png [ 96.41 KiB | Viewed 698 times ]

_________________

What I'm Working On

MapTool Tutorials:
Introduction to Tokens
Introduction to Properties
Introduction to Macro Writing
Introduction to Light and Sight


Top
 Profile  
 
 Offline
Great Wyrm
 
Joined: Tue May 26, 2009 7:51 pm
Posts: 2060
Location: Philadelphia, PA
 Post subject: Re: D&D 4E Line of Sight Checker (for jfrazierjr!)
PostPosted: Fri Dec 03, 2010 8:35 am 
Can you change the colors of the lines? Sometimes white does not contrast that well with the background. This will save time as currently I draw lines on the map.


Top
 Profile  
 
User avatar  Offline
Deity
 
Joined: Tue Jul 01, 2008 6:48 pm
Posts: 6235
 Post subject: Re: D&D 4E Line of Sight Checker (for jfrazierjr!)
PostPosted: Fri Dec 03, 2010 9:19 am 
neofax wrote:
Can you change the colors of the lines? Sometimes white does not contrast that well with the background. This will save time as currently I draw lines on the map.


Nope, no color changes yet. I realize contrast is an issue - color changing is a pain to add, but another option is do to like the path line: a two-tone line to give it some contrast.

Examples:


loscontrast2.png
loscontrast2.png [ 20.04 KiB | Viewed 691 times ]
los-contrast.png
los-contrast.png [ 121.95 KiB | Viewed 691 times ]

_________________

What I'm Working On

MapTool Tutorials:
Introduction to Tokens
Introduction to Properties
Introduction to Macro Writing
Introduction to Light and Sight


Last edited by Rumble on Fri Dec 03, 2010 9:39 am, edited 1 time in total.
Top
 Profile  
 
User avatar  Offline
Deity
 
Joined: Tue Sep 11, 2007 6:31 pm
Posts: 5228
 Post subject: Re: D&D 4E Line of Sight Checker (for jfrazierjr!)
PostPosted: Fri Dec 03, 2010 9:34 am 
Would it make more sense in this context to click the TARGET first and then the source? I was thinking for checking LOS, it would be nice to be able to quickly check the same target against multiple points of the source token. ie, move the source vertex.

_________________
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  
 
User avatar  Offline
Deity
 
Joined: Tue Jul 01, 2008 6:48 pm
Posts: 6235
 Post subject: Re: D&D 4E Line of Sight Checker (for jfrazierjr!)
PostPosted: Fri Dec 03, 2010 9:41 am 
jfrazierjr wrote:
Would it make more sense in this context to click the TARGET first and then the source? I was thinking for checking LOS, it would be nice to be able to quickly check the same target against multiple points of the source token. ie, move the source vertex.


I don't know - it's certainly a good idea. It should be simple enough to reverse the process (he says, boldly).

(edit: actually, it was easy enough to do - swapped a few variables, is all). So, what do people think? Target first, then source? Or the other way around? To me, intuitively, I'd select source -> target. However, jfrazierjr has a good point about quickly checking other corners.

Other possibilities could be keyboard commands to move the origin, or a right-click to clear the thing instead of a double-click (make it easier to clear away and check again?).

_________________

What I'm Working On

MapTool Tutorials:
Introduction to Tokens
Introduction to Properties
Introduction to Macro Writing
Introduction to Light and Sight


Top
 Profile  
 
User avatar  Offline
Great Wyrm
 
Joined: Fri Apr 20, 2007 11:12 pm
Posts: 2317
Location: Albuquerque, NM
 Post subject: Re: D&D 4E Line of Sight Checker (for jfrazierjr!)
PostPosted: Fri Dec 03, 2010 11:09 am 
I haven't put together your custom build yet, but I wonder:

If ImpersonatedToken = True, Then Source = ImpersonatedToken

Then you click on a target. If no impersonated token, then it works souce->target is how I'd imagine.


Top
 Profile  
 
User avatar  Offline
Deity
 
Joined: Tue Jul 01, 2008 6:48 pm
Posts: 6235
 Post subject: Re: D&D 4E Line of Sight Checker (for jfrazierjr!)
PostPosted: Fri Dec 03, 2010 11:27 am 
Hawke wrote:
I haven't put together your custom build yet, but I wonder:

If ImpersonatedToken = True, Then Source = ImpersonatedToken

Then you click on a target. If no impersonated token, then it works souce->target is how I'd imagine.


I'm sorry, I don't follow?

Wait...okay, you mean "if there is an impersonated token, automatically do an LOS check for it?" I'm not sure I like that. There's still the question of which corner to use, for example. I'd also rather this made no assumptions about what you want to have happen - you open the tool, and then it's up to you who is looking at whom.

_________________

What I'm Working On

MapTool Tutorials:
Introduction to Tokens
Introduction to Properties
Introduction to Macro Writing
Introduction to Light and Sight


Top
 Profile  
 
User avatar  Offline
Dragon
 
Joined: Tue Feb 07, 2006 12:55 pm
Posts: 381
 Post subject: Re: D&D 4E Line of Sight Checker (for jfrazierjr!)
PostPosted: Fri Dec 03, 2010 12:16 pm 
Rumble wrote:
So, what do people think? Target first, then source? Or the other way around?

I would say source then target. Normally you know who's attacking and you're trying to find the best target.

I know you said that as this is so system specific it wouldn't go into the main Maptool build, but I would argue that this is so useful and that we do have quite a lot of D&D specific things already (token sizes, movement metric, auras, etc.) that assuming there are no bugs and it just works, what's the reason NOT to include it? I for one, would use this every session instead of drawing straight lines corner to corner with snap to grid and then undoing said lines.

EDIT - also much prefer the two colour lines.

-- AidyBaby --

_________________
D&D qualities are related inversely to those of Poker... and I love both.
http://www.yorkpoker.co.uk


Top
 Profile  
 
User avatar  Offline
Great Wyrm
 
Joined: Sat Jun 21, 2008 12:07 am
Posts: 1950
 Post subject: Re: D&D 4E Line of Sight Checker (for jfrazierjr!)
PostPosted: Fri Dec 03, 2010 12:41 pm 
Two color lines ftw.
I also noted and loved the spyglass icon right off.

As for target or source first i would vote source personally if i had to choose but both would be handy. Would it be possible to have something like the template drawing tool where you get some secondary options to the right of the tool buttons and this would let you toggle between the two?

_________________
Drop-In Utilities:
My Spell Manager for D&D3.5 and PFRPG
My Inventory Manager for D&D and PFRPG, but more generally useable than that.
My Message Manager -- My Top-Down D&D Token Images
and my Custom Initiative & Status/Spell-Effect Tracker (work in progress, but functional).


Top
 Profile  
 
User avatar  Offline
Deity
 
Joined: Tue Jul 01, 2008 6:48 pm
Posts: 6235
 Post subject: Re: D&D 4E Line of Sight Checker (for jfrazierjr!)
PostPosted: Fri Dec 03, 2010 12:44 pm 
Okay, so, a couple things:

1. I really prefer source - then - target. However, I also think that being able to quickly check other corners is appropriate! So, I made it so we can have it both ways. The process is:

a. Select the tool.
b. Select the source token (the attacker, in 4E parlance). Click near one of its corners, as usual.
c. Select the target. You'll get the LOS lines and shaded box.
d. Now, if you go back to the source and click near another corner, the LOS lines will change their origin corner.

2. I've noticed an ugly graphics flicker when I use it on my computer here at work (lunch break time!) - when you first select the tool, and try to click on a source token, the whole screen flickers once. It will then work normally, but that first token has an ugly flicker. HOWEVER, this doesn't happen on my home computer - there, there's no flicker or anything. I've discovered that there isn't a flicker if I follow these steps:

1) click the tool to activate it.
2) click on the map anywhere except on a token
3) then click the token

So there's something about component focus and it varies by computer but beyond that, I don't know - it could be a Java version thing, or a graphics driver thing, or...anything. I hope to resolve it programmatically but I'm not sure there is a solution. Any thoughts, anyone? Here's the current code:
Attachment:
rumble_lostool_december3.txt [11.01 KiB]
Downloaded 8 times


plothos wrote:
Two color lines ftw.
I also noted and loved the spyglass icon right off.

As for target or source first i would vote source personally if i had to choose but both would be handy. Would it be possible to have something like the template drawing tool where you get some secondary options to the right of the tool buttons and this would let you toggle between the two?


Actually, I was thinking about doing a tool type and then sub-tools, but the subtools would be 4E-style LOS and then just Center-to-Center LOS. I can't think of any other options beyond those (how many types of LOS are there, excluding ones that involve elevation too?). But I'm open to ideas!

_________________

What I'm Working On

MapTool Tutorials:
Introduction to Tokens
Introduction to Properties
Introduction to Macro Writing
Introduction to Light and Sight


Top
 Profile  
 
User avatar  Offline
Deity
 
Joined: Tue Sep 11, 2007 6:31 pm
Posts: 5228
 Post subject: Re: D&D 4E Line of Sight Checker (for jfrazierjr!)
PostPosted: Fri Dec 03, 2010 12:57 pm 
Rumble wrote:
a. Select the tool.
b. Select the source token (the attacker, in 4E parlance). Click near one of its corners, as usual.
c. Select the target. You'll get the LOS lines and shaded box.
d. Now, if you go back to the source and click near another corner, the LOS lines will change their origin corner.


Works for me!!... as long as you don't mind, I will also include this in my custom build along with the other items I am working on(well... once we get b77 out).

_________________
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  
 
User avatar  Offline
Deity
 
Joined: Tue Sep 11, 2007 6:31 pm
Posts: 5228
 Post subject: Re: D&D 4E Line of Sight Checker (for jfrazierjr!)
PostPosted: Fri Dec 03, 2010 1:06 pm 
Quick question(I won't have time to apply and test this until tonight or tomorrow): just glancing at your code, it appears as if the SOURCE token is using the token bounds instead of the footbrint bounds. Is that correct or am I reading this wrong(which is possible... I only did a quick glance through.)?

_________________
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  
 
User avatar  Offline
Deity
 
Joined: Tue Jul 01, 2008 6:48 pm
Posts: 6235
 Post subject: Re: D&D 4E Line of Sight Checker (for jfrazierjr!)
PostPosted: Fri Dec 03, 2010 1:08 pm 
jfrazierjr wrote:
Quick question(I won't have time to apply and test this until tonight or tomorrow): just glancing at your code, it appears as if the SOURCE token is using the token bounds instead of the footbrint bounds. Is that correct or am I reading this wrong(which is possible... I only did a quick glance through.)?


Erm. It might be. Lemme check some stuff, I may have just forgotten to do that.

Okay, after testing - both source and target have the lines go from a grid vertex to another grid vertex, not to the token bounding box. That seems to be correct. I'll have to tinker a bit, I may just be getting lucky with the "getNearestVertex()" thing. (edit: and I was. If you make a top down token so that it's way out of its grid square, you can get "invalid" corners because of the nearest vertex thing).

You can go with what I posted, I think. If you wait until tomorrow, I can polish it up - I've been playing around with it and things are in an "in-between" state at the moment. But the patch I posted should work as specified, if you add the icon and the line to ToolbarPanel.

Edit: Argh. One thing - I need to add in something to clear out the last line of sight check, otherwise it remembers it when you add a new map! Easily fixed.

_________________

What I'm Working On

MapTool Tutorials:
Introduction to Tokens
Introduction to Properties
Introduction to Macro Writing
Introduction to Light and Sight


Last edited by Rumble on Fri Dec 03, 2010 1:24 pm, edited 1 time in total.

Top
 Profile  
 
Display posts from previous:  Sort by  
Reply to topic  [ 97 posts ]  Go to page 1, 2, 3, 4, 5 ... 7  Next

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 are 3 users online :: 0 registered, 0 hidden and 3 guests (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 3 guests





Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group

Style based on Andreas08 by Andreas Viklund

Style by Elizabeth Shulman