Jump to content


Photo

Can Mod installation identify worldmap size (large or hugh)?


  • Please log in to reply
5 replies to this topic

#1 Roxanne

Roxanne

    Modder

  • Member
  • 3564 posts

Posted 18 April 2013 - 07:23 AM

I am just in the final testing of my new mod which adds some maps to the worldmap, some of them outside of the Sword Coast and Amn territory, e.g Waterdeep, Thay, etc.

I have so far used the large map to locate the areas but now do testing on an installation with the hugh map as well. I have converted the coordinates for this map size so that the mod will be able to install with correct locations for either option.

 

In the installation tp2, I provide the option to select the map you are using, so you will get the new areas in their right place on the map for both cases.

 

Question: Is there a way to automate the selection, i.e. the mod identifies the map that is installed and selects the right installation option instead of asking you (some players may not remember what they have)?  I think you will get something funny on the map if you select the hugh map when you really have large installed with those areas that are far to the east (e.g. Bezantur has coordinate 7838,2614).


Edited by Roxanne, 18 April 2013 - 10:18 AM.

The Sandrah Saga

another piece of *buggy, cheesy, unbalanced junk*

 


#2 Isaya

Isaya
  • Modder
  • 294 posts

Posted 18 April 2013 - 01:43 PM

Since your mod needs to be installed before Worldmap (unless you don't use the usual way to do that), only divination could tell you what the player is about to choose when he/she installs Worldmap eventually. ;)

 

It's actually simpler than that. If you study the mod files, you'll see there is a single set of data provided for each area, so there are no separate data for large/huge, as you have in mind. You only need to provide the location for the huge map. To get the data properly set on the large map, the y coordinate will be decreased by 1700 if the player chooses the large map.

For details you can have a look at map_size.tpa in the lib directory.



#3 Roxanne

Roxanne

    Modder

  • Member
  • 3564 posts

Posted 19 April 2013 - 05:00 AM

Since your mod needs to be installed before Worldmap (unless you don't use the usual way to do that), only divination could tell you what the player is about to choose when he/she installs Worldmap eventually. ;)

 

It's actually simpler than that. If you study the mod files, you'll see there is a single set of data provided for each area, so there are no separate data for large/huge, as you have in mind. You only need to provide the location for the huge map. To get the data properly set on the large map, the y coordinate will be decreased by 1700 if the player chooses the large map.

For details you can have a look at map_size.tpa in the lib directory.

This is one method to do it, provided the mod is installed in the context of a full Installation and before BP-Worldmap. Even then the ycoord-1700 method (I've tried it like the mapmod does for the Drizzt Areas) does not work for Areas that are too far to the east.

As currently I am in testing still I always install the mod on top of an existing Installation (and I expect most who would like to try it would do so as well) as it requires all of BGT, Megamods and most other mods installed before (the Story runs across all three parts of the game).


Edited by Roxanne, 19 April 2013 - 05:02 AM.

The Sandrah Saga

another piece of *buggy, cheesy, unbalanced junk*

 


#4 Roxanne

Roxanne

    Modder

  • Member
  • 3564 posts

Posted 19 April 2013 - 05:00 AM

Since your mod needs to be installed before Worldmap (unless you don't use the usual way to do that), only divination could tell you what the player is about to choose when he/she installs Worldmap eventually. ;)

 

It's actually simpler than that. If you study the mod files, you'll see there is a single set of data provided for each area, so there are no separate data for large/huge, as you have in mind. You only need to provide the location for the huge map. To get the data properly set on the large map, the y coordinate will be decreased by 1700 if the player chooses the large map.

For details you can have a look at map_size.tpa in the lib directory.

This is one method to do it, provided the mod is installed in the context of a full Installation and before BP-Worldmap. Even then the ycoord-1700 method (I've tried it like the mapmod does for the Drizzt Areas) does not work for Areas that are too far to the east.

As currently I am in testing still I always install the mod on top of an existing Installation (and I expect most who would like to try it would do so as well) as it requires all of BGT, Megamods and most other mods installed before (the Story runs across all three parts of the game).


Edited by Roxanne, 19 April 2013 - 05:03 AM.

The Sandrah Saga

another piece of *buggy, cheesy, unbalanced junk*

 


#5 Isaya

Isaya
  • Modder
  • 294 posts

Posted 20 April 2013 - 09:15 AM

BP-BGT-Worldmap has special handling for areas that should be located on the framed areas on the map like Icewind Dale and the ice island because the way the frames are set on the large and huge map are different and don't fit the typical Y shift of 1700.

Other frames, including the ones to the east, Hondleth and Selgaunt, have the same position on large and huge pictures, except the Y coordinates, but the shift of 1700 applies for them too.

I fail to see why you would have problems with the shift on Y on the east part. If it doesn't fit, that means the areas are out of bounds of the large map and you need the huge map.

 

If you want to read the size of the current map, you can use something like that (inspired by lib.tpa, where it sets it):

  COPY_EXISTING worldmap.wmp override
    READ_LONG    0x0c              map_offset
    READ_LONG   map_offset + 0x08  width
    READ_LONG   map_offset + 0x0c height
  BUT_ONLY
// Do your stuff depending on the size
PATCH_IF width > 4900 BEGIN
    ...
  END
  ELSE BEGIN
    // To small
  END



#6 Roxanne

Roxanne

    Modder

  • Member
  • 3564 posts

Posted 20 April 2013 - 12:57 PM

BP-BGT-Worldmap has special handling for areas that should be located on the framed areas on the map like Icewind Dale and the ice island because the way the frames are set on the large and huge map are different and don't fit the typical Y shift of 1700.
Other frames, including the ones to the east, Hondleth and Selgaunt, have the same position on large and huge pictures, except the Y coordinates, but the shift of 1700 applies for them too.
I fail to see why you would have problems with the shift on Y on the east part. If it doesn't fit, that means the areas are out of bounds of the large map and you need the huge map.
 
If you want to read the size of the current map, you can use something like that (inspired by lib.tpa, where it sets it):

  COPY_EXISTING worldmap.wmp override
    READ_LONG    0x0c              map_offset
    READ_LONG   map_offset + 0x08  width
    READ_LONG   map_offset + 0x0c height
  BUT_ONLY
// Do your stuff depending on the size
PATCH_IF width > 4900 BEGIN
    ...
  END
  ELSE BEGIN
    // To small
  END
 

Thank you!!!! This was exactly the bit of code I needed.
 
I have replaced my current TP2 entry

PRINT @281 (~Which size of the worldmap do you have installed?

1. Large Worldmap 4900x3500
2. Huge Worldmap 8000x6300~
  ACTION_READLN how
  OUTER_WHILE NOT(IS_AN_INT %how%) || (%how% > 2) || (%how% < 1) BEGIN
   PRINT @281 (
   ACTION_READLN how
  END

ACTION_IF (%how% = 1) THEN BEGIN
//Standard Worldmap
COPY_EXISTING ~worldmap.wmp~ ~Override~


END  //how=1

ACTION_IF (%how% = 2) THEN BEGIN
//Hugh 8000x6300 Worldmap Entries

END  //how=1


by what you have proposed just reusing the modification code I already had in those two Option blocks.

 

The areas in different installations with different worldmap sizes are exactly where they should be without the need to make a manual selection.

 

So again, thank you for your help.


The Sandrah Saga

another piece of *buggy, cheesy, unbalanced junk*