-
January 10th, 2015, 06:38 #1
- Join Date
- May 2014
- Location
- Sydney, Australia
- Posts
- 811
Changing map targeting scale/units and getting targeted range
Hi all,
I give up, I've searched for ages and I can't for the life of me see how this is done.
For my update to the Shadowrun ruleset, I'm not layered on CoreRPG and can target on the map and in the Combat Tracker but the range displayed on the map is simply the number of squares (e.g. 3). I'd like to to be a number of meters (e.g. 3m).
I saw that the 3.5e ruleset displays 5' for each square but I can't see where it is set up in the code.
I also need to get the range to the target when calculating the attack roll as different weapons have different ranges and all suffer penalties for medium, long and extreme range. What do I call to get the range as displayed on the map?
Thanks
Ian
-
January 10th, 2015, 10:37 #2
https://www.fantasygrounds.com/forum...2561-Map-units
How are the long white clouds?
-
January 11th, 2015, 05:25 #3
- Join Date
- May 2014
- Location
- Sydney, Australia
- Posts
- 811
That was a damned useful link there Damian, it answers part 1, thanks!
Anyone know the answer to part 2?
-
January 11th, 2015, 13:07 #4
- Join Date
- Jun 2013
- Location
- Isanti, MN
- Posts
- 2,922
-
January 11th, 2015, 14:53 #5
I'm not aware of any direct way in the API of doing this.
However, you should be able to write some code to do it:
- Use <imagecontrol>.getGridSize to return the pixel-per-square size set on the map in question.
- Use <tokeninstance>.getPosition to get the position of your source token.
- <tokeninstance>.getTargets to get a table to token instances that are targeted by your source <tokeninstance>
- Step through the token instances returned from getTargets, use <tokeninstance>.getPosition to get the position of the target token.
- Work out the difference in distance using the difference in pixels and the pixels-per-gride size returned in #1.
<tokeninstance> API info here: https://www.fantasygrounds.com/refdoc/tokeninstance.xcpPrivate Messages: My inbox is forever filling up with PMs. Please don't send me PMs unless they are actually private/personal messages. General FG questions should be asked in the forums - don't be afraid, the FG community don't bite and you're giving everyone the chance to respond and learn!
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks