Making the c2runtime.js file readable

Get help using Construct 2

Post » Sat Apr 20, 2013 4:37 pm

Is there a way to give all of the variables in the c2runtime.js file meaningful names? I'm asking because I'd like to pretty print the file and read through it/potentially modify some of the code.
B
4
Posts: 4
Reputation: 618

Post » Sat Apr 20, 2013 4:48 pm

It's pretty readable.

Did you try to tick off the "minify script" tick on the export dialog?

Cheers!
Be nice until it's time to not be nice
B
36
S
9
G
9
Posts: 293
Reputation: 6,652

Post » Sat Apr 20, 2013 5:26 pm

I would strongly recommend using the Javascript SDK as a maintainable way to add your own javascript in to projects. The exported c2runtime.js has been deliberately designed to be hard to modify in order to make reverse engineering difficult.
Scirra Founder
B
359
S
214
G
72
Posts: 22,946
Reputation: 178,518

Post » Sat Apr 20, 2013 5:43 pm

Hmm, in my c2runtime.js files, all the variables' names are just random letters/combos of letters of the alphabet. E.g.

function Va() {
    this.sa = this.ra = this.ua = this.ta = this.ya = this.xa = this.Y = this.X = 0
}

and

v.clear = function () {
    Ca(this.Tc);
    this.xe = 0;
    this.Vd.length = 0;
    this.ge = f;
    return this
};

I guess my question is, is there anyway to change the names of the variables and functions to be something besides these random letter combos?
B
4
Posts: 4
Reputation: 618

Post » Sat Apr 20, 2013 5:44 pm

Ah, thanks ashley, I sort of figured that but good to know!
B
4
Posts: 4
Reputation: 618


Return to How do I....?

Who is online

Users browsing this forum: blackhornet, Solomon and 28 guests