PDA

View Full Version : Access image elements (walls, drawn elements, LOS items, ...) from LUA



Almand
December 8th, 2020, 16:31
After looking through the documentation of maps/images and the CoreRPG ruleset it appears that it is not possible to access the elements of an image, such as layers, LOS items (walls, doors, windows, ...) and elements drawn by players from Lua code. The only elements accessible from code seem to be tokens.

I am trying to implement a teleport/staircase/trap door/... system, where you'd draw rectangles on a specific layer, and link them to a target location, and players entering any of the linked rectangles would have their tokens automatically be moved to the linked element, and their viewpoint would be adjusted accordingly.

In Roll20, which I was using before Fantasy Grounds, this was quite simple to do, since scripts have access to every single element of a map. However, in Fantasy Grounds it seems the composition of images is completely opaque to scripts and only tokens placed on them can be accessed. This would make my idea of a teleportation system impossible, at the moment.

Am I missing something, or is there really no way to access the elements of an image/map?

LordEntrails
December 8th, 2020, 17:05
Don't know the answer to your question. But I thought I would let you know that I think their is/was an extension that did token teleportation available already. Not sure exactly though, but I believe it was one of the folks under the Rob Twohy (Rob2e) umbrella. You might ask on his discord for more details.

celestian
December 8th, 2020, 17:10
Am I missing something, or is there really no way to access the elements of an image/map?

Far as I am aware, right now, the API for such things is "limited".

I'd love to be able to move tokens and images into layers as well but as of yet, there is no mechanism for it.

Ulric
December 8th, 2020, 17:42
I am trying to implement a teleport/staircase/trap door/... system, where you'd draw rectangles on a specific layer, and link them to a target location, and players entering any of the linked rectangles would have their tokens automatically be moved to the linked element, and their viewpoint would be adjusted accordingly.
I use this extension to teleport the party to different locations on the same map or a different map. https://www.dmsguild.com/product/323471/Fantasy-Grounds-Portals--REVAMPED

Almand
December 8th, 2020, 22:18
Yeah, this seems to be the extension @LordEntrails meant, by Rob Twohy (Rob2e), I'm gonna check that out, thanks. Seems they did what I feared I would have to do - build an entire own editor for the hotspots and links, since there is no access to the drawing elements in the images.

Almand
December 8th, 2020, 22:35
Far as I am aware, right now, the API for such things is "limited".

I'd love to be able to move tokens and images into layers as well but as of yet, there is no mechanism for it.
I really hope that is something that will be added at some point, because a whole bunch of things I had added to our Roll20 game seem impossible without it. Things like allowing thieves to pick locks on doors, placing traps on doors, automatic teleportation, pressure plates that open/close doors, or have walls shift in mazes when players move within it.