Roll20 uses cookies to improve your experience on our site. Cookies enable you to enjoy certain features, social sharing functionality, and tailor message and display ads to your interests on our site and others. They also help us understand how our site is being used. By continuing to use our site, you consent to our use of cookies. Update your cookie preferences .
×
Create a free account

[Script] Carrying tokens

June 16 (12 years ago)

Edited December 20 (11 years ago)
Ada L.
Marketplace Creator
Sheet Author
API Scripter

This is a script that allows you to specify your tokens to carry other tokens, such as torches.

It was originally part of my marching order script, but it was requested that the logic for two capabilities be separated. So here it is!

Update 12/19/2013: Players can now have their tokens carry other tokens as long as both their token and the token they are carrying represent characters under their control. The GM can still assign any token to carry any other token.

https://gist.github.com/Cazra/5792605

ok, don't know if you are aware of this, but this script is currently broken, with an unidentified identifer error when I try and run it currently.

Worked before the api update, so I don't know if it has something to do with that.

also, just realised I hadn't thanked you for splitting it off and creating a seperate script for it, as it was EXACTLY what I was looking for at the time for easy hand off of torches in a party with very limited resources in a very... VERY dark place.


June 30 (12 years ago)
Ada L.
Marketplace Creator
Sheet Author
API Scripter

I'll take a look at it. I've also discovered that my marching order script doesn't work correctly when a player tries to use the chat commands. It's not able to get the player object from the message's who property. I suspect there might be a similar problem with this script.

Quick question-does the script move objects on the dm layer?

June 30 (12 years ago)
Ada L.
Marketplace Creator
Sheet Author
API Scripter

No, just the objects layer. It could be easily modified though to also move objects on the dm layer. See the findObjs line in the getToken function (right at the bottom).

Just thinking that moving tokens that are being carried to the GMlayer and having it follow them there would stop the problem of selecting the wrong token when trying to move things on the players map - but then realized that I don't know if light auras are visible from the GMlayer - perhaps dropping them to the maplayer while they are carried? and retrieving them from there when you drop them?

June 30 (12 years ago)
Ada L.
Marketplace Creator
Sheet Author
API Scripter

The map layer trick sounds like a good way to do it.

July 01 (12 years ago)
Alex L.
Pro
Sheet Author

Michael H. said:

Just thinking that moving tokens that are being carried to the GMlayer and having it follow them there would stop the problem of selecting the wrong token when trying to move things on the players map - but then realized that I don't know if light auras are visible from the GMlayer - perhaps dropping them to the maplayer while they are carried? and retrieving them from there when you drop them?

Or you could shift the token to the GM layer and copy the Light settings to the player token, then you just change them back once you drop the item.


I was thinking about that but hit a few snags

the snags mostly being low light vision and darkvision. at the moment the only way to replicate low light vision is to have a second torch that is bound to the first one and set to be controllable by the characters with low light vision. so its not JUST the radius of the torch, its what people can see, which is different for each type of vision.

darkvision is easy, but they get it on themselves with a 60/60 light radius visible only to themselves. and if they happen to hold a torch, it would kill their darkvision (which is fine in 2nd ed i grant you) but not perfect. just two problems I saw with that solution (which is how i initially worked it till i realised i could just have two tokens - one for each kind of vision)


a more comprehensive lighting system would fix the majority of these problems, but for now two tokens works.