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: 98
Joined: Thu Mar 28, 2019 8:45 pm
Contact:

Giving a sticker to a character

Post 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? ._.

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

Re: Giving a sticker to a character

Post 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}

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

Re: Giving a sticker to a character

Post by tiriscef »

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

Post Reply

Return to “Modding help”