Showing message string and variables

N

Nathan Matthews

Guest
I thought this code would have worked but it didn't, can someone please help me with the right way to do it.
Code:
show_message("Level Status: "+room_caption+"#Coins Remaining: " +instance_number(Coin)+"#Fuel" + health);
 

Jakylgamer

Member
when you string together non strings you need to do
Code:
"Level Status: " + string(variable) + "more text" + string(variable2)
 

DukeSoft

Member
What the parser thinks you're doing here is adding a number to another variable. But since the first variable there is a string, it can't add that number to the string, so you will have to cast your variable to being a string using that function.
 
Top