Hinny 0 Posted March 25, 2004 Okay I have a variable, _x, which is a number value. I want that number to be displayed on screen. I've tried unit sidechat _x but as it rightly says _x isn't a string. Is there any way to convert _x into a string, and if not anyway to get it on screen? Share this post Link to post Share on other sites
RED 0 Posted March 25, 2004 Unit sidechat format ["%1",_x] RED Share this post Link to post Share on other sites
raptorsaurus 0 Posted March 25, 2004 Try this: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE"> _str = format ["%1",_x] _soldier sidechat _str This works for me. If you want there to be text in front/behind the number you can do: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE"> _str = format ["Enemy spotted %1 m to North West",_x] _soldier sidechat _str If _x is 75 then the chat message will be: "Enemy spotted 75 m to North West" Share this post Link to post Share on other sites
RED 0 Posted March 25, 2004 There is little point making the string then having the unit say a sidechat. The shorter you make a script, the faster it will be. RED Share this post Link to post Share on other sites