getTokenX / Y

If you have searched the other User Creations subforums and an answer to your question has not been found, please post here!

Moderators: dorpond, trevor, Azhrei, Gamerdude

Post Reply
mattekure
Kobold
Posts: 14
Joined: Sun Jan 25, 2009 5:20 pm

getTokenX / Y

Post by mattekure »

I am having trouble getting the getTokenX and getTokenY to work at all. The testing I did was on an empty campaign file, and on the simple campaign file I created for my group.

On token macro: getTokenX() failed with error "Error in body of roll." Both the Auto Execute and Apply to selection tokens are checked.

Code: Select all

[h: myX = getTokenX()]
X = [myX]
I have also tried calling them within a Lib function that I made which also returns an error.

When the same function is in a Campaign macro, it seems to work.

I have been seeing this error with b89, and the beta 91

Any help?


mattekure
Kobold
Posts: 14
Joined: Sun Jan 25, 2009 5:20 pm

Re: getTokenX / Y

Post by mattekure »

Absolutely. Thanks for taking a look. Let me describe more fully what I am doing.

In the campaign I have 2 maps, one is the starting map, and another map for ImageTokens. On the starting map I have the token Monster. I am trying to get the tokens X & Y position to assist with the macro genEffect. The genEffect macro moves a token from the ImageToken map to the Starting Map, makes some changes to it, copies it, them moves it back to the image token map. Not a very elegant solution, but for some reason I couldnt affect the properties of the token when it was on another map.

To do this, I have the genEffect macro call a macro on the Lib token. The issue I was trying to resolve was that I wanted the copied tokens to appear next to the calling token, but to do so I need the X & Y. When trying to get that I kept getting errors. So to test it I made 3 test cases. Calling the X & Y from a macro on the token (get Position self), from the Lib token (get Position from lib) and as a campaign macro. When calling from self I get errors, when calling from the Lib I get no output or errors, when calling from the campaign macro I get the correct response.
Attachments
trollhaunt_warrens.cmpgn
(2.82 MiB) Downloaded 52 times

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

Re: getTokenX / Y

Post by wolph42 »

- campaign works
- local token works (I just dragged the campaign macro to a local token and ran it. The *other* one had 'allow players to edit macro' checked, and bc getTokenX is trusted, it won't work.)
- lib works (you used h option, which hides the result, hence no output, but it *does* work.)

so there is no issue.

my suggestion is you follow the HELP link in my sig and check out the macro tutorials!

mattekure
Kobold
Posts: 14
Joined: Sun Jan 25, 2009 5:20 pm

Re: getTokenX / Y

Post by mattekure »

:oops: Ok, I feel like an idiot. In my defense, http://lmwcs.com/rptools/wiki/getTokenX doesnt list it as a trusted macro, at least I cant see it. Maybe a note could be put there.

Thanks again for the help.


Post Reply

Return to “Requests for HELLLLP!”