.15 Request for Consistent event names

Nexela
Smart Inserter
Smart Inserter
Posts: 1828
Joined: Wed May 25, 2016 11:09 am
Contact:

.15 Request for Consistent event names

Post by Nexela »

I figure before .15 comes out this would be the best time to ask for consistency with event names.

On the left is the existing event name, on the right the proposed change. Most of these are related to Player events (i.e. They have a non-optional player_index associated with them)
This follows the general scheme of EVENT_FOR_WHAT that most of the existing events are already written as.

on_preplayer_mined_item -> on_player_pre_mined
Player event consistency, as well as matching on_robot_pre_mined, as well as I have to look this one up everytime as its naming scheme is very different from all other events.

on_put_item -> on_player_put_item
Player event consistency

on_built_entity -> on_player_built_entity
Player event consistency

on_pre_player_died -> on_player_pre_died
Player event consistency, for the player: before dying

on_pre_entity_settings_pasted -> on_entity_settings_pre_pasted
Entity event consistency, for the entity: before settings are pasted
User avatar
aubergine18
Smart Inserter
Smart Inserter
Posts: 1264
Joined: Fri Jul 22, 2016 8:51 pm
Contact:

Re: .15 Request for Consistent event names

Post by aubergine18 »

+1

In particular, it should be possible to do this in a way that retains backwards compatibility - simply add the new event names to data.defines.events with the same numeric ID as the existing events. This way existing mods won't break (the docs could state that the old names are deprecated but ultimately the old names could be retained indefinitely).
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: 14642
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: .15 Request for Consistent event names

Post by Rseding91 »

If I do it I'm not keeping the old names. I would just force anyone to fix mods that use the old names because that's the only way it would actually happen.
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: .15 Request for Consistent event names

Post by aubergine18 »

I think that would be acceptable. It's a trivial fix for modders, and it will make things much more consistent as well as removing ambiguity.
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.
User avatar
bobingabout
Smart Inserter
Smart Inserter
Posts: 7352
Joined: Fri May 09, 2014 1:01 pm
Contact:

Re: .15 Request for Consistent event names

Post by bobingabout »

If there was some sort of list of these changes in a "Changes in 0.15" like there was for 0.13, then, I'd be fine with this.

I don't make extensive use of scripting at all, but I know I've used at least the on_built_entity event before. I'd probably just do a find and replace with it.

In fact, I'd rather you do make this sort of change, it means consistency in the future, with is a worthy cause for such evils.
Creator of Bob's mods. Expanding your gameplay since version 0.9.8.
I also have a Patreon.
User avatar
dandielo
Burner Inserter
Burner Inserter
Posts: 11
Joined: Wed Mar 30, 2016 9:25 pm
Contact:

Re: .15 Request for Consistent event names

Post by dandielo »

+1
Resurrecting DyTech's Mods, more about this Here!
User avatar
aubergine18
Smart Inserter
Smart Inserter
Posts: 1264
Joined: Fri Jul 22, 2016 8:51 pm
Contact:

Re: .15 Request for Consistent event names

Post by aubergine18 »

bobingabout wrote:If there was some sort of list of these changes in a "Changes in 0.15" like there was for 0.13, then, I'd be fine with this.
Current list of modding changes for 0.15 viewtopic.php?f=28&t=39555
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.
Post Reply

Return to “Implemented mod requests”