Robustcolor 30 Posted January 29, 2022 Hi, how can i make a array with units showing up as a column/linebreaks with the hint command? This code below shows everything in a line. _aliveUnits = []; _aliveUnits pushBack (allUnits select {alive _x}); hint (format ["Remaining units %1", _aliveUnits]); Share this post Link to post Share on other sites
7erra 629 Posted January 29, 2022 (edited) _aliveUnits = allUnits select {alive _x}; hint parseText format ["Alive units:<br/>%1", _aliveUnits joinString "<br/>"]; Edited January 29, 2022 by 7erra fixed <br/> tag 3 Share this post Link to post Share on other sites
Schatten 268 Posted January 29, 2022 @Robustcolor, hint (format ["Remaining units\n%1", _aliveUnits joinString "\n"]); 2 1 Share this post Link to post Share on other sites
Harzach 2507 Posted January 29, 2022 21 minutes ago, 7erra said: _aliveUnits = allUnits select {alive _x}; hint (parseText format ["Remaining units<br>%1", _aliveUnits joinString "<br/>"]); That's where I was headed, but I couldn't get it to work. It seems like it should. I would be interested to know why! hint parseText (_aliveUnits joinString "<br/>"); Works, but then we don't have the header. @Schatten's works nicely. 2 Share this post Link to post Share on other sites
Schatten 268 Posted January 29, 2022 10 minutes ago, Harzach said: That's where I was headed, but I couldn't get it to work. It seems like it should. I would be interested to know why! That's because Arma only interprets XML-like syntax, e.g. "<br/>", not "<br>". This works: hint (parseText (format ["Remaining units<br/>%1", _aliveUnits joinString "<br/>"])); 2 1 Share this post Link to post Share on other sites
Harzach 2507 Posted January 29, 2022 Ah, I think the "<br>" was maybe a typo in 7erra's code. 7 minutes ago, Schatten said: This works: I'm getting this: Share this post Link to post Share on other sites
Schatten 268 Posted January 29, 2022 @Harzach, I've got this: https://imgur.com/a/T24LrmE Share this post Link to post Share on other sites
7erra 629 Posted January 29, 2022 Yea the <br> was a typo. Should work now. 1 Share this post Link to post Share on other sites
Harzach 2507 Posted January 29, 2022 24 minutes ago, Schatten said: @Harzach, I've got this: https://imgur.com/a/T24LrmE Ah, I was using the OP's array-building code by accident. With @7erra's it works great. *edit* - and @7erra's code works as well. The issue was using OP's original code to build the array. Clarity achieved! 1 Share this post Link to post Share on other sites
Robustcolor 30 Posted January 29, 2022 Thanks! This worked great with using pushBack / array. hint (format ["Remaining units\n%1", _aliveUnits joinString "\n"]); Question, is it possible to add color to the header text with above code? Share this post Link to post Share on other sites
Schatten 268 Posted January 29, 2022 14 minutes ago, Robustcolor said: Question, is it possible to add color to the header text with above code? No. To do this you need to use @7erra's code and structured text. 2 Share this post Link to post Share on other sites