String concatenation only can assign first element.
TheDiabolicalMr4Dee
Member Posts: 15
I created and attribute game.myName yet when I try to assign a concatenated string to it <char1>..<char2>..<char3> it only displays the first character. thus doing a displayText of game.myName I get <char1>
Comments
Make sure you are choosing your attributes from the drop-down menu,i.e:
myText = game.char1..game.char2..game.char3
vars['self.attributes.id572726']..vars['self.attributes.909518']. . . .
game.char1 = A
game.char2 = B
game.char3 = C
game.myName = game.char1..game.char2..game.char3
Display Text: game.myName will display ABC
mytext=game.char1..game.char2..
mine are local:
mytext=self.char1..self.char2.....self.char12
basically I reimplemented your keyboard example for multiple text items so I made char1...char12 local to each actor consisting of a dislayText behavior, where the actors are named displayNameText, displaySchoolText . . etc. maybe i should try just making multiple sets of global attributes
myName=game.nameLetter1..game.nameletter2..game.nameletter3
mySchool=game.schoolLetter1..game.schooLetter2..gameschoolLetter3
mytext=self.char1..self.char2.....self.char12
is not as predictable as:
myName=game.nameLetter1..game.nameletter2..game.nameletter3
mySchool=game.schoolLetter1..game.schooLetter2..gameschoolLetter3
Also I dont think the actor that contained the attribute was the prototype. It was an instance of the rototype in a scene. so I just deleted it and started fresh. hope this helps anyone having wierd scoping problems. My advice . . . when in doubt, go global :0)