07th-mod / 07th-mod/umineko-question

Disappearing text after automatic lines with Experimental Script + ADV + Japanese

未關閉
#171 0 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視
bug
主要語言
C#
星號
98
分支
10
PR 合併指標
30 天內沒有已合併 PR

描述

# Problem

See video: https://1drv.ms/v/s!Ar-lAVeetlqhhMF0mMuol8wS7MkDAw?e=dQfAFK

It was reported that using Experimental Script + ADV + Japanese caused some text lines to disappear.

The example was an automatic line (one which does not end with a clickwait, followed by an effect (screen shake), followed by the actual clickwait.

```basic
advchar "16"
langjp:dwave_jp 0, kan_2e106:「…僕がお邪魔でしたら、いつでも言ってくだされば…。」@
advchar "-1"
langjp:dwave_jp 0, "voice\99\awase0005.ogg":((きゃーッ、うっそーー、僕ッコだぁあああーー!!!!))/
sl
advchar "16"
langen:dwave_eng 0, kan_2e106:^"...Please tell me at any time if I start getting in the way..."^@
advchar "-1"
langen:dwave_eng 0, "voice\99\awase0005.ogg":^((Kyaa, no waaay, he calls himself `boku'!!!!))^@/

se1 12
quakey 4,500
mov %disable_adv_clear, 1
langjp\
langen\
mov %disable_adv_clear, 0

advchar "04"
langjp:dwave_jp 0, jes_2e192:「あひィイイイイィ、じゃじゃ、邪魔なんかじゃないよ嘉音くん!!」@
advchar "-1"
langjp:dwave_jp 0, "voice\99\awase0006.ogg":(((きゃああぁッ、彼氏、クン付けだぁあああぁあぁ!!!)))/
sl
advchar "04"
langen:dwave_eng 0, jes_2e192:^"Ahiiiiiiiii, th-th-there's no way you'd get in the way, Kanon-kun!!"^@
advchar "-1"
```

After some investigation, the issue is that the `advchar` function is executed for both languages (when in this case it should only run for the language that is enabled). The only reason there are no bugs in English when using this mode, is that English lines are always after Japanese lines, so they can't have their text cleared unexpectedly as the English lines are emitted **after** the `advchar` functions intended for the Japanese lines.

While playing around, I also noticed that `textclear` only clears the text of the active language. For example, if you called `langjp`, then emitted some Japanese text, then called `langen`, then called `textclear`, it wouldn't clear the Japanese text because the previously emitted text does not match the current language.

The `advchar` function internally uses `textclear` so you could just set `langen`/`langjp` appropriately to make `advchar` to only work on the appropriate lines, but might be better to explicitly add a language check in the `advchar` function.

Note that other parts of the script don't interlace japanese and english, so don't have this issue (the intention is to deliberately have the advchar apply to both langauges).

```basic
advchar "10"
langjp:dwave_jp 0, but_2e560:「捨て台詞は敗者の特権だぜ。@:dwave_jp 0, but_2e561:好きに楽しめよ。」\
langen:dwave_eng 0, but_2e560:^"Parting remarks are a loser's privilege.^@:dwave_eng 0, but_2e561:^ Say as many as you like."^\

meta_ld r,$BEA_aseruA1,80

advchar "27"
langjp:dwave_jp 0, bea_2e1071:「……く…!@:dwave_jp 0, bea_2e1072: 妾の存在を否定し続ける以上、そなたはやがて追い詰められることになるぞ…。」\
langen:dwave_eng 0, bea_2e1071:^"...Nngg...!^@:dwave_eng 0, bea_2e1072:^ Since you continue to deny my existence, you will eventually be cornered..."^\
```

----

# Possible Fixes

## Inline advchar

The downside of this method is that the script would no longer easily merge against master because all the lines are different.
```basic
langjp:advchar "16":dwave_jp 0, kan_2e106:「…僕がお邪魔でしたら、いつでも言ってくだされば…。」@
langjp:advchar "-1":dwave_jp 0, "voice\99\awase0005.ogg":((きゃーッ、うっそーー、僕ッコだぁあああーー!!!!))/
sl
langen:advchar "16":dwave_eng 0, kan_2e106:^"...Please tell me at any time if I start getting in the way..."^@
langen:advchar "-1":dwave_eng 0, "voice\99\awase0005.ogg":^((Kyaa, no waaay, he calls himself `boku'!!!!))^@/
```

```basic
langjp:advchar "10":dwave_jp 0, but_2e560:「捨て台詞は敗者の特権だぜ。@:dwave_jp 0, but_2e561:好きに楽しめよ。」\
langen:advchar "10":dwave_eng 0, but_2e560:^"Parting remarks are a loser's privilege.^@:dwave_eng 0, but_2e561:^ Say as many as you like."^\

meta_ld r,$BEA_aseruA1,80

langjp:advchar "27":dwave_jp 0, bea_2e1071:「……く…!@:dwave_jp 0, bea_2e1072: 妾の存在を否定し続ける以上、そなたはやがて追い詰められることになるぞ…。」\
langen:advchar "27":dwave_eng 0, bea_2e1071:^"...Nngg...!^@:dwave_eng 0, bea_2e1072:^ Since you continue to deny my existence, you will eventually be cornered..."^\
````

## Prefixing `advchar` with the appropriate language

It may be possible to just make functions for each language, for example `adv_char_jp` and `adv_char_en`, and a `adv_char` which applies to both languages. But below I've just used the existing function, and prefixed it with `langen`/`langjp` as appropriate.

```basic
`langjp:advchar "16"`
langjp:dwave_jp 0, kan_2e106:「…僕がお邪魔でしたら、いつでも言ってくだされば…。」@
`langen:advchar "-1"`
langjp:dwave_jp 0, "voice\99\awase0005.ogg":((きゃーッ、うっそーー、僕ッコだぁあああーー!!!!))/
sl
langen:advchar "16"
langen:dwave_eng 0, kan_2e106:^"...Please tell me at any time if I start getting in the way..."^@
langen:advchar "-1"
langen:dwave_eng 0, "voice\99\awase0005.ogg":^((Kyaa, no waaay, he calls himself `boku'!!!!))^@/
```

````basic
langjp:advchar "10":langen:advchar "10"
langjp:dwave_jp 0, but_2e560:「捨て台詞は敗者の特権だぜ。@:dwave_jp 0, but_2e561:好きに楽しめよ。」\
langen:dwave_eng 0, but_2e560:^"Parting remarks are a loser's privilege.^@:dwave_eng 0, but_2e561:^ Say as many as you like."^\

meta_ld r,$BEA_aseruA1,80

langjp:advchar "27":langen:advchar "27"
langjp:dwave_jp 0, bea_2e1071:「……く…!@:dwave_jp 0, bea_2e1072: 妾の存在を否定し続ける以上、そなたはやがて追い詰められることになるぞ…。」\
langen:dwave_eng 0, bea_2e1071:^"...Nngg...!^@:dwave_eng 0, bea_2e1072:^ Since you continue to deny my existence, you will eventually be cornered..."^\
````

## Shuffling the order of lines so it works (make lines similar format to normal lines)

I thought this was too hard, but thinking about it it shouldn't be *that* bad. You would need to identify which lines have problems, then group all the jp and en lines together, with clickwaits separating each group.

An advantage would be you only need to modify the affected parts of the script. But those parts wouldn't maintain mergability with `master`

But I guess the difficulty is that you may miss some cases, or shuffling lines around somehow breaks something.

## Other solution which doesn't require modifying the whole script

I'm pretty sure this isn't possible, because you need to know in advance what the language of the text that is about to be displayed is, to determine whether the `advchar` function should run. But perhaps I'm overlooking something.

----

- [ ] Fix advchar not working correctly in japanese mode
- [ ] Fix `textclear` in script only applying to English and not Japanese language

貢獻指南

這個儲存庫沒有索引到貢獻指南

研究方向

查看程式碼庫中的 advchar 函式和 textclear 邏輯,可能在腳本處理或對話系統中。理解語言切換(langjp/langen)如何與這些函式互動。修復涉及確保 advchar 尊重當前使用語言或按語言呼叫。使用提供的腳本範例進行測試,以驗證文字不再消失。

由索引模型根據 Issue 內容生成。

評估

領域
game-dev
Issue 類型
缺陷
難度
3/5
預估耗時
1-2 天
活躍度
停滯
描述清晰度
基本清楚
新手友好度
45/100

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。