Jump to content


Photo

A New Map area


  • Please log in to reply
25 replies to this topic

#1 Sticz

Sticz

    Monkey - In the time of Chimpanzees

  • Member
  • 385 posts

Posted 30 June 2006 - 07:40 AM

I'm looking into getting into adding areas. I know there is a lot of scripting and such with this, is there a really good example of, say, one area added to the map with perhaps a couple of lesser areas off of it? I know getting them to link to other areas on the map takes some scripting/coding. I'm looking for a template, any suggestions?

Sticz :huh:
"For a crazy person, you don't drool much." Complement from Dilbert's Wally.

#2 Azkyroth

Azkyroth
  • Modder
  • 3496 posts

Posted 30 June 2006 - 04:43 PM

I'm looking into getting into adding areas. I know there is a lot of scripting and such with this, is there a really good example of, say, one area added to the map with perhaps a couple of lesser areas off of it? I know getting them to link to other areas on the map takes some scripting/coding. I'm looking for a template, any suggestions?

Sticz :huh:


I'm not sure, but I am very, very interested in this...

"Tyranny is a quiet thing at first, a prim and proper lady pursing her lips and shaking her head disapprovingly, asking, well what were you doing (wearing that dress, walking home at that hour, expressing those inappropriate thoughts) anyway? It's subtle and insidious, disguised as reasonable precautions which become more and more oppressive over time, until our lives are defined by the things we must avoid. She's easy enough to agree with, after all, she's only trying to help -- and yet she's one of the most dangerous influences we face, because if she prevails, it puts the raping, robbing, axe-wielding madmen of the world in complete control. Eventually they'll barely need to wield a thing, all they'll have to do is leer menacingly and we fall all over ourselves trying to placate them." -godlizard


#3 Sir BillyBob

Sir BillyBob
  • Modder
  • 5315 posts

Posted 01 July 2006 - 04:16 PM

Not difficult at all. However, compatibility is an issue. If you want players to use other mods that also add to the Worldmap, you will need to verify that your new area isn't going to overlay other areas or cause other problems.

You might want to look at the WorldMap mod that Yacomo started for BGT/BP. This is a larger map than what comes standard with the game. It includes areas from BG1 (with DSotSC and NTotSC areas) and all the areas from TDD, CtB, and SoS for BG2.

The next version of the map, version 6 has special scripting to see which mods you have installed and adds those areas to the Worldmap without having to install all of the Worldmap areas.

You'll find this map on TheWizard's site and I think it is here on Spellhold as well.

Tired of Bhaal? Try some classics mods instead:
Classic Adventures
Official Classic Adventures Website


#4 Azkyroth

Azkyroth
  • Modder
  • 3496 posts

Posted 01 July 2006 - 05:21 PM

Not difficult at all. However, compatibility is an issue. If you want players to use other mods that also add to the Worldmap, you will need to verify that your new area isn't going to overlay other areas or cause other problems.

You might want to look at the WorldMap mod that Yacomo started for BGT/BP. This is a larger map than what comes standard with the game. It includes areas from BG1 (with DSotSC and NTotSC areas) and all the areas from TDD, CtB, and SoS for BG2.

The next version of the map, version 6 has special scripting to see which mods you have installed and adds those areas to the Worldmap without having to install all of the Worldmap areas.

You'll find this map on TheWizard's site and I think it is here on Spellhold as well.


Interesting. Is there a list of mods that add areas to the worldmap?

"Tyranny is a quiet thing at first, a prim and proper lady pursing her lips and shaking her head disapprovingly, asking, well what were you doing (wearing that dress, walking home at that hour, expressing those inappropriate thoughts) anyway? It's subtle and insidious, disguised as reasonable precautions which become more and more oppressive over time, until our lives are defined by the things we must avoid. She's easy enough to agree with, after all, she's only trying to help -- and yet she's one of the most dangerous influences we face, because if she prevails, it puts the raping, robbing, axe-wielding madmen of the world in complete control. Eventually they'll barely need to wield a thing, all they'll have to do is leer menacingly and we fall all over ourselves trying to placate them." -godlizard


#5 Sticz

Sticz

    Monkey - In the time of Chimpanzees

  • Member
  • 385 posts

Posted 02 July 2006 - 04:28 AM

I will look into the new wold-map, however, I still need to have an idea as to how to make my new area. I usually don't fret too much about other mods, I tend to stick to my own, or incorporate the mods I like that others do into my own mod, and not release it publically. I am still too inexperienced for this.

For area editing, what is a good mod to use for a template? I have seen a few mods that add areas to the map, but they are huge, I would like a mod that only adds a couple of spots that I can work off of. I have a good idea as to the actual creation of the area (I'll just steal from BG1) it's the adding of the entrance and exit spots, and then placing it on the map with WEIDU that will be an issue.


Thanks for any help!

Sticz
"For a crazy person, you don't drool much." Complement from Dilbert's Wally.

#6 Yovaneth

Yovaneth

    The newly-appointed Master Builder of Baldur's Gate

  • Modder
  • 3058 posts

Posted 02 July 2006 - 05:03 AM

The current biggest problem is that adding new areas always seems to require starting the entire game again from scratch. Weidu installs them okay and the activation scripts work okay but the area just never shows up if a game is already in progress. I've got this problem currently; I know Seb was working on a solution but because I wasn't in a rush, I haven't followed up on it. Must poke him about that.... :P

Adding new entrances to an existing area i.e. using the added entrance to move to a new non-map area works fine; I can give you the code for that, if it's any help.

-Y-

#7 SConrad

SConrad

    I swear to drunk I'm not God

  • Administrator
  • 11148 posts

Posted 02 July 2006 - 05:08 AM

I know Seb was working on a solution but because I wasn't in a rush, I haven't followed up on it. Must poke him about that.... :P

:blush:

I saw this thread yesterday and got reminded. I'll see what I can do.

Posted Image Khadion NPC mod - Team leader, head designer
Posted Image Hubelpot NPC mod - Team leader, coder
Posted Image NPC Damage - Coder
Posted Image PC Soundsets - Coder, voice actor
Posted Image Brythe NPC mod - Designer
Posted Image DragonLance TC - Glory of Istar - Designer
Posted Image The NPC Interaction Expansion Project - Writer for Cernd, Sarevok
Posted Image The Jerry Zinger Show - Producer

Iron Modder 5 - Winner


#8 Sticz

Sticz

    Monkey - In the time of Chimpanzees

  • Member
  • 385 posts

Posted 03 July 2006 - 03:37 AM

I could use the code. If nothing else to add one of the existing areas in the game (small teeth's pass) to the map prior to its usual introduction. I have tried adding it with scripting, but it ends up being unreachable. Please let me know what code I need, thanks!


Sticz
"For a crazy person, you don't drool much." Complement from Dilbert's Wally.

#9 Vlad

Vlad
  • Member
  • 577 posts

Posted 07 July 2006 - 08:39 AM

I could use the code. If nothing else to add one of the existing areas in the game (small teeth's pass) to the map prior to its usual introduction. I have tried adding it with scripting, but it ends up being unreachable. Please let me know what code I need, thanks!


Sticz


You may easily create an area on the map using the same approach as Watcher's Keep has been created. It is actually dynamic addition of areas to your worldmap. The WeiDU code is rather simple, and you'll need to append XNEWAREA.2DA, MASTAREA.2DA and AREALINK.2DA files, and you'll need to create a new file named XL[name].2DA file. Also I remeber I saw some WeiDU code at G3 which allows you dynamically add areas to the existing WorldMap.

#10 Yovaneth

Yovaneth

    The newly-appointed Master Builder of Baldur's Gate

  • Modder
  • 3058 posts

Posted 09 July 2006 - 02:57 AM

Sticz: My apologies for the much-delayed reply. This code is purely to add a new entrance to an existing area - it does not add e.g. a new door graphic (I'm not even sure you can do that). In this case it's adding an entrance to the red-painted building at the south-east entrance to the Slums District. I also had to modify the search map to allow the party to get close enough for the entrance to appear to be 'real', but that's another story.

//**************************************************
//Modify the slums to accept new entrances and exits
//**************************************************
//Ceinwen's house

COPY_EXISTING ~ar0400.are~ ~override~
 // We start by reading offsets and numbers but don't actually do anything with these
 READ_SHORT 0x5a "trig_num"
 READ_LONG  0x5c "trig_off"
 READ_LONG  0x60 "spawn_off"
 READ_LONG  0x68 "ent_off"
 READ_SHORT 0x6c "ent_num"
 READ_LONG  0x70 "cont_off"
 READ_LONG  0x78 "item_off"
 READ_LONG  0x7c "vert_off"
 READ_SHORT 0x80 "vert_num"
 READ_LONG  0x84 "amb_off"
 READ_LONG  0x88 "var_off"
 READ_LONG  0xa0 "bmp_off"
 READ_LONG  0xa8 "door_off"
 READ_LONG  0xb0 "anim_off"
 READ_LONG  0xb8 "tiled_off"
 READ_LONG  0xbc "song_off"
 READ_LONG  0xc0 "rest_off"
 READ_LONG  0xc4 "note_off"
 INSERT_BYTES  ("%vert_off%" + ("%vert_num%" * 0x4)	  ) 0x10

 // Add 4 vertices to specify the position of the entrance, working anti-clockwise
//Top right x & y 
   WRITE_SHORT ("%vert_off%" + ("%vert_num%" * 0x4)	  ) 2844
   WRITE_SHORT ("%vert_off%" + ("%vert_num%" * 0x4) + 0x2) 2963

//Top left x & y 
   WRITE_SHORT ("%vert_off%" + ("%vert_num%" * 0x4) + 0x4) 2776
   WRITE_SHORT ("%vert_off%" + ("%vert_num%" * 0x4) + 0x6) 2998

//Bottom left x & y 
   WRITE_SHORT ("%vert_off%" + ("%vert_num%" * 0x4) + 0x8) 2776
   WRITE_SHORT ("%vert_off%" + ("%vert_num%" * 0x4) + 0xa) 3050
  
//Bottom right x & y 
   WRITE_SHORT ("%vert_off%" + ("%vert_num%" * 0x4) + 0xc) 2843
   WRITE_SHORT ("%vert_off%" + ("%vert_num%" * 0x4) + 0xe) 3021
 
// Now, we add a new entrance. Yippie!
 INSERT_BYTES  ("%ent_off%" + ("%ent_num%" * 0x68)	   ) 0x68
   WRITE_ASCII ("%ent_off%" + ("%ent_num%" * 0x68)	   ) ~Exitys0310~   // Name of the new entrance
   WRITE_SHORT ("%ent_off%" + ("%ent_num%" * 0x68) + 0x20) 2889		  // Location: X
   WRITE_SHORT ("%ent_off%" + ("%ent_num%" * 0x68) + 0x22) 3038		  // Location: Y
   WRITE_SHORT ("%ent_off%" + ("%ent_num%" * 0x68) + 0x24) 12			// Directional facing
 
// First, we insert the new trigger by adding 196 bytes at a specific location in the file, then we patch it :)
 INSERT_BYTES  ("%trig_off%" + ("%trig_num%" * 0xc4)	   ) 0xc4
   WRITE_ASCII ("%trig_off%" + ("%trig_num%" * 0xc4)	   ) ~Travys0310~   // Name of the new trigger
   WRITE_SHORT ("%trig_off%" + ("%trig_num%" * 0xc4) + 0x20) 0x02		 // Which trigger type? 2= Travel

//Bounding box: should be x,y,dx,dy of the entance specified above
   WRITE_SHORT ("%trig_off%" + ("%trig_num%" * 0xc4) + 0x22) 2776		  // Bounding box x
   WRITE_SHORT ("%trig_off%" + ("%trig_num%" * 0xc4) + 0x24) 2963		  // Bounding box y
   WRITE_SHORT ("%trig_off%" + ("%trig_num%" * 0xc4) + 0x26) 2844		  // Bounding box dx
   WRITE_SHORT ("%trig_off%" + ("%trig_num%" * 0xc4) + 0x28) 3050		  // Bounding box dy
   WRITE_SHORT ("%trig_off%" + ("%trig_num%" * 0xc4) + 0x2a) 0x04		 // Number of vertices = 4

   WRITE_LONG  ("%trig_off%" + ("%trig_num%" * 0xc4) + 0x2c) "%vert_num%" // First vertex index
   WRITE_LONG  ("%trig_off%" + ("%trig_num%" * 0xc4) + 0x34) 0x2a		 // Cursor index 2a=28
   WRITE_ASCII ("%trig_off%" + ("%trig_num%" * 0xc4) + 0x38) ~ys0310~	 // Destination area
   WRITE_ASCII ("%trig_off%" + ("%trig_num%" * 0xc4) + 0x40) ~Exitar0400~   // Exit point
   WRITE_LONG  ("%trig_off%" + ("%trig_num%" * 0xc4) + 0x60) 0x04		 // Flags
   SAY		 ("%trig_off%" + ("%trig_num%" * 0xc4) + 0x64) #-1		  // Trigger Text
 // Code wrapup - need to adjust numbers of vertices and triggers and adjust offsets
 WRITE_SHORT 0x80 ("%vert_num%" + 0x04) // Four new vertices
 WRITE_SHORT 0x5a ("%trig_num%" + 0x01) // One new trigger
 WRITE_SHORT 0x6c ("%ent_num%"  + 0x01) // One new entrance
 // Remember that even if the offset-fields are listed in one certain order, the offsets aren't
 SET "adj" = 0xc4
 WRITE_LONG 0x60 ("%spawn_off%" + "%adj%")
 WRITE_LONG 0x68 ("%ent_off%"   + "%adj%")
 SET "adj" = (0xc4 + 0x68)
 WRITE_LONG 0x70 ("%cont_off%"  + "%adj%")
 WRITE_LONG 0x78 ("%item_off%"  + "%adj%")
 WRITE_LONG 0x7c ("%vert_off%"  + "%adj%")
 WRITE_LONG 0x84 ("%amb_off%"   + "%adj%")
 WRITE_LONG 0x88 ("%var_off%"   + "%adj%")
 WRITE_LONG 0xa8 ("%door_off%"  + "%adj%")
 WRITE_LONG 0xb8 ("%tiled_off%" + "%adj%")
 SET "adj" = (0xc4 + 0x68 + 0x10)
 WRITE_LONG 0xa0 ("%bmp_off%"   + "%adj%")
 WRITE_LONG 0xb0 ("%anim_off%"  + "%adj%")
 WRITE_LONG 0xbc ("%song_off%"  + "%adj%")
 WRITE_LONG 0xc0 ("%rest_off%"  + "%adj%")
 WRITE_LONG  0xc4 ("%note_off%"  + "%adj%")
BUT_ONLY_IF_IT_CHANGES

I'd wait for Seb to sort out the appearance problem before worrying too much about the new map area; as Vlad says, you can code it in WeiDU and modify the .2DA files to suit but I have to confess, I could never get that method to work successfully. Has to be finger-trouble somewhere here, I guess.

-Y-

#11 igi

igi

    IESDP Guardian

  • Administrator
  • 1058 posts

Posted 09 July 2006 - 05:04 AM

as Vlad says, you can code it in WeiDU and modify the .2DA files to suit but I have to confess, I could never get that method to work successfully. Has to be finger-trouble somewhere here, I guess.


Ghreys sample works fine for me, though it seems to require starting of a new game (whereas, iirc, the addition of Watchers Keep doesn't).

Visit the IESDP


#12 Sir BillyBob

Sir BillyBob
  • Modder
  • 5315 posts

Posted 09 July 2006 - 04:03 PM

If you want to create a simple, new area, use IETME. It is easier than DLTCEP. However, at some point, you will want the full features that DLTCEP offers over IETME. You can use IETME now to look over areas and see how the travel regions and entrances work together.

Tired of Bhaal? Try some classics mods instead:
Classic Adventures
Official Classic Adventures Website


#13 Azkyroth

Azkyroth
  • Modder
  • 3496 posts

Posted 09 July 2006 - 06:08 PM

If you want to create a simple, new area, use IETME. It is easier than DLTCEP. However, at some point, you will want the full features that DLTCEP offers over IETME. You can use IETME now to look over areas and see how the travel regions and entrances work together.


Download link? (I'm lazy)

"Tyranny is a quiet thing at first, a prim and proper lady pursing her lips and shaking her head disapprovingly, asking, well what were you doing (wearing that dress, walking home at that hour, expressing those inappropriate thoughts) anyway? It's subtle and insidious, disguised as reasonable precautions which become more and more oppressive over time, until our lives are defined by the things we must avoid. She's easy enough to agree with, after all, she's only trying to help -- and yet she's one of the most dangerous influences we face, because if she prevails, it puts the raping, robbing, axe-wielding madmen of the world in complete control. Eventually they'll barely need to wield a thing, all they'll have to do is leer menacingly and we fall all over ourselves trying to placate them." -godlizard


#14 Sticz

Sticz

    Monkey - In the time of Chimpanzees

  • Member
  • 385 posts

Posted 10 July 2006 - 01:56 PM

I was fidgeting with the DLTCP and got a few results, nothing I would bother trying to put into the game yet. I have many questions.

First of all, I'll tell you what I'm working with. I wanted to add the AR0500 from BG1 to the big vacant area between Windspear and Amn. I tried a severely dumbed down version of the area (no other areas, no doors, no spawns, etc.) just to get the area on the map and be able to travel back and fourth to it.

My questions so far are these:

Making the map icon: First, without making a new one, just using an existing one (D'Arnese Hold for example) how do I attach the necessary icon to the map or .are? I don't see this anywhere.

Seccond, what program would I edit an existing BG2 icon or BG1 Icon with and where are these files located to edit them with? I have not been able to isolate these icons other than with NI in the worldmap.

Naming the area: Using the newarea.2da, how do I get a good STR REF in there? I need to give it a name like "Sticz Fortress", how do I get this in there?


Lots of questions, but these will get me pretty far. I would love to know how the BGT team got all of their icons installed and all of their areas mapped into BG2, but I dont have the skills to plow through all of that information.

Thanks all.

Sticz
"For a crazy person, you don't drool much." Complement from Dilbert's Wally.

#15 Sticz

Sticz

    Monkey - In the time of Chimpanzees

  • Member
  • 385 posts

Posted 10 July 2006 - 03:04 PM

Ok, I found a GREAT template from SConrad, which follows:

// 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.

However, I need a couple of things verified, possibly a few examples:

For all of the things in "%link_off%", "%area_numb%", etc., what am I putting in here? This is the code I am searching for, I'm fairly sure anyways, but I have a few issues with it.

I still need to know how to add the area icons, but this should be one of two ways to add the area. I know the newarea.2da is a method, but this one looks complicated enough to work too! :woot:

Anyways, I still need a TON of help on this one. Once I make my cheese-festival area, I can go on to make the village-people bar, the high-colonic forrest, and, most importantly, the Neverland Ranch.


Sticz
"For a crazy person, you don't drool much." Complement from Dilbert's Wally.

#16 Azkyroth

Azkyroth
  • Modder
  • 3496 posts

Posted 10 July 2006 - 03:17 PM

First of all, I'll tell you what I'm working with. I wanted to add the AR0500 from BG1 to the big vacant area between Windspear and Amn. I tried a severely dumbed down version of the area (no other areas, no doors, no spawns, etc.) just to get the area on the map and be able to travel back and fourth to it.


Err, where on the map exactly? (Coordinates on the image?)

"Tyranny is a quiet thing at first, a prim and proper lady pursing her lips and shaking her head disapprovingly, asking, well what were you doing (wearing that dress, walking home at that hour, expressing those inappropriate thoughts) anyway? It's subtle and insidious, disguised as reasonable precautions which become more and more oppressive over time, until our lives are defined by the things we must avoid. She's easy enough to agree with, after all, she's only trying to help -- and yet she's one of the most dangerous influences we face, because if she prevails, it puts the raping, robbing, axe-wielding madmen of the world in complete control. Eventually they'll barely need to wield a thing, all they'll have to do is leer menacingly and we fall all over ourselves trying to placate them." -godlizard


#17 Sticz

Sticz

    Monkey - In the time of Chimpanzees

  • Member
  • 385 posts

Posted 10 July 2006 - 03:20 PM

I think I was aiming at about 1100, 300. The coordinates can be fudged, I just want to see it on the map and then I'll start tweaking.

Sticz
"For a crazy person, you don't drool much." Complement from Dilbert's Wally.

#18 Yovaneth

Yovaneth

    The newly-appointed Master Builder of Baldur's Gate

  • Modder
  • 3058 posts

Posted 11 July 2006 - 07:26 AM

I think I was aiming at about 1100, 300. The coordinates can be fudged, I just want to see it on the map and then I'll start tweaking.

Sticz

That's the template I'm using..... it won't show the area without starting a new game. Give me a while and I'll upload a commented version of it as used for one of my new areas.

-Y-

#19 Sticz

Sticz

    Monkey - In the time of Chimpanzees

  • Member
  • 385 posts

Posted 11 July 2006 - 03:05 PM

Thanks, I will wait patiently for it!

Sticz
"For a crazy person, you don't drool much." Complement from Dilbert's Wally.

#20 Azkyroth

Azkyroth
  • Modder
  • 3496 posts

Posted 11 July 2006 - 05:47 PM

I think I was aiming at about 1100, 300. The coordinates can be fudged, I just want to see it on the map and then I'll start tweaking.

Sticz


1100, 300...

Ok, shouldn't be a conflict then. Offhand, does anyone know if there's currently a mod that puts anything at about 1000, 100?

"Tyranny is a quiet thing at first, a prim and proper lady pursing her lips and shaking her head disapprovingly, asking, well what were you doing (wearing that dress, walking home at that hour, expressing those inappropriate thoughts) anyway? It's subtle and insidious, disguised as reasonable precautions which become more and more oppressive over time, until our lives are defined by the things we must avoid. She's easy enough to agree with, after all, she's only trying to help -- and yet she's one of the most dangerous influences we face, because if she prevails, it puts the raping, robbing, axe-wielding madmen of the world in complete control. Eventually they'll barely need to wield a thing, all they'll have to do is leer menacingly and we fall all over ourselves trying to placate them." -godlizard