pylivemaker icon indicating copy to clipboard operation
pylivemaker copied to clipboard

STYLE ID bug in extractcsv insertcsv

Open LioMajor opened this issue 5 years ago • 3 comments

  • pylivemaker version: 10.05.2020
  • Python version: 3.7
  • Operating System: Win10

Description

The extractcsv doesn't honor blocks / lines and reformates the text.

What I Did

  1. lmlsb extractcsv 00000001.lsb 00000001.csv
  2. Fixed typos i found
  3. lmlsb insertcsv 00000001.lsb 00000001.csv

After the lines got replaced, the text formation in 00000001-00004D92.lns is different.

Before extractcsv:

<TXSPF>What should i do?<STYLE ID="1"> Push down chance: <VAR NAME="押し倒され確率" unk3="0"> Blame chance: <VAR NAME="言葉責め確率" unk3="0">L<VAR NAME="レベル" unk3="0"> Enemy Level: <VAR NAME="敵レベル" unk3="0"> Enemy HP <VAR NAME="敵HP" unk3="0"> Lust Increase: <VAR NAME="増加する性欲" unk3="0"> <VAR NAME="攻撃力補正" unk3="0"></STYLE>

After insertcsv:

<TXSPF>What should i do? Push down chance: <STYLE ID="1"><VAR NAME="押し倒され確率" unk3="0"> Blame chance: <VAR NAME="言葉責め確率" unk3="0">L<VAR NAME="レベル" unk3="0"> Enemy Level: <VAR NAME="敵レベル" unk3="0"> Enemy HP <VAR NAME="敵HP" unk3="0"> Lust increase: <VAR NAME="増加する性欲" unk3="0"> <VAR NAME="攻撃力補正" unk3="0"></STYLE>

The csv: (VAR is ignored, but still puts the text back to where it belongs)

pylm:text:00000001.lsb:2941:0,00004D92,,What should i do? Push down chance: ,
pylm:text:00000001.lsb:2941:1,00004D92,, Blame chance: ,
pylm:text:00000001.lsb:2941:2,00004D92,,L,
pylm:text:00000001.lsb:2941:3,00004D92,, Enemy Level: ,
pylm:text:00000001.lsb:2941:4,00004D92,, Enemy HP ,
pylm:text:00000001.lsb:2941:5,00004D92,, Lust Increase: ,
pylm:text:00000001.lsb:2941:6,00004D92,, ,

PS: I fixed the file and validation passes out

00000001.zip

LioMajor avatar May 10 '20 23:05 LioMajor

Yes, this is a known limitation of the text block/csv method. If you need support for style/text speed/link/etc tags in a text block you basically have to use the .lns tools.

it's why the --help option for extractsv has the warning about potential loss of style information

https://github.com/pmrowla/pylivemaker/pull/33#discussion_r418929546

pmrowla avatar May 11 '20 02:05 pmrowla

but we should probably have

  1. output warning message (w/block ID) on insert if we try to insert a block that uses style tags
  2. have an option to skip inserting blocks that use style tags (maybe this should be the default, and option should be to force inserting blocks that use style tags)

either way, basically for those lines you will always need to work directly with the .lns scripts at some point, either to fix the tag after inserting w/csv, or to just do the whole translation for that block via .lns scripts

edit: we can also consider (optionally?) including tags in csv extracted blocks, but I think the original issue was that including tags messes up machine translation, which was one of the desired use cases for having the csv format

pmrowla avatar May 11 '20 02:05 pmrowla

To include tags would be fine by me. You can either just not translate the line or make your needed modification honoring the style. This would also allow to remove it or to add your own.

LioMajor avatar May 11 '20 07:05 LioMajor