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
.15 Request for Consistent event names
- aubergine18
- Smart Inserter
- Posts: 1264
- Joined: Fri Jul 22, 2016 8:51 pm
- Contact:
Re: .15 Request for Consistent event names
+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).
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.
Re: .15 Request for Consistent event names
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.
- aubergine18
- Smart Inserter
- Posts: 1264
- Joined: Fri Jul 22, 2016 8:51 pm
- Contact:
Re: .15 Request for Consistent event names
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.
- bobingabout
- Smart Inserter
- Posts: 7352
- Joined: Fri May 09, 2014 1:01 pm
- Contact:
Re: .15 Request for Consistent event names
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.
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.
- Arch666Angel
- Smart Inserter
- Posts: 1636
- Joined: Sun Oct 18, 2015 11:52 am
- Contact:
Re: .15 Request for Consistent event names
+1
Angels Mods
I. Angel's Mods Subforum
II. Development and Discussion
III. Bugs & FAQ
"should be fixed"
I. Angel's Mods Subforum
II. Development and Discussion
III. Bugs & FAQ
"should be fixed"
- aubergine18
- Smart Inserter
- Posts: 1264
- Joined: Fri Jul 22, 2016 8:51 pm
- Contact:
Re: .15 Request for Consistent event names
Current list of modding changes for 0.15 viewtopic.php?f=28&t=39555bobingabout 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.
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.