The power of #

eaguirreeaguirre Member Posts: 89
edited November -1 in Working with GS (Mac)
I found that # can give you the size of a string.

For example:

#"hello" will return 5
#"hello".."this" return "5this"
#("hello".."this") return 9

But still there is no way to get the content of an attribute by using a text concatenation (like 'Game.text'..'1'
I got "Game.text1" but I want the value of the attribute Game.text1 = "hello"
only works with the expression editor by selecting the attribute.

Anyone knows when this will be available?

Comments

  • eaguirreeaguirre Member Posts: 89
    Do you want to see something interesting?...

    Create a text attribute: Game.text1 = "Welcome"

    In a DisplayText behavior put this: Game.text[0] with the expression editor. Select the Game.text1 attribute and add the [0]

    The display text is "Hello World!".
  • CodeMonkeyCodeMonkey Head Chef, Member, PRO Posts: 1,803
    That is just reverting to the default "Hello World!" because it is an invalid expression.
  • BarkBarkCoBarkBarkCo Member Posts: 1,400
    What would be really cool is an expression-based load option! That way you could just save an attribute and then use your text concat method to build the key linked to your attribute when loading it inside an expression...

    Is there an official "feature request" section?
Sign In or Register to comment.