ToB worldmap appending
#1
-XzPePijNzX-
Posted 29 January 2007 - 12:33 PM
My matter is the following: I created some small area that i want added to the worldmap. I broke my head on it a few times and finally used the xnewarea.2da file to fetch me the new file. Well after some tinkering i got 2 waukeen's promenades, one with the text: 'I promise nothing... speak on!'
Well this extra waukeen promenade did go to my new area. Well a few crashed and bugs to complete the system, but overall i can now add an area to the SoA worlmap without having to replace any .wmp file.
Now, here comes the question, defineable in 1 phrase: 'And now onto ToB'
Yep, the question is: How can i append my newly created area onto the ToB worldmap25.wmp file rahter than on the SoA worldmap.wmp file, and all this using the xnewarea 2da file.
Any help would be greatly appreciated. 'you can't' s will be ignored.
#2
Posted 29 January 2007 - 01:47 PM
For TOB I believe that there is a code out there, but it is not at all as easy as the XNEWAREA.2DA method. It is roughly two pages of pure code and about the only thing that I can see that would have to be changed in it (besides the name of your area). You need to search the forums for the code, it is pretty well written, I just do not have the will-power to start with it (though I have been doing things for this game that are easily as hard as that).
Good luck.
Sticz
#3
Posted 29 January 2007 - 02:36 PM
I think/hope i finally pulled a hard one out of the closet. So put on your thinking cap, and hope it shall serve you better than it served me, seeing im completeley stuck
My matter is the following: I created some small area that i want added to the worldmap. I broke my head on it a few times and finally used the xnewarea.2da file to fetch me the new file. Well after some tinkering i got 2 waukeen's promenades, one with the text: 'I promise nothing... speak on!'
Well this extra waukeen promenade did go to my new area. Well a few crashed and bugs to complete the system, but overall i can now add an area to the SoA worlmap without having to replace any .wmp file.
Now, here comes the question, defineable in 1 phrase: 'And now onto ToB'
Yep, the question is: How can i append my newly created area onto the ToB worldmap25.wmp file rahter than on the SoA worldmap.wmp file, and all this using the xnewarea 2da file.
Any help would be greatly appreciated. 'you can't' s will be ignored.
If you use WM6 you can use the guide for compatibility in your mod's tp2 to put the proper info where it needs to be to have the areas installed when WM6 is installed. See here: http://www.shsforums...p...ost&id=4611
It takes a village...
#4
-XzPePijNzX-
Posted 29 January 2007 - 11:36 PM
Sadly enough, this gives me the same problem as i had before, which is that i can only put together stuff in the SoA worldmap, not in ToB. And if i knew what made it a ToB area i could've done the same with XNEWAREA (or not).If you use WM6 you can use the guide for compatibility in your mod's tp2 to put the proper info where it needs to be to have the areas installed when WM6 is installed. See here: http://www.shsforums...p...ost&id=4611
As for the code, hell it might be there, but i can't find it. If it ever was on these forums i'm either not looking well enough or it has been deleted
EDIT: Wait i think i found it. Was it posted on G3 rather than here?
RE-EDIT: If it was, it doesn't work. You'll get a pretty nice CTD if you even try to convert it to a worldm25 code
Edited by XzPePijNzX, 30 January 2007 - 12:47 AM.
#5
Posted 30 January 2007 - 04:44 AM
Sadly enough, this gives me the same problem as i had before, which is that i can only put together stuff in the SoA worldmap, not in ToB. And if i knew what made it a ToB area i could've done the same with XNEWAREA (or not).If you use WM6 you can use the guide for compatibility in your mod's tp2 to put the proper info where it needs to be to have the areas installed when WM6 is installed. See here: http://www.shsforums...p...ost&id=4611
As for the code, hell it might be there, but i can't find it. If it ever was on these forums i'm either not looking well enough or it has been deleted![]()
EDIT: Wait i think i found it. Was it posted on G3 rather than here?
RE-EDIT: If it was, it doesn't work. You'll get a pretty nice CTD if you even try to convert it to a worldm25 code
The last component of the WM6 install asks if you want to use the WM6 for ToB as well. The same map is used, just differently named files. Add your area to WM6 and copy that processed file at the end of the install and the map should work properly.
Edited by erebusant, 30 January 2007 - 04:45 AM.
It takes a village...
#6
-XzPePijNzX-
Posted 30 January 2007 - 06:51 AM
people who DON't use the wm6 for tob, or not use it at all, have no way to see the new area, unless they install the wm6 file.
But i for example don't use wm6 and would still like to see the area on the original map, and this is were the above method fails.
#7
Posted 30 January 2007 - 07:42 AM
// Append mastarea.2da with the new area
APPEND ~MASTAREA.2da~ ~ARSC#A value~
COPY_EXISTING ~worldmap.wmp~ ~override~
// Read offsets and stuff.
READ_LONG 0x30 "area_num"
READ_LONG 0x34 "area_off"
READ_LONG 0x38 "link_off"
READ_LONG 0x3c "link_num"
READ_LONG 0xc "map_off"
SET "entry" = ("%map_off%" + 0xb8)
SET "outer_check" = 0
SET "inner_check" = 0
SET "num_ent" = 0
// New offsets
WRITE_LONG 0x30 ("%area_num%" + 1)
WRITE_LONG 0x38 ("%link_off%" + 0xf0)
WRITE_LONG 0x3c ("%link_num%" + 4)
// Add area to worldmap
INSERT_BYTES ("%area_off%" + (0xf0 * "%area_num%")) 0xf0
WRITE_ASCII ("%area_off%" + (0xf0 * "%area_num%")) ~ARSC#A~ // AR-name
WRITE_ASCII ("%area_off%" + 0x08 + (0xf0 * "%area_num%")) ~ARSC#A~ // AR-name
WRITE_ASCII ("%area_off%" + 0x10 + (0xf0 * "%area_num%")) ~ARSC#A~ // AR-name
WRITE_LONG ("%area_off%" + 0x34 + (0xf0 * "%area_num%")) 27 // Map icon
WRITE_LONG ("%area_off%" + 0x38 + (0xf0 * "%area_num%")) 1063 // X coordinate
WRITE_LONG ("%area_off%" + 0x3C + (0xf0 * "%area_num%")) 39 // Y coordinate
SAY ("%area_off%" + 0x40 + (0xf0 * "%area_num%")) ~SConrad's area~ // Name of the area
SAY ("%area_off%" + 0x44 + (0xf0 * "%area_num%")) #-1 // Description
// Now, we add four area links, all from east
WRITE_SHORT ("%area_off%" + 0x50 + (0xf0 * "%area_num%")) ("%link_num%" + 4) // First N link
WRITE_SHORT ("%area_off%" + 0x58 + (0xf0 * "%area_num%")) ("%link_num%" + 4) // First W link
WRITE_SHORT ("%area_off%" + 0x60 + (0xf0 * "%area_num%")) ("%link_num%" + 4) // First S link
WRITE_SHORT ("%area_off%" + 0x68 + (0xf0 * "%area_num%")) ("%link_num%") // First E link
WRITE_SHORT ("%area_off%" + 0x6c + (0xf0 * "%area_num%")) 4 // Number of links from E
// Add links from Umar Hills to the new area
// We'll start by fixing the offsets
WHILE ("%outer_check%" = 0) BEGIN
READ_ASCII ("%entry%" + 0x8) "area" (2)
READ_ASCII ("%entry%" + 0x8) "spec_area" (6)
WHILE (("%spec_area%" STRING_COMPARE_CASE "AR1100" = 0) AND ("%inner_check%" = 0)) BEGIN
READ_SHORT ("%entry%" + 0x50) "nlink"
READ_SHORT ("%entry%" + 0x50 + 0x4) "#nlink"
WRITE_SHORT ("%entry%" + 0x50 + 0x4) ("%#nlink%" + 1)
READ_SHORT ("%entry%" + 0x50 + 0x8) "wlink"
WRITE_SHORT ("%entry%" + 0x50 + 0x8) ("%wlink%" + 3)
READ_SHORT ("%entry%" + 0x50 + 0x8) "wlink"
READ_SHORT ("%entry%" + 0x50 + 0x8 + 0x4) "#wlink"
WRITE_SHORT ("%entry%" + 0x50 + 0x8 + 0x4) ("%#wlink%" + 1)
READ_SHORT ("%entry%" + 0x50 + 0x8 + 0x8) "slink"
WRITE_SHORT ("%entry%" + 0x50 + 0x8 + 0x8) ("%slink%" + 2)
READ_SHORT ("%entry%" + 0x50 + 0x8 + 0x8) "slink"
READ_SHORT ("%entry%" + 0x50 + 0x8 + 0x8 + 0x4) "#slink"
WRITE_SHORT ("%entry%" + 0x50 + 0x8 + 0x8 + 0x4) ("%#slink%" + 1)
READ_SHORT ("%entry%" + 0x50 + 0x8 + 0x8 + 0x8) "elink"
WRITE_SHORT ("%entry%" + 0x50 + 0x8 + 0x8 + 0x8) ("%elink%" + 1)
READ_SHORT ("%entry%" + 0x50 + 0x8 + 0x8 + 0x8) "elink"
READ_SHORT ("%entry%" + 0x50 + 0x8 + 0x8 + 0x8 + 0x4) "#elink"
WRITE_SHORT ("%entry%" + 0x50 + 0x8 + 0x8 + 0x8 + 0x4) ("%#elink%" + 1)
SET "inner_check" = 1
END
PATCH_IF (("%area%" STRING_COMPARE_CASE "AR" = 0) OR ("%area%" STRING_COMPARE_CASE "G3" = 0)) BEGIN
SET "num_ent" = ("%num_ent%" + 1)
END ELSE
PATCH_IF (("%area%" STRING_COMPARE_CASE "AR" != 0) AND ("%area%" STRING_COMPARE_CASE "G3" != 0)) BEGIN
SET "outer_check" = 1
END
SET "entry" = ("%entry%" + 0xf0)
END
// Re-read offsets
READ_LONG 0x30 "area_num"
READ_LONG 0x38 "link_off"
// Add link to ARSC#A
INSERT_BYTES ("%link_off%" - 0x01 + (0xd8 * "%nlink%")) 0xd8
WRITE_LONG ("%link_off%" + (0xd8 * "%nlink%")) ("%area_num%" - 1) // Add the last entry
WRITE_ASCII ("%link_off%" + 0x04 + (0xd8 * "%nlink%")) ~ARSC#E~ // Entrance
WRITE_LONG ("%link_off%" + 0x28 + (0xd8 * "%nlink%")) 4 // Unknown
// If you want to add random encounters, travelling time, do so here
// Add link to ARSC#A
INSERT_BYTES ("%link_off%" - 0x01 + (0xd8 * "%wlink%")) 0xd8
WRITE_LONG ("%link_off%" + (0xd8 * "%wlink%")) ("%area_num%" - 1) // Add the last entry
WRITE_ASCII ("%link_off%" + 0x04 + (0xd8 * "%wlink%")) ~ARSC#E~ // Entrance
WRITE_LONG ("%link_off%" + 0x28 + (0xd8 * "%wlink%")) 4 // Unknown
// If you want to add random encounters, travelling time, do so here
// Add link to ARSC#A
INSERT_BYTES ("%link_off%" - 0x01 + (0xd8 * "%slink%")) 0xd8
WRITE_LONG ("%link_off%" + (0xd8 * "%slink%")) ("%area_num%" - 1) // Add the last entry
WRITE_ASCII ("%link_off%" + 0x04 + (0xd8 * "%slink%")) ~ARSC#A~ // Entrance
WRITE_LONG ("%link_off%" + 0x28 + (0xd8 * "%slink%")) 4 // Unknown
// If you want to add random encounters, travelling time, do so here
// Add link to ARSC#A
INSERT_BYTES ("%link_off%" - 0x01 + (0xd8 * "%elink%")) 0xd8
WRITE_LONG ("%link_off%" + (0xd8 * "%elink%")) ("%area_num%" - 1) // Add the last entry
WRITE_ASCII ("%link_off%" + 0x04 + (0xd8 * "%elink%")) ~ARSC#E~ // Entrance
WRITE_LONG ("%link_off%" + 0x28 + (0xd8 * "%elink%")) 4 // Unknown
// If you want to add random encounters, travelling time, do so here
// Check which link is largest
PATCH_IF (("%nlink%" > "%wlink%") AND ("%nlink%" > "%slink%") AND ("%nlink%" > "%elink%")) BEGIN
SET "link" = "%nlink%"
END
PATCH_IF (("%wlink%" > "%nlink%") AND ("%wlink%" > "%slink%") AND ("%wlink%" > "%elink%")) BEGIN
SET "link" = "%wlink%"
END
PATCH_IF (("%slink%" > "%wlink%") AND ("%slink%" > "%nlink%") AND ("%slink%" > "%elink%")) BEGIN
SET "link" = "%slink%"
END
PATCH_IF (("%elink%" > "%wlink%") AND ("%elink%" > "%slink%") AND ("%elink%" > "%nlink%")) BEGIN
SET "link" = "%elink%"
END
// Correct ALL other links after elink
// New variables
SET "entry" = ("%map_off%" + 0xb8)
SET "outer_c" = 0
// Let's WHILE a bit and search for area-links
WHILE ("%outer_c%" = 0) BEGIN
READ_ASCII ("%entry%" + 0x8) "area" (2)
PATCH_IF (("%area%" STRING_COMPARE_CASE "AR" = 0) OR ("%area%" STRING_COMPARE_CASE "G3" = 0)) BEGIN
READ_SHORT ("%entry%" + 0x50) "nlink"
READ_SHORT ("%entry%" + 0x50 + 0x8) "wlink"
READ_SHORT ("%entry%" + 0x50 + 0x8 + 0x8) "slink"
READ_SHORT ("%entry%" + 0x50 + 0x8 + 0x8 + 0x8) "elink"
// And if they are larger, let's patch 'em
PATCH_IF ("%nlink%" > "%link%") BEGIN
WRITE_SHORT ("%entry%" + 0x50) ("%nlink%" + 4)
END
PATCH_IF ("%wlink%" > "%link%") BEGIN
WRITE_SHORT ("%entry%" + 0x50 + 0x8) ("%wlink%" + 4)
END
PATCH_IF ("%slink%" > "%link%") BEGIN
WRITE_SHORT ("%entry%" + 0x50 + 0x8 + 0x8) ("%slink%" + 4)
END
PATCH_IF ("%elink%" > "%link%") BEGIN
WRITE_SHORT ("%entry%" + 0x50 + 0x8 + 0x8 + 0x8) ("%elink%" + 4)
END
END ELSE
PATCH_IF (("%area%" STRING_COMPARE_CASE "AR" != 0) AND ("%area%" STRING_COMPARE_CASE "G3" != 0)) BEGIN
SET "outer_c" = 1
END
SET "entry" = ("%entry%" + 0xf0)
END
// Add four new links from the new area
// Re-read offsets
READ_LONG 0x38 "link_off"
READ_LONG 0x3c "link_num"
// New offset
WRITE_LONG 0x3c ("%link_num%" + 4)
// Add link to City Gates
INSERT_BYTES ("%link_off%" - 0x01 + (0xd8 * "%link_num%")) 0xd8
WRITE_LONG ("%link_off%" + (0xd8 * "%link_num%")) 11 // City Gates
WRITE_ASCII ("%link_off%" + 0x04 + (0xd8 * "%link_num%")) ~ExitNE~ // Entrance
WRITE_LONG ("%link_off%" + 0x28 + (0xd8 * "%link_num%")) 4 // Unknown
// If you want to add random encounters, travelling time, do so here
// Add link to Umar Hills
INSERT_BYTES ("%link_off%" - 0x01 + (0xd8 * "%link_num%")) 0xd8
WRITE_LONG ("%link_off%" + (0xd8 * "%link_num%")) 7 // Umar Hills
WRITE_ASCII ("%link_off%" + 0x04 + (0xd8 * "%link_num%")) ~ExitNW~ // Entrance
WRITE_LONG ("%link_off%" + 0x28 + (0xd8 * "%link_num%")) 4 // Unknown
// If you want to add random encounters, travelling time, do so here
// Add link to Trademeet
INSERT_BYTES ("%link_off%" - 0x01 + (0xd8 * "%link_num%")) 0xd8
WRITE_LONG ("%link_off%" + (0xd8 * "%link_num%")) 14 // Trademeet
WRITE_ASCII ("%link_off%" + 0x04 + (0xd8 * "%link_num%")) ~ExitNW~ // Entrance
WRITE_LONG ("%link_off%" + 0x28 + (0xd8 * "%link_num%")) 4 // Unknown
// If you want to add random encounters, travelling time, do so here
// Add link to de'Arnise Hold
INSERT_BYTES ("%link_off%" - 0x01 + (0xd8 * "%link_num%")) 0xd8
WRITE_LONG ("%link_off%" + (0xd8 * "%link_num%")) 9 // de'Arnise
WRITE_ASCII ("%link_off%" + 0x04 + (0xd8 * "%link_num%")) ~ExitSE~ // Entrance
WRITE_LONG ("%link_off%" + 0x28 + (0xd8 * "%link_num%")) 4 // Unknown
// If you want to add random encounters, travelling time, do so here
BUT_ONLY_IF_IT_CHANGES
EDIT: Updating S_C_C to != 0 instead of = 1.
This should work for the TOB map as well if someone can define the linked areas you will need. I do not know how to work with ToB areas as of yet. I beleive you would need to change the WORLDMAP file to WMP25 or whatever the file name is for the TOB map. This is the WeiDu way to edit the SoA map rather than the XNEWAREA.2DA. This way is infinately more complicated than simply appending a 2DA file, but this will allow you to add areas to the map without using the 2DA file that is limited to SoA (no, you cannot add areas to the TOB map with XNEWAREA).
Sticz
Edited by Sticz, 30 January 2007 - 07:44 AM.
#8
-XzPePijNzX-
Posted 30 January 2007 - 10:09 AM
oh well i'd rather not add my new area on the worldmap then, but add a simple teleport option
#9
Posted 03 February 2007 - 03:45 AM
I'm using that code and just have to add the rider that although it works as advertised, like the 2DA method you still need to start a new game to get the areas to show up.Ok, I found a GREAT template from SConrad, which follows:
-Y-
'Go for the optics, Chiktikka. GO FOR THE OPTICS!!' - Tali vas Neema
DLTCEP Tutorials Update Page
DLTCEP Tutorials Main Page
Yovaneth's AI Scripts for BG1, BG2-SoA and IWD1
Fishing for Trouble - a quest mod for Shadows of Amn






