-
Notifications
You must be signed in to change notification settings - Fork 28
General Coding and Style Guidelines
Matt edited this page Jan 14, 2024
·
8 revisions
Some general information regarding how to make the linter happy, and how to not make your code ugly.
As a general rule, try to stay close to the style of the file you're currently editing. If you're making a new file, check the CFC Style Guidelines, ESPECIALLY the "General" section.
If the above guidelines are too much to follow, at least keep the following sections in mind.
Bad:
if Var1 && (Var2 || Var3) then
print("Done") // finished
endGood:
if Var1 and (Var2 or Var3) then
print("Done") -- finished
endACE is plagued with these, we don't need more of them. Unit conversions and whatnot should be specifically defined before being used.
Bad:
local Penetration = Velocity * 39.3701 * 2.5Worse:

Good:
local MetersToInches = 39.3701
local OPFactor = 2.5 -- Make shells more OP by this amount
local Penetration = Velocity * MetersToInches * OPFactor- We use tabs instead of spaces
- Consistency
Find others here: https://github.com/MartyX5555/ACE-Dev/blob/master/.glualint.json
- ACE Official Rules
- Fixing Common Issues
- Incompatible Addons
- Console Commands List
- History Of The Project
Guns
Missiles (& Bombs)
Mobility
Special
Gameplay features
Documentation