Multiple vision types on token

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
Adurna
Cave Troll
Posts: 34
Joined: Thu Jul 07, 2016 7:45 am

Multiple vision types on token

Post by Adurna »

Hi!

Is it possible to apply multiple vision types on a token at once?

Like having simultaneously cone and circle vision on a token?


I'm asking because my group has decided that the standard options we're using are a bit too stringent for our liking. So we wanted to change them, but then either we're using cone and everyone always has to move the facing, or we're using a circle which is a bit too much since it allows us to see 360°.

So the solution I proposed was to see if it was possible to create a vision type with a large cone and a smaller circle. Allowing the tokens to see farther in the direction they're facing but also keeping a bit of sight in the back.

However, I can't seem to make it work. Is it at all possible? And if not, are there some workarounds to achieve something similar?

MandyRae
Cave Troll
Posts: 53
Joined: Sat Mar 12, 2016 11:39 am

Re: Multiple vision types on token

Post by MandyRae »

There can only be one active form of vision for any given token at a time. You might be able to get a work around with a "clear" token - one that has no image and completely transparent - and give it the second vision type, stack it on/under another token, and move them together . . .

Adurna
Cave Troll
Posts: 34
Joined: Thu Jul 07, 2016 7:45 am

Re: Multiple vision types on token

Post by Adurna »

Thanks, that's not the solution I'd hoped for tho :(

Unless there is a way to stick two tokens toghether? I.e. moving one moves the other as well? It would be a bit cumbersome to remember each time to move both, especially if on'es nigh invisible and you forget about it :P

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

Re: Multiple vision types on token

Post by wolph42 »

yeah there is, you can create a macro onTokenMove on a lib:whatever token. that macro will be activated everytime you move a token. It will be easy to e.g. have a token
"John The Slayer" and then another blank token "John The Slayer Vision" and do that for all palyer tokens.
http://lmwcs.com/rptools/wiki/Guide_to_onTokenMove

Adurna
Cave Troll
Posts: 34
Joined: Thu Jul 07, 2016 7:45 am

Re: Multiple vision types on token

Post by Adurna »

Awesome! That looks a bit more complex than what I'm used to doing with maptool. I'll try, but I'll probably need some help along the way :P

Thanks!

Edit: ok, as I expected.

I created a library token with the onTokenMove macro. I have two tokens: PC1 and PC1Vision. I extracted their id and tried the movetoken macro on the lib token.

Code: Select all

[h: CurrentX = getTokenX(0, 00000000E58412195734000000000000)]
[h: CurrentY = getTokenY(0, 00000000E58412195734000000000000)]


[h: moveToken(CurrentX, CurrentY, 0, 00000000C7E1EB2BFC1D000000000000)]
The first ids are PC1's while the second is Pc1Vision's. But I'm getting:

Code: Select all

Error running onTokenMove on Lib:MoveVision : Invalid number of parameters 1, expected exactly 2 parameter(s)
So I tried to remove the first id, after all it should default to the current token and might be redundant. But then I get:

Code: Select all

Error running onTokenMove on Lib:MoveVision : java.lang.NullPointerException errore nell'esecuzione dell'espressione moveToken(CurrentX, CurrentY, 0, 00000000C7E1EB2BFC1D000000000000).
I think I'm stuck.

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

Re: Multiple vision types on token

Post by wolph42 »

i would suggest first that you use the token names and not rhe ids. seoncd the issue you have is thatv the 'names ' mus be quoted (or the ids) thats why its not working

Adurna
Cave Troll
Posts: 34
Joined: Thu Jul 07, 2016 7:45 am

Re: Multiple vision types on token

Post by Adurna »

Uh, I didn't know I could use the names. It's much easier now. And the missing quotes was, indeed what was causing the issue. It's now working perfectly! Thank you!

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

Re: Multiple vision types on token

Post by wolph42 »

yeah, what you can do in addition is:

Code: Select all

[h:name = listGet(getSelectedNames(),0)]
<!-- in case multiple tokens are selected -->
[h,if(findToken(name+" vision") <> ""), CODE:{
  [CurrentX = getTokenX(0, name)]
  [CurrentY = getTokenY(0, name)]
  [moveToken(CurrentX, CurrentY, 0, name+" vision")]
  <!-- assuming that the other token name is the same name with the appendix " vision" (as in the previous post -->
}] 

Post Reply

Return to “MapTool”