DE EN FR ES IT CZ
Back Back to top

Lua string variables question [SOLVED]

This thread is a few years old. Some details may refer to an earlier version of Visionaire Studio. Current tutorials

  • #1, by red363 3 years ago Quote
    Hello!

    Is it possible to add a string value to string values?
    For example, Values[char].String = "name1".
    I want to add the values "name2", "name3", etc. to this and end up with vs=char:

    name1, name2, name3, etc. (in the same variable)

    Thanks

  • New to Visionaire Studio?

    Create point and click adventures without coding. The free version covers up to 25 scenes per project. For more scenes or to earn money with your game, you need a license.

    See the Indie Bundle Try it for free
  • #2, by afrlme 3 years ago Quote
    Do you mean string concatenation, where you amend more text to the end of the existing text?
  • #3, by red363 3 years ago Quote
    Do you mean string concatenation, where you amend more text to the end of the existing text?

    Yes
  • #4, by red363 3 years ago Quote
    seems to figure it out:

    local a = getObject("Values[name]")
    a.String = a.String .."name2"

  • #5, by afrlme 3 years ago Quote
    Aye, that's correct, but feel free to use shorthand instead of the old longhand getObject method.

    Values["name"].String = Values["name"].String .. "example"
  • #6, by red363 3 years ago Quote
    Aye, that's correct, but feel free to use shorthand instead of the old longhand getObject method.

    Values["name"].String = Values["name"].String .. "example"

    Ok, Thanks