Text object and variables [Solved]

For questions about using Classic.

Post » Sat Feb 26, 2011 3:35 pm

I am cutting down on all the text objects in my game, so I use this code so one text object can hold more information.

Example - crashes the game.
[code:3odn6azh]
set text to global('global1') & global('global2')[/code:3odn6azh]

Example - game and string/variables load.
[code:3odn6azh]
set text to global('global1') & INI_1.ItemString("1", "1") & global('global2')[/code:3odn6azh]

Is there a way to display two variables first with no text in between them?
B
3
G
2
Posts: 14
Reputation: 703

Post » Sat Feb 26, 2011 10:28 pm

if you explicitly convert the values to strings it won't crash.
ex.
str(global('global1')) & str(global('global2'))
B
79
S
24
G
54
Posts: 4,747
Reputation: 40,757

Post » Sun Feb 27, 2011 2:24 pm

Thank you. Problem solved.
B
3
G
2
Posts: 14
Reputation: 703


Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 6 guests