Page 1 of 1

[1.4.0.5] moveTokenToMap does not work properly

Posted: Thu Mar 16, 2017 6:03 am
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 :)

Re: [1.4.0.5] moveTokenToMap does not work properly

Posted: Thu Mar 16, 2017 8:50 am
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??

Re: [1.4.0.5] moveTokenToMap does not work properly

Posted: Thu Mar 16, 2017 10:41 am
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:

Re: [1.4.0.5] moveTokenToMap does not work properly

Posted: Thu Mar 16, 2017 11:45 am
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.

Re: [1.4.0.5] moveTokenToMap does not work properly

Posted: Thu Mar 16, 2017 12:41 pm
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.

Re: [1.4.0.5] moveTokenToMap does not work properly

Posted: Thu Mar 16, 2017 2:33 pm
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?

Re: [1.4.0.5] moveTokenToMap does not work properly

Posted: Thu Mar 16, 2017 3:18 pm
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".

Re: [1.4.0.5] moveTokenToMap does not work properly

Posted: Fri Mar 17, 2017 4:58 am
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?

Re: [1.4.0.5] moveTokenToMap does not work properly

Posted: Fri Mar 17, 2017 8:30 am
by wolph42
I've already reported it to the DEVs so not necessary. Thank you for the report!

Re: [1.4.0.5] moveTokenToMap does not work properly

Posted: Fri Mar 17, 2017 10:17 am
by noah
I'd like to thank wolph42 for reporting on my behalf, and everyone who responded to me :wink: