Skip to content

Multiple calls to autoload functions in text are ignore #2668

@jsladovic

Description

@jsladovic

The problem

Describe the bug
Calling a function from an autoload script multiple times with different variables leads to only one call being processed. It looks like the call to the function with the first variable "swallows up" the text until the end of the call with the second variable. Apologies for the confusing way it's described, tried to point out that calling the function with the strings acts normally, but it looks like calling it with variables leads to errors.

To Reproduce
Steps to reproduce the behavior:

  1. Create an autoload script with a function that receives and returns a string. My example is
    static func possessify(input: String) -> String:
    return (input + "'") if input.ends_with("s") else (input + "'s")
  2. Create two variables, I called mine x and y, and assign them values
  3. Add the following text to a timeline
    Test {Helper.possessify({x})} test1 {Helper.possessify("xxx")} test2 {Helper.possessify({y})} test3 {Helper.possessify("yyy")} test4
  4. Run the timeline
  5. Notice the output is "Test abc's test3 yyy's test4"

Expected behavior
I'd expect the text to be "Test abc's test1 xxx's test2 sss' test3 yyy's test4"

Screenshots
Example of incorrect output
Image

System (please complete the following information):

  • OS: MAC
  • Godot Version: 4.5
  • Dialogic Version: 2.0-Alpha-16 (Godot 4.2+)

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