number of crafts in on_pre_player_crafted_item event

Post Reply
seky16
Burner Inserter
Burner Inserter
Posts: 15
Joined: Tue Nov 17, 2020 4:13 pm
Contact:

number of crafts in on_pre_player_crafted_item event

Post by seky16 »

Hello,
I'd like to monitor player's handcrafting, but I hit an API limitation.

on_pre_player_crafted_item gets fired once no matter whether player crafts 1, 5 or all items. Knowing this would be very helpful.

Same thing is already built into on_player_cancelled_crafting, called cancel_count. Although when player cancels all (shift+click) cancel_count always equals 65535. I understand why this number (maximal value of unsigned int16), but both cancel_count and my proposed addition could contain exact number that get’s queued/canceled.

Rseding91
Factorio Staff
Factorio Staff
Posts: 13209
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: number of crafts in on_pre_player_crafted_item event

Post by Rseding91 »

Ok, I've done both.

Changed on_player_cancelled_crafting 'cancel_count' to report the exact number of crafts cancelled.
Added 'queued_count' to on_pre_player_crafted_item.
If you want to get ahold of me I'm almost always on Discord.

seky16
Burner Inserter
Burner Inserter
Posts: 15
Joined: Tue Nov 17, 2020 4:13 pm
Contact:

Re: number of crafts in on_pre_player_crafted_item event

Post by seky16 »

Thanks for such a quick response. Awesome as always

Post Reply

Return to “Implemented mod requests”