Page 1 of 1

[0.12.2]game.player.print table

Posted: Wed Aug 05, 2015 6:48 pm
by Adil
One of the error messages on incorrect usage of game.player.print states: Invalid literal type (boolean) in localisedstring, table, string or number type expected.
Apart from the fact that it cannot print bool, it can also be inferred from this message that it can print tables, but invocation with table also results into error about unknown keys. (even if the table consists of localised strings)
Could there be some clarification on that?
(Was the previous thread silently moved to help or it was me missing a board?)
edit: nevermind, a table of localised strings worked I've just missed the category when referencing it, sorry.

Re: [0.12.2]game.player.print table

Posted: Wed Aug 05, 2015 9:17 pm
by Oxyd
I'm a little confused here – what's the bug, exactly?

Re: [0.12.2]game.player.print table

Posted: Thu Aug 06, 2015 3:23 am
by Adil
Function usage hint:
Invalid literal type (boolean) in localisedstring, table, string or number type expected
mentions tables but function can't print them.
Don't bother though , it's my bad. I've figured out later, that a table there stands for a table of localised strings, for which function works correctly.

edit: Sorry, that's me again actually function only prints the first element of table:

Code: Select all

/c game.player.print({'entity-name.gun-turret', 'entity-name.laser-turret'})
Gun turret
edit: I feel silly now.
I've put results of my experiments on game.player.print() on wiki. Could we please get corrections on that?

Re: [0.12.2]game.player.print table

Posted: Thu Aug 06, 2015 4:27 pm
by kovarex
Actually, it has to be always in the {} brackets when it is localised string. The wiki was just plain wrong. I fixed the wiki.