Page 1 of 1

Giving a sticker to a character

Posted: Sun Jul 14, 2019 3:26 pm
by tiriscef
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? ._.

Re: Giving a sticker to a character

Posted: Sun Jul 14, 2019 3:41 pm
by Klonan
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}

Re: Giving a sticker to a character

Posted: Sun Jul 14, 2019 4:42 pm
by tiriscef
So that's what I was missing. Thank you. :)