8000 External Functions now evaluated twice when sandwiched between content · Issue #253 · inkle/ink · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
External Functions now evaluated twice when sandwiched between content #253
Closed
@nullObjectPtr

Description

@nullObjectPtr

We recently upgraded from 0.4.1 to 0.7 and noticed that the behavior of external function calls has changed when its sandwiched between two lines. We've skipped quite a few updates so I don't yet know when this cropped up, but I'll update the issue when I track it down.

External functions are now evaluated once, for the line they appear above, and once, for the line they appear below.

Below is a small ink that illustrates the behavior. During my test the function log is bound using the API to Unity's Debug.Log(). On version 0.7 "I dig it!" is printed to the console twice. Once when the line "theres some gold in my purse" is shown and once again when "Now isn't that nice" is show. In 0.4.1,

The value of gold is, correctly, 10 by the end of the story. So I'm guessing that this behavior is not expected.

INCLUDE ../Inc/Functions.ink

VAR gold = 0

===function give_gold(x)==
~ gold = gold + x
~ log("i dig it!")

===GoldTest===
Here young man, I have a reward for you
There's some gold in my purse
~give_gold(10)
Now isn't that nice?
{gold}
->END

-Jonathan

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0