Skip to main content

Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
Tags

Yes, you can just use "+" between two strings in the expression syntax.

You can set the result to a string or you can append directly inside a print.

You can also append in a dynamic string reference too (not demonstrated below).

start_at = start
locations { start; }
strings   { tmp : string ; }
integers  { seven : integer "7" ; two : integer "2" ; } on_startup {    : print {("This " + "is " + "a " + "built " + "string ("+(seven+two)+")." )}
   
   : press_any_key ;
   
   : set_string var = "tmp"  {( "This " + "is " + "a " + "built " + "string ("+(seven*two)+")." )}
   : print "{tmp}" ;
   
   : press_any_key ;
}
(1 edit)

I realise that, but I don't want to do it all in one step. I want to do a test, then add something to the string, then do another test and add something to the string and so on.

Use the old value of the string in the set string.

E.g.

: set_string var="tmp" {(tmp + " append text")}

Oh, I can do that? That's perfect. Thanks.

It turns out that I can use:

: set_string var = "name" text = "string";
: set_string var = "name" {("string")}

But I can't use:

: set_string var = "name" "string";
: set_string var = "name" text = {("string")}

I had tried using the last form and that's why it wasn't working.

I updated the document to show a second example of this (there was already one in there), but I made the second example more obvious.

https://adventuron.io/documentation/#QuickStartStringExpressions