Determine when player eats fish?

Place to get help with not working mods / modding interface.
User avatar
aubergine18
Smart Inserter
Smart Inserter
Posts: 1264
Joined: Fri Jul 22, 2016 8:51 pm
Contact:

Determine when player eats fish?

Post by aubergine18 »

It's difficult to explain why, but I need to know when player eats fish :)

So far, I have a deeply cumbersome approach of checking what's in players' hand, and when it goes from fish to no fish (or fewer fish) it checks to see if health has increased. This is nightmarishly crufty, slow, and also unreliable.

Anyone know a better way? I feel like we need a `defines.event.on_om_nom_nom` event lol
Better forum search for modders: Enclose your search term in quotes, eg. "font_color" or "custom-input" - it prevents the forum search from splitting on hypens and underscores, resulting in much more accurate results.
Rseding91
Factorio Staff
Factorio Staff
Posts: 15995
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: Determine when player eats fish?

Post by Rseding91 »

"fish" is just a capsule with -20 damage that only effects the player. There's no event for it and no way to reliably detect when a player uses one.
If you want to get ahold of me I'm almost always on Discord.
User avatar
aubergine18
Smart Inserter
Smart Inserter
Posts: 1264
Joined: Fri Jul 22, 2016 8:51 pm
Contact:

Re: Determine when player eats fish?

Post by aubergine18 »

I was also trying to alter the capsule to make it release some other capsule so the `on_trigger_created_entity` event would get fired, but so far no luck :(
Better forum search for modders: Enclose your search term in quotes, eg. "font_color" or "custom-input" - it prevents the forum search from splitting on hypens and underscores, resulting in much more accurate results.
Nexela
Smart Inserter
Smart Inserter
Posts: 1828
Joined: Wed May 25, 2016 11:09 am
Contact:

Re: Determine when player eats fish?

Post by Nexela »

aubergine18 wrote:I was also trying to alter the capsule to make it release some other capsule so the `on_trigger_created_entity` event would get fired, but so far no luck :(
I think the cluster grenade has this type of behavior
Post Reply

Return to “Modding help”