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

controlledby value not updating?

This is holding up what would otherwise be a simple project.  My script pulls all tokens on the current page which represent characters. At a later point, it tries to read the "controlledby" property. In my current case (with all of my PCs resting on a default page, all of which are 'controlled by' their respective users and them only), the script only seems to gather two of the relevant ids.  Does anyone know why this would be happening assuming the script is otherwise solid? Or do I just need to take a harder look at my code. (Sandbox output which demonstrates what I'm talking about) 
1491755044
Jakob
Sheet Author
API Scripter
The 'controlledby' property of a token is actually ignored when the token represents a character. Perhaps, for those two tokens, you set a controlledby property before setting represents, and the data is still there (but unused), whereas for the others, you did not. If you want to get the actual  controlledby for a token representing a character, you have to get the character's controlledby.
Jakob said: The 'controlledby' property of a token is actually ignored when the token represents a character. Perhaps, for those two tokens, you set a controlledby property before setting represents, and the data is still there (but unused), whereas for the others, you did not. If you want to get the actual  controlledby for a token representing a character, you have to get the character's controlledby. Just looked into it, and yep. The two that displayed ids had been set manually at one point in time.  Thanks!