Author Topic: Why are Certain Sections of Code spaced out?  (Read 352 times)

For example
Code: [Select]
datablock fxDTSBrickData (brickCheckpointData){
brickFile = "Add-Ons/Brick_Checkpoint/Checkpoint.blb";

specialBrickType = "Checkpoint";

orientationFix = 1;

canCover = false;

category = "Special";
subCategory = "Interactive";
uiName = "Checkpoint";
iconName = "Add-Ons/Brick_Checkpoint/Checkpoint";

   indestructable = true;
};
You see the lines "brickFile" through " indestructable"?
Why are they spaced out from the left margin? Is it required, or is it just easy to read Asthetics?

it's all about style. easier to read. notice how all things handling category/uiname are together - that's not a coincidence.

on a side note, people that code like{
     this
}

piss me off as opposed to
{
     this
}

but that's just me being picky!

I'm pretty sure you could even code it like this if you so desired:
Code: [Select]
datablock fxDTSBrickData (brickCheckpointData){ brickFile = "Add-Ons/Brick_Checkpoint/Checkpoint.blb"; specialBrickType = "Checkpoint"; orientationFix = 1; canCover = false; category = "Special"; subCategory = "Interactive"; uiName = "Checkpoint"; iconName = "Add-Ons/Brick_Checkpoint/Checkpoint"; indestructable = true; };
So organizing it is so the scripters can read it better.

I'm taking a Flash class, which is sorta like Torque, and the teacher says that tabs are required for adding a "datablock" (in Flash its called something else but i forget).
Like whenever that datablock is triggered, those certain variables are triggered aswell.

But looking at the code, there is only one { and one }; so that throws away what i was talking about.

Torque ignores all whitespace (new lines and tabs and etc.) so I could have 80 empty lines in between code lines and the functionality would not change.