Find / Replace texts in events

Discussion and feedback on Construct 2

Post » Sun Dec 07, 2014 11:57 pm

Man I would like to have a simple find and replace text in the event sheets.

The find feature does not quite do it, because when you are searching for a specific string or refactoring it is so hard searching through your lines of code to find what you are searching for.

Sometimes it would be just nice to be able to edit the source directly in a text editor, if you have to refactor your code.
B
5
S
1
Posts: 59
Reputation: 493

Post » Mon Dec 08, 2014 3:37 am

If your project is saved as a .caproj file, you can open up event sheets directly (they are xml files under the subfolder 'event sheets'). You can find variable names and the like this way.

It's not a good idea to edit these directly though, unless you are very careful. For example, if you change a variable name, you have to change all it's occurrences across all event sheets. Any events you miss will be broken.
Don't lose your work. Backup your game with Dropbox.
B
44
S
10
G
10
Posts: 1,106
Reputation: 9,202

Post » Wed Dec 10, 2014 9:19 pm

TiAm wrote:It's not a good idea to edit these directly though, unless you are very careful. For example, if you change a variable name, you have to change all it's occurrences across all event sheets. Any events you miss will be broken.


This is why I would like to see a find/replace option in construct 2.

Refactoring in Construct 2 is a pain.
B
5
S
1
Posts: 59
Reputation: 493

Post » Wed Dec 10, 2014 10:56 pm

@hgr

I agree, it can be a pain. I just try to work around it.

The best thing is to keep a small number of event sheets. I used to use event sheets for partitioning a project into components; now I tend to pack more into an event sheet and use groups to sort things.

For example: instead of a sheet for every level, put the logic for each level in a group, and all those groups in one event sheet. Start with all level logic inactive, and activate/deactivate the groups as needed.

For logic that needs to be included across different sheets, I try to encapsulate as functions unless the operation is going to be called so often as to become a performance issue. All the functions go on one sheet, which is included where needed.
Don't lose your work. Backup your game with Dropbox.
B
44
S
10
G
10
Posts: 1,106
Reputation: 9,202


Return to Construct 2 General

Who is online

Users browsing this forum: No registered users and 12 guests