LoTROInterface

LoTROInterface (https://www.lotrointerface.com/forums/index.php)
-   Lua Programming Help (L) (https://www.lotrointerface.com/forums/forumdisplay.php?f=50)
-   -   Access to the map (https://www.lotrointerface.com/forums/showthread.php?t=1590)

Fido 08-09-2011 12:59 PM

Access to the map
 
Hi,
is there a way to set overlay on the world map? I took a look on MoorMap, but there is its own window created. (btw. where he took the map graphics from, in the resources folder I didn't find anything)
Has the API no access to the map object?

Thanks
Fido

Garan 08-09-2011 03:02 PM

Quote:

Originally Posted by Fido (Post 6978)
Hi,
is there a way to set overlay on the world map? I took a look on MoorMap, but there is its own window created. (btw. where he took the map graphics from, in the resources folder I didn't find anything)
Has the API no access to the map object?

Thanks
Fido

There is no access to the built-in Turbine map which is why MoorMap exists. There is also no direct access to the player location or heading - we can get ;loc coordinates by requiring the user to click a quickslot but that is the most access Turbine has granted at this point.

As to the empty Map folder, that is a placeholder for any maps which need external images when the built in resource has not yet been identified. Currently, all of the resource IDs for the maps included in MoorMap have been identified but as new areas are released, a JPG image will be in the Maps folder until the in-game resource is identified. In game resources are far more efficient so I do my best to keep the Maps folder empty :)

If you are interested in creating your own overlays for the maps, I have an option in the works with MoorMap to allow custom overlays to be assigned to a map and selected from a dropdown - this will be more useful (such as for raids and tutorials) once there are more interrior/instanced maps included in MoorMap. Unfortunately, the Overlay option will not be published for several months yet as there are a lot of other tasks with higher priority atm.

Fido 08-09-2011 04:35 PM

Thank you. This are bad news :(
But if I unterstand it correctly there is a way to get access to the build-in resources. Can you show an example how to load a build-in resource? And how did you found it out?

Fido

Garan 08-09-2011 06:11 PM

Quote:

Originally Posted by Fido (Post 6983)
Thank you. This are bad news :(
But if I unterstand it correctly there is a way to get access to the build-in resources. Can you show an example how to load a build-in resource? And how did you found it out?

Fido

The built in images can be assigned with the SetBackground() method for those controls supporting images - review the Turbine API for which
controls support SetBackground(). Unfortunately, using images isn't always just as straightforward as that. Depending on how you want the image to interact with other images, you may have to use SetBlendMode() and SetBackColorBlendMode() and in some instances the undocumented method SetStretchmode(). All of these methods are used in various ways in MoorMap and AltInventory.

As to locating the image resource IDs, this is complicated by a bug in the SetBackground() method - if a non-image resource ID is passed, the client will crash to desktop. This makes it difficult to just browse the resource IDs looking for a specific image. The most obvious workaround is to read through the dat files to get a list of images, then use an application to view just those valid images. However, reverse engineering is a ToS violation and many would consider reading through the DAT files to discover the image resources and match them to IDs as a form of reverse engineering. I took a slightly different approach - I wrote a plugin (IRV - Image Resource Viewer) which can track ranges of good images and bad images and allow the user to scan until a bad image is found (at which point the client crashes to desktop). The bad image is automatically locked out when the plugin is next loaded (it saves the image id just prior to testing it). This, combined with seed values from the undocumented methods Item:GetBackgroundImageID(), Item:GetQualityImageID(), Item:GetShadowImageID() and Item:GetUnderlayImageID() provided enough resources to build a decent library of images.

Unfortunately, I haven't updated the published version of IRV since last November so it is no longer functional and the library is sorely out of date. My current library has 261 maps identified with another 144 maps of places I haven't been to yet (whereas the old library only had a couple dozen identified) with over 3400 total Library entries. I plan to clean it up and publish a newer version with the enhancements that I have added to it since last November as well as the current image library, but I have a number of other tasks that keep pushing that project back. You can get around the one major bug in the published version by following the instructions in the comments section of the plugin.
EDIT: I have published ver 1.03 of IRV which should have most of my current Library as well as a number of enhancements.

Fido 08-10-2011 12:58 PM

Wow, I didn't thought creating a map plugin will be so complicated :(
It is a great work you've done. I'll play with the images first. Maybe is a map plugin not the best idea to learn creating plugins :)
Thanks a lot for the infos.

Fido


All times are GMT -5. The time now is 08:23 AM.

vBulletin® - Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
© MMOUI