Loading table values to Display Text
Hi,
I try to load table values as the following syntax in display text but it's not working... Do I have to copy the table values to the attribute first or there is other way I can load values directly to display text with text in front. Thanks.
"x: tableCellValue(game.Weapons.TBL,1,3)"
Newbie
I try to load table values as the following syntax in display text but it's not working... Do I have to copy the table values to the attribute first or there is other way I can load values directly to display text with text in front. Thanks.
"x: tableCellValue(game.Weapons.TBL,1,3)"
Newbie
Comments
The .. indicates a space. You can also do something like "Gun"..tableCellValue(game.Weapons.TBL,1,3).."is loaded!"
@kentcheung2000@yahoo.com
Hi, I'm sure @LiquidGameworks won't mind me correcting something: the two dots (..) don't indicate a space, they indicate concatenation (just a programming word for joining together).
One way to get your space is to add it after and before the words in your example, like this:
"Gun "..tableCellValue(game.Weapons.TBL,1,3).." is loaded!"
""You are in a maze of twisty passages, all alike." - Zork temp domain http://spidergriffin.wix.com/alphaghostapps
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
"Gun".."\32"..tableCellValue(game.Weapons.TBL,1,3).."\32".."is loaded!"
Just for fun, you could use all the ASCI escape codes:
"\71".."\117".."\110".."\32"..tableCellValue( game.TBL ,1,3).."\32".."\105".."\115".."\32".."\108".."\111".."\97".."\100".."\101".."\100".."\33"
"Gun\32"..tableCellValue(game.Weapons.TBL,1,3).."\32isloaded!"
Same as "first\nsecond\nthird" returns
first
second
third
But if you like your code clean, you might want to keep the quotes.
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
"\71\117\110\32"..tableCellValue( game.TBL ,1,3).."\32\105\115\32\108\111\97\100\101\100\33"
I just love learning something new about GameSalad. (But for practical purposes, it is of course easier just to type the letters rather that than the ASCI codes.)