Skip to main content

Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines

It's possible to mod the mod system, to change that regular expression to something that would work better.

I wasn't very familiar with Godot syntax when I wrote that regular expression.  I had to look up multi-line variables, and was not aware at the time that a dictionary with multiple values could be declared on a single line, and I couldn't even find an example of a static multi-dimensional array/dictionary and its declaration.


Regular expressions are... difficult to get right.

Having said that,

what is a regex tester and where can I find one?

Haha yeah... I tried to tweak the regex to get it working right, but bit burned out on coding from work to finish.  I typically use a site like www.regex101.com so I can visually see how it's matching to a set of text.  Can then stick in a variety of test cases and see how it responds.  I was able to tweak it to accept:

var blah = {
<tab indented text>
}

But the solution wouldn't have worked for single lines.  Likely could have made it work with some more groupings and or operators.  I used that site earlier to figure out why some of my code wasn't working, as in my own mod,it also fails on:

var randomportraits = load(globals.modfolder + "/randomportraits/randomportraits.gd").new()

Because it only matches on
var randomportraits = load(globals.modfolder
and inserts that into the file, breaking the game.  Thus, i did var blah = null, and then conditionally load it first time i need it.