Jump to content

Traifying REPLACE_TEXTUALLY


Grammarsalad

Recommended Posts

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..

Link to comment

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)

Link to comment
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.

Link to comment

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...