Jump to content

obtaining and using STRREFs


subtledoctor

Recommended Posts

Why does this work:

OUTER_SPRINT words #22
PRINT ~%words%~

...but this doesn't:

OUTER_SET string = 22
OUTER_SPRINT [EVAL] words #%string%
PRINT ~%words%~

It gives me a LEXER ERROR saying # is an invalid character, but obviously it's not, it is used to refer to in-game strings.

I need to use kit names from kitlist.2da:

COPY_EXISTING ~kitlist.2da~ ~override~
  READ_2DA_ENTRIES_NOW rows 10
  FOR (row = 1; row < rows; ++row) BEGIN
    READ_2DA_ENTRY_FORMER rows row 3 ~kit_name~
    SPRINT words #%kit_name%
    PATCH_PRINT ~%words%~
  END
BUT_ONLY

%kit_name% derives the STRREF numbers of each kit name, but I need to obtain the actual strings in variables, for use elsewhere.  What am I missing?  (I'm always missing something, the perrennial question is, what is it? 😛 )

Edited by subtledoctor
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...