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

Making a square un-enterable

Is there anyway to do it? For instance, when I'm using the dynamic lighting, a player cannot see where to go and can willy nily walk into dark patches. A fix?
1380738903
Pat S.
Forum Champion
Sheet Author
If you are asking if there is a way to block a player from moving their token into a darkened area, no there is not. If you are asking about a way to make it where they can not see what is behind the dynamic lines so they don't see what you are hiding, you will have to use Fog of War to cover all the areas you want to be hidden. The dynamic lighting was design to work with fow for just this reason. In various maps I use. I fog of war everything and reveal up to a doorway so that until the token reaches barrier they can reveal stuff. On the other side of the doors is fow and they can't not see anything even if they put their character that has light there. you can also set up the map (in the map settings) to only update the DL on the tokens placement. This keeps players from moving their tokens about to look over the map. They will have to move it to a specific location and place it there for the DL to update and reveal if there is no FoW.
Darn, well thanks for the FoW tip.
1380742629
Pat S.
Forum Champion
Sheet Author
You're welcomed and if you have any questions, post them. Someone will answer them as soon as they can.
1380746552
Lithl
Pro
Sheet Author
API Scripter
This could be achievable with the API (either perform line-intersection math when the token moves, or fill the "disallowed" squares with a specific token and compare that token's location to the player's token), but it is not possible with the base system.
1380747075
Pat S.
Forum Champion
Sheet Author
But that would take a mentor level account and not supporter level. I do agree that with an api, almost anything is possible but at his current subscription, no it is not.
Well, that's definitely something that would make upgrading worth it as I've already been considering it, but how difficult would that be to do? I've never used API before.
1380749905
Pat S.
Forum Champion
Sheet Author
It is a form of javascripting. I'm not that familar with it so that falls in the domain of Brian and other api users.
1380775279

Edited 1380775481
Lithl
Pro
Sheet Author
API Scripter
There's two ways this could be achieved: Line-Line intersection . When you create an event that fires on a token being moved, some of the data you get is the token's current position and the token's previous position. From that, you can create a line. You're also going to need all of the lines on the map that cannot be crossed -- this could be hardcoded, created from the locations of specific tokens on the GM layer, or created from the _path property of a Path object*. Check for intersections between the line created by the token's movement and the "no cross" lines on the map. If there are any intersections, check if the location of the intersection is within the line segment created by the token's movement and within the line segment closing off an area of the map. If an intersection meets those criteria, the token has tried to cross into a forbidden area (or perhaps just pass through a wall), so adjust the token's final position accordingly; likely you'll want to leave it at the start position, or move the token as far along its line as permitted by the walls. Drop special tokens in each square of the forbidden areas on the map. If the final location of the moved token is the same as one of the forbidden tokens**, leave the moved token at its starting position. If you leave the moving token in its start position, it's probably best to whisper an error message to the player, so they know why the token didn't move. Both methods could be slow, depending on how much "forbidden area" is on the map. * I have not studied the Path object much, so I'm not certain how to interpret the _path property. This would require some testing. ** If you're not using the grid or you're worried about the players using Alt+Drag or Shift+Arrow key, you'll want to compare the distance between the "forbidden" tokens and the player's token, rather than just checking whether the location is equal. Edit: Hmm... now I'm interested in writing the first variant of this script. We'll see if I'm still interested once I have time to sit down and work on it, though. Not gonna happen tonight, certainly.
Right now, there is no good way to prevent players from moving tokens wherever they want to... but as others have said, Fog of War prevents them from seeing anything in the areas you block off, even if they can move their tokens into those areas. An API script will still have issues with lag, timing, and such because it happens after the player moves the token. So they can still see something before the script fires and moves the token back.
I would absolutely LOVE for this to be a feature. Throws money at screen