Page 1 of 1

.15 Request for Consistent event names

Posted: Sat Jan 21, 2017 6:22 am
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

Re: .15 Request for Consistent event names

Posted: Wed Feb 01, 2017 9:47 pm
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).

Re: .15 Request for Consistent event names

Posted: Wed Feb 01, 2017 11:24 pm
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.

Re: .15 Request for Consistent event names

Posted: Thu Feb 02, 2017 12:35 am
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.

Re: .15 Request for Consistent event names

Posted: Thu Feb 02, 2017 12:07 pm
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.

Re: .15 Request for Consistent event names

Posted: Thu Feb 02, 2017 2:56 pm
by Arch666Angel
+1

Re: .15 Request for Consistent event names

Posted: Thu Feb 02, 2017 4:46 pm
by dandielo
+1

Re: .15 Request for Consistent event names

Posted: Sat Feb 04, 2017 8:41 pm
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