So there is an need in those. Several times I've been thinking about sitting down and defining a few area-patching macros after seeing the question repeatedly asked.I'd be more interested in seeing commands (or at least standard macros) to do stuff like ADD_CONTAINER_TO_AREA or ADD_DOOR_TO_AREA or ADD_INFO_TRIGGER to replace your long sheets of code
Dialogue/string patching
#41
Posted 23 May 2009 - 02:25 PM
Retired from modding.
#42
Posted 23 May 2009 - 02:58 PM
- Liam
Modding Projects
Complete:
Arath NPC - Nephele NPC - Xulaye NPC - Iylos NPC - Ninde NPC - Darian NPC - Yeslick NPC - Adrian NPC - Dace NPC - Valerie NPC - Isra NPC
Viconia Friendship - Mazzy Friendship - Imoen Friendship - Yoshimo Friendship - Sarevok Friendship - Neera Expansion
IEP Extended Banter
Sarevok Romance
Haer'Dalis Romance
In Progress:
Khadion NPC - Delainy NPC - Sarine NPC
#43
Posted 09 June 2009 - 01:44 AM
Ok, it seems I hit another glitch here. I want to change a string of unknown index that has an associated sound clip, for example:Miloch, if you know the string you want the word replaced in, why not simply use STRING_SET? It takes both full strings and indexes as the first parameter.
STRING_SET ~[TANAR'RI 01]~ [_ANAR_01] ~[TANAR'RI 01]~ [TANAR01]Doesn't like that, or: STRING_SET "~[TANAR'RI 01]~ [_ANAR_01]" "~[TANAR'RI 01]~ [TANAR01]" or anything else I can think of offhand.
Infinity Engine Contributions
Aurora * BG1 NPC * BG1 Fixpack * Haiass * Infinity Animations * Level 1 NPCs * P5Tweaks
PnP Free Action * Thrown Hammers * Unique Containers * BG:EE * BGII:EE * IWD:EE
================================================================
Player & Modder Resources
BAM Batcher * Creature Lister * Creature Checker * Creature Fixer * Tutu/BGT Area Map & List * Tutu Mod List
================================================================
"Infinity turns out to be the opposite of what people say it is. It is not 'that which has nothing beyond itself' that is infinite, but 'that which always has something beyond itself'." -Aristotle
#44
Posted 09 June 2009 - 12:07 PM
It doesn't like it because it can't find the sound clip within the strings data. For that, you're going to have to go back to READING the dialog.tlk file. See my initial idea/post and see the IESDP for adjustments to make. You will need to search for the matching sound clip and then use the reference number that is associated with it...Ok, it seems I hit another glitch here. I want to change a string of unknown index that has an associated sound clip, for example:Miloch, if you know the string you want the word replaced in, why not simply use STRING_SET? It takes both full strings and indexes as the first parameter.
STRING_SET ~[TANAR'RI 01]~ [_ANAR_01] ~[TANAR'RI 01]~ [TANAR01]Doesn't like that, or: STRING_SET "~[TANAR'RI 01]~ [_ANAR_01]" "~[TANAR'RI 01]~ [TANAR01]" or anything else I can think of offhand.
If your afraid of doing
COPY_EXISTING ~dialog.tlk~ ~dialog.tlk~
//your reads
BUT_ONLY_IF_IT_CHANGES
Then change it to
COPY_EXISTING ~dialog.tlk~ ~yourmod\dialog.tlk~
//your reads
BUT_ONLY_IF_IT_CHANGES
My working mods:
an AI Party Script for BG2 game engine DOWNLOAD LINK ONLY!
Interactive Tweaks for BG series with some IWD support. DOWNLOAD LINK ONLY!
Rest For 8 Hours an IWD mod
-------------------------------------------
My contributions: BG1Fixpack, BG1Tweaks
On Hold: Solestia an NPC for SOA
-------------------------------------------
My website: http://sasha-altheri...s.com/index.htm
#45
Posted 09 June 2009 - 03:41 PM
Eh, no... I'd rather overwrite the bogus sound clips, but there's got to be a better way. The sound clips are directly linked to the strings, so this really shouldn't be difficult to do with STRING_SET or a similar command.For that, you're going to have to go back to READING the dialog.tlk file.
That's probably worse than copying it directly (WeiDU will make a backup anyway).COPY_EXISTING ~dialog.tlk~ ~yourmod\dialog.tlk~
//your reads
BUT_ONLY_IF_IT_CHANGES
Infinity Engine Contributions
Aurora * BG1 NPC * BG1 Fixpack * Haiass * Infinity Animations * Level 1 NPCs * P5Tweaks
PnP Free Action * Thrown Hammers * Unique Containers * BG:EE * BGII:EE * IWD:EE
================================================================
Player & Modder Resources
BAM Batcher * Creature Lister * Creature Checker * Creature Fixer * Tutu/BGT Area Map & List * Tutu Mod List
================================================================
"Infinity turns out to be the opposite of what people say it is. It is not 'that which has nothing beyond itself' that is infinite, but 'that which always has something beyond itself'." -Aristotle
#46
Posted 09 June 2009 - 05:14 PM
You forget that BUT_ONLY_IF_IT_CHANGES prevents weidu from actually copying the file unless it actually changes. The file is placed into memory and read for the data. You will NOT be doing any writes, only getting the string reference number so that you can do STRING_SET strref# ~[TANAR'RI 01]~ [TANAR01] where strref# is the number that you discovered by READING the dialog.tlkEh, no... I'd rather overwrite the bogus sound clips, but there's got to be a better way. The sound clips are directly linked to the strings, so this really shouldn't be difficult to do with STRING_SET or a similar command.For that, you're going to have to go back to READING the dialog.tlk file.
That's probably worse than copying it directly (WeiDU will make a backup anyway).COPY_EXISTING ~dialog.tlk~ ~yourmod\dialog.tlk~
//your reads
BUT_ONLY_IF_IT_CHANGES
Trust me this is one thing that I KNOW will work without overwriting your dialog.tlk file. I can't stress this enough you will NOT be doing ANY WRITES so weidu will NOT copy it nor will there be a backup made...
But if you are still afraid...
Then try this out and see if it will work for you...
<<<<<<<< blank.file >>>>>>>> COPY ~blank.file~ ~get_strings_for_sound.txt~ INNER_PATCH_FILE ~dialog.tlk~ BEGIN //read dialog.tlk as an inner_patch_file which gets thrown away and not saved READ_LONG 0xa strref_num FOR(index=0;index<%strref_num%;index+=1)BEGIN READ_ASCII (0x12 + (0x1a * %index%) + 0x2) sound PATCH_IF (~%sound%~ STRING_EQUAL_CASE ~_ANAR_01~) BEGIN //if sound file matches what you want SET string_ref = %index% INNER_ACTION BEGIN OUTER_APPEND ~get_strings_for_sound.txt~ ~Found %sound% at %string_ref%~ END END END BUT_ONLY_IF_IT_CHANGES //STRING_SET_EVALUATE %string_ref% ~[TANAR'RI 01]~ [TANAR01]If after reading the report file, there is only one instance un-comment the string_set line. If there are multiple instances and they all need changed, you can move the string_set line to where the outer_append is at...
The nature of inner_patch_file requires that it be inside of a patch so some file must be copied to get into the patch state, in this case I used an inlined empty file to use for generating a report. If it works (I don't know if inner_patch_file can handle the dialog.tlk), you could do it inside of another copy block within the same component....
My working mods:
an AI Party Script for BG2 game engine DOWNLOAD LINK ONLY!
Interactive Tweaks for BG series with some IWD support. DOWNLOAD LINK ONLY!
Rest For 8 Hours an IWD mod
-------------------------------------------
My contributions: BG1Fixpack, BG1Tweaks
On Hold: Solestia an NPC for SOA
-------------------------------------------
My website: http://sasha-altheri...s.com/index.htm
#47
Posted 09 June 2009 - 06:22 PM
Infinity Engine Contributions
Aurora * BG1 NPC * BG1 Fixpack * Haiass * Infinity Animations * Level 1 NPCs * P5Tweaks
PnP Free Action * Thrown Hammers * Unique Containers * BG:EE * BGII:EE * IWD:EE
================================================================
Player & Modder Resources
BAM Batcher * Creature Lister * Creature Checker * Creature Fixer * Tutu/BGT Area Map & List * Tutu Mod List
================================================================
"Infinity turns out to be the opposite of what people say it is. It is not 'that which has nothing beyond itself' that is infinite, but 'that which always has something beyond itself'." -Aristotle
#48
Posted 09 June 2009 - 06:50 PM
<<<<<<<< table.2da _ANAR_01 @1 TANAR01 _ANAR_02 @2 TANAR02 >>>>>>>> COPY ~table.2da~ ~table.2da~ COUNT_2DA_ROWS 3 rows FOR (i=0;i<rows;i+=1) BEGIN READ_2DA_ENTRY i 0 3 ~old_sound~ READ_2DA_ENTRY i 1 3 ~string~ READ_2DA_ENTRY i 2 3 ~new_sound~ INNER_PATCH_FILE ~dialog.tlk~ BEGIN READ_LONG 0xa strref_num FOR(index=0;index<%strref_num%;index+=1)BEGIN READ_ASCII (0x12 + (0x1a * %index%) + 0x2) sound PATCH_IF (~%sound%~ STRING_EQUAL_CASE ~%old_sound%~) BEGIN SET string_ref = %index% STRING_SET_EVALUATE %string_ref% ~%string%~ %new_sound% END END END BUT_ONLY_IF_IT_CHANGES
PS Bah, typos...
Edited by GeN1e, 09 June 2009 - 06:54 PM.
Retired from modding.