How to place an icon on a vehicle?

Place to get help with not working mods / modding interface.
Post Reply
mrvn
Smart Inserter
Smart Inserter
Posts: 5704
Joined: Mon Sep 05, 2016 9:10 am
Contact:

How to place an icon on a vehicle?

Post by mrvn »

I would like to do 4 things:

1) Place icons on a locomotive, cargo wagon or fluid wagon so it shows up in the game (could be with or without alt view, I'm not picky)
2) Place an icon on locomotive, cargo wagon or fluid wagon so it shows up on the mini map.
3) Place an icon on locomotive, cargo wagon or fluid wagon so it shows up in map mode.
4) Place an icon on locomotive, cargo wagon or fluid wagon so it shows up on the train map.

The icon has to stay over the vehicle and moving it on_tick() is out of the question.

Is any of that possible from LUA?

User avatar
DaveMcW
Smart Inserter
Smart Inserter
Posts: 3700
Joined: Tue May 13, 2014 11:06 am
Contact:

Re: How to place an icon on a vehicle?

Post by DaveMcW »

1.

Code: Select all

/c
vehicle = game.player.selected
rendering.draw_sprite{
  sprite = "item/iron-plate",
  render_layer = "entity-info-icon-above",
  target = vehicle,
  target_offset = {0,0},
  surface = vehicle.surface,
  forces = {vehicle.force},
  only_in_alt_mode = false,
}
2. No
3. No
4. No

mrvn
Smart Inserter
Smart Inserter
Posts: 5704
Joined: Mon Sep 05, 2016 9:10 am
Contact:

Re: How to place an icon on a vehicle?

Post by mrvn »

Thanks

Post Reply

Return to “Modding help”