Jump to content


Photo

Question about appending .2da file


  • Please log in to reply
4 replies to this topic

#1 Welverin

Welverin
  • Member
  • 26 posts

Posted 30 January 2004 - 05:55 AM

Is it possible to add a new row to a 2da file (which contains reference to a new string, which is supposed to be installed) in a way less destructive than this:
APPEND ~tooltip.2da~ ~SW1H16 -1 13138 13139~
APPEND ~tooltip.2da~ ~SW1H16A -1 13138 13088~
APPEND ~tooltip.2da~ ~SW1H16B -1 13087 13088~
APPEND ~tooltip.2da~ ~SW1H16C -1 13088 13089~
APPEND ~tooltip.2da~ ~SW1H16D -1 13139 13140~
APPEND ~tooltip.2da~ ~SW1H16E -1 13139 13089~

STRING_SET 13087 @20 //string orginally containing name of book11
STRING_SET 13138 @21 //string orginally containing description of book11
STRING_SET 13088 @22 //string orginally containing name of book12
STRING_SET 13139 @23 //string orginally containing description of book11
STRING_SET 13089 @24 //string orginally containing name of book13
STRING_SET 13140 @25 //string orginally containing description of book11

COPY_EXISTING ~book11.itm~ ~override/book11.itm~
  SAY NAME2 @26
  SAY DESC @27
COPY_EXISTING ~book12.itm~ ~override/book12.itm~
  SAY NAME2 @28
  SAY DESC @29
COPY_EXISTING ~book13.itm~ ~override/book13.itm~
  SAY NAME2 @30
  SAY DESC @31
:rolleyes:

#2 Rastor

Rastor

    Yes, I really am a dragon. Yes, I am a jerk. Live with it.

  • Member
  • 2001 posts

Posted 30 January 2004 - 10:43 AM

Yeah.

Do your APPENDS to the .2da as you do,

Don't use the STRING_SET command, but instead do COPY_EXISTING and then SAY NAME & SAY DESC for each of the books.

Sorry I can't post more, but I'm on my way out the door.
Home of Kitanya, Improved Asylum, more...

Posted Image

#3 Welverin

Welverin
  • Member
  • 26 posts

Posted 30 January 2004 - 11:41 AM

Yes, well, there is one problem however... books are completly irrelevant in this case. To say the truth I've used them only becouse I think that not too many mods are adding items which are using orginal descriptions of history books, such as Hystory of Sembia or Cormyr :rolleyes: Anyway, logic behind above code is quite simple:
Since I cannot just use something like this: APPEND ~tooltip.2da~ ~SW1H16 -1 @25 @26~ I was forced to use some of existing strings (in this case: 13138, 13139, 13088, 13087, 13089, 13140) to put their strref into the APPEND code, and then to have correct info in strings I've used STRING_SET to switch book descriptions to short descriptions of abilities, and since it would be quite lame to leave books without correct descriptions I've used COPY_EXISTING with SAY actions to bring back correct descriptions.

:rolleyes: I just hope this makes any sense.

#4 Idobek

Idobek

    Pocket Plane Gibberling

  • Member
  • 429 posts

Posted 30 January 2004 - 03:26 PM

You want to APPEND with some (hopefully) unique placeholder numbers and then reload the APPENDed file and REPLACE the numbers with string refs:
COPY_EXISTING ~tooltip.2da~ ~override/tooltip.2da~

   APPEND ~tooltip.2da~ ~NEWITEM 99990 99991 99992~

COPY_EXISTING ~tooltip.2da~ ~override/tooltip.2da~

   REPLACE ~99990~ @0

   REPLACE ~99991~ @1

   REPLACE ~99992~ @2
You might be able to use text as the placeholders but I have never tried.

#5 Welverin

Welverin
  • Member
  • 26 posts

Posted 30 January 2004 - 03:49 PM

Thank you very much Idobek :D That will save me lots of hair loss ^_^

Text placeholders work fine as well ;)