Jump to content

[code] Borrowing strings from other IE games


DavidW

Recommended Posts

In addressing the unique items bug, I needed code that would take a string from one IE game and make it available in another. It was convenient to address this generally, and it might be useful elsewhere.

The relevant function is get_strings_from_game, in eefixpack/files/tph/dw/get_strings_from_game.tph. You call it like this:

LAF get_strings_from_game STR_VAR strings=[whatever] END

Set 'strings' to the name of an array that stores the strings you want in the format [strref]=>[discard]. It collects the strings at those strrefs from every language installed on the game, and saves them in eefixpack/languages/[language]/copy_from_[game], where game is either 'sod' or the value of the 'game' variable. This is all done idempotently and doesn't get rolled back if you uninstall a component. 

(Obviously you shouldn't use this in live code; it's to be used in advance to get all the strings without tedious copy-paste.)

Link to comment

Join the conversation

You are posting as a guest. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...