Jump to content


Photo

Broken lines in .tp2 file


18 replies to this topic

#1 Steve

Steve
  • Members
  • 94 posts

Posted 15 November 2008 - 07:52 AM

Song and Silence v3 misuses the STRING_MATCHES_REGEXP operator in its .TP2 file, causing WeiDU to do the opposite of what is wanted. Adding the Adventurer kit after the NPC Kitpack's "Give Imoen Adventurer kit" will change every CRE except Imoen to an Adventurer. This mistake also shows up if the BG2 Fixpack is not installed. The fix is to change every:
"string" STRING_MATCHES_REGEXP ~pattern~
to:
("string" STRING_MATCHES_REGEXP ~pattern~)=0

Hm, I can't see any way to attach the fixed .TP2 file so you'll need to change it manually.

#2 Guest_Guest_*

Guest_Guest_*
  • Guests

Posted 15 November 2008 - 08:19 AM

Maybe you could email it to cmorgan and he could upload the fix?

#3 cmorgan

cmorgan

    journeyman investigator

  • Gibberlings
  • 6910 posts
  • Gender:Male
  • Location:Glencoe, IL, USA

Posted 15 November 2008 - 08:59 AM

Hey, Steve, to confirm: the change is


from:
// unecessary if Fixpack
ACTION_IF NOT MOD_IS_INSTALLED setup-bg2fixpack.tp2 0 THEN BEGIN
  //Fix Blade's pick pockets skill
  COPY ~song_and_silence/chorister/a!pp2.spl~  override
  COPY ~song_and_silence/chorister/a!pp3.spl~  override
  COPY ~song_and_silence/chorister/a!pp13.spl~ override
  COPY_EXISTING clabba02.2da override
	COUNT_2DA_COLS cols
	READ_2DA_ENTRIES_NOW rows cols
	SPRINT entry null
	FOR (i_0 = 0; i_0 < rows && ~%entry%~ STRING_MATCHES_REGEXP ~\*+~; i_0 += 1) BEGIN
	  READ_2DA_ENTRY_FORMER rows i_0 1 entry
	  PATCH_IF NOT ~%entry%~ STRING_MATCHES_REGEXP ~\*+~ BEGIN
		SET_2DA_ENTRY_LATER clabba02_set i_0 1 ~AP_A!PP13~
	  END
	END
	FOR (i_0 = 2; i_0 < cols && i_0 < 16; i_0 += 2) BEGIN
	  SPRINT entry null
	  FOR (i_1 = 0; i_1 < rows && ~%entry%~ STRING_MATCHES_REGEXP ~\*+~; i_1 += 1) BEGIN
		READ_2DA_ENTRY_FORMER rows i_1 i_0 entry
		PATCH_IF NOT ~%entry%~ STRING_MATCHES_REGEXP ~\*+~ BEGIN
		  PATCH_IF 2 * (i_0 / 2) = i_0 BEGIN
			SET_2DA_ENTRY_LATER clabba02_set i_1 i_0 ~AP_A!PP2~
		  END ELSE BEGIN
			SET_2DA_ENTRY_LATER clabba02_set i_1 i_0 ~AP_A!PP3~
		  END
		END
	  END
	END
	SET_2DA_ENTRIES_NOW clabba02_set cols
	PRETTY_PRINT_2DA
  BUT_ONLY
  UNLESS ~AP_CDBLPP~

to:
// unecessary if Fixpack
ACTION_IF NOT MOD_IS_INSTALLED setup-bg2fixpack.tp2 0 THEN BEGIN
  //Fix Blade's pick pockets skill
  COPY ~song_and_silence/chorister/a!pp2.spl~  override
  COPY ~song_and_silence/chorister/a!pp3.spl~  override
  COPY ~song_and_silence/chorister/a!pp13.spl~ override
  COPY_EXISTING clabba02.2da override
	COUNT_2DA_COLS cols
	READ_2DA_ENTRIES_NOW rows cols
	SPRINT entry null
	FOR (i_0 = 0; i_0 < rows && ~%entry%~ STRING_MATCHES_REGEXP ~\*+~; i_0 += 1) BEGIN
	  READ_2DA_ENTRY_FORMER rows i_0 1 entry
	  PATCH_IF NOT (~%entry%~ STRING_MATCHES_REGEXP ~\*+~) = 0  BEGIN
		SET_2DA_ENTRY_LATER clabba02_set i_0 1 ~AP_A!PP13~
	  END
	END
	FOR (i_0 = 2; i_0 < cols && i_0 < 16; i_0 += 2) BEGIN
	  SPRINT entry null
	  FOR (i_1 = 0; i_1 < rows && ~%entry%~ STRING_MATCHES_REGEXP ~\*+~; i_1 += 1) BEGIN
		READ_2DA_ENTRY_FORMER rows i_1 i_0 entry
		PATCH_IF NOT (~%entry%~ STRING_MATCHES_REGEXP ~\*+~) =  0 BEGIN
		  PATCH_IF 2 * (i_0 / 2) = i_0 BEGIN
			SET_2DA_ENTRY_LATER clabba02_set i_1 i_0 ~AP_A!PP2~
		  END ELSE BEGIN
			SET_2DA_ENTRY_LATER clabba02_set i_1 i_0 ~AP_A!PP3~
		  END
		END
	  END
	END
	SET_2DA_ENTRIES_NOW clabba02_set cols
	PRETTY_PRINT_2DA
  BUT_ONLY
  UNLESS ~AP_CDBLPP~



FOR (i_0 = 0; i_0 < rows && ~%entry%~ STRING_MATCHES_REGEXP ~\*+~; i_0 += 1) BEGIN matches the pattern, but

~%entry%~ STRING_MATCHES_REGEXP ~\*+~ does not...

right?

And more specifically to this trouble,

//This means that if Idobek's Kitpack is installed, Nalia and Imoen will get this version of the Adventurer.
ACTION_IF MOD_IS_INSTALLED npckit.tp2 1400 || MOD_IS_INSTALLED npckit.tp2 2500 THEN BEGIN
  COPY_EXISTING_REGEXP GLOB ~^.+\.cre$~ override
	PATCH_IF SOURCE_SIZE > 0x2d3 BEGIN
	READ_ASCII DEATHVAR dv
	  PATCH_IF		  "%dv%" STRING_MATCHES_REGEXP ~^imoen2?$~ && MOD_IS_INSTALLED npckit.tp2 1400 BEGIN
		PATCH_PRINT @80
		WRITE_SHORT 0x244 0x0000
		WRITE_BYTE  0x246 %A!ADVENTURER%
		WRITE_BYTE  0x247 0x40
	  END ELSE PATCH_IF "%dv%" STRING_MATCHES_REGEXP ~^nalia$~   && MOD_IS_INSTALLED npckit.tp2 2500 BEGIN
		PATCH_PRINT @81
		WRITE_SHORT 0x244 0x0000
		WRITE_BYTE  0x246 %A!ADVENTURER%
		WRITE_BYTE  0x247 0x40
	  END
	END
  BUT_ONLY
END


the

PATCH_IF "%dv%" STRING_MATCHES_REGEXP ~^imoen2?$~ && MOD_IS_INSTALLED npckit.tp2 1400 BEGIN

and similar need to be

PATCH_IF ("%dv%" STRING_MATCHES_REGEXP ~^imoen2?$~) = 0 && MOD_IS_INSTALLED npckit.tp2 1400 BEGIN


?

(wait a sec - no. it needs to be

FOR (i_0 = 0; i_0 < rows && (~%entry%~ STRING_MATCHES_REGEXP ~\*+~) = 0; i_0 += 1) BEGIN


right...)
I love deadlines. I love the whooshing noise they make as they go by. - Douglas Adams

#4 Mike1072

Mike1072
  • Gibberlings
  • 1718 posts
  • Gender:Male
  • Location:Canada

Posted 15 November 2008 - 02:20 PM

Hey, Steve, to confirm: the change is


from:

// unecessary if Fixpack
ACTION_IF NOT MOD_IS_INSTALLED setup-bg2fixpack.tp2 0 THEN BEGIN
  //Fix Blade's pick pockets skill
  COPY ~song_and_silence/chorister/a!pp2.spl~  override
  COPY ~song_and_silence/chorister/a!pp3.spl~  override
  COPY ~song_and_silence/chorister/a!pp13.spl~ override
  COPY_EXISTING clabba02.2da override
	COUNT_2DA_COLS cols
	READ_2DA_ENTRIES_NOW rows cols
	SPRINT entry null
	FOR (i_0 = 0; i_0 < rows && ~%entry%~ STRING_MATCHES_REGEXP ~\*+~; i_0 += 1) BEGIN
	  READ_2DA_ENTRY_FORMER rows i_0 1 entry
	  PATCH_IF NOT ~%entry%~ STRING_MATCHES_REGEXP ~\*+~ BEGIN
		SET_2DA_ENTRY_LATER clabba02_set i_0 1 ~AP_A!PP13~
	  END
	END
	FOR (i_0 = 2; i_0 < cols && i_0 < 16; i_0 += 2) BEGIN
	  SPRINT entry null
	  FOR (i_1 = 0; i_1 < rows && ~%entry%~ STRING_MATCHES_REGEXP ~\*+~; i_1 += 1) BEGIN
		READ_2DA_ENTRY_FORMER rows i_1 i_0 entry
		PATCH_IF NOT ~%entry%~ STRING_MATCHES_REGEXP ~\*+~ BEGIN
		  PATCH_IF 2 * (i_0 / 2) = i_0 BEGIN
			SET_2DA_ENTRY_LATER clabba02_set i_1 i_0 ~AP_A!PP2~
		  END ELSE BEGIN
			SET_2DA_ENTRY_LATER clabba02_set i_1 i_0 ~AP_A!PP3~
		  END
		END
	  END
	END
	SET_2DA_ENTRIES_NOW clabba02_set cols
	PRETTY_PRINT_2DA
  BUT_ONLY
  UNLESS ~AP_CDBLPP~

to:
...

I don't believe this needs to be changed.

//This means that if Idobek's Kitpack is installed, Nalia and Imoen will get this version of the Adventurer.
ACTION_IF MOD_IS_INSTALLED npckit.tp2 1400 || MOD_IS_INSTALLED npckit.tp2 2500 THEN BEGIN
  COPY_EXISTING_REGEXP GLOB ~^.+\.cre$~ override
	PATCH_IF SOURCE_SIZE > 0x2d3 BEGIN
	READ_ASCII DEATHVAR dv
	  PATCH_IF		  "%dv%" STRING_MATCHES_REGEXP ~^imoen2?$~ && MOD_IS_INSTALLED npckit.tp2 1400 BEGIN
		PATCH_PRINT @80
		WRITE_SHORT 0x244 0x0000
		WRITE_BYTE  0x246 %A!ADVENTURER%
		WRITE_BYTE  0x247 0x40
	  END ELSE PATCH_IF "%dv%" STRING_MATCHES_REGEXP ~^nalia$~   && MOD_IS_INSTALLED npckit.tp2 2500 BEGIN
		PATCH_PRINT @81
		WRITE_SHORT 0x244 0x0000
		WRITE_BYTE  0x246 %A!ADVENTURER%
		WRITE_BYTE  0x247 0x40
	  END
	END
  BUT_ONLY
END


the

PATCH_IF "%dv%" STRING_MATCHES_REGEXP ~^imoen2?$~ && MOD_IS_INSTALLED npckit.tp2 1400 BEGIN

and similar need to be

PATCH_IF ("%dv%" STRING_MATCHES_REGEXP ~^imoen2?$~) = 0 && MOD_IS_INSTALLED npckit.tp2 1400 BEGIN


?

Yep.

#5 Steve

Steve
  • Members
  • 94 posts

Posted 15 November 2008 - 03:11 PM

Mike is correct; I misread the code. The lines that are done when the Fixpack is not installed are OK. Only the two STRING_MATCHES_REGEXP in the Adventurer section need to be changed.

#6 Guest_Dirty Uncle Bertie_*

Guest_Dirty Uncle Bertie_*
  • Guests

Posted 16 November 2008 - 06:11 AM

I looked in ABDCDSRQ.2DA and ABDCSCRQ.2DA and saw that the ADVENTURER entry looked like this:

MIN_STR MIN_DEX MIN_CON MIN_INT MIN_WIS MIN_CHR
A!ADVENTURER 0 17 0 0 0 0

But all the other entries look like this:

[codebox] MIN_STR MIN_DEX MIN_CON MIN_INT MIN_WIS MIN_CHR
HELM 0 0 0 0 17 0
LATHANDER 0 0 0 0 17 0
[/codebox]

#7 Guest_D. U. Bertie_*

Guest_D. U. Bertie_*
  • Guests

Posted 06 December 2008 - 03:31 PM

Anyone care to comment on the ABDCDSRQ.2DA and ABDCSCRQ.2DA issue? Is this something I should be worried about?

#8 Steve

Steve
  • Members
  • 94 posts

Posted 07 December 2008 - 09:06 PM

The game doesn't care about lining up columns, just that there are the right number of fields. The line shows that the A!ADVENTURER kit requires a minimum Dex of 17.

#9 Guest_D. U. Bertie_*

Guest_D. U. Bertie_*
  • Guests

Posted 08 December 2008 - 02:59 AM

Cool, thanks.

I noticed that the BURGLAR and SHARPSHOOTER entries were fine (haven't installed any other kits from S&S) so thought that maybe there was just an issue with the ADVENTURER kit. Still, for neatness sake maybe it could be corrected in the next version.

#10 Azazello

Azazello

    The Anti-Spammer

  • Members
  • 555 posts
  • Gender:Male
  • Location:Orlando (via Nairobi, Kenya {via New York City})

Posted 08 December 2008 - 08:37 PM

I noticed that the BURGLAR and SHARPSHOOTER entries were fine (haven't installed any other kits from S&S) so thought that maybe there was just an issue with the ADVENTURER kit. Still, for neatness sake maybe it could be corrected in the next version.

Mods are rarely corrected for neatness. Don't believe me--start going thru many TP2 and BAF files of different mods.

Edited by Azazello, 08 December 2008 - 08:38 PM.


#11 Leomar

Leomar
  • Members
  • 405 posts
  • Location:Germany

Posted 25 May 2009 - 08:07 AM

Only to let you know, that we fix this with the BiG World Fixpack:

--- song_and_silence\setup-song_and_silence.tp2	Fri Aug 01 10:13:22 2008
+++ C:\BWP Patchstudio\patched files\song_and_silence\setup-song_and_silence.tp2	Tue Dec 16 19:13:05 2008
@@ -685,7 +685,7 @@
   COPY_EXISTING_REGEXP GLOB ~^.+\.cre$~ override
	 PATCH_IF SOURCE_SIZE > 0x2d3 BEGIN
	 READ_ASCII DEATHVAR dv
-	  PATCH_IF		  "%dv%" STRING_MATCHES_REGEXP ~^imoen2?$~ && MOD_IS_INSTALLED npckit.tp2 1400 BEGIN
+	  PATCH_IF ("%dv%" STRING_MATCHES_REGEXP ~^imoen2?$~) = 0 && MOD_IS_INSTALLED npckit.tp2 1400 BEGIN
		 PATCH_PRINT @80
		 WRITE_SHORT 0x244 0x0000
		 WRITE_BYTE  0x246 %A!ADVENTURER%

Greetings Leomar

#12 Mike1072

Mike1072
  • Gibberlings
  • 1718 posts
  • Gender:Male
  • Location:Canada

Posted 25 May 2009 - 01:30 PM

Only to let you know, that we fix this with the BiG World Fixpack:

-	  PATCH_IF		  "%dv%" STRING_MATCHES_REGEXP ~^imoen2?$~ && MOD_IS_INSTALLED npckit.tp2 1400 BEGIN
+	  PATCH_IF ("%dv%" STRING_MATCHES_REGEXP ~^imoen2?$~) = 0 && MOD_IS_INSTALLED npckit.tp2 1400 BEGIN

Greetings Leomar

The similar statement just below on line 693:
END ELSE PATCH_IF "%dv%" STRING_MATCHES_REGEXP ~^nalia$~   && MOD_IS_INSTALLED npckit.tp2 2500 BEGIN
Should be changed as well, to:
END ELSE PATCH_IF ("%dv%" STRING_MATCHES_REGEXP ~^nalia$~) = 0 && MOD_IS_INSTALLED npckit.tp2 2500 BEGIN


#13 Leomar

Leomar
  • Members
  • 405 posts
  • Location:Germany

Posted 27 May 2009 - 01:49 AM

Only to let you know, that we fix this with the BiG World Fixpack:

-	  PATCH_IF		  "%dv%" STRING_MATCHES_REGEXP ~^imoen2?$~ && MOD_IS_INSTALLED npckit.tp2 1400 BEGIN
+	  PATCH_IF ("%dv%" STRING_MATCHES_REGEXP ~^imoen2?$~) = 0 && MOD_IS_INSTALLED npckit.tp2 1400 BEGIN

Greetings Leomar

The similar statement just below on line 693:
END ELSE PATCH_IF "%dv%" STRING_MATCHES_REGEXP ~^nalia$~   && MOD_IS_INSTALLED npckit.tp2 2500 BEGIN
Should be changed as well, to:
END ELSE PATCH_IF ("%dv%" STRING_MATCHES_REGEXP ~^nalia$~) = 0 && MOD_IS_INSTALLED npckit.tp2 2500 BEGIN

Thank you Mike1072, we'll add this. :crazyeyes:

Greetings Leomar

#14 cmorgan

cmorgan

    journeyman investigator

  • Gibberlings
  • 6910 posts
  • Gender:Male
  • Location:Glencoe, IL, USA

Posted 24 June 2009 - 09:21 AM

Posting for recheck, before uploading Song 7 Silence v4;

changes:

Roter Berserker, German Translation of Song & Silence http://forums.gibber...showtopic=17482

Steve and mike1072's repairs, http://forums.gibber...showtopic=16050

Nothing else anyone has found, right?
I love deadlines. I love the whooshing noise they make as they go by. - Douglas Adams

#15 cmorgan

cmorgan

    journeyman investigator

  • Gibberlings
  • 6910 posts
  • Gender:Male
  • Location:Glencoe, IL, USA

Posted 24 June 2009 - 09:31 AM

Oh, and
http://forums.gibber...s...st&p=149516

If not, then it should be ready for packaging. I will show changes below and leave this for a bit for recheck by anyone who can comment -

readme changes:
<body> 
<h1>Song and Silence: A Mod for Bards and Thieves</h1>
<div class="section">
<p><strong><a href="http://www.gibberlings3.net/">A Gibberlings Three Mod</a><br />
Authors: <a href="http://forums.gibberlings3.net/index.php?showuser=30">Andyr</a>, <a href="http://forums.gibberlings3.net/index.php?showuser=25">Grim Squeaker</a>, and <a href="http://forums.gibberlings3.net/index.php?showuser=17">NiGHTMARE</a> <br />
On the web: <a href="http://www.gibberlings3.net/sns/">Home page</a></strong> and <strong><a href="http://forums.gibberlings3.net/index.php?showforum=72">discussion forum</a></strong></p>
<p><strong> Version 4 - <a href="http://www.gibberlings3.net/downloads/#sns">Check for the most recent version</a></strong><br />
<strong>Languages:</strong> English, French, German, Polish<br />
<strong>Platforms:</strong> Windows, Mac OS X, and Linux
</div>

// snip for space
<h2>Version History</h2>
<div class="section">
<p><strong>Version 4 - June 24, 2009 </strong></p>
<ul>
<li>WeiDU update to v210</li>
<li><a href="http://forums.gibberlings3.net/index.php?showtopic=17482">German translation</a> provided by Roter Berserker</li>
<li><a href="http://forums.gibberlings3.net/index.php?showtopic=16050">PATCH_IF code repair</a> provided by Steve and Mike1072</li>
<li><a href="http://forums.gibberlings3.net/index.php?showtopic=12060">ASCIIE code repair</a> provided by Mike1072</li>
</ul>
<p><strong>Version 3 - August 1, 2008 </strong></p>
<ul>
<li>WeiDU update to v208, README/VERSION behavior, removed obsolete auto-update.bat, cosmetic readme fixes.</li>
<li>French translation by Zayn and Lothringen of the d'Oghmatiques, Polish translation by Yarpen.</li>
<li>Bugfixes and reported problems through June, 2008 addressed by Nythrun.</li>
</ul>
<p><strong>Version 2 - September 18, 2007</strong></p>
<ul>


code changes:

language added,
LANGUAGE ~German (translated by Roter Berserker)~ ~german~ ~song_and_silence/tra/german/setup-song_and_silence.tra~

and PATCH_IF repairs:
{done incorrectly - Mike1072 is IM'ing me through makings sure they work right!)
I love deadlines. I love the whooshing noise they make as they go by. - Douglas Adams



Reply to this topic



  


0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users