In order to have 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".
Orders and Ancient Traditions are very likely to possess one of these. The Obstructive Code of Conduct is the most important (or just first) article of The Code. The Commandments are a very brief Code presented in the form of an enumerated list. The Big Book of War is a written-down Code that pertains specifically to war. Honor Before Reason is what happens when someone insists on following The Code even when this is obviously a really stupid thing to do. Violating it can result in Personal Horror.
See also, Heroic Vow, which sometimes coincides.
Examples:
- Kid Colt (2009): Bloodeye and his scavenger band have their own rules, one of which is that they don't attack other outlaws.
Bloodeye: Contrary to what people say about us, me and mine are honest thieves, outlaws and killers. We live by a strict code of honor and don't prey on our own.
- Wonder Woman: Back when the Amazons were still human women who had taken refuge on Paradise Island and then decided to stay they had to take an oath with undergoing the process to become Amazons. The oath was never given in full but looking out for kids and taking care of refugees seemed to be core elements.
- Justified Trope in Jericho (MLP). The titular Jericho has a very simple one, with only two specific entries about rules he must not break. Jericho explains that they exist to keep him from becoming an irredeemable monster, since Jericho is a sociopath. The code is: "Harm not children. Commit not rape."
- However, the Code/Kodex only gets elaborated upon after Jericho accidentally breaks it when he kills a child. And then willingly kills several more children. And their parents. And ends up murdering every single member of the small town of Sleepy Oaks. Because they're trying to murder him after enervation drives them all homicidally mad, giving Jericho no choice. After breaking the Code, for the first time ever does Jericho break down and lose his sense of optimistically dark humor, becoming a Stepford Smiler as he tries to hide his sins from his companions.
- The Reaping of Hatsune Miku: The Reapers usually have no reason to go easy on the Players, but "Reapers always repay their debts". If a Player manages to do a Reaper good, the Reaper Collective will repay them somehow.
- The Jedi Code in Star Wars. Depending on the era and individual, the Sith code can also function as one.
- The "Code of the West" is sometimes mentioned in The Western genre.
- The Pirate Code of Pirates of the Caribbean is more like a set of guidelines rather than actual rules, but it still works.
- The Arthurian code of chivalry, as referenced in Dragonheart.
- The Sea Beast: The hunters all live by a code. It's not elaborated upon in much detail, but two of its stipulations are that they shall not leave fellow hunters to die or turn to the dreaded sea witch Gwen Batterbie for aid.
- In A Brother's Price, there seems to exist a code of honour, although it is never described in detail. Princess Trini, who was unwilling to marry in the first place, invokes her "duty", when her husband is in danger. "It is a wife's duty to protect her husband" - and she will do so, and risk her life for it. Whether she loves him isn't important.
- The Code that the barbarian heroes (and their opposite numbers, Dark Lords) live by in Discworld.
- Also, the Igors in Discworld have a Code which requires such things as "The Marther is always right." and "Don't ask [big] questions." At one point in Thief of Time, an Igor has to answer a question he cannot due to the Code. He simply says "I would be unable to say that." They must also not betray the Master but at the same time the Code doesn't forbid them from leaving right before the villagers come with torches and pitchforks.
- The Stormlight Archive:
- The Alethi Codes of War are an ancient set of rules that the local Proud Warrior Race gave up centuries ago as part of their devolution into Blood Knights. Dalinar is the only one who still holds to them, and the other highprinces scoff at the idea, insisting that no one ever actually followed them, they just claimed to so that they could pretend to be honorable. The really sad thing is that any modern real-world army would find the Codes perfectly reasonable, and in many cases less restrictive than real military doctrine: Stay in uniform while in a war zone, don't drink while on duty, don't duel unnecessarily in case important officers get injured, don't ask your men to do something you wouldn't do yourself, and don't abandon allies on the battlefield or seek to profit from their loss. It shows how much the Alethi have fallen that they refuse to even consider the wisdom in any of that.
- The Knights Radiant had the Immortal Words, five oaths they lived by. The first Ideal ("Life before death, strength before weakness, journey before destination") was the same for all ten Orders, but the other four were different. They derived these codes from a book called The Way of Kings, written by a ruler who had achieved peace throughout his kingdom.
- In The Witcher series, Geralt will often bring up the Witcher Code when he refuses a job or stays neutral in any given conflict. That said, he's never very forthcoming about what the code says or why it prevents him from getting involved in that instance. It turns out that there is no formal Witchers code. There are some general guidelines, like the basics of what Witcher are supposed to do as well as keeping Witcher secrets safe, but that's it. Geralt admits that invoking the "Witchers Code" is just a good way to get people to stop bugging him about things. Of course each Witchers can also come up with their own rules for what they will or won't do, like how Geralt won't take contracts to hunt down anything intelligent.
- The Warrior Code in the Warrior Cats series. It's eventually deconstructed in the Power of Three arc when 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, when the characters realize that the code is a guideline that can be changed, and when Hollyleaf uses it to atone.
- In The Dresden Files:
- The Fair Folk live by this. All their actions, both benign and malign, fall under this. Any debt incurred must be repaid in kind. Any insult must have an appropriate response. As the series has gone on it's become pretty clear that his is not just a code of conduct, but literally a physical necessity for them. A fae literally cannot choose to fail to repay a debt, if given the chance to. And, While not compelled to the same extent, most Supernatural creatures are similarly very good to the letter (if not always the spirit) of their word. That certainly doesn't mean you should trust them, it does mean that if a supernatural being makes a promise, they will almost always be good for it.
- The Shadowhunters' Law from The Mortal Instruments, which provides a moral framework for what they do, but which is often very restrictive. Both the heroes and villains have a distinct tendency to try to circumvent it, even while accepting it in principle.
- In Grandmaster of Demonic Cultivation: Mo Dao Zu Shi, no other sect matches the Lan sect for scope: they carve all their rules on the giant Wall of Discipline at the entrance of the Cloud Recesses. In his time studying there, Wei Wuxian noted that there were three thousand-plus rules crammed onto the wall. In the thirteen years since he died, a thousand more were added...
- In Villains by Necessity a paladin who fights Blackmail is astonished when the latter allows him to get his sword after he was disarmed and is left defenseless, as this follows the code paladins have. This confuses him as Blackmail is supposedly evil. It foreshadows that Blackmail is really Sir Pryce, a paladin.
- The Han Solo Trilogy:
- Roa's Rules, which Han, Chewie, and their general crowd within the smuggling community try to live by. Some of the rules are just common sense (never gamble unless you're prepared to lose, always be prepared for a quick getaway, never pilot a ship under the influence), but others are moral imperatives (never ignore a call for help, never take from those who are poorer than yourself).
- Boba Fett has one as well. He considers himself a law-abiding being, but also tries to remain honorable in his dealings with his clients, and at one point is shown trying to figure out how to respond to an offer from a Hutt not to honor a bounty to kill someone while still satisfying his code. Eventually he settles on taking the deal until he's finished his current job, then sending the money back when he wants to claim the other bounty.
- The Hutts have a rudimentary one, though how much they live up to it fluctuates throughout the series. One of the rules, alluded to in the Hutt Council from Rebel Dawn, is that it's okay to exploit other species, while some better behavior is expected between Hutts.
- The male Togorians like Muuurgh, along with Wookies in general, have strict ones. In the former case, if they gave their word of honor, it won't be broken unless the person who received this got it under false pretenses. Wookies, on the other hand, will serve whoever they owe a life debt. Both also show a strong loyalty toward their families, friends, friends' families etc. When he introduces Muuurgh to Chewie, Han notes they have a lot in common.
- Star Wars: Lost Stars: The valley kindred on Jelucan live by a strict set of principles mandating they never break promises, stand with those whom they believe have been falsely accused and undergo rituals for mourning.
- Heralds of Valdemar: In Foundation, Cole Pieter has been running his mine long enough that Mags and the other mine-slaves have developed their own unwritten code. Some parts are pragmatic, such as sharing the blankets in the sleeping pit (so the rest of the slaves don't have to make up the work if one of them gets "cold-sick"), other parts include an absolute ban on telling on another slave.
- The Reluctant King: Corineus, Estrildis' lover, follows a knightly code that has been out of fashion for centuries, which dictates fighting Jorian to win her. He finds it grossly dishonorable after Jorian doesn't kill him when he's beaten, but leaves along with her anyway at Jorian's urging.
- Threadbare:
- Knight classes (as well as their advanced version, Paladins) have a class feature that lets them swear to a code. The code is up to the knight in question, but as long as they hold to it, they receive powerful defensive bonuses that scale the longer they hold it. If they break their code, they can swear a new one starting at their next level, but they have to start at zero again. The Crown's knights swear to protect the innocent, fight the Crown's enemies, and never speak treason. This doesn't say anything about obeying the law, as Celia discovers to her horror when her fellow knights execute an unarmed prisoner because it's easier for them. When Celia and Graves discover that the King is a lying madman, their codes break pretty much immediately, because speaking against the King—even truthfully—counts as treason.
- When Missus Fluffbear becomes a Knight, she swears to fight bad guys, protect good guys, and always feed her kitty on time. When the group gets captured, she is quite reasonably worried that her code will break because she's been separated from her cat; even if their captors feed her, she's not the one doing it. Threadbare convinces her that this isn't on "her time," so she's not responsible. Just like how they let the cats hunt for themselves when they can; Fluffbear isn't feeding her, but her code doesn't break.
- The Model Job has a class feature that is functionally the same as a code of honor, called Dietary Restriction. As long as you don't eat unhealthy foods, you get powerful bonuses to your pools, which improve the higher your level and the longer you maintain the restriction. Threadbare discovers a great Min-Maxing opportunity when he accidentally takes the Job: Golems don't eat, so it's impossible for him to violate his Dietary Restriction.
- Cradle Series: To a sacred artist, reputation and honor are everything. An artist keeps his word, respects and serves his clan or school, and honors those above him in rank. He also doesn't kill his juniors, but that's a much less important rule, so the weak had better treat the strong with respect. As Eithan explains, this system is the only thing keeping a world full of overpowered psychopaths from complete anarchy. The main characters stand out as pretty much the only people who say "maybe I don't want to murder everyone I meet, held back only by threats from the stronger."
- The Obsidian Chronicles: The nobles of Manfort abide by a strict one. For instance, an insult can be grounds to fight a duel if the insulted party doesn't get a sufficient apology.
- Doctor Who: "Never cruel or cowardly. Never give up, never give in."]]
- The Hexer: In the books, there was no actual witcher code, although Geralt made up a code of his own. In the series, witchers have a code that allows them only to fight in an "honorable" way (even against monsters). However, there are numerous hints throughout the series the code is a mere excuse used by elders to control the guild, trainees, shape interactions with humans and abuse their own power, with no actual set rules. Thus mirroring Geralt's personal "code" from the books in basic function, but with sinister intent behind it.
- The Bro Code from How I Met Your Mother.
- Scoundrels (2010): The West might be criminals, but they have lines they don't cross. "No violence and no drugs" is the major one, but they're also not supposed to snitch or scam family or friends. The longer Wolf stays in jail, the looser with his code he becomes.
- Star Trek:
- While the Klingons have a code of honor that befits a Proud Warrior Race, whether or not they abide by it is another matter entirely. Some act in direct contravention to their ideals; Duras, for example, attempted a Klingon Promotion via poison rather than honorable combat. Worf, who was raised by humans, may be the strongest adherent to the Klingon ideals of honor.
- As revealed in Star Trek: Deep Space Nine, the Ferengi Alliance has a code of honor known as the "Rules of Acquisition", which outlines how to live a profitable life.
- Star Trek: Discovery: Starfleet has the "Uniform Code of Conduct." In "If Memory Serves" Captain Pike tells Saru after Saru allowed Culber to attack Tyler that given the circumstances he was going to overlook the fight, but all future conflicts would be settled according to the Uniform Code.
- The Code Of Honor was/is the defining trait of Ring of Honor. It used to be a five point law that could earn one severe penalties if they violated it, put in place to cut back on the usual antics that go on in professional wrestling. For two years it seemed to be working, with even most of the heels subscribing to it at least partially. But then its obvious flaw became apparent; if most of the roster decides to violate it, are you going to suspend them all? Having strayed from its super indie roots, finding replacements in time for the next show would prove nigh impossible, so Gabe Sapolsky did away with the code. After he left the company it was brought back, although simplified to what amounted to "play nice" as there were no longer penalties for violators.
- Samoa Joe tried to end the career of Christopher Daniels in TNA, AJ Styles accused Joe of violating the unwritten code of honor that comes with being a part of the X-Division, a code Joe said he did not care about in response. This was a great divergence from Joe's usual gimmick, where he refused to break ROH's code even when Christopher Daniels paid him to. He also kept upholding an honor code in The Pure Wrestling Association.
- 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 Dungeons & Dragons Dragonlance setting.
- Forgotten Realms has too many specific organizations. Even 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 Harpers (they got a separate sourcebook).
- The Paladin's Code from Dungeons & Dragons 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 Lawful Stupid character. They're not even allowed to render aid to chaotic characters.
- ... in some editions. 3E downgraded it to not allowing aid if said aid would be used for chaotic purposes, and it became even more flexible in 4E and 5E; the latter in particular splits it into several different oaths to follow with different tenets to each, from the usual paladin of old with some lighter codes all the way to both free spirits and outright tyrants.
- The Aslan Fteir code in Traveller. The exact tenets depend on which clan you're part of, but they're important enough that Fteirle ("those who live by Fteir") is what Aslan call themselves.
- There are many Codes of Conduct found in Rocket Age, from the oaths taken by Maduri warriors to the ethics practised by reporters and private detectives. All are covered by the Code of Conduct bad trait.
- The dogs of Pugmire believe in the Code of Man, which contains edicts such as "protect those who are true," "obey a worthy master" and "fetch that which has been left behind." Since this is a somewhat idealistic game, all player characters are expected to pick at least some of them to adhere to, though they are free to disregard others as being "not the important parts of the Code."
- The Monarchies of Mau spin-off, which covers cats in the setting, reveals the cats have their own code of honor, the Precepts of Mau. Contrasting the dog approach of one big code that dogs can find some parts not important, there are only four common preceptsnote , but cat noble houses have their own additional Precepts (such as "Always push boundaries.") — the four common precepts are simply the only ones they all managed to agree on when trying to create a common code of honor.
- Warhammer 40,000:
- Khornate warriors vary from vaguely honorable fighters (very rare) to bloodthirsty maniacs who'll kill anything that moves including allies (the vast majority). However, the one thing they have in common is that Khorne demands the skulls of warriors (enemies or your own), but doing something like proclaiming yourself a great warrior after valiantly decapitating defenseless victims is a very good way to get the Blood God pissed at you specifically.
- Part of the reason the Tau are viewed with great suspicion by the Imperium is that they don't hold Honor Before Reason- where Imperial history is filled with glorious last stands that might have been avoided in retrospect with a little more mental flexibility, the Tau's view is that a commander who let the situation degrade that badly was clearly incompetent in the first place. They'l also agree to leave conflicts if it's too much effort for not enough reward to win, something the Imperium can't imagine itself doing.
- The Clans of Battletech built their entire society on one of these: The 'Clan way' (for lack of a better term) is based on a series of writings and traditions passed down by Nicholas Kerensky when he founded the original Clans, and was based on a number of Real Life codes of honour, especially bushido. Said writings basically cover every aspect of Clan civilian and military life, from families, economics, and how to conduct warfare, and Clanners take adherence to these writings very, very seriously to the degree that being seen as 'un-Clan-like' can be a fatal prospect.
- BIONICLE has the Toa Code, which is basically Thou Shall Not Kill.
- Beast Wars: Uprising has the Predacon Manifesto, set down by Preditron. It mostly follows with the attitudes expressed by Dinobot in Beast Wars (see Western Animation), based on seven "pillars" - Ambition (but not greed), honor, valor, pride (but only when deserved), loyalty, justice and sacrifice. By the time of the story, most Predacons don't follow or give a rat's about it, not helped by the Tripredacus Alliance "recontextualizing" it after they got rid of Preditron.
- The code of the Asari Justicars in Mass Effect 2.
- The titular Assassin's Creed is a sort of anti-Code that still manages to be a Code: "The wisdom of our creed is revealed in these words: '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. Their was originally a whole slew of other rules (no poison, a number of ritual requirements like removing a finger to earn hidden blade privileges, absolute loyalty to superiors, etc.) but these were mostly abandoned over the centuries and each protagonist follows the warrior code appropriate to their culture.
- Ghost of Tsushima has a traditional Samurai code that prevents them from doing anything that is considered dishonorable.
- In The Gamer's Alliance, 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.
- Da Rules in The Fairly OddParents!.
- The Code of Thundera in ThunderCats: "Justice, Truth, Honor, and Loyalty."
- The Unwritten Kids Code of Honor in Recess
- The Code of The Schoolyard mentioned in an early episode of The Simpsons. After Bart is beaten up, he won't tell a teacher because that would violate the code.
- Two episodes of Defenders of the Earth reference this trope:
- "A Demon in His Pocket" reveals that the Defenders have a Code of Honour which forbids them from fighting unnecessarily. So when Kshin is targeted by the school bullies, he feels unable to fight back, leading to him disobeying a direct order not to touch Mandrake's sorcery books and summoning the titular demon.
- In "Return of the Skyband", the Phantom tells the other Defenders about an incident where his grandfather encountered an all-female band of Sky Pirates, but was unable to fight them because of a Code of Honour which forbids those who assume the Phantom title from harming women.
- In Beast Wars, Predicons do have a complex code of honor they pay lip service to to some degree. What made Dinobot switch sides in the first episode wasn't that Megatron was wrong, but rather when he challenged Megatron's authority on that, Megatron had another Predicon eliminate Dinobot, rather than face him in one on one combat. What endeered him to the Maximals in general and Optimus in particular was that Optimus was willing to accept Dinobot's challenge to leadership and face him in single combat and accept that if he lost, he would be killed by Dinobot, but revealed that the stipulation of death to the loser was not returned to Dinobot (Optimus chose to spare his life and still allow him on his team.). We'd see in later episodes Dinobot was shown evidence to suggest his initial challenge of Megatron was ill informed, and switch back, but his established loyalty with the Maximals was in constant conflict when this happened.
- Word of God holds that among the Predicons, Trechary was not a dishonorable act cowardly act (This version of Megatron has at most two loyal followers, neither at the same time) and in fact, Megatron values it. The catch here is that treachery was used as a test of good leadership. A good leader, would be able to stop treachery, either through inspiring loyalty or by preventing treacherous underlings from a successful challenge. Meanwhile, subordinantes could achieve leadership by successful coups and were expected to challenge authority by betraying leadership if they felt leadership was poor, however, they should anticipate that their leader would be able to counter their machiations.
- Dinobot's closest friend on the Maximals was Rattrap, who seemed to Vitriolic Best Buds do to their own personal codes coming into conflict. Ratrrap was devout to the Maximal cause but not to Maximal Codes of Honor. Conversely, Dinobot was not devout to the Predicon Cause but was devout to Predicon Codes of Honor. Dinobot was willing to make a Heel–Face Turn because Megatron had crossed a line. Rattrap was willing to make a Face–Heel Turn because it would give the Maximals an edge if he joined the Predicons for a while. So natrually, they had no trust of each other. Rattrap would always be suspicious because Dinobot lived by an idealogy that was payed lip service to by so many of his loyal members, so obviously Dinobot was just a spy and not an ethically troubled individual. Meanwhile, Dinobot saw in Rattrap an individual who payed lip service to an moral idealology, but only so much as it justified his dishonoralbe actions, essentially, what he betrayed Megatron over.
- The bushido code of the samurai class (written after the samurai had ceased being an active warrior class).
- The chivalric code of medieval knights (most variants written after the knights had ceased being an active warrior class).
- The Mafia code of Omertà.
- The Hippocratic Oath for doctors. Making this trope Older Than Feudalism.
- Lawyers, being lawyers, know that some in their profession will want to, erm, lawyer their way around any Code, and have come up with very complicated Codes that either leave little room for wiggling or limit how useful to the lawyer or damaging to others the wiggling can be. The American Model Rules of Professional Conduct (applied in some form in all states except California, which has slightly different rules) are a good example. (Incidentally, this code contains Rule Number 1 for lawyers: "Touch your client's money and you're done.")
- Most professional bodies will similarly have their own codes of conduct/good practice.