Author Topic: Please, help with an area  (Read 2944 times)

0 Members and 1 Guest are viewing this topic.

Offline Riojano2002

  • Newbie
  • *
  • Posts: 1
  • Karma: +0/-0
    • View Profile
Please, help with an area
« on: October 17, 2006, 05:05:27 PM »
Hi everybody:

Im Riojano2002, a spanish modder. Our mod, "Lord of Darkness" its near to it conclusion, but we are

having some problems adding the new area to the worldmap.

This new area does appear in the worldmap, and you can travel there without any error. After that, the

group can't travel from this new area anywhere. I couldnt tell where the error is in: code, area... Can

anyone help us?

This is the code in the .tp2 file



APPEND ~MASTAREA.2da~ ~ARMEJ5  value~

COPY_EXISTING ~worldmap.wmp~ ~override~
 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
 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 // inserting new area to wmp
   WRITE_ASCII ("%area_off%" +        (0xf0 * "%area_num%")) ~ARMEJ5~
   WRITE_ASCII ("%area_off%" + 0x08 + (0xf0 * "%area_num%")) ~ARMEJ5~
   WRITE_ASCII ("%area_off%" + 0x10 + (0xf0 * "%area_num%")) ~ARMEJ5~
   WRITE_LONG  ("%area_off%" + 0x34 + (0xf0 * "%area_num%")) 19   // mapicon number
   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%")) ~Nido de Estrellas~
   SAY         ("%area_off%" + 0x44 + (0xf0 * "%area_num%")) #-1
   WRITE_SHORT ("%area_off%" + 0x50 + (0xf0 * "%area_num%")) ("%link_num%" + 4) // N link index
   WRITE_SHORT ("%area_off%" + 0x58 + (0xf0 * "%area_num%")) ("%link_num%" + 4) // W link index
   WRITE_SHORT ("%area_off%" + 0x60 + (0xf0 * "%area_num%")) ("%link_num%" + 4) // S link index
   WRITE_SHORT ("%area_off%" + 0x68 + (0xf0 * "%area_num%")) ("%link_num%") // E link index
   WRITE_SHORT ("%area_off%" + 0x6c + (0xf0 * "%area_num%")) 4 // one link E
 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 + 0x4)                   "#nlink2"
     READ_SHORT  ("%entry%" + 0x50 + 0x8)                   "wlink"
     WRITE_SHORT ("%entry%" + 0x50 + 0x8)                   ("%wlink%" + 3)
     READ_SHORT  ("%entry%" + 0x50 + 0x8)                   "wlink2"
     READ_SHORT  ("%entry%" + 0x50 + 0x8 + 0x4)             "#wlink"
     WRITE_SHORT ("%entry%" + 0x50 + 0x8 + 0x4)             ("%#wlink%" + 1)
     READ_SHORT  ("%entry%" + 0x50 + 0x8 + 0x4)             "#wlink2"
     READ_SHORT  ("%entry%" + 0x50 + 0x8 + 0x8)             "slink"
     WRITE_SHORT ("%entry%" + 0x50 + 0x8 + 0x8)             ("%slink%" + 2)
     READ_SHORT  ("%entry%" + 0x50 + 0x8 + 0x8)             "slink2"
     READ_SHORT  ("%entry%" + 0x50 + 0x8 + 0x8 + 0x4)       "#slink"
     WRITE_SHORT ("%entry%" + 0x50 + 0x8 + 0x8 + 0x4)       ("%#slink%" + 1)
     READ_SHORT  ("%entry%" + 0x50 + 0x8 + 0x8 + 0x4)       "#slink2"
     READ_SHORT  ("%entry%" + 0x50 + 0x8 + 0x8 + 0x8)       "elink"
     WRITE_SHORT ("%entry%" + 0x50 + 0x8 + 0x8 + 0x8)       ("%elink%" + 1)
     READ_SHORT  ("%entry%" + 0x50 + 0x8 + 0x8 + 0x8)       "elink2"
     READ_SHORT  ("%entry%" + 0x50 + 0x8 + 0x8 + 0x8 + 0x4) "#elink"
     WRITE_SHORT ("%entry%" + 0x50 + 0x8 + 0x8 + 0x8 + 0x4) ("%#elink%" + 1)
     READ_SHORT  ("%entry%" + 0x50 + 0x8 + 0x8 + 0x8 + 0x4) "#elink2"
     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" = 1) BEGIN
     SET "outer_check" = 1
   END
   SET "entry" = ("%entry%" + 0xf0)
 END
 READ_LONG  0x30 "area_num2"
 READ_LONG  0x38 "link_off2"

 // Add link to ARMEJ5
 INSERT_BYTES  ("%link_off2%" - 0x01 + (0xd8 * "%nlink%")) 0xd8 // inserting one byte before eof to

avoid errors
   WRITE_LONG  ("%link_off2%"        + (0xd8 * "%nlink%")) ("%area_num2%" - 1) // target ARMEJ5
   WRITE_ASCII ("%link_off2%" + 0x04 + (0xd8 * "%nlink%")) ~RRMEJ5~ // entry point
   WRITE_LONG  ("%link_off2%" + 0x28 + (0xd8 * "%nlink%")) 4 // unknown value--matching other links just

in case

 // Add link to ARMEJ5
 INSERT_BYTES  ("%link_off2%" - 0x01 + (0xd8 * "%wlink2%")) 0xd8 // inserting one byte before eof to

avoid errors
   WRITE_LONG  ("%link_off2%"        + (0xd8 * "%wlink2%")) ("%area_num2%" - 1) // target ARMEJ5
   WRITE_ASCII ("%link_off2%" + 0x04 + (0xd8 * "%wlink2%")) ~RRMEJ5~ // entry point
   WRITE_LONG  ("%link_off2%" + 0x28 + (0xd8 * "%wlink2%")) 4 // unknown value--matching other links

just in case

 // Add link to ARMEJ5
 INSERT_BYTES  ("%link_off2%" - 0x01 + (0xd8 * "%slink2%")) 0xd8 // inserting one byte before eof to

avoid errors
   WRITE_LONG  ("%link_off2%"        + (0xd8 * "%slink2%")) ("%area_num2%" - 1) // target ARMEJ5
   WRITE_ASCII ("%link_off2%" + 0x04 + (0xd8 * "%slink2%")) ~RRMEJ5~ // entry point
   WRITE_LONG  ("%link_off2%" + 0x28 + (0xd8 * "%slink2%")) 4 // unknown value--matching other links

just in case

 // Add link to ARMEJ5
 INSERT_BYTES  ("%link_off2%" - 0x01 + (0xd8 * "%elink2%")) 0xd8 // inserting one byte before eof to

avoid errors
   WRITE_LONG  ("%link_off2%"        + (0xd8 * "%elink2%")) ("%area_num2%" - 1) // target ARMEJ5
   WRITE_ASCII ("%link_off2%" + 0x04 + (0xd8 * "%elink2%")) ~RRMEJ5~ // entry point
   WRITE_LONG  ("%link_off2%" + 0x28 + (0xd8 * "%elink2%")) 4 // unknown value--matching other links

just in case

 // Correct ALL other links after elink
 SET "entryy"       = ("%map_off%" + 0xb8)
 SET "outer_c"      = 0
 SET "num_entt"     = 0
 WHILE ("%outer_c%" = 0) BEGIN
   READ_ASCII ("%entryy%" + 0x8) "areaa" (2)
   PATCH_IF (("%areaa%" STRING_COMPARE_CASE "AR" = 0) OR ("%areaa%" STRING_COMPARE_CASE "G3" = 0)) BEGIN
     READ_SHORT ("%entryy%" + 0x50)                   "nllink"
     READ_SHORT ("%entryy%" + 0x50 + 0x8)             "wllink"
     READ_SHORT ("%entryy%" + 0x50 + 0x8 + 0x8)       "sllink"
     READ_SHORT ("%entryy%" + 0x50 + 0x8 + 0x8 + 0x8) "ellink"
     PATCH_IF ("%nllink%" > "%wlink2%") BEGIN
       WRITE_SHORT ("%entryy%" + 0x50) ("%nllink%" + 4)
     END
     PATCH_IF ("%wllink%" > "%wlink2%") BEGIN
       WRITE_SHORT ("%entryy%" + 0x50 + 0x8) ("%wllink%" + 4)
     END
     PATCH_IF ("%sllink%" > "%wlink2%") BEGIN
       WRITE_SHORT ("%entryy%" + 0x50 + 0x8 + 0x8) ("%sllink%" + 4)
     END
     PATCH_IF ("%ellink%" > "%wlink2%") BEGIN
       WRITE_SHORT ("%entryy%" + 0x50 + 0x8 + 0x8 + 0x8) ("%ellink%" + 4)
     END
   END ELSE
   PATCH_IF (("%area%" STRING_COMPARE_CASE "AR" = 1) AND ("%areaa%" STRING_COMPARE_CASE "G3" = 1)) BEGIN
     SET "outer_c" = 1
   END
   SET "entryy" = ("%entryy%" + 0xf0)
 END
 READ_LONG  0x30 "area_num"
 READ_LONG  0x34 "area_off"
 READ_LONG  0x38 "link_off"
 READ_LONG  0x3c "link_num"
 WRITE_LONG 0x3c ("%link_num%" + 4)

 // Add link to City Gates
 INSERT_BYTES  ("%link_off%" - 0x01 + (0xd8 * "%link_num%")) 0xd8 // inserting one byte before eof to

avoid errors
   WRITE_LONG  ("%link_off%"        + (0xd8 * "%link_num%")) 11 // target city gates
   WRITE_ASCII ("%link_off%" + 0x04 + (0xd8 * "%link_num%")) ~ExitNE~ // slums entry point
   WRITE_LONG  ("%link_off%" + 0x28 + (0xd8 * "%link_num%")) 4 // unknown value--matching other links

just in case


 // Add link to Umar Hills
 INSERT_BYTES  ("%link_off%" - 0x01 + (0xd8 * "%link_num%")) 0xd8 // inserting one byte before eof to

avoid errors
   WRITE_LONG  ("%link_off%"        + (0xd8 * "%link_num%")) 7 // target umar hills
   WRITE_ASCII ("%link_off%" + 0x04 + (0xd8 * "%link_num%")) ~ExitNW~ // slums entry point
   WRITE_LONG  ("%link_off%" + 0x28 + (0xd8 * "%link_num%")) 4 // unknown value--matching other links

just in case


 // Add link to Trademeet
 INSERT_BYTES  ("%link_off%" - 0x01 + (0xd8 * "%link_num%")) 0xd8 // inserting one byte before eof to

avoid errors
   WRITE_LONG  ("%link_off%"        + (0xd8 * "%link_num%")) 14 // target trademeet
   WRITE_ASCII ("%link_off%" + 0x04 + (0xd8 * "%link_num%")) ~ExitNW~ // slums entry point
   WRITE_LONG  ("%link_off%" + 0x28 + (0xd8 * "%link_num%")) 4 // unknown value--matching other links

just in case


 // Add link to De'Arnise Hold
 INSERT_BYTES  ("%link_off%" - 0x01 + (0xd8 * "%link_num%")) 0xd8 // inserting one byte before eof to

avoid errors
   WRITE_LONG  ("%link_off%"        + (0xd8 * "%link_num%")) 9 // target de'arnise
   WRITE_ASCII ("%link_off%" + 0x04 + (0xd8 * "%link_num%")) ~ExitSE~ // slums entry point
   WRITE_LONG  ("%link_off%" + 0x28 + (0xd8 * "%link_num%")) 4 // unknown value--matching other links

just in case
BUT_ONLY_IF_IT_CHANGES