Choose Your Language

Thursday, 30 October 2008

Show Me The Way

I have been busy sorting out buying a new car this week, which has distracted me somewhat from working with the toolset. However, in the time I have had, I have been trying to work on a system that would enable players to use their own map pins with NWN2. But, after a few hours trial and error, I have failed to produce anything that works. (SEE UPDATE BELOW.)

I thought I might be able to add waypoints at the player's location and use an input GUI to alter the text used for the map pin description. However, you cannot (a) Add map text after a pin has been added, and more importantly (b) You cannot see newly created waypoints (as map pins) that are added dynamically during the game. I had a couple of other ideas, but both fail in a big way: For the first idea I was hoping I might be able to "copy" existing waypoints already placed on a map to the players location, but you can only copy creatures or items. The second idea involved placing a number of waypoints to form a kind of matrix across the map and then use code to locate the closest one when searched for by the player who would then be able to enable it. Unfortunately, both of these ideas also fail to be able to update the map text in any way. I also wondered if it was possible to add a small "pin texture" somehow that could be hovered over and allow a tool tip to be displayed. Unfortunately, I don't believe my knowledge of XML coding is up to the job, nor do I know if it is even possible. And so .... I ask any readers if they have any idea how I might be able to approach this problem, or if they know the problem has already been solved by someone else or can confirm if it is a fruitless task.

The new car ... A Kia Rio 1.4 Chill in Midnight Black.

UPDATE (31/10/08):

I managed to build a system that I believe works well enough! :) After researching earlier work done with map pins back in NWN1, I found this by Mad Andrew and this by Jassper. After trying similar code in my module for NWN2, I was able to create map pins that (a) Showed as small placeables immediately, but also (b) Recorded "proper" map pins that would be updated whenever the player left and re-entered the area. To help with this, I added a button to the PC Options menu that allows the Main PC to quickly exit and re-enter the area if they wish to recall the location of their map pins. As the area I jump the player to is very small, the transition is only as long as it takes to load the area they are currently in, which in most cases is only a few seconds. However, as the player already has immediate "placeable" pins within the area, then this procedure to update the "proper" pins is only required on rare occasions.

No comments: