game.print // player.print addition to add color

riot2212
Burner Inserter
Burner Inserter
Posts: 6
Joined: Sat Mar 10, 2018 6:11 am
Contact:

game.print // player.print addition to add color

Post by riot2212 »

If there is a way to do this, I apologize, I could not find a way to do this so I am requesting this

Basically the ability to set a color on game.print & player.print for example

Code: Select all

player.print("some random message to the player with the color red", {r=1, g=0, b=0, a=1})
if a color is not presented like

Code: Select all

player.print("some random message to the player with the default color")
then it would be the basic white.



just a thought. since the /color command shows the reply message colored. it would be nice if we could do the same with our scripts
User avatar
eradicator
Smart Inserter
Smart Inserter
Posts: 5211
Joined: Tue Jul 12, 2016 9:03 am
Contact:

Re: game.print // player.print addition to add color

Post by eradicator »

riot2212 wrote:If there is a way to do this, I apologize, I could not find a way to do this so I am requesting this

Basically the ability to set a color on game.print & player.print for example

Code: Select all

player.print("some random message to the player with the color red", {r=1, g=0, b=0, a=1})
You could not find a way to do this? Yet the code you post there is exactly how it's done. O_o
User avatar
Klonan
Factorio Staff
Factorio Staff
Posts: 5341
Joined: Sun Jan 11, 2015 2:09 pm
Contact:

Re: game.print // player.print addition to add color

Post by Klonan »

eradicator wrote:
riot2212 wrote:If there is a way to do this, I apologize, I could not find a way to do this so I am requesting this

Basically the ability to set a color on game.print & player.print for example

Code: Select all

player.print("some random message to the player with the color red", {r=1, g=0, b=0, a=1})
You could not find a way to do this? Yet the code you post there is exactly how it's done. O_o
Yep...

http://lua-api.factorio.com/latest/LuaP ... ayer.print
riot2212
Burner Inserter
Burner Inserter
Posts: 6
Joined: Sat Mar 10, 2018 6:11 am
Contact:

Re: game.print // player.print addition to add color

Post by riot2212 »

really o_O

I did it like so and I got an error, I must of screwed something up in the code, my bad


Edit: I see why, I am coding in 15.40 yet, this is in 16. Okay we are all good.
Post Reply

Return to “Implemented mod requests”