New this build: replace objects in the event sheet! There's also the long-overdue show grid option for the Layout View.
Now you can right-click any selected events, actions or conditions and choose Replace object to swap the object out for something else. Note this is quite a complex feature: it checks all the dependencies on instance variables and behaviors, and checks that any object to try to replace it with also has instance variables and behaviors with the same names and types so that the replacement is valid. This includes being able to swap objects with families. If there is a bug in this new feature it could break your events so please back up your projects before replacing objects in a lot of events. If you haven't already then also check out how to keep your work safe with Construct 2's backup options.
'Replace object' also allows you to 'upgrade' an ordinary object to a family. If you want to replace all references to an object in the events with a family that has the same behaviors and instance variables, you can do it by following these steps:
- Create a new empty object to be used temporarily to create the family. For example, create an empty Sprite if it's a family of Sprites.
- Create the new family. When prompted to choose objects to add to the family, select the new empty object you just created.
- Add instance variables and behaviors to the new family matching those in the object you want to replace. They must have exactly the same names and types.
- Back up your project, then go through all your event sheets doing select-all then replace object and replace with the family. If the family doesn't appear as an option, double-check you added the right behaviors and instance variables.
- In the original object, remove all its instance variables and behaviors. (The family now provides these.)
- Now you can edit the family and add the original object to the family. You can remove the temporary object from the family and delete it from the project.
- End result: you have now upgraded your object to a family, preserving all its behavior and instance variable references in the events!
Hopefully that's useful in case you forgot to plan ahead and went on making your game without a family when one would have been useful!
Please also note the breaking change in the changelog regarding the 'On created' trigger. This has been deliberately changed and it may break existing projects; however, the new functionality is a lot more logical so hopefully will be better in the long term.