In order to have [[CharacterAlignment Lawful characters]], you first need to have a law. Most works provide that law in the form of The Code of Honour.

The Code is basically any code of honor or conduct that governs a certain group of people. Codes can be written down or oral tradition, they can be short or long, or practical or philosophical; the gist of the trope is that it has the more lawful characters of the cast mulling over which course of action would be "true to The Code".

[[TheOrder Orders]] and {{Ancient Tradition}}s are very likely to possess one of these. The ObstructiveCodeOfConduct is the most important (or just first) article of The Code. TheCommandments are a very brief Code presented in the form of an enumerated list. The BigBookOfWar is a written-down Code that pertains specifically to war.

----
!!Examples:

[[foldercontrol]]

[[folder:Film]]
* The Jedi Code in ''Franchise/StarWars''.
* The "Code of the West" is sometimes mentioned in TheWestern genre.
* The Pirate Code of ''Film/PiratesOfTheCaribbean'' is more like a set of guidelines rather than actual rules, but it still works.
* The Arthurian code of chivalry, as referenced in ''Film/{{Dragonheart}}''
[[/folder]]

[[folder:Literature]]
* The Code that the barbarian heroes (and their opposite numbers, Dark Lords) live by in ''Literature/{{Discworld}}''.
** Also, the Igors in ''Literature/{{Discworld}}'' have a Code which requires such things as "The Marther is always right." and "Don't ask [big] questions." At one point in ''Discworld/ThiefOfTime'', an Igor has to answer a question he cannot due to the Code. He simply says "I would be unable to say that."
* ''Literature/TheStormlightArchive'' has the Alethi Codes of War, and the Immortal Words of the Ideals of the Knights Radiant (the first Ideal being "Life before Death, Strength before Weakness, Journey before Destination." the others being different for each of the ten Orders).
* In ''TheWitcher'' Series, Geralt [[spoiler:pretends he]] has one of these and will often bring it up when he refuses a job or stays neutral in any given conflict. [[spoiler:There actually is a code but all it really covers is not sharing Witcher secrets and lore and preserving the secrecy of the mutagens that allow them to do their jobs. So Geralt is just bullshitting people when he quotes the Witcher Code when he doesn't want to do something.]]
* The Warrior Code in the ''Literature/WarriorCats'' series. It's eventually deconstructed in the ''Power of Three'' arc when [[spoiler:Hollyleaf, who had used the code to determine morality, realizes that the code is imperfect and goes on a murderous rampage.]] Then it gets reconstructed in ''[=SkyClan=]'s Destiny'' and ''The Forgotten Warrior'', [[spoiler:when the characters realize that the code is a guideline that can be changed, and when Hollyleaf uses it to atone.]]
[[/folder]]

[[folder:Live Action TV]]
* The Bro Code from ''Series/HowIMetYourMother''.
[[/folder]]

[[folder:Tabletop Games]]
* ''TabletopGame/{{GURPS}}'' has various Codes of Honour as disadvantages. While many of them are connected to specific organisations, there's also things like the "Pirates' Code of Honour" and "Gentlemen's Code of Honour"
* The Oath and the Measure of the Solamnic Knights in the ''TabletopGame/DungeonsAndDragons'' {{Dragonlance}} setting.
* TabletopGame/ForgottenRealms has too many specific organizations. Even [[ChurchMilitant paladin orders]] of the same god don't have ''exactly'' the same charter: they were founded by different leaders for different goals. Of those published, there's The Code of the [[HeroSecretService Harpers]] (they [[http://index.rpg.net/display-entry.phtml?mainid=9425 got]] a separate {{sourcebook}}).
* The Paladin's Code from ''TabletopGames/DungeonsAndDragons'' is intended to be a non-denominational version, and the paladin must adhere to it or lose his abilities. Unfortunately, sticking to the letter of the code will result in a LawfulStupid character. They're not even allowed to render ''aid'' to chaotic characters.
* The Aslan ''Fteir'' code in ''TabletopGame/{{Traveller}}''.

[[/folder]]

[[folder:Toys]]
* ''Franchise/{{Bionicle}}'' has the Toa Code, which is basically ThouShallNotKill.
[[/folder]]

[[folder:Video Games]]
* The code of the Asari Justicars in ''VideoGame/MassEffect2''.
* The titular ''Franchise/AssassinsCreed'' is a sort of anti-Code that still manages to be a Code: "The wisdom of our creed is revealed in these words: '[[TheAntiNihilist Nothing is true. Everything is permitted]].'" Naturally, there isn't much debate over what fits with a Code like that, only how it should be applied.
[[/folder]]

[[folder:Web Original]]
* In ''Roleplay/TheGamersAlliance'', some thieves follow specific rules of honour known as the Code of Thieves. The Code specifies what thieves can and can't do. Over the years many thieves have abandoned the Code as they see it as antiquated, but others have successfully integrated it into their guilds and their way of life.
[[/folder]]

[[folder:Western Animation]]
* Da Rules in ''WesternAnimation/TheFairlyOddParents''.
* The Code of Thundera in ''WesternAnimation/{{Thundercats}}'': "Justice, Truth, Honor, and Loyalty."
* The Unwritten Kids Code of Honor in ''WesternAnimation/{{Recess}}''
[[/folder]]

[[folder:Real Life]]
* The [[http://en.wikipedia.org/wiki/Bushido bushido code]] of the samurai class.
* The [[http://en.wikipedia.org/wiki/Knight#Chivalric_code chivalric code]] of medieval knights.
* TheMafia code of [[http://en.wikipedia.org/wiki/Omerta Omertà]].
* The [[http://en.wikipedia.org/wiki/Hippocratic_oath Hippocratic Oath]] for doctors. Making this trope OlderThanFeudalism.
[[/folder]]

----