RPTools.net
http://forums.rptools.net/

[1.4.0.5] moveTokenToMap does not work properly
http://forums.rptools.net/viewtopic.php?f=86&t=27126
Page 1 of 1

Author:  noah [ Thu Mar 16, 2017 5:03 am ]
Post subject:  [1.4.0.5] moveTokenToMap does not work properly

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:
[h: id = currentToken()]
[h: setState("Dead", 1)]
[h: moveTokenToMap(id, "Grave", 1, 1)]


This topic suitable for writing this content?
Thank you :)

Author:  wolph42 [ Thu Mar 16, 2017 7:50 am ]
Post subject:  Re: [1.4.0.5] moveTokenToMap does not work properly

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??

Author:  noah [ Thu Mar 16, 2017 9:41 am ]
Post subject:  Re: [1.4.0.5] moveTokenToMap does not work properly

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:

Author:  Full Bleed [ Thu Mar 16, 2017 10:45 am ]
Post subject:  Re: [1.4.0.5] moveTokenToMap does not work properly

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.

Author:  jfrazierjr [ Thu Mar 16, 2017 11:41 am ]
Post subject:  Re: [1.4.0.5] moveTokenToMap does not work properly

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.

Author:  wolph42 [ Thu Mar 16, 2017 1:33 pm ]
Post subject:  Re: [1.4.0.5] moveTokenToMap does not work properly

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?

Author:  jfrazierjr [ Thu Mar 16, 2017 2:18 pm ]
Post subject:  Re: [1.4.0.5] moveTokenToMap does not work properly

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".

Author:  noah [ Fri Mar 17, 2017 3:58 am ]
Post subject:  Re: [1.4.0.5] moveTokenToMap does not work properly

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?

Author:  wolph42 [ Fri Mar 17, 2017 7:30 am ]
Post subject:  Re: [1.4.0.5] moveTokenToMap does not work properly

I've already reported it to the DEVs so not necessary. Thank you for the report!

Author:  noah [ Fri Mar 17, 2017 9:17 am ]
Post subject:  Re: [1.4.0.5] moveTokenToMap does not work properly

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

Page 1 of 1 All times are UTC - 6 hours [ DST ]
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/