Cannot change the color of an entity
Posted: Mon Jul 19, 2021 7:32 pm
I can't change the color of a turret, but I can change the color of a character. Why can't I assign a new color to a turret?
Code: Select all
/c game.permissions.get_group( 'Default' ).set_allows_action( defines.input_action.set_entity_color, true )
/c game.permissions.get_group( 'Default' ).set_allows_action( defines.input_action.set_player_color, true )
/c game.surfaces.nauvis.create_entity( { name = 'character', position = { 0, 0 }, force = 'player' } )
/c game.surfaces.nauvis.create_entity( { name = 'gun-turret', position = { 2, 2 }, force = 'player' } )
/c game.player.selected.color = { r = 255, g = 255, b = 0 }
/color blue