Jump to content

Is it possible to c_announce a prefab and say something in the same line?


Recommended Posts

Heyo everybody.

Before the marchupdate I used a bind to count prefabs.

It then said" Wulrus Camps: 4" or something like that. The update kinda broke the funcunality to have 2 things in the same announcement?

All help is appreciated!

.. is the Lua operator for string concatination

if you have 2 strings you can put a .. inbetween them to combine them into a single string

so 

c_announce("string 1" .. " string 2")

would announce 

"string 1 string 2"

note this only works with strings but Lua also has another function tostring()

which can convert types like numbers into a string.

If the update changed this idk :P

11 minutes ago, hhh2 said:

note this only works with strings but Lua also has another function tostring()

which can convert types like numbers into a string.

It definitely works with integer as well, like the ones you get from c_countprefabs().

Just now, QuartzBeam said:

It definitely works with integer as well, like the ones you get from c_countprefabs().

i think it depends of the implementation or version of Lua. I've had crashes and errors from trying to do that in many different Lua engines, it may be redundant but can't hurt tostring() whatever you're trying to concatenate 

Archived

This topic is now archived and is closed to further replies.

Please be aware that the content of this thread may be outdated and no longer applicable.

×
  • Create New...