Grammarsalad Posted May 1, 2017 Posted May 1, 2017 I'm wondering if it is possible to traify REPLACE_TEXTUALLY. Here's an example of what I have: COPY_EXISTING ~b_po010.spl~ ~override~ READ_LONG 0x50 "valid" PATCH_IF (%valid% >= 0) BEGIN // verify desc is valid READ_STRREF 0x50 ~desc~ INNER_PATCH_SAVE new_desc ~%desc%~ BEGIN REPLACE_TEXTUALLY ~Sphere: Healing~ ~Sphere: Life~ END SAY_EVALUATED 0x50 ~%new_desc%~ END I would like to do something like this: REPLACE_TEXTUALLY ~Sphere: Healing~ @001 But, it doesn't work..
Wisp Posted May 1, 2017 Posted May 1, 2017 You want REPLACE (I'd link it but the WeiDU readme being what it is...; it's immediately above REPLACE_TEXTUALLY).
Ardanis Posted May 1, 2017 Posted May 1, 2017 SPRINT old @123 SPRINT new @456 REPLACE_TEXTUALLY ~%old%~ ~%new%~
subtledoctor Posted May 2, 2017 Posted May 2, 2017 What Ardanis said. The problem is, there's no way to really ensure that the translation in the mod's .tra perfectly matches the translation in the descriptions you want to change. And REPLACE_TEXTUALLY only works on perfect matches.
Grammarsalad Posted May 2, 2017 Author Posted May 2, 2017 What Ardanis said. The problem is, there's no way to really ensure that the translation in the mod's .tra perfectly matches the translation in the descriptions you want to change. And REPLACE_TEXTUALLY only works on perfect matches. So far I'm only using it to replace in my own (and/or our) mod(s) where I can guarantee that the text will match. SPRINT old @123 SPRINT new @456 REPLACE_TEXTUALLY ~%old%~ ~%new%~ gha. There was even an example in Weidu documentation. Anyway, thanks. I'll play around with it when I have a chance, but it looks like I have what I will need. Edit: I'll probably go with this rather than REPLACE as there is an example (unless there is a good reason why I should use REPLACE rather than REPLACE_TEXTUALLY)
Ardanis Posted May 3, 2017 Posted May 3, 2017 And REPLACE_TEXTUALLY only works on perfect matches You can still match regexp, see how IR updates descriptions. Some of the "old"s consist almost entirely of regexp code instead of normal text. I'll probably go with this rather than REPLACE as there is an example (unless there is a good reason why I should use REPLACE rather than REPLACE_TEXTUALLY) I believe REPLACE is used to set strrefs in text files, not for in-string replacement.
Wisp Posted May 3, 2017 Posted May 3, 2017 Yeah, sorry. REPLACE will resolve the new text into a strref and replace old text with the strref.
Recommended Posts
Archived
This topic is now archived and is closed to further replies.