HomeWildfire Games

Add help comments to WallPiece component schema

Description

Add help comments to WallPiece component schema

Also resolves whitespace issue in WallSet component breaking structree and rmgen
wallbuilder when wall curve pieces are listed separated with newlines (& tabs)
instead of single spaces.

Requested by: Nescio
Refs: #2944, D900

Event Timeline

/ps/trunk/binaries/data/mods/public/simulation/components/WallPiece.js
7

Isn't it actually in simulation template units, e.g. 4×4 corresponds to 1 tile?

11

So if I want to rotate something, I suppose I have to approximate π/2 with 1.552?
Also, you can use proper opening and closing quotation marks inside strings, instead of escaping straight programmer's quotes \".

Stan added inline comments.
/ps/trunk/binaries/data/mods/public/globalscripts/Templates.js
470

Shouldn't you use _string instead to not have to do this? The cpp template parser split by spaces and remove all the unnedeed characters. I suppose this regex is not really used often but it's still slower than the split
https://code.wildfiregames.com/D2404

Ok, story time: I wrote this patch, and then sat on it for about a day. Read through it again, thought to myself "this looks ok: factually correct and all that", so committed it. Not half-an-hour later, I realised that I had made a mistake: orientation and bend weren't in radians[^1]. By this time, it was roughly six in the morning, I recognised I was way too tired to attempt to fix then, so resolved to do so after some sleep. I wake up, and find out I'd got the other unit of measurement wrong too... ?


^1 - In my defence, I haven't had to do maths for so long that I'd forgotten what radians actually were... ?

/ps/trunk/binaries/data/mods/public/globalscripts/Templates.js
470

The cpp template parser split by spaces and remove all the unnedeed characters

It doesn't in this case - this is not a tokenised string.

Something for a revision, perhaps.

/ps/trunk/binaries/data/mods/public/simulation/components/WallPiece.js
7

Uh, yes. Got confused. Can't do maths.

11

I really can't do maths - it's not radians, it's multiples of Pi.