Firstly I want to do it using some script (on vbs or powershell), but this idea wants to eat a lot of time because of issues with best way of open and rewrite file. There may be issues with file code format after rewrite. + time to research regexp in them. And also some logging system develop (to know which files and how changes).
We cannot use just GMS, because of no regexp search.
So the best way for me was Notepad++ (https://notepad-plus-plus.org/downloads/).
Firstly, replace all [i,j] to [i][j]
- Open Notepad++
- Drag'n'drop project folder
- RMB on folder in workplace > Find in Files..
- Find in files tab
- Find what:
([\w])(\[\s*)([^\]\[]+)(\s*,\s*)([^\[\]]+)(\s*\])
- Replace with:
\1\[\3\]\[\5\]
- Filters:
*.gml
- Regular expression radio button
- In all subfolders checkbox
- Find All button
- Research all finded places, if all ok Replace in Files button.
Then think about fix [[i][j],k] to [[i][j]][k]:
- Same as before but
- Find what:
([\w])(\[\s*)([^\]\[]+\]\[[^\]\[]+\])(\s*,\s*)([^\[\]]+)(\s*\])
- Replace with:
\1\[\3\]\[\5\]
- May be issues if you have difficult logic
Secondly, replace all array_height_2d to array_length
- Same as before but
- Find what:
array_height_2d\(
- Replace with:
array_length\(
- Check array_height_2d existence
Thirdly, replace all array_length_2d to array_length
- Same as before but
- Find what:
(array_length_2d\(\s*)([^\(]+)(\s*,\s*)([^\)]+)(\s*\))
- Replace with:
array_length\(\2\[\4\]\)
- Check array_length_2d existence (it may be if you use scripts inside array_length_2d check)
And finally, replace all array_length_1d to array_length
- Same as before but
- Find what:
array_length_1d\(
- Replace with:
array_length\(
- Check array_length_1d existence
It also may be some issues with 2d array creation. If you use accessors, then you should fully init array before access to property. (before, accessor was increased array size by itself)
Then fix other corner cases.