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

psIsoFacing Edit

1602606079

Edited 1602615361
Project Overview I am modifying PlexSoup's psIsoFacing code to work for non-PC controlled tokens and to access rollable tables to incorporate Front and Back facing with horizontal flips.&nbsp; This edit will allow players access to horizontal flips and to change sides of their multi-sided tokens without right-clicking and accessing a menu. PlexSoup's Code :&nbsp; <a href="https://gist.github.com/plexsoup/6fb407c51d3ded60119f914ea82781de" rel="nofollow">https://gist.github.com/plexsoup/6fb407c51d3ded60119f914ea82781de</a> Project Plan Stage 1: Completed (see below) Stage 2: The second edit I plan to implement is accessing rollable tables.&nbsp; Currently, the code determines a token's movement on the x-axis and horizontally flips accordingly.&nbsp; I hope to do something similar for the y-axis.&nbsp; I have front/back multi-sided tokens in rollable tables labeled Front and Back.&nbsp; Moving a token "up" (+y direction) will switch the token to the Back facing and moving a token "down" (-y direction) will switch the token to the Front facing.&nbsp; I haven't worked much on this part yet, so any advice or references to code that draws from rollable tables would be greatly appreciated. This is an example of the rollable tables I'm using and hoping to access with api scripts from front/back&nbsp;flipping: Completed Stages Stage 1: &nbsp; &nbsp;The issue I had was with permissions.&nbsp; As the GM, I couldn't horizontally flip tokens unless they were placed on the map and owned by a player.&nbsp; That worked fine for PCs, but it rendered the DM unable to flip monster tokens during combat.&nbsp; Now tokens the DM places on the map can be registered to flip when moved.&nbsp; To do this I removed the following code from the activeChecker function: else if (isTokenOwned(tokenObj) === false ) { &nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;result = false; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}&nbsp;
I believe I have a decent grasp of the code now and what I'l need to do to add a function for vertical movement, but I'm still unsure how to call/manipulate rollable tables to make use of the multi-sided tokens.&nbsp; I looked on the Roll20wiki, but I only saw how to use rollable tables, not how to script with them.