[1.4.0.5] moveTokenToMap does not work properly

Developer discussion regarding MapTool 1.4

Moderators: dorpond, trevor, Azhrei

Forum rules
Posting now open to all registered forum users.
Post Reply
User avatar
noah
Kobold
Posts: 17
Joined: Thu Mar 16, 2017 4:44 am
Location: Japan

[1.4.0.5] moveTokenToMap does not work properly

Post by noah »

I will write to the forum for the first time.
I cannot use English well, so please forgive me if I say something rude.

I'm using MapTool 1.4.0.5.
When using moveTokenToMap and setState in combination, the token moves to the designated coordinates of the current map (setState is also applied) as if using moveToken, and the token is copied to the map specified by moveTokenToMap.

Code: Select all

[h: id = currentToken()]
[h: setState("Dead", 1)]
[h: moveTokenToMap(id, "Grave", 1, 1)]
This topic suitable for writing this content?
Thank you :)

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

Re: [1.4.0.5] moveTokenToMap does not work properly

Post by wolph42 »

im sorry, but I can't deduce what is going wrong from your message.
I get that you run the given script for a token, and then what happens??

User avatar
noah
Kobold
Posts: 17
Joined: Thu Mar 16, 2017 4:44 am
Location: Japan

Re: [1.4.0.5] moveTokenToMap does not work properly

Post by noah »

In my computer environment, if you execute the above code on the selected token, the token will be moved to the Grave map, but the token will remain in the current map as well (It moves to specified coordinates on the current map.)

The reproduce method is as follows,

1. Create a new Grave map.
2. Prepare the token in another map.
3. Enter the above macro in the button on the macro panel, check "Apply to Selected Token", uncheck "Allow Players to Edit Macro" and make it executable.
4. Execute this macro for the prepared token.
5. The token becomes Dead status and moves to x1, y1 coordinates on the current map (the token does not disappear).
6. Looking at the Grave map, the token with Dead status is present at the x1, y1 coordinates.

In other words, if you use moveTokenToMap, the token is supposed to disappear from the current map and it should be moved to the specified map, but it will be present in either map.

If [h: setState ("Dead", 1)] is deleted from the above code and executed, the token does not remain in the current map and moveTokenToMap works correctly.

I am sorry I can not explain it well… :cry:

User avatar
Full Bleed
Demigod
Posts: 4736
Joined: Sun Feb 25, 2007 11:53 am
Location: FL

Re: [1.4.0.5] moveTokenToMap does not work properly

Post by Full Bleed »

wolph42 wrote:im sorry, but I can't deduce what is going wrong from your message.
I get that you run the given script for a token, and then what happens??
Just tested (on 1.4.0.2).

It moves a copy of the token to the new map *AND* moves a copy of the token to the same coordinates on the current map.


EDIT:
The problem does appear to be with using setState() in the same macro. When you remove setState() from the macro you can actually see the token flash to 1,1 on the current map (like moveToken() is executing first) before the token is sent to the new map. But *with* setState() it does not remove from the current map after "flashing" there and you end up with two copies of the token (one on each map).

I think this can go into the Bug reports forum.
Maptool is the Millennium Falcon of VTT's -- "She may not look like much, but she's got it where it counts."

User avatar
jfrazierjr
Deity
Posts: 5176
Joined: Tue Sep 11, 2007 7:31 pm

Re: [1.4.0.5] moveTokenToMap does not work properly

Post by jfrazierjr »

sounds like the same type of issue with copyToken.

For the OP, just for giggles, before the move happens, put an input and see if that changes stuff? I suspect it will. If this is the case, you will likely need to set a deferred macro to do the copy part.
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..

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

Re: [1.4.0.5] moveTokenToMap does not work properly

Post by wolph42 »

jfrazierjr wrote:sounds like the same type of issue with copyToken.

For the OP, just for giggles, before the move happens, put an input and see if that changes stuff? I suspect it will. If this is the case, you will likely need to set a deferred macro to do the copy part.
you do know that your post to the OP makes about as much sense as the OP's post did to me?

User avatar
jfrazierjr
Deity
Posts: 5176
Joined: Tue Sep 11, 2007 7:31 pm

Re: [1.4.0.5] moveTokenToMap does not work properly

Post by jfrazierjr »

wolph42 wrote:
jfrazierjr wrote:sounds like the same type of issue with copyToken.

For the OP, just for giggles, before the move happens, put an input and see if that changes stuff? I suspect it will. If this is the case, you will likely need to set a deferred macro to do the copy part.
you do know that your post to the OP makes about as much sense as the OP's post did to me?

You don't speak ignoramus? I just have tiny snippets of time to post from my phone at work and, well... I say stupid stuff with too few "steps".
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..

User avatar
noah
Kobold
Posts: 17
Joined: Thu Mar 16, 2017 4:44 am
Location: Japan

Re: [1.4.0.5] moveTokenToMap does not work properly

Post by noah »

I'm sorry for confusing you with my post.
What happened at my MT is the same as that of Full Bleed's post.

Should I post this issue in the bug report forum, including how to reproduce the problem?


User avatar
noah
Kobold
Posts: 17
Joined: Thu Mar 16, 2017 4:44 am
Location: Japan

Re: [1.4.0.5] moveTokenToMap does not work properly

Post by noah »

I'd like to thank wolph42 for reporting on my behalf, and everyone who responded to me :wink:

Post Reply

Return to “MapTool 1.4”