Get map (cursor) coordinates?

Thoughts, Help, Feature Requests, Bug Reports, Developing code for...

Moderators: dorpond, trevor, Azhrei

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. :)
Post Reply
Nertht
Kobold
Posts: 23
Joined: Sun Jul 27, 2014 3:46 am

Get map (cursor) coordinates?

Post by Nertht »

I´d like to make on click based moving. But in that case I need current cursor coordinates. There are two numbers(XY), in right bottom corner of MT called Map Coordinates. Thats exactly what I need. Is it posible to get them in Macro? I didnt find any expresion in wiki function list. And any topic about it.
Thanks a lot - Petr.
Image

User avatar
aliasmask
RPTools Team
Posts: 9031
Joined: Tue Nov 10, 2009 6:11 pm
Location: California

Re: Get map (cursor) coordinates?

Post by aliasmask »

There is no event in the macro language to get the cursor location by clicking the map. The only way it can be done is if you click a token and get the token's location.

Nertht
Kobold
Posts: 23
Joined: Sun Jul 27, 2014 3:46 am

Re: Get map (cursor) coordinates?

Post by Nertht »

Oh, well. Thanks for instant replay.

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

Re: Get map (cursor) coordinates?

Post by wolph42 »

What is it you want to achieve. Cause I have recently developed a story of click based method that sends the coords back. But it had its drawbacks

Nertht
Kobold
Posts: 23
Joined: Sun Jul 27, 2014 3:46 am

Re: Get map (cursor) coordinates?

Post by Nertht »

Move current token to actual click. It should be used like substitute of moving while player movement is locked (moving pad with arrows is a little bit clumsy for my purpose). Heroes can´t move more than 5 cells/round. So I´ll probably try to make array of tokens in conic vision of token, ended of 5 (max 35 tokens). These tokens will partly transparent, and will look like grind. After chosing one of these toknes will hero change location, and "grind tokens" will be destroyed.

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

Re: Get map (cursor) coordinates?

Post by wolph42 »

ok there are two things that you can do:
1. you can create a layer of transparent tokens on the grid. When you select such token then that coord can be grabbed and the player token is moved there. In this case I would move the players tokens to the object layer so they cant intereact, they can only click on the transparent token grid. Check out my bag of tricks vid about swift map creation (last vid, link in sig) to get an idea.
2. you can use onTokenMove event. with that even you can reset an illegal move and you can check the distance travelled. In addition you can add macros to activate when a certain (legal) move has been committed. It would still require dragging and dropping tokens, but i gets the job done.

Nertht
Kobold
Posts: 23
Joined: Sun Jul 27, 2014 3:46 am

Re: Get map (cursor) coordinates?

Post by Nertht »

Okay, first option sound best. But what about mass of transparetn tokens? In map, for example, 300x300 cells it is about 90 000 tokens. Is MT still usable in this case?

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

Re: Get map (cursor) coordinates?

Post by wolph42 »

Nertht wrote:Okay, first option sound best. But what about mass of transparetn tokens? In map, for example, 300x300 cells it is about 90 000 tokens. Is MT still usable in this case?
thats an interesting question. I'm inclined to say: yes. I've created area of much much larger scale and then used them for macro and it was insanely swift. This is different true, BUT
1. its only one token of <10 bytes large so memory wise its nothing. And maptool only saves the one to memory whether its one or one million
2. you also do not cycle through them but you use the onSelection event which is triggered by selecting one token.
be careful though that the select and impersonation panel are NOT open when you remove the tokens cause it refreshes those panels after EACH deletion which might take a couple of hours!!

in the end though the proof is in the pudding. But you can use the bag of tricks and create such a field on a clean map to see the impact. Should take you a few minutes to test. Note that the tokens I used for the field editor are semi transparent, you might want to use full transparent tokens.

Nertht
Kobold
Posts: 23
Joined: Sun Jul 27, 2014 3:46 am

Re: Get map (cursor) coordinates?

Post by Nertht »

Wow, thanks a lot for your answers. These informations are really significant to me. This is pretty cool.


Post Reply

Return to “MapTool”