Giving a sticker to a character

Place to get help with not working mods / modding interface.
Post Reply
User avatar
tiriscef
Long Handed Inserter
Long Handed Inserter
Posts: 56
Joined: Thu Mar 28, 2019 8:45 pm
Contact:

Giving a sticker to a character

Post by tiriscef » Sun Jul 14, 2019 3:26 pm

Hey,

I'm somehow struggling with finding out how to conveniently and reliably give a sticker to a character.
The LuaEntity class has a stickers table, but it's read-only.
I could create a projectile or a smoke-with-trigger at the players position, but that could not work in some cases or affect the players car instead of himself. And those prototypes would require an animation - which I don't want.

So... am I missing something? ._.

User avatar
Klonan
Factorio Staff
Factorio Staff
Posts: 3746
Joined: Sun Jan 11, 2015 2:09 pm
Contact:

Re: Giving a sticker to a character

Post by Klonan » Sun Jul 14, 2019 3:41 pm

You can create a sticker directly with surface.create_entity:
/c game.player.surface.create_entity{name = "slowdown-sticker", position = game.player.position, force = "enemy", target = game.player.character}

User avatar
tiriscef
Long Handed Inserter
Long Handed Inserter
Posts: 56
Joined: Thu Mar 28, 2019 8:45 pm
Contact:

Re: Giving a sticker to a character

Post by tiriscef » Sun Jul 14, 2019 4:42 pm

So that's what I was missing. Thank you. :)

Post Reply

Return to “Modding help”

Who is online

Users browsing this forum: No registered users