Skip to content

Commit

Permalink
temp fix for softlock after dragon fight (#30), minor fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
eadmaster committed Nov 9, 2024
1 parent 99fa889 commit 888a07f
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 18 deletions.
6 changes: 3 additions & 3 deletions script/eng/events/110_00_1.TXT
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
1|
<CC03EA><color=0003><string=0001><lineend><color=0001>What are you doing here? Get yourself somewhere safe<pause><lineend>|
2|
<CC03EA><color=0006><string=000A><lineend><color=0001>I was, but my little girl is<lineend>missing.<pause><lineend><CC03EA>She must be somewhere nearby.<lineend>I'm not going anywhere<lineend>without her.<pause><lineend>|
<CC03EA><color=0006><string=000A><lineend><color=0001>I was, but my little girl is missing.<pause><lineend><CC03EA>She must be somewhere nearby.<lineend>I'm not going anywhere without her.<pause><lineend>|
3|
<CC03EA><color=0006><string=0035><lineend><color=0001>Mommy!<pause><lineend>|
4|
Expand Down Expand Up @@ -45,7 +45,7 @@
196609|
<CC03EA><color=0003><string=0001><lineend><color=0001>What are you doing here? Get yourself somewhere safe<pause><lineend>|
196610|
<CC03EA><color=0006><string=000A><lineend><color=0001><CC03ED=000A0018000103FF>I was, but<lineend>my little girl is missing.<lineend><CC03ED=000A0017000103FF><pause><CC03EA><CC03ED=000A0018000103FF>She must be.<lineend>somewhere nearby.<lineend><CC03ED=000A0017000103FF><pause><CC03EA><CC03ED=000A0018000103FF>I'm not going anywhere<lineend>without her.<lineend><CC03ED=000A0017000103FF><pause>|
<CC03EA><color=0006><string=000A><lineend><color=0001><CC03ED=000A0018000103FF>I was, but my little girl is missing.<lineend><CC03ED=000A0017000103FF><pause><CC03EA><CC03ED=000A0018000103FF>She must be somewhere nearby.<lineend><CC03ED=000A0017000103FF><pause><CC03EA><CC03ED=000A0018000103FF>I'm not going anywhere without her.<lineend><CC03ED=000A0017000103FF><pause>|
196611|
<CC03EA><color=0006><string=0035><lineend><color=0001>Mommy!<pause><lineend>|
196612|
Expand All @@ -67,7 +67,7 @@
196620|
<CC03EA><color=0004><string=017C><lineend><color=0001>That's a good idea.<pause><lineend>|
196621|
<CC03EA><color=0003><string=0001><lineend><color=0001>I still have something<lineend>important to do.<pause><lineend><CC03EA>The Black Dragon...<lineend>may still be<lineend>in the village, you see.<pause><lineend>|
<CC03EA><color=0003><string=0001><lineend><color=0001>I still have something important to do.<pause><lineend><CC03EA>The Black Dragon...<lineend>may still be in the village, you see.<pause><lineend>|
196622|
<CC03EA><color=0003><string=0001><lineend><color=0001><CC03ED=00010008000103FF>But where is he...Where did the Black Dragon go?<lineend><CC03ED=00010007000103FF><pause>|
196623|
Expand Down
2 changes: 1 addition & 1 deletion script/eng/events/135_21_0.TXT
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
65546|
<CC03EA><color=0005><string=0114><lineend><color=0001>You must be the one...<pause><lineend><CC03EA>...who got rid that meddling sword...<pause><lineend>|
65547|
<CC03EA><color=0003><string=0001><lineend><color=0001>Well, you save your breath, Demon. A few moments from now, you'll be right back where you were.<pause><lineend>|
<CC03EA><color=0003><string=0001><lineend><color=0001>Save your breath, Demon. A few moments from now, you'll be right back where you were.<pause><lineend>|
65548|
<CC03EA><color=0005><string=0114><lineend><color=0001>Your blood smells familiar...<pause><lineend><CC03EA>Golgotha...the one who trapped me...<lineend><pause><CC03EA>His blood smelled the same way...<lineend><pause><CC03EA>That makes you his son, doesn't it?<pause><lineend>|
65549|
Expand Down
2 changes: 1 addition & 1 deletion script/eng/events/176_00_0.TXT
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
65536|
<CC03EA><color=0002><string=0000><lineend><color=0001>This is the...God of Darkness...<<pause><lineend>|
<CC03EA><color=0002><string=0000><lineend><color=0001>This is the... God of Darkness...<<pause><lineend>|
65537|
<CC03EA><color=0002><string=0000><lineend><color=0001>I'll definitely stop it here!<pause><lineend>|
65538|
Expand Down
15 changes: 7 additions & 8 deletions src/buildcd/_build_patch.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,25 +6,22 @@ rm *.eng
rm "Princess Crown (Japan) (1M) (Track 01) (English).iso"
rm "Princess Crown (Japan) (1M) (Track 01) (English).iso.bak"
rm "Princess Crown (Japan) (1M) (Track 01) (English).iso.xdelta"
rm KANJI_ENG.BIN

# convert data bin track to iso
iat "Princess Crown (Japan) (1M) (Track 01).bin" "Princess Crown (Japan) (1M) (Track 01) (English).iso"
cp "Princess Crown (Japan) (1M) (Track 01) (English).iso" "Princess Crown (Japan) (1M) (Track 01) (English).iso.bak"

# update font
7z e -y "Princess Crown (Japan) (1M) (Track 01) (English).iso" KANJI.BIN
if [ "$1" == "new" ]; then
xdelta3 -d -s KANJI.BIN KANJI.BIN.xdelta KANJI_ENG.BIN # apply font patch
#xdelta3 -e -s KANJI.BIN KANJI_ENG.BIN KANJI.BIN.xdelta # create new font patch
fi
#cd-replace "Princess Crown (Japan) (1M) (Track 01) (English).iso" KANJI.BIN KANJI_ENG.BIN
xdelta3 -d -s KANJI.BIN KANJI.BIN.xdelta KANJI_ENG.BIN # apply English font patch
#xdelta3 -e -s KANJI.BIN KANJI_ENG.BIN KANJI.BIN.xdelta # create new font patch

TRANSLATED_SCRIPT_PATH=../../script/eng

# update items and names
7z e -y "Princess Crown (Japan) (1M) (Track 01) (English).iso" 0.BIN
#wine itemsutil.exe -i ${TRANSLATED_SCRIPT_PATH}/names.txt ${TRANSLATED_SCRIPT_PATH}/items.txt 0.BIN KANJI_ENG.BIN 0x2400
wine itemsutil.exe -i ${TRANSLATED_SCRIPT_PATH}/names.txt ${TRANSLATED_SCRIPT_PATH}/items.txt 0.BIN KANJI_ENG.BIN 0xEA0
wine itemsutil.exe -i ${TRANSLATED_SCRIPT_PATH}/names.txt ${TRANSLATED_SCRIPT_PATH}/items.txt 0.BIN KANJI_ENG.BIN 0xEA0 # 0xEA0 = starting write offset in KANJI_ENG.BIN, ranges are in itemsutils/main.cpp

cd-replace "Princess Crown (Japan) (1M) (Track 01) (English).iso" KANJI.BIN KANJI_ENG.BIN

Expand Down Expand Up @@ -64,7 +61,6 @@ if [ "$1" == "new" ] || [ "$1" == "update_script" ]; then
python _split_long_lines.py "$txt" ${TRANSLATED_SCRIPT_PATH}/events_splitted_35chars/$(basename $txt)
done
fi

find *.EVN | while read eventfile; do
EVNBASENAME="$(basename "$eventfile" .EVN )"
if [ -f ${TRANSLATED_SCRIPT_PATH}/events_splitted_35chars/${EVNBASENAME}.TXT ]; then
Expand All @@ -76,5 +72,8 @@ find *.EVN | while read eventfile; do
fi
done

# temp. fix for dragon fight softlock (restore jap ver) https://github.com/eadmaster/pcrown/issues/30
cd-replace "Princess Crown (Japan) (1M) (Track 01) (English).iso" 015_00_1.EVN 015_00_1.EVN

# build xdelta patch
xdelta3 -e -s "Princess Crown (Japan) (1M) (Track 01) (English).iso.bak" "Princess Crown (Japan) (1M) (Track 01) (English).iso" "Princess Crown (Japan) (1M) (Track 01) (English).iso.xdelta"
19 changes: 14 additions & 5 deletions src/buildcd/_split_long_lines.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
#! /usr/bin/env python
# -*- coding: utf-8 -*-

# Split long lines to avoid text overflowing due to space limitations.
# Interts "lineend" and "pause" tags in the appropriate positions, while keeping the other tags intact.
# Made by eadmaster for the Princess Crown Translation GPL Edition project https://github.com/eadmaster/pcrown/

# mass convert with:
# for txt in *.txt ; do python _split_long_lines.py "$txt" ../events_splitted_35chars/$txt ; done

Expand Down Expand Up @@ -67,15 +71,18 @@ def insert_lineend_in_colored_text(s, init_lines_counter, init_char_counter):
result += s[position:insert_pos].rstrip() + "<lineend>" + s[insert_pos:].lstrip()
else:
result += s[position:insert_pos].rstrip() + "<pause><lineend><CC03EA>" + s[insert_pos:].lstrip()
return result, (len(s) - insert_pos)


if(len(s[insert_pos:].lstrip()) > MAX_CHARS_PER_LINE):
post_str = insert_lineend_every_x_chars(s[insert_pos:].lstrip(), lines_counter)
result = result.replace(s[insert_pos:].lstrip(), post_str)
return result, length_after_last_tag(result)
else:
return result, ( len(s[insert_pos:].lstrip()) )



def length_after_last_tag(s):
lineend_tag_end = s.rfind('lineend>')
lineend_tag_end = s.rfind('CC03EA>')

tag_end = s.rfind('>')
if tag_end == -1:
return 0 # No closing tag found, so return 0
return len(s) - tag_end - 1
Expand Down Expand Up @@ -118,8 +125,10 @@ def length_after_last_tag(s):
line = line.replace(curr_line_text, new_line_text)
if "<CC03EA" in new_line_text:
init_lines_counter = 0
#init_lines_counter = new_line_text.count("<lineend")
if "<lineend" in new_line_text:
init_lines_counter += 1
#init_lines_counter += new_line_text.count("<lineend")
#print(t)
#print(init_char_counter)
#init_char_counter = length_after_last_tag(new_line_text)
Expand Down

0 comments on commit 888a07f

Please # to comment.