Skip to content

+= operator does not work with strings but + does #2601

@PairOfRaggedClaws

Description

@PairOfRaggedClaws

The problem

Describe the bug
Using += to add to a string does not work and generates an unclear error message.

To Reproduce
Steps to reproduce the behavior:

  1. In a timeline, assign text to a string variable
    set {var.var1} = "Hello"
  2. In a second line, add text using +=
    set {var.var1} += ", world."
  3. In a third line, add text using + inbetween two strings
    set {var.var1} = {var.var1} + " darkness, my old friend.

Result: {var.var1} == "Hello darkness, my old friend."

Expected behavior
+= and + should both concatenate strings

Screenshots
n/a

System (please complete the following information):

  • OS: MacO@
  • Godot Version: 4.4.1
  • Dialogic Version: 2.0 Alpha 17 WIP

Solutions

Workaround

use the format {var} = {var} + "string"

Possible fixes

Metadata

Metadata

Assignees

No one assigned

    Labels

    Bug 🐞Something isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions