Page 1 of 1

EntityPrototype.picker_result = item_name (Q-key behavior addition)

Posted: Fri May 31, 2019 3:38 pm
by eradicator
What?

I'd like to specify what type of item a player gets into the cursor when using the Q key to "pick" an item for the selected entity.

Why?

I have an entity that is conditionally converted from a "placer entity". The player uses itemA to build entityA. EntityA is later converted to entityB via script. entityB can not be built directly. But i want the player to get a stack of itemA when they Q-key entityB.

I'd implement this manually, but i don't see a way to put an ItemStack from the main_inventory to the cursor_stack while reserving the slot with a "hand icon" like vanilla does. If that is possible (or was made possible) i'd also be quite happy.

Re: EntityPrototype.picker_result = item_name (Q-key behavior addition)

Posted: Fri May 31, 2019 3:38 pm
by Bilka

Re: EntityPrototype.picker_result = item_name (Q-key behavior addition)

Posted: Fri May 31, 2019 4:02 pm
by eradicator
Hm. I wasn't aware that placeable_by would change the picker result :).
Also entityB *shouldn't* be placeable at all. But...replacing entityB ghosts might actually be better than blueprint editing.

Thanks for the answer.

Btw, the wiki page on flags for "player-creation" should state that it is also required for entities to become blueprintable. (And honestly i'd prefer if the AI didn't attack these entities :|)

Re: EntityPrototype.picker_result = item_name (Q-key behavior addition)

Posted: Fri May 31, 2019 4:09 pm
by Bilka
The player-creation description is completely inaccurate :p It's used in too many places in the code to be able to document it easily.

Re: EntityPrototype.picker_result = item_name (Q-key behavior addition)

Posted: Fri May 31, 2019 4:11 pm
by eradicator
Bilka wrote: Fri May 31, 2019 4:09 pm The player-creation description is completely inaccurate :p It's used in too many places in the code to be able to document it easily.
Well duh. It *is* required for blueprintability though, i can saw that much now, just found that out by randomly trying flags \o/. An unexperienced modder might be less lucky.

If it's inaccurate maybe make a note of that at least. Inaccuracy is not something i'm used to from the wiki ;).

Re: EntityPrototype.picker_result = item_name (Q-key behavior addition)

Posted: Fri May 31, 2019 4:21 pm
by Bilka
Okay, you convinced me. I updated the page with the most "important"/"obvious" effects of the flag.

Re: EntityPrototype.picker_result = item_name (Q-key behavior addition)

Posted: Fri May 31, 2019 4:24 pm
by eradicator
Thanks again. You're doing a great job so close to the weekend ;).