Jump to content

Sam.'s misc WeiDU related questions


Sam.

Recommended Posts

2 hours ago, Sam. said:

Is there an analog to


OUTER_SET tmp = (~%prefix%~ STRING_EQUAL_CASE ~MOS~ = 1) ? 0 : 1

that uses the ternary operator but with strings instead of numbers?  Something like:


OUTER_TEXT_SPRINT tmp EVAL ((~%prefix%~ STRING_EQUAL_CASE ~MOS~ = 1) ? ~zero~ : ~one~)

(except that doesn't work).

Nope.  You'd have to use an IF statement.

Link to comment

I'm looking for a function to clone all of an extended header's effects into global effects (for an item).  I thought I had seen such a function posted somewhere, but I don't remember where and didn't see it here.  Any suggestions?  I could probably write my own, but would prefer not to reinvent the wheel if an existing solution exists.

 

Link to comment

When I run

ACTION_DEFINE_ARRAY foo BEGIN 1 2 3 END

DEFINE_ACTION_FUNCTION xyz STR_VAR foo = "" BEGIN
  ACTION_PHP_EACH foo AS k => v BEGIN
    PRINT ~%v%~ // should print 1, 2 and 3
  END
END

LAF xyz STR_VAR foo END

with the MODDER flag on, I get this warning

Quote

Installing [Test Array Functions] [v0.0.0]
WARNING:
WARNING: possible missing EVALUATE_BUFFER in
[array name at $"foo"("0")]

1
WARNING:
WARNING: possible missing EVALUATE_BUFFER in
[array name at $"foo"("1")]

2
WARNING:
WARNING: possible missing EVALUATE_BUFFER in
[array name at $"foo"("2")]

3

 

INSTALLED WITH WARNINGS     Test Array Functions

but if I run

ACTION_DEFINE_ARRAY bar BEGIN 1 2 3 END

DEFINE_ACTION_FUNCTION xyz STR_VAR foo = "" BEGIN
  ACTION_PHP_EACH foo AS k => v BEGIN
    PRINT ~%v%~ // should print 1, 2 and 3
  END
END

LAF xyz STR_VAR foo = bar END

there are no warnings but 1 2 3 are not printed.  What am I missing?

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