passing selected rooms on map to a script?
passing selected rooms on map to a script?
I was wondering - is there any way to access the list of rooms that have been selected visually on the map screen from our own scripts? Like, so I can drag-select some rooms with the mouse then use an alias to walk to each of the selected rooms, for example?
- SlySven
- Posts: 1023
- Joined: Mon Mar 04, 2013 3:40 pm
- Location: Deepest Wiltshire, UK
- Discord: SlySven#2703
Re: passing selected rooms on map to a script?
I don't think you can currently capture that list, but I agree it would be a useful thing to have.
From a coder's viewpoint I think you would need to add a map context menu (right click) item - which can be done by the user and use that to call a, as unwritten yet, built-in lua function that would return the current map room selection widget content. This would only work on the 2D map but then nothing is perfect.
From a coder's viewpoint I think you would need to add a map context menu (right click) item - which can be done by the user and use that to call a, as unwritten yet, built-in lua function that would return the current map room selection widget content. This would only work on the 2D map but then nothing is perfect.
- SlySven
- Posts: 1023
- Joined: Mon Mar 04, 2013 3:40 pm
- Location: Deepest Wiltshire, UK
- Discord: SlySven#2703
Re: passing selected rooms on map to a script?
I was wrong - you CAN do that, but I don't yet fully understand how. Though it does sort of follow the outline I gave before. Apparently the current list of selected rooms is something that get passed to any user action that is put onto that mapper context menu (right-click) with the addMapEvent() function. I'm trying to put together an outline of how it is done but it seems a function you declare and assign as a UserEventHandler gets called and the fourth and subsequent arguments are the rooms in the list - I don't fully understand enough about Lua to see how such a "vararg" function can be constructed to recover a lua table from that - perhaps someone with more skill in that area would like to comment?
- SlySven
- Posts: 1023
- Joined: Mon Mar 04, 2013 3:40 pm
- Location: Deepest Wiltshire, UK
- Discord: SlySven#2703
Re: passing selected rooms on map to a script?
By Jove, that's it! Somebody give that man(?) a sock filled to the brim with custard...
Re: passing selected rooms on map to a script?
Umm thanks I think, I trust that comes with spotted dick
Or at a push jam roly poly.
Or at a push jam roly poly.
Mapper of Bedlam