Rules and SS13 for Experienced Programmers: Difference between pages

From Chompstation Wiki
(Difference between pages)
Jump to navigation Jump to search
imported>Nadyr
(Page restored.)
 
imported>Nadyr
(Page restored.)
 
Line 1: Line 1:
{{GetStartedHeader}}
{{BayPage}}
{{hatnote|This article was gratefully copied from the corresponding page on the [http://tgstation13.org/wiki/SS13_for_experienced_programmers /tg/station13 wiki].}}
Other related guides: [[Basics of Coding in BYOND]] and the [[Guide to Mapping]]


These are the rules for the server and ''are subject to change without notice''. For further clarification, also see the guide to [[Not Getting Banned]]. If you did get banned, there's probably a good reason for it, but if you disagree, you can always [http://www.chompstation13.com/phpbb/viewforum.php?f=12 appeal your ban]. Although these are rules, but they are not infallible, complete, or concrete, and probably never will be despite our best efforts. If ''ever'' something feels wrong, either don't do it, or admin-help it first. Above all, use your common sense, listen to the game staff, and try to keep the game fun for everyone; not just yourself.
So you know how to write programs in other languages and would like a quick guide on how to understand and code for SS13? Good, this is the guide for you. It likely doesn't contain everything that you need to know but it's a start.


If you disagree with the rules as they currently stand, talk about it on the forum or with admins and maybe we can improve them through some healthy criticism and debate.
== Syntax ==


'''These rules are designed to be written in such a way that you can ''usually'' understand them just by reading the headers''', because reading ''all of this'' would be insanity for most people. If you cannot understand a rule just by looking at it, or wish to know about possible exceptions or examples, click the rule to learn more.
*Semicolons at the end are not mandatory,
*Loop, proc, object, variable etc. spans are determined by indentations (similar to Python, see examples below)
  /obj
    var
      i1
      i2
      i3
is the same as (Strongly recommended you use this layout to make searching for variable and proc definitions easier.)
  /obj
    var/i1
    var/i2
    var/i3
which is inturn the same as
  /obj/var/i1
  /obj/var/i2
  /obj/var/i3
*This guide uses the word 'object' for any defined type (see [[#Variable types|Variable types]]) and the word 'obj' for derivatives of atom/obj, which are all objects which can be placed on the map.
*This guide uses the word 'AI controlled' for behavior to do with an [[AI]] player controlling an item. The term 'Game controlled' is used when refering to behavior which the script itself determins (Usually called AI controlled creatures or NPCs)
*All things are inherited from parent objects. If a variable is defined in /obj/item, it doesn't need to be (actually can't be) redefined in /obj/item/weapon.


If you find yourself spending too much time reading this page, or are confused about any rules, please contact an admin on Discord to make suggestions on how these rules could be better worded.
=== [http://www.byond.com/members/?command=reference&path=var Variables] ===
Variables are very general, Byond makes no difference in the declaration of strings, integers, etc. (Similar to PHP)


== You must be 18 or older to play on this server ==
==== [http://www.byond.com/members/?command=reference&path=var Predefined variables] ====
<font color="red">'''There are no exceptions.'''</font> If the staff suspects that you are underage for any reason, you will be banned from playing on the server until you are able to prove to the satisfaction of the staff that you are at least 18 years old. Proof would involve a ID/Driver's license with most info blurred out except the date of birth and a randomly chosen word to be written on a paper next to it.  
There is a lot of predefined variables for objects in BYOND, but the most important are:
*'''[http://www.byond.com/members/?command=reference&path=proc%2Fvar%2Fsrc src]''' - a variable equal to the object containing the proc or verb. It is defined to have the same type as that object. (Similar to "this" in Java or C++)
*'''[http://www.byond.com/members/?command=reference&path=proc%2Fvar%2Fusr usr]''' - a mob variable (var/mob/usr) containing the mob of the player who executed the current verb, or whose action ultimately called the current proc. '''A good rule of thumb is to never put usr in a proc.''' If src would not be the correct choice, it is better to send another argument to your proc with the information it needs.
*'''[http://www.byond.com/members/?command=reference&path=proc%2Fvar%2Fargs args]''' - a list of the arguments passed to the proc or verb.
*'''[http://www.byond.com/members/?command=reference&path=datum%2Fvar%2Fvars vars]''' - a list of object variables. If the variable name is used as an index into the list, the value of that variable is accessed.


*Use of real world slurs, ‘lolspeak’, and other indications of immaturity may be taken as signs that you are underage.
For more SS13 specific variables see [[#SS13 common variable meanings|SS13 common variable meanings]]


*Knowing another user is underaged but not reporting it is considered grounds for an immediate, permanent ban.
==== Variable definition ====


*The age of consent in your country is irrelevant. Your opinion about this rule is irrelevant.
=====Basic definitions=====
  var/j
  var/i = 4
  var/a, b, c


*You may also not play a character who is under 18 years of age.
=====Complex definitions=====
The general syntax is [http://www.byond.com/members/?command=reference&path=var var/type/variable_name = value]


== Be respectful to other players ==
Examples:
This is a game, we're all here to have fun, but try to make certain your type of fun fits our server and doesn't ruin things for others. Don't be overly offensive, rude, rapey, violent, or insulting OOCly. With IC there's some wiggle room, but there's still a limit to how much people will tolerate before they get sick of you, so keep it in moderation. When in doubt, use LOOC.
  var/obj/item/I = new/obj/item
  [http://www.byond.com/members/?command=reference&path=operator%2F%40dt%3B I.name] = "Some item"


*Racial slurs/epithets, derogatory/defamatory language against social groups, and generally any other category of bigoted language is not allowed (as covered by the global rules). Using this language ICly is still not allowed if it pertains to any real-life social group. Saying that “all Tajara look the same” is fine. Saying that “all [insert rl social group] look the same” is not. Also, being part of some real life social group doesn't grant you immunity to this rule or some special ticket to use these slurs.
Datum definition and declaration of a variable of that datum type:
*Metagrudging can be considered being disrespectful. Metagrudging is having an extreme grudge against another player through different rounds, causing heavy amount of drama between the two and causing the other person to feel upset about it. However, we think it's fine if there is some sort of grudge as long as it's agreed on OOCly first.
  datum/test_datum
*Ignoring people because you do not want to interact with them is not considered being disrespectful, as long as it's kept mature and within it's boundaries this is considered fine.
    var/test_variable = 0 //declaration of the test_variable var
*Do not share people's usernames/details anywhere as this can be similar to "doxxing" another player in-game, and this can easily create metagrudge issues with other players. Exceptions to this can be if the other player agrees.
   
*We want to encourage some drama in the game, as this is what can add a lot of depth and character design into the game, but keep it moderate, otherwise staff would have to be involved. If you do feel like there's any drama getting way too far, or getting to the point where it's going over IC interactions and into OOC interactions, contact a staff member as this can be considered disrespectful.
    proc/set_as(var/i) //proc definition within the test_datum datum
      test_variable = i //set the test_variable var to the value in the argument
 
  var/datum/test_datum/TD = new/datum/test_datum //TD will now be a reference to a datum of type test_datum
  TD.test_variable = 4  //Byond doesn't know of private variables, so you can set any variables like this
  [http://www.byond.com/members/?command=reference&path=world world] [http://www.byond.com/members/?command=reference&path=operator%2F%26lt%3B%26lt%3B <<] TD.test_variable //will output 4 to all connected users
  TD.set_as(10) //Will call the set_as proc in the datum with the argument 10
  TD.test_variable //will output 10 to all connected users


== Do not inconvenience AFK or disconnected characters ==
==== Bitflags ====
Under normal circumstances, do not harm, eat, or otherwise inconvenience characters whose player is idle, ghosted, or disconnected entirely. There are some exceptions to this rule, as follows:
Bitflags are variables which use bits instead of numbers to determine conditions. The bit operators are [http://www.byond.com/members/?command=reference&path=operator%2F%26 &] and [http://www.byond.com/members/?command=reference&path=operator%2F%7C |]. For now, you should know that bitflag operators use the binary value of numbers to determine the result. So [http://www.byond.com/members/?command=reference&path=operator%2F%26 13 & 3] will result in 1. ([http://www.byond.com/members/?command=reference&path=operator%2F%26 1101 & 0011 = 0001]) and [http://www.byond.com/members/?command=reference&path=operator%2F%7C 13 | 3 = 15] ([http://www.byond.com/members/?command=reference&path=operator%2F%7C 1101 | 0011 = 1111]) see [[#If|if]] for uses
*If they've disconnected/idle for more than 30 minutes, you can put them in cryosleep. If you do that, take away all of their belongings except for their jumpsuit, shoes, ID, and PDA, and return everything else to its rightful department.
*If they've committed a crime, jail them as you normally would and conduct their sentence even if they aren't connected. 20 minutes in the brig is still 20 minutes in the brig.
*Some players will say in their OOC notes that they're okay with getting devoured while AFK or offline. As long as you don't break these preferences, it's okay to do things to them.
*Emergencies bypass this rule. If it's an emergency and you need something an idle player has to fix it, you may take it.


If you are caught possibly breaking this rule, you will be questioned and without a reasonable/acceptable answer, you will be punished. If you are lying (it's very easy to find out) you will be faced with a more serious punishment.
==== Variable types ====
[http://www.byond.com/members/?command=reference&path=var reference]


== ERP preferences must be respected ==
*[http://www.byond.com/members/?command=reference&path=datum datum] - ordinary object type (class in java)
Players should have their ERP prefs listed in their “OOC Metainfo” or “OOC Notes” on their characters. You are required to respect these preferences so long as they pertain to ERP. If you are unsure about the meaning of some of their preferences, then use LOOC to discuss it with them. If you accidentally go against someone’s preferences, or someone else goes against yours, work to correct it as quickly as possible, even if that means just deciding in LOOC among yourselves that ‘this didn’t happen’ and going your separate ways.
*[http://www.byond.com/members/?command=reference&path=atom atom] - atom derives into obj, turf, mob and area
* Do not put "anything goes" or similar in OOC notes, we will warn you once, and not take complaints in ERP regards if your notes remain unchanged.
*[http://www.byond.com/members/?command=reference&path=turf turf] - tiles which make up the floors, walls and space on SS13
* If you like non-consensual scenes, State that in your notes! If it is not stated in someone's notes, assume all scenes should be consensual.
*[http://www.byond.com/members/?command=reference&path=area area] - areas are grouped locations. They combine many turfs and it gives some common properties. Power, atmosphere, etc. are determined by areas
* AFK/SSD/Disconnected players are not valid targets for any ERP unless their OOC Notes specifically permit otherwise.
*[http://www.byond.com/members/?command=reference&path=mob mob] - an object with life, be it game controlled or player controlled.
* If you learn of something that makes you uncomfortable while you are in game. Please speak up in LOOC as normal, and remember to add it right away after the round has ended on station, or when you leave so it does not happen again in the future.
*[http://www.byond.com/members/?command=reference&path=obj obj] - objects which can be placed on the map
* Remember this is a vore server! Because of this, it is suggested not to have "no vore" in your OOC preferences. It is okay to be nervous about it or unsure, but making some attempts to at least experiment would be appreciated.
*[http://www.byond.com/members/?command=reference&path=client client] - a new client object is created for each connected player
*[http://www.byond.com/members/?command=reference&path=list list] - a list of elements. The first element in a list called L is L[1]
*[http://www.byond.com/members/?command=reference&path=world world] - this is a variable where some global variables for the entire world can be set. World's contents var contains all atoms currently in the game world.


*Do not kinkshame others. This includes overt comments about someone’s ERP preferences being ‘wrong’ or ‘immoral’, but also includes passive-aggressive remarks related to preferences, such as public remarks suggesting that you won’t go near someone because of their OOC ERP preferences. If you have negative feelings about someone’s ERP preferences, don’t interact with them, and keep it to your self.
==== [http://www.byond.com/members/?command=reference&path=operator%2F%26lt%3B%26lt%3B%2Foutput Outputting messages] ====
The most basic way of outputting messages is with the [http://www.byond.com/members/?command=reference&path=operator%2F%26lt%3B%26lt%3B%2Foutput '<<' output operator].


*Do not attempt to force yourself into ERP scenes where the other party (or parties) involved are not comfortable with it, or not even actually participating. This includes (but is not limited to) repeatedly jumping into people's food as a micro, trying to do ERP that a player has blatantly stated they are uncomfortable with, trying to guilt players into having a pity RP with you, doing [https://www.reddit.com/r/SS13/comments/451jtt/hitandrun_erp_is_a_thing_now_apparently hit and run ERP], filling drinks with your bodily fluids, etc. You get the idea. Don't do that.
  [http://www.byond.com/members/?command=reference&path=world world] [http://www.byond.com/members/?command=reference&path=operator%2F%26lt%3B%26lt%3B <<] "Hello World!" //Outputs a message to all clients in the world
  [http://www.byond.com/members/?command=reference&path=proc%2Fvar%2Fusr usr] [http://www.byond.com/members/?command=reference&path=operator%2F%26lt%3B%26lt%3B <<] "Hello usr" //Outputs a message to only the user who is tied to the calling of the proc which contains this.


== The dorms are protected ==
===== Output with variables =====
The ‘dorms’ area on the map are reserved for ERP and are ‘protected’ from interruption. It is a violation of this rule to break into occupied dorms or harass players in dorms.
  var/s1 = "Hello"
* Security is not allowed to indiscriminately inspect dorms for crimes, but a known criminal hiding in a dorm is not protected by this rule.
  var/s2 = "World"
* It is not permissible to attempt to use dorms to hide from security, or to make their job of finding you harder. The dorms are for people who want to ERP in privacy.
  var/i = 2011
* Do not leave the server in locked dorms. They're for scenes only
  [http://www.byond.com/members/?command=reference&path=world world] [http://www.byond.com/members/?command=reference&path=operator%2F%26lt%3B%26lt%3B <<] "[s1] [s2], this guide was written in [i]" //Returns "Hello World, this guide was written in 2011"


See also: [[Guide_to_Vore#Area-by-Area_Response|Guide to Vore - Area by Area Response]]
==== Determining variable types in code ====
The [http://www.byond.com/members/?command=reference&path=proc%2Fistype istype()] proc will come in handy


== Roleplay as long as it's feasible ==
Example
Roleplay as long as it's feasible
  var/obj/item/weapon/W = new/obj/item/weapon/baton
This is an MRP (Medium roleplay) server. This server will allow combat but keep in mind there are also people who like to rp. You can fight with someone if its with someone that you know would willingly fight but do not involve others who don't want to fight.
  if([http://www.byond.com/members/?command=reference&path=proc%2Fistype istype](W,/obj/item/weapon/baton))
* We'll allow stuff to be dealt with IC instead of ooc if its in character drama, the only way that you'll be in trouble for this is if you do something to violate someone's prefs or you murderbone, make sure you read OOC notes.
    [http://www.byond.com/members/?command=reference&path=world world] << "It's a baton!"
* You are expected to roleplay out roleplay actions. However, if combat breaks out, or you find yourself in a situation against another player trying to fight you or just suddenly attacking you with no explanation why, you are expected to use the in-game mechanics.
* You are expected to roleplay your actions with other players as long as it's feasible. If someone engages you in purely ‘robust’ (aka game-mechanics driven) combat while you were attempting to roleplay with them and you never gave ooc permission, with no "reasonable provocation", please use the admin-help feature to inform an admin.
* "Reasonable provocation" are situations or actions that deem you too dangerous to be given even a chance to talk. For example, openly wielding a gun while threatening people, charging someone with a knife, trying to create a hazard, or being the target of a manhunt.


Please Note
The second argument is optional, if it's omitted, the variable will be checked against its declared type, like
If a fight does begin, you're not expected to type out every gunshot and dodge and attack. You are to roleplay up until the point that it makes sense to start attacking, and then use game mechanics from there. You are allowed to respond to ‘robust’ violence with your own, if you desire, though you should attempt to return to roleplaying as soon as feasible. The environment is not designed for a focus on action, but rather for character-building and roleplaying. When a fight is over, resume roleplaying.
  var/obj/item/weapon/W = new/obj/item/weapon/baton
Movement is considered a game mechanic for the purpose of this rule. Wordlessly running at a security officer who is attempting to arrest you, or wordlessly fleeing from them, is considered engaging in game-mechanic combat. The security officer has valid cause to stop trying to roleplay and stunlock you into the ground.
  if([http://www.byond.com/members/?command=reference&path=proc%2Fistype istype](W))
    [http://www.byond.com/members/?command=reference&path=world world] << "It's a weapon!"


== Do not join with an inappropriate ckey ==
Standard code for getting specific arguments from variables which have a type that is a subclass of the type the current proc treats them with (see any attackby() proc for examples). Note that the example below is of a proc which is globaly defined, not tied to the object. It doesn't make much sense to do it like this but it works for the purposes of the example. /obj objects don't have the 'amount' variable, it's defined in /obj/item/stack (as ilustrated by the oversimplified definition of classes below. Also note where var/ is used and where it isn't).
Ckeys, better known as BYOND user names, must be appropriate. If any are deemed inappropriate, the ckey will be banned and you will be unable to play on our server until you make an account with an appropriate name.
  /obj
*Ckeys that mock certain players or groups are an example of inappropriate.
    var/name = "Object"
*Ckeys that violate BYOND's terms of service may also be reported.
 
  /obj/item
    name = "Item"
 
  /obj/item/stack
    name = "Stack"
    var/amount = 50
 
  proc/get_amount(var/obj/O)
    if([http://www.byond.com/members/?command=reference&path=proc%2Fistype istype](O,/obj/item/stack))
      var/obj/item/stack/S = O
      return [http://www.byond.com/members/?command=reference&path=operator%2F%40dt%3B S.amount]


== Do not misuse Global OOC ==
There is another way of doing this. I'll show you that it exists but it is NOT TO BE USED.
Many servers simply mute global OOC. We do not, because the OOC command is useful to have on in an RP heavy server.
  proc/get_aount(var/obj/S)
    if([http://www.byond.com/members/?command=reference&path=proc%2Fistype istype](O,/obj/item/stack))
      return [http://www.byond.com/members/?command=reference&path=operator%2F%3A O:amount]
The [http://www.byond.com/members/?command=reference&path=operator%2F%3A colon operator] (:) in the example above tells the byond compiler: "I know what I'm doing, so ignore the fact the object doesn't have this variable, I'll make sure it works myself." The problem is that people will revise your code and use it in ways you never planed for. This means something might eventually make the O:amount throw exceptions in the form of runtime errors. Some variables might eventually need to be removed or replaced and this is impossible when they are used with object:variable as the compiler will not throw an error when the variable is removed. The error will only become apparent after the game is ran on the live server which might cause it to crash. So just don't use this method, ever.


* Global OOC is used, for instance, to contact someone you were typing a reply to had walked out of the room before you were done, and you're trying to ask them to come back. It's also useful if you're a new player, or an old player exploring new mechanics, who asks something like, "How do I make Tricord again?" or something short and similar. Short, sweet, and relevant OOC messages are generally okay. Welcoming old players returning, or new players joining, is also generally okay.
There are some shortcuts to [http://www.byond.com/members/?command=reference&path=proc%2Fistype istype()] proc:<br>
[http://www.byond.com/members/?command=reference&path=proc%2Fisarea isarea(variable)] = istype(variable, /area)<br>
[http://www.byond.com/members/?command=reference&path=proc%2Fisicon isicon(variable)] = istype(variable, /icon)<br>
[http://www.byond.com/members/?command=reference&path=proc%2Fismob ismob(variable)]  = istype(variable, /mob)<br>
[http://www.byond.com/members/?command=reference&path=proc%2Fisobj isobj(variable)]  = istype(variable, /obj)<br>
[http://www.byond.com/members/?command=reference&path=proc%2Fisturf isturf(variable)] = istype(variable, /turf)<br>
[http://www.byond.com/members/?command=reference&path=proc%2Fisloc isloc(variable)]  = ismob(variable) || isobj(variable) || isturf(variable) || isarea(variable)


* Global OOC is ''not'' for idle banter, ranting, things pertaining to incidents in the current round (see previous rule), in-depth explanations (an explanation that takes more than a few lines), shitposting memes, or discussing topics not relating directly to the game. If you want to chatter OOCly, go to our Discord channel, which is linked from the home page at https://vore-station.net/ or use LOOC so as to not disturb the rest of the server.
==== Switching between variable types in code ====


* Also, if someone does misuse OOC, do not complain in global OOC about their misusing of global OOC. Not only are you just making the problem worse, that is considered being a backseat admin, which is prohibited by other rules.
Byond defined:<br>
[http://www.byond.com/members/?command=reference&path=proc%2Fascii2text ascii2text]<br>
[http://www.byond.com/members/?command=reference&path=proc%2Ffile2text file2text]<br>
[http://www.byond.com/members/?command=reference&path=proc%2Flist2params list2params]<br>
[http://www.byond.com/members/?command=reference&path=proc%2Fnum2text num2text]<br>
[http://www.byond.com/members/?command=reference&path=proc%2Fparams2list params2list]<br>
[http://www.byond.com/members/?command=reference&path=proc%2Ftext2ascii text2ascii]<br>
[http://www.byond.com/members/?command=reference&path=proc%2Ftext2file text2file]<br>
[http://www.byond.com/members/?command=reference&path=proc%2Ftext2num text2num]<br>
[http://www.byond.com/members/?command=reference&path=proc%2Ftext2path text2path]<br>
[http://www.byond.com/members/?command=reference&path=proc%2Ftime2text time2text]<br>


== Keep IC and OOC separate ==
SS13 Defined:<br>
IC (In-character) and OOC (Out-of-Character) actions and knowledge should be separated as much as possible. Don't use OOC channels to discuss what's going on IC until after the round is finished, don't use OOC knowledge to do things your character wouldn't know, such as operate medical machines when a cargo technician. You are not playing yourself in the game, you are controlling a character with their own wants and knowledge and the IC/OOC boundary is to help reflect that.
text2dir(direction)<br>
dir2text(direction)<br>
dd_file2list(file_path, separator)<br>
dd_text2list(text, separator, var/list/withinList)<br>
dd_text2List(text, separator, var/list/withinList)<br>
dd_list2text(var/list/the_list, separator)<br>
angle2dir(var/degree)<br>
angle2text(var/degree)<br>


== Do not discuss ongoing rounds in any discord channels on the chompers discord ==
For more useful procs see<br>
Note that these same rules apply to LOOC as well.
[http://code.google.com/p/tgstation13/source/browse/trunk/code/defines/procs/helpers.dm code/defines/procs/helpers.dm]<br>
* Don't complain in OOC when your actions IC get you in trouble. This is self explanatory.
[http://code.google.com/p/tgstation13/source/browse/trunk/code/game/objects/items/helper_procs.dm code/game/objects/items/helper_procs.dm]
* Disconnecting or using other OOC means to avoid IC consequences is against the rules. If you do need to suddenly leave, a-help admins and looc/ooc to the server.
* Do not use Metacomms: Using third-party programs, such as Discord, IRC, Skype, or even the BYOND pager, to discuss and share information of the ongoing round. This excludes other players, can contribute to toxicity among the playerbase, and is often a tactic used by griefers and thus is a no-go.
* Do not Metagame: Using information obtained from elsewhere to influence IC decisions and actions. Your opinions or knowledge of other players or characters obtained via OOC methods should not direct your IC actions. If you have an OOC grudge against someone, you may not try to antagonize them IC, for example.
There is one exception to this. Asking in LOOC to be cloned after a vore scene is fine.
* Multi-keying: Logging in with multiple BYOND accounts on our game server. There is never any legitimate reason for you to do this and thus is not allowed.
* Create and play server-appropriate characters


== Please use a functional, appropriate character ==
=== [http://www.byond.com/members/?command=reference&path=proc%2Fif If] ===
* Play a reasonably sane and mature character, give them a non-immersion breaking name, do not play obvious reference characters, or characters from published works without a special character application approved for that character.
* Keep in mind that people do not like pain or dying and usually try to avoid it without good reason. Give your character a reasonable set of strengths, fears, and weaknesses. When writing things for IC, write things out that sound like speech, not emoticons or lolspeak.
* The setting contains no magic. Your character cannot have any superpowers, magical abilities, or anything that does not exist in the setting or cannot be reasonably replicated with game mechanics. That being said, if you do have a question about an ability you wish to have that is small and more flavor based, please ask an admin.
* If they are not someone who has a good reason to work on the station, they should not occupy any normal job slot and should be a ‘Visitor’ only.


'''Exception to this rule'''
Ifs default to checking for true if not otherwise stated. True is defined for all variable types as empty, 0 or non-existant (null).
  if(condition)
    action_true()
  else
    action_false()


The exception to this is purely private roleplay. For example: If your character and another character are in a dorm by themselves, and the other is OOCly fine with it, your character can display potentially supernatural abilities. This is limited to that roleplay, though. You should not discuss anything about that in public. Use magic at your own risk however, because technically the moment your RP is discovered by someone else, it stops being private, putting you in potential violation of this rule.
==== Common variable behavior in if statements: ====
{|
!Variable type
!False when
!True when
|-
!String (text / ascii)
|"" or null
|Anything else
|-
!Int / Real
|0 or null
|Anything else
|-
!datum, atom
|null
|Anything else
|}


== Please use workable sizes ==
==== [http://www.byond.com/members/?command=reference&path=operator Logical operators] ====
Obscenely oversized or undersized characters are forbidden. Minimum height is at least a few inches. Maximum height is about 30 feet. Anything more or less really pushes the already shaky believably of micros or macros existing on the station--and that's coming from a server whose theme is eating people.
Pretty standard:
If you are playing a whitelisted species such as Diona, Vox, Xenochimera, or whatever else we add in the future, you are expected to play the race as they are canonically meant to be played.
  [http://www.byond.com/members/?command=reference&path=operator%2F%21 !statement1] //NOT statement1
  [http://www.byond.com/members/?command=reference&path=operator%2F%26%26 (statement1) && (statement2)] //statement1 AND statement2
  [http://www.byond.com/members/?command=reference&path=operator%2F%7C%7C (statement1) || (statement2)] //statement1 OR statement2
  [http://www.byond.com/members/?command=reference&path=operator%2F%3D%3D ==] //equals
  [http://www.byond.com/members/?command=reference&path=operator%2F%21%3D !=] //not equal
  [http://www.byond.com/members/?command=reference&path=operator%2F%26lt%3B <] ([http://www.byond.com/members/?command=reference&path=operator%2F%26lt%3B%3D <=]) //less (or equal)
  [http://www.byond.com/members/?command=reference&path=operator%2F%26gt%3B >] ([http://www.byond.com/members/?command=reference&path=operator%2F%26gt%3B%3D >=]) //more (or equal)
  [http://www.byond.com/members/?command=reference&path=operator%2F%26 &] //bitflag AND operator. 13 & 3 = 1 (1101 & 0011 = 0001)
  [http://www.byond.com/members/?command=reference&path=operator%2F%7C |] //bitflag OR operator. 13 | 3 = 15 (1101 | 0011 = 1111)


== Flavor Text is encouraged ==
Byond does not recognize the === (identical) operator. More operators can be found in the left menu on the [http://www.byond.com/members/?command=reference&path=operator reference page]
Adding flavor text to describe your characters, along with visual refs if you have them can really help people get a good idea of your character. These should not include non-physical attributes (do not include feelings your character has, or how they act).


== Do not kill or attack things (including yourself) for no good reason ==
=== [http://www.byond.com/members/?command=reference&path=proc%2Fwhile While] ===
*This includes yourself. Even in self-defense your goal is to fight off your attack and escape to go get help, killing in a fight should only be done as a last-ditch effort when it's clear it's a you or them situation.
Byond will cancel a loop if it reaches a certain number of iteration and give a runtime error out of fear of infinite loops. Same applies for recursions.
Same as anywhere else
  while(condition)
    action1()


*Suicide or self-mutilation is almost NEVER allowed. Contact an admin if you want to have a character commit suicide. Typically the manner in which suicide is carried out is played as an in-game attention grab and without actual compelling reasons. This can upset those that find this subject OOCly uncomfortable. The punishment for suicide is nearly always a permanent ban, so think about that before you kill yourself.
All loops understand the [http://www.byond.com/members/?command=reference&path=proc%2Fcontinue continue] and [http://www.byond.com/members/?command=reference&path=proc%2Fbreak break] commands


*Excessive responses are also covered by this. Caving in someone's skull for cutting in line, stabbing yourself in the eye with a screwdriver because you are bored, or jumping out an airlock because you're sad, are all examples of being excessive.
=== For ===
All loops understand the [http://www.byond.com/members/?command=reference&path=proc%2Fcontinue continue] and [http://www.byond.com/members/?command=reference&path=proc%2Fbreak break] commands


== Do not powergame ==
For combines the for loop and foreach loop:
*Better known as 'playing to win'. As a security person this can be seen as going out of your way and needlessly endangering others to ‘win against’ criminals. As the station AI exploiting loopholes in your laws to get yourself out of them or getting the person who subverted you into trouble is another way. There is an implicit allowance for lawed characters to ERP. You may create loopholes for this reason only.
==== [http://www.byond.com/members/?command=reference&path=proc%2Ffor%2Floop For loop] ====
  for(var/i = 1; i <= 10; i++)
    [http://www.byond.com/members/?command=reference&path=world world] << i //Will write (each in a new line) 1 2 3 4 5 6 7 8 9 10


*While this shares several things in common with other rules, it still is it's own entity. Play to have fun, allow yourself to lose now and again and roll with the blows as it can make things potentially even more interesting.
==== [http://www.byond.com/members/?command=reference&path=proc%2Ffor%2Flist For each] ====
  for(var/obj/item/weapon/baton/B [http://www.byond.com/members/?command=reference&path=operator%2Fin in] world)  //will iterate through world.contents (which contains all atoms in the world) and only pick those which are of the given type (/obj/item/weapon/baton)
    B.name = "Smelly baton" //Will apply the new name to the baton in the current iteration loop


*Having '''way''' too many skills for one character is another example of this. Just because you're the Colony Director and have access to everywhere doesn't mean you should (or can) know how to do all the different jobs. (See [[Character Creation#Give them a set of skills|Character Creation]] regarding skills for more information.)
=== [http://www.byond.com/members/?command=reference&path=proc%2Fdo Do - While] ===


*[[Identifying Antagonists]] when you shouldn't be able to is also a violation of this rule.
The Do while operator is not commonly used in SS13 code, Byond does support it tho.


== Do not ‘Self-Antag’ ==
  var/i = 3
Do not be hostile to other crew for no legitimate reason. Don’t break things, steal things, or do other antagonistic stuff just because you’re bored, it's the end of the round, you “want to give Security something to do”, etc. If you're going to be an asshole, have a believable reason why you're being an asshole. Think about how a normal person would behave under similar circumstances.
  do
Remember that if you are selected to be an antagonist-type role, it does give you some wiggle room than usual as far as the server rules go, but it does not give you permission to break any rules. Stick to your objectives, don't be over-the-top and ruining everyone else's fun if you can avoid it. Ask for admin help if you're not sure.
    world << i--
  while(i)


== Make sure you do your assigned job ==
All loops understand the [http://www.byond.com/members/?command=reference&path=proc%2Fcontinue continue] and [http://www.byond.com/members/?command=reference&path=proc%2Fbreak break] commands
When your character joins the round, you are accepting the responsibilities that the job you have chosen brings with it Remember: if you are playing in a slot, you are likely preventing other players from performing that role. It is important that you fulfill the tasks that you have signed up for!


Should you join as a head of staff, you accept you'll be held to higher job standards than other crew due to the authority, responsibilities, and limited slots of said positions. When a vital job duty crops up, responsibility ultimately falls on you to ensure it is fulfilled. What this means is should such a duty be ignored in a well-staffed department, you will be held accountable . While you may delegate tasks to others in your department, you will be expected to pause roleplays and address the issue should nobody else do so.
=== [http://www.byond.com/members/?command=reference&path=datum Defining objects] ===
Doesn't matter if you want a [http://www.byond.com/members/?command=reference&path=datum datum] or [http://www.byond.com/members/?command=reference&path=atom atom], the definition of objects is the same and simple:
  /obj/item/weapon/item1 //will nmake a new object of type obj.
    var/item_property = 5 //Will define a new variable type for all item1 objs
    name = "Testing Item" //The name var is already defined in parent objects so it is not defined here, but only assigned a new valie.
 
  /obj/item/weapon/item1/[http://www.byond.com/members/?command=reference&path=datum%2Fproc%2FNew New()] //Constructor proc
    [[#..()|..()]] //should always be present in New() procs, see [[#..()|..()]] for more information
    item_property = 3 //An action that is performed in the object constructor.


* We reserve the right to ban players from jobs who repeatedly fail to perform to an acceptable standard until we're confident that they will be able to perform the job in question.
=== [http://www.byond.com/members/?command=reference&path=proc Procs] (Methods, functions, procedures) ===
* Do not do other people’s jobs. If you joined as medical, do not attempt to hunt down criminals. If you joined as engineering, do not attempt to perform medical treatment on your coworkers. If you are a head position, allow your staff to do work before you do the work yourself; you are a supervisor and manager first and foremost as a head position.
You're used to the standards of methods, functions and procedures, right? Well procs ignore some aspects of these. They can best be compared to Java methods, as they're tied to specific objects. They cannot be defined as static, private, public, etc. tho. You can write static methods, however the compiler will not restrict you from calling them in a non-static way or environment. Same applies for non-static methods.
* Do not hijack other people's jobs. For example, if you're a chemist but someone needs surgery, and there's already a surgeon who isn't currently busy, then don't perform the surgery instead of letting them do it.
* Playing jobs that can be called upon at any time to assist other crew members in emergencies waives your right to have interruption-free (E)RP sessions in private, even if you are in the dorms, you are required to put your scene on hold.
* You are expected to obey the chain of command (within reason)
* The Colony Director is the station's boss, so listen to them. Likewise, you should obey your department's Head of Staff unless directly overridden by the Colony Director.
* If you consistently do not follow reasonable orders, you will be job banned.


Permitted character disability is covered under the [[Standard_Operating_Procedure#NanoTrasen_Disability_Policy|NanoTrasen Disability Policy]].
  proc/proc_name(var/argument1, var/argument2)
    [http://www.byond.com/members/?command=reference&path=world world] << "[argument1] [argument2]"


== AI must obey laws ==
The above would declare a global proc. If you wish to tie it to a certain level
If you're playing a role that has AI laws, you must obey these rules first and foremost to the best of your ability. This includes even disobeying Central Command staff if your AI laws are in conflict with the orders given. (Note you can disregard AI laws when vore is the goal of disobeying them, but it's usually more immersive to play this off as glitches or by finding loopholes that allow you to eat people.)
* As any role without AI laws, you can disobey orders you think are traitorous, harmful, immoral, or violating Corporate Regulation. Use your judgement and consider whether or not disobeying the order could get you in trouble or get someone else horribly killed.
* If you are given an order or AI law that may break another server rule, please alert the admins for a second opinion before continuing.


Keep in mind. this is not a rule that lets people be fun police as heads of staff. If you feel that someone is ordering you do things that basically require you not to do your job, or to do your job in ways that aren't fun, then contact an admin for a second opinion.
==== ..() ====
This is the same as super() in Java. It calls the parent object type's proc with the same name and same arguments.


== Memories of unwilling deaths are imperfect ==
Example:
You are expected to forget events leading up to an unwilling death UNLESS if it was LOOC consensual between ALL parties involved in the situation. [[Clone_Memory_Disorder|Non-contiguous memory disorder]] (or Non-Con Disorder for short) is the in-character explanation for your character losing memories of recent events leading up to their death. You should not remember how you died, or who killed you.
  /obj/item
    name = "Item"
 
  /obj/item/New() //New() is the proc that gets called whenever a new object of this type is created. A constructor if you will.
    src.name = "It's an item!"
 
  /obj/item/stack
    name = "Stack"
 
  /obj/item/stack/New()
    src.name = "It's a stack!"
    ..()


Exceptions for this is a scenario where both prey and pred consented in LOOC to gurgles and remembering it.
If you have the code from the example above and create a new object of type /obj/item/stack, it will first make the item in the game world with the name "Stack", because it's defined to be that by default. Then the New() proc will be called immedietally after. This will change the name to "It's a Stack!" but the call of the parent type's New() proc with the ..() command will then set it to "It's an item!". So in the end, the new object will be called "It's an item!". The ..() command is however very important in many cases as some things are defined only in the common parent's New() procs. In Del(), the proc which gets called prior to an object's deletion, it requires the code to get to the root Del() proc to even delete it. See examples of Del() in the code.


== The purpose of the rules is to preserve a fun and enjoyable environment for all players ==
== Important procs ==
If everyone is enjoying themselves even while the ‘letter’ of a rule is not being followed, it’s likely that no staff intervention will be required. On the other hand, just because something isn't in the rules doesn't mean it's okay or allowed if it's upsetting a large number of players.


It is within admin staff's discretion to decide that certain actions violate one or more rules, even if the specific action is not listed as part of the rule. This is simply the job of the staff to interpret the rules. You can appeal decisions to other admins if you believe one has a bias against you, but doing so to more than three staff members will be considered harassment.
=== [http://www.byond.com/members/?command=reference&path=atom%2Fproc%2FNew New()] ===
This proc is called whenever a new instance of the object is created. It can have arguments if needed. It should call ..() where applicable so that parent constructors can be applied.


Plenty of rules are left vague enough to cover as much as possible without being too oppressing. Attempting to rules-lawyer saying that "this rule doesn't specifically say I can't do X", even if what you are doing is disrupting the server, will generally be ignored. We assume most of you have enough common sense to recognize what a sane and stable individual would and wouldn't do within this fictional setting.
If you wish to create a New() proc for [[#Variable types|atoms]] with custom arguments, ensure the first argument is for the object's location. Example:
  obj/item/weapon/my_item/New(var/location, var/i)
    ..()
    //Whatever else you need to do


== Listen to admin staff ==
To make a general object use
One admin's word is usually as good as any other. For example, just because the Server Host says it's okay to do something one moment doesn't mean you can still do it when a Trial Admin later tells you to stop.
  [http://www.byond.com/members/?command=reference&path=proc%2Fnew new] /datum/test_datum
To make an atom (which usually has a locaiton)
  [http://www.byond.com/members/?command=reference&path=proc%2Fnew new] /obj/item/weapon(src.loc)
For the custom example above, the code to create a new such object would be: The 5 is just an example of a value which could be assigned to the var/i in the constructor.
  [http://www.byond.com/members/?command=reference&path=proc%2Fnew new] /obj/item/weapon/my_item(src.loc, 5)
Where src is the proc owner, which contains the line above. src.loc is the locaiton of the src object.


If this causes a contradiction, you can (and should) inform the new admin of what you were told previously. For example, a Head Admin says you can do something, but that admin has left the server. A lower ranked admin shows up and asks you to stop doing that thing. You can explain that the Head Admin previously said you could do this, but if the lower ranked admin still wants you to stop, then you should stop. (This obviously works vise-versa as well.)
=== [http://www.byond.com/members/?command=reference&path=datum%2Fproc%2FDel Del()] ===
Intentionally not telling a new admin about a contradiction is considered lying. It's like asking your mom for ice cream, but she says no, so you go ask dad because you think he'll be less strict.
This proc gets called before an object's delection. It MUST call ..() at the end as the actual deletion is done in the root Del() proc.


== CHOMPstation is not a democracy ==
An object is deleted by using the del(O) proc with O being the object to be deleted.
Our rules and guidelines exist for a reason and we have staff dedicated to enforcing them and help set further guidelines if necessary. However, these rules are always going to be incomplete, and as such, just because something isn't written doesn't mean it's allowed. If a staff member tells you to do something, do it.  


They tell you to stop, then stop. If you disagree with a ruling, don't try to argue it then and there, especially if things are hectic. Once things have calmed down, or preferably after the round has ended, you can try to contact the staff member privately to discuss the ruling, or talk to another admin if you cannot talk to or cannot convince the offending admin.
=== attack_hand(mob/M as mob) ===
Whenever a user (M) clicks on the object with an empty active hand


You can talk to up to three other admins. If all of them are unanimous in their decision, you are probably in the wrong and should give up. If you do not, it will be considered harassment.
=== attack_paw(mob/M as mob) ===
Whenever a monkey (M) clicks the object with an empty active hand


If you have a question over something unclear or questionable, never be afraid to adminhelp. The staff on hand should discuss it among themselves and give you a ruling, from there on if the ruling is in bad judgement, it's on the admin who cleared it, not you. The staff should also NEVER ban you purely for a complaint against them. Even if you're a complete asshole about it, as long as the argument stays private, you cannot be banned just for arguing. Although being an asshole usually won't win an argument, so you probably shouldn't do that anyway.
If a custom attack_paw(mob/user) proc is not written for an atom, it defaults to calling attack_hand(user)


Don't confuse this for "complaining grants you immunity to bans", because that's not how it works. If you are told to not break windows and you complain how that isn't fair, you're still getting banned for breaking windows if we disagree with your complaint. What this means is we won't ban you or make an existing ban worse just because you tell us we're being excessively mean, confusing, or unfair to you or someone else.
=== attack_ai(mob/user) ===
Whenever an AI or cyborg clicks the object with an empty active hand


[[Category:Guides]]
If a custom attack_ai(mob/user) proc is not written for an atom, it defaults to calling attack_hand(user)
[[Category:Rules]]
 
=== attack(mob/M as mob, mob/user as mob) ===
When the object is used to attack mob M by mob user
 
=== attackby(obj/item/W, mob/user) ===
When the object is being attacked by user with W (Example: If you click on wires with wirecutters)
 
=== ex_act(severity) ===
How the item reacts to explosions. Severity can either be 1, 2 or 3 with 1 being the most destructive.
 
=== blob_act() ===
How the item reacts to a blob (magma) attack
 
=== emp_act(severity) ===
How the item reacts to an EMP. Severity can either be 1 or 2 with 1 being the more powerful EMP surge.
 
=== [http://www.byond.com/members/?command=reference&path=datum%2Fproc%2FTopic Topic(href, href_list)] ===
This one's called when you click a link in a pop-up window. Like when you increase the output of [[SMES cells]]. The href_list variable is the important one as it's a parsed version of the arguments you add into a link. To make a link in the pop-up window, add the following line to the text you display (dat in the example):
  <nowiki>dat += </nowiki>[http://www.byond.com/members/?command=reference&path=proc%2Ftext text](<nowiki>"<A href='?src=\ref[src];select=[i]'>[src.name]</a><br>")</nowiki>
Check the code for more examples of this.
 
=== process() ===
This gets called for all objects on every tick. If possible, avoid it as it's processor heavy, but for some things it just can't be avoided.
 
== SS13 common variable meanings ==
 
=== Datum ===
 
Datums have the smallest number of pre-defined variables. These are present in all objects in the game:
  type //The type of an object. If your object is of type /obj/item/weapon/shovel writing the following: new src.type(src.loc) will make another shovel in the same tile.
  parent_type //Parent type of /obj/item/weapon/shovel is /obj/item/weapon... seems streight-foward enough.
  tag //The tag is used to help you identify things when using several instances. It has to be set manually for each instance tho. Lazy coders and mappers resulted in not many tags being used. Instances in the map editor are sorted by tag.
  vars //List of object vars the datum has defined
 
=== Atom ===
 
These variables are shared by all areas, mobs, objs and turfs.
 
  contents //List of contents. Closets store their contents in this var as do all storage items. All the items on a turf are in the turf's contents var.
  density //If density is at 0, you can walk over the object, if it's set to 1, you can't.
  desc //Description. When you right-click and examine an object, this will show under the name.
  dir //Object direction. Sprites have a direction variable which can have 8 'legal' states. [[Understanding SS13 code#Direction (dir) var|More info]]
  gender //not used
  icon //The dmi file where the sprite is saved. Must be written in single quotations (Example: 'items.dmi')
  icon_state //The name of the sprite in the dmi file. If it's not a valid name or is left blank, the sprite without a name in the dmi file will be used. If such a sprite doesn't exist it will default to being blank.
  invisibility //Invisibility is used to determine what you can and what you can't see. Check the code or wait for someone who knows how exactly this works to write it here.
  infra_luminosity //Only mecha use this
  underlays //List of images (see image() proc) which are underlayed under the current sprite
  overlays //List of images (see image() proc) which are overlayed over the current sprite
  loc //Contains a reference to the turf file where the object currently is.
  layer //A numerical variable which determins how objects are layered. Tables with a layer of 2.8 are always under most items which have a layer of 3.0. Layers go up to 20, which is reserved for HUD items.
  luminosity //How much the item will glow. Note that the picking up and dropping of luminous items needs to be specially handled. See flashlight code for an example.
  mouse_over_pointer //not used
  mouse_drag_pointer //(almost) not used
  mouse_drop_pointer //not used
  mouse_drop_zone //not used
  mouse_opacity //Used in a few places. Check the description in the reference page
  name //The name of the object which is displayed when you right click the object and in the bottom left of the screen when you hover your mouse over it.
  opacity //Whether you can see through/past it (glass, floor) when set to 0 or whether you can't (walls, mecha) when set to 1.
  pixel_x //How many pixels in the x direction should the sprite be offset from the starting set. See the APC's New() proc for an example and how fire alarms are defined on the map. pixel_x = -5 will move it 5 pixels to the left and pixel_x = 5 will move it 5 pixels to the right
  pixel_y //Same as pixel_y but in the y direction. Positive values move it to the north, negative to the south.
  pixel_z //Used in isometric maps, so it's not used in SS13
  suffix //Rarely used. See the reference page for more information
  text //How to represent the object on text clients. Not used.
  type //The type of the object
  vars //See [[#Datum|Datum]] above
  verbs //The verbs you can use with the item. Verbs are the options in the right click menu.
  x //X position, read only. Set the loc variable to move it or use the inbulit functions.
  y //Y position, read only.
  z //Z position (Which z-level it's on), read only.
 
=== Area ===
 
  var/requires_power = 1 //Areas which are to work without an APC (Such as centcom areas) should have this at 0. All other areas should have it at 1.
  var/music = null //Music to be played when you enter the area.
  [http://www.byond.com/members/?command=reference&path=atom%2Fvar%2Fluminosity luminosity] = 0 //Areas which should be lit at all times (such as space and centcom) should have this at 1 as well as the sd_lighting var at 0
  var/sd_lighting = 0 //This var determines whether dynamic lighting is to be calculated for the area's tiles. Turn this to off only for areas which have the luminosity var set to 1
 
Most other variables exist only for technical reasons and should not be messed with unless done through existing procs, they are defined in:
  [http://code.google.com/p/tgstation13/source/browse/trunk/code/defines/area/Space%20Station%2013%20areas.dm code/defines/area/Space Station 13 areas.dm]
 
=== Mob ===
 
There is a huge amount of variables for mobs. Take a look at the following files:
  [http://code.google.com/p/tgstation13/source/browse/trunk/code/defines/mob/mob.dm code/defines/mob/mob.dm]
  [http://code.google.com/p/tgstation13/source/browse/trunk/code/defines/mob/dead/observer.dm code/defines/mob/dead/observer.dm]
  [http://code.google.com/p/tgstation13/source/browse/trunk/code/defines/mob/living/living.dm code/defines/mob/living/living.dm]
  [http://code.google.com/p/tgstation13/source/browse/trunk/code/defines/mob/living/carbon/carbon.dm code/defines/mob/living/carbon/carbon.dm]
  [http://code.google.com/p/tgstation13/source/browse/trunk/code/defines/mob/living/carbon/human.dm code/defines/mob/living/carbon/human.dm]
  [http://code.google.com/p/tgstation13/source/browse/trunk/code/defines/mob/living/carbon/monkey.dm code/defines/mob/living/carbon/monkey.dm]
  [http://code.google.com/p/tgstation13/source/browse/trunk/code/defines/mob/living/silicon/silicon.dm code/defines/mob/living/silicon/silicon.dm]
  [http://code.google.com/p/tgstation13/source/browse/trunk/code/defines/mob/living/silicon/ai.dm code/defines/mob/living/silicon/ai.dm]
  [http://code.google.com/p/tgstation13/source/browse/trunk/code/defines/mob/living/silicon/robot.dm code/defines/mob/living/silicon/robot.dm]
There are also additional files for aliens, larva, facehuggers and more there, but the files above will have most of the variables you might need.
 
=== Obj ===
 
  var/m_amt = 0 // How much metal the item has. Used to determine how much metal you get when feeding it into an autolathe and how much it costs to produce it at the lathe
  var/g_amt = 0 // How much glass the item has. Used to determine how much glass you get when feeding it into an autolathe and how much it costs to produce it at the lathe
  var/w_amt = 0 // waster amounts. Not used
  var/origin_tech = null //Used by R&D to determine what research bonuses it grants. See examples in item definitions in code.
  var/reliability = 100 //Used by SOME devices to determine how reliable they are. The number represents the percentual chance for them to work properly.
  var/unacidable = 0 //universal "unacidabliness" var, objects with this set to 1 cannot be destroyed by acids.
  var/throwforce = 0 //The amount of damage applies to a target when they're hit by the item.
 
More variables are defined in:
  [http://code.google.com/p/tgstation13/source/browse/trunk/code/defines/obj.dm code/defines/obj.dm]
 
==== Item ====
 
Items are objs which can be picked up. They're divided into several categories according to their function.
 
/obj/item is defined in the following file:
  [http://code.google.com/p/tgstation13/source/browse/trunk/code/defines/obj.dm code/defines/obj.dm]
 
It adds the following variables (Look at the file for more, but these are the more important ones):
  var/force = null //This determins how much damage the target takes when they're attacked by the item in hand. Small items usually have it at 0, medium ones between 5 and 10, rare and powerful items around 10-15 and two-handed items at 15 and more. Syndicate items have it even higher at 40 and more.
  var/item_state = null //This it the var that determines which sprite will be used for the item from icons/mob/items_lefthand.dmi and items_righthand.dmi.
  var/damtype = "brute" //Determines what damage type the item produces.
  var/health = null //Some items use this to determine when they'll break from use or damage. Not common tho.
  var/hitsound = null //Sound that's played when you hit something with the item. Not commonly used.
  var/w_class = 3.0 //Weight class.
    // w_class = 1 means it's an item that can fit in a pocket (diskette, pen, cigarette packet)
    // w_class = 2 means the item can't fit in pockets but can fit in a box (clipboard, analyzer, cleaner)
    // w_class = 3 means the item can't fit in a box but can fit in backpacks (box, rods, metal)
    // w_class = 4 means the item can't even fit in a backpack (packpack, pickaxe, fireaxe)
    // w_class = 5 is used but not for weight classes.
  var/wielded = 0 //Used for double-handed items which can be carried in one hand but needs to be wielded by two hands before they can be used. This is determined by code when wielding and unwielding. All items should start with this at 0.
  var/twohanded = 0 ///Set this to 1 if your item is two-handed.
  flags = FPRINT | TABLEPASS //Flags
 
==== Machinery ====
 
Defined in:
  [http://code.google.com/p/tgstation13/source/browse/trunk/code/defines/obj/machinery.dm code/defines/obj/machinery.dm]
 
Machinery are objs which cannot be picked up and generally require power to operate. They have the following vars defined for all of them:
  var/use_power = 0 //Determines if and how much power the machine will use each tick.
    //use_power = 0 - no power is used
    //use_power = 1 - idle power is used
    //use_power = 2 - active power is used
  var/idle_power_usage = 0 //How many watts of power the machine will use each tick when use_power is set to 1
  var/active_power_usage = 0 //How many watts of power the machine will use each tick when use_power is set to 2
  var/power_channel = EQUIP //Determines which APC power category the device falls under. EQUIP, ENVIRON or LIGHT
  var/list/component_parts = null //A list of parts needed to construct the machine from a machine frame.
 
=== Turf ===
 
  var/intact = 1 //This determines if the turf will hide pipes, cable and such. Set to 1 to hide and to 0 to not hide them. Only pipes and wire with level set to 1 will be hidden. Set their level var to 2 to keep them from being hidden.
  var/blocks_air = 0 //Determines if the turf prevents air from passing (walls) if set to 1.
Other variables exist but they're tied to atmospherics code which is not to be touched as whenever anything is changed in it it results in a million things breaking.
  [http://code.google.com/p/tgstation13/source/browse/trunk/code/defines/turf.dm code/defines/turf.dm]
 
==== Simulated ====
 
Simulated floors are tiles which simulate air movement and temperature. The station is made entirely from these while centcom is made from unsimulated floors to prevent massive and unneeded lag.
 
  var/wet = 0 //If this it a positive number, it is wet and you'll slip on it if you run.
  var/thermite = 0 //Will be set to 1 when thermite is poured on it.
 
===== Simulated floors =====
 
  var/icon_regular_floor = "floor" //Determines what icon the steel version of the floor should have. Determined at floor creation (New() proc). If the icon_state of the floor at that point is one from the global icons_to_ignore_at_floor_init var, then this variable is assigned the value "floor". The icons_to_ignore_at_floor_init list contains broken, plating, burnt and non-steel icon_states from icons/turf/floors.dmi
  heat_capacity = 10000 //When a fire (hotspot) on the tile exceeds this number, the floor has a chance of melting. The more the number is exceeded, the higher the chance of melting.
  var/broken = 0 //This mostly only determins if you'll get the tile back when you use the crowbar
  var/burnt = 0 //This mostly only determins if you'll get the tile back when you use the crowbar
  var/obj/item/stack/tile/floor_tile = new/obj/item/stack/tile/steel //What floor tile is on the tile
 
Simulated floors are defined in:
  [http://code.google.com/p/tgstation13/source/browse/trunk/code/game/turf.dm code/game/turf.dm]
 
===== Simulated walls =====
 
Doesn't really contain any special new variables.
 
Defined in:
  [http://code.google.com/p/tgstation13/source/browse/trunk/code/defines/turf.dm code/defines/turf.dm]
 
[[Category:Guides]] [[Category:Game Resources]]
{{Contribution guides}}

Latest revision as of 02:34, 11 November 2019

This article or section is from the Baystation 12 wiki.

This article or section is directly taken from the Baystation 12 wiki, and should not be fully relied on for CHOMPstation. You can help by updating it.

Other related guides: Basics of Coding in BYOND and the Guide to Mapping

So you know how to write programs in other languages and would like a quick guide on how to understand and code for SS13? Good, this is the guide for you. It likely doesn't contain everything that you need to know but it's a start.

Syntax

  • Semicolons at the end are not mandatory,
  • Loop, proc, object, variable etc. spans are determined by indentations (similar to Python, see examples below)
 /obj
   var
     i1
     i2
     i3

is the same as (Strongly recommended you use this layout to make searching for variable and proc definitions easier.)

 /obj
   var/i1
   var/i2
   var/i3

which is inturn the same as

 /obj/var/i1
 /obj/var/i2
 /obj/var/i3
  • This guide uses the word 'object' for any defined type (see Variable types) and the word 'obj' for derivatives of atom/obj, which are all objects which can be placed on the map.
  • This guide uses the word 'AI controlled' for behavior to do with an AI player controlling an item. The term 'Game controlled' is used when refering to behavior which the script itself determins (Usually called AI controlled creatures or NPCs)
  • All things are inherited from parent objects. If a variable is defined in /obj/item, it doesn't need to be (actually can't be) redefined in /obj/item/weapon.

Variables

Variables are very general, Byond makes no difference in the declaration of strings, integers, etc. (Similar to PHP)

Predefined variables

There is a lot of predefined variables for objects in BYOND, but the most important are:

  • src - a variable equal to the object containing the proc or verb. It is defined to have the same type as that object. (Similar to "this" in Java or C++)
  • usr - a mob variable (var/mob/usr) containing the mob of the player who executed the current verb, or whose action ultimately called the current proc. A good rule of thumb is to never put usr in a proc. If src would not be the correct choice, it is better to send another argument to your proc with the information it needs.
  • args - a list of the arguments passed to the proc or verb.
  • vars - a list of object variables. If the variable name is used as an index into the list, the value of that variable is accessed.

For more SS13 specific variables see SS13 common variable meanings

Variable definition

Basic definitions
 var/j
 var/i = 4
 var/a, b, c
Complex definitions

The general syntax is var/type/variable_name = value

Examples:

 var/obj/item/I = new/obj/item
 I.name = "Some item"

Datum definition and declaration of a variable of that datum type:

 datum/test_datum
   var/test_variable = 0 //declaration of the test_variable var
   
   proc/set_as(var/i) //proc definition within the test_datum datum
     test_variable = i //set the test_variable var to the value in the argument
 
 var/datum/test_datum/TD = new/datum/test_datum //TD will now be a reference to a datum of type test_datum
 TD.test_variable = 4  //Byond doesn't know of private variables, so you can set any variables like this
 world << TD.test_variable //will output 4 to all connected users
 TD.set_as(10) //Will call the set_as proc in the datum with the argument 10
 TD.test_variable //will output 10 to all connected users

Bitflags

Bitflags are variables which use bits instead of numbers to determine conditions. The bit operators are & and |. For now, you should know that bitflag operators use the binary value of numbers to determine the result. So 13 & 3 will result in 1. (1101 & 0011 = 0001) and 13 | 3 = 15 (1101 | 0011 = 1111) see if for uses

Variable types

reference

  • datum - ordinary object type (class in java)
  • atom - atom derives into obj, turf, mob and area
  • turf - tiles which make up the floors, walls and space on SS13
  • area - areas are grouped locations. They combine many turfs and it gives some common properties. Power, atmosphere, etc. are determined by areas
  • mob - an object with life, be it game controlled or player controlled.
  • obj - objects which can be placed on the map
  • client - a new client object is created for each connected player
  • list - a list of elements. The first element in a list called L is L[1]
  • world - this is a variable where some global variables for the entire world can be set. World's contents var contains all atoms currently in the game world.

Outputting messages

The most basic way of outputting messages is with the '<<' output operator.

 world << "Hello World!" //Outputs a message to all clients in the world
 usr << "Hello usr" //Outputs a message to only the user who is tied to the calling of the proc which contains this.
Output with variables
 var/s1 = "Hello"
 var/s2 = "World"
 var/i = 2011
 world << "[s1] [s2], this guide was written in [i]" //Returns "Hello World, this guide was written in 2011"

Determining variable types in code

The istype() proc will come in handy

Example

 var/obj/item/weapon/W = new/obj/item/weapon/baton
 if(istype(W,/obj/item/weapon/baton))
   world << "It's a baton!"

The second argument is optional, if it's omitted, the variable will be checked against its declared type, like

 var/obj/item/weapon/W = new/obj/item/weapon/baton
 if(istype(W))
   world << "It's a weapon!"

Standard code for getting specific arguments from variables which have a type that is a subclass of the type the current proc treats them with (see any attackby() proc for examples). Note that the example below is of a proc which is globaly defined, not tied to the object. It doesn't make much sense to do it like this but it works for the purposes of the example. /obj objects don't have the 'amount' variable, it's defined in /obj/item/stack (as ilustrated by the oversimplified definition of classes below. Also note where var/ is used and where it isn't).

 /obj
   var/name = "Object"
 
 /obj/item
   name = "Item"
 
 /obj/item/stack
   name = "Stack"
   var/amount = 50
 
 proc/get_amount(var/obj/O)
   if(istype(O,/obj/item/stack))
     var/obj/item/stack/S = O
     return S.amount

There is another way of doing this. I'll show you that it exists but it is NOT TO BE USED.

 proc/get_aount(var/obj/S)
   if(istype(O,/obj/item/stack))
     return O:amount

The colon operator (:) in the example above tells the byond compiler: "I know what I'm doing, so ignore the fact the object doesn't have this variable, I'll make sure it works myself." The problem is that people will revise your code and use it in ways you never planed for. This means something might eventually make the O:amount throw exceptions in the form of runtime errors. Some variables might eventually need to be removed or replaced and this is impossible when they are used with object:variable as the compiler will not throw an error when the variable is removed. The error will only become apparent after the game is ran on the live server which might cause it to crash. So just don't use this method, ever.

There are some shortcuts to istype() proc:
isarea(variable) = istype(variable, /area)
isicon(variable) = istype(variable, /icon)
ismob(variable) = istype(variable, /mob)
isobj(variable) = istype(variable, /obj)
isturf(variable) = istype(variable, /turf)
isloc(variable) = ismob(variable) || isobj(variable) || isturf(variable) || isarea(variable)

Switching between variable types in code

Byond defined:
ascii2text
file2text
list2params
num2text
params2list
text2ascii
text2file
text2num
text2path
time2text

SS13 Defined:
text2dir(direction)
dir2text(direction)
dd_file2list(file_path, separator)
dd_text2list(text, separator, var/list/withinList)
dd_text2List(text, separator, var/list/withinList)
dd_list2text(var/list/the_list, separator)
angle2dir(var/degree)
angle2text(var/degree)

For more useful procs see
code/defines/procs/helpers.dm
code/game/objects/items/helper_procs.dm

If

Ifs default to checking for true if not otherwise stated. True is defined for all variable types as empty, 0 or non-existant (null).

 if(condition)
   action_true()
 else
   action_false()

Common variable behavior in if statements:

Variable type False when True when
String (text / ascii) "" or null Anything else
Int / Real 0 or null Anything else
datum, atom null Anything else

Logical operators

Pretty standard:

 !statement1 //NOT statement1
 (statement1) && (statement2) //statement1 AND statement2
 (statement1) || (statement2) //statement1 OR statement2
 == //equals
 != //not equal
 < (<=) //less (or equal)
 > (>=) //more (or equal)
 & //bitflag AND operator. 13 & 3 = 1 (1101 & 0011 = 0001)
 | //bitflag OR operator. 13 | 3 = 15 (1101 | 0011 = 1111)

Byond does not recognize the === (identical) operator. More operators can be found in the left menu on the reference page

While

Byond will cancel a loop if it reaches a certain number of iteration and give a runtime error out of fear of infinite loops. Same applies for recursions. Same as anywhere else

 while(condition)
   action1()

All loops understand the continue and break commands

For

All loops understand the continue and break commands

For combines the for loop and foreach loop:

For loop

 for(var/i = 1; i <= 10; i++)
   world << i //Will write (each in a new line) 1 2 3 4 5 6 7 8 9 10

For each

 for(var/obj/item/weapon/baton/B in world)  //will iterate through world.contents (which contains all atoms in the world) and only pick those which are of the given type (/obj/item/weapon/baton)
   B.name = "Smelly baton" //Will apply the new name to the baton in the current iteration loop

Do - While

The Do while operator is not commonly used in SS13 code, Byond does support it tho.

 var/i = 3
 do
   world << i--
 while(i)

All loops understand the continue and break commands

Defining objects

Doesn't matter if you want a datum or atom, the definition of objects is the same and simple:

 /obj/item/weapon/item1 //will nmake a new object of type obj.
   var/item_property = 5 //Will define a new variable type for all item1 objs
   name = "Testing Item" //The name var is already defined in parent objects so it is not defined here, but only assigned a new valie.
 
 /obj/item/weapon/item1/New() //Constructor proc
   ..() //should always be present in New() procs, see ..() for more information
   item_property = 3 //An action that is performed in the object constructor.

Procs (Methods, functions, procedures)

You're used to the standards of methods, functions and procedures, right? Well procs ignore some aspects of these. They can best be compared to Java methods, as they're tied to specific objects. They cannot be defined as static, private, public, etc. tho. You can write static methods, however the compiler will not restrict you from calling them in a non-static way or environment. Same applies for non-static methods.

 proc/proc_name(var/argument1, var/argument2)
   world << "[argument1] [argument2]"

The above would declare a global proc. If you wish to tie it to a certain level

..()

This is the same as super() in Java. It calls the parent object type's proc with the same name and same arguments.

Example:

 /obj/item
   name = "Item"
 
 /obj/item/New() //New() is the proc that gets called whenever a new object of this type is created. A constructor if you will.
   src.name = "It's an item!"
 
 /obj/item/stack
   name = "Stack"
 
 /obj/item/stack/New() 
   src.name = "It's a stack!"
   ..()

If you have the code from the example above and create a new object of type /obj/item/stack, it will first make the item in the game world with the name "Stack", because it's defined to be that by default. Then the New() proc will be called immedietally after. This will change the name to "It's a Stack!" but the call of the parent type's New() proc with the ..() command will then set it to "It's an item!". So in the end, the new object will be called "It's an item!". The ..() command is however very important in many cases as some things are defined only in the common parent's New() procs. In Del(), the proc which gets called prior to an object's deletion, it requires the code to get to the root Del() proc to even delete it. See examples of Del() in the code.

Important procs

New()

This proc is called whenever a new instance of the object is created. It can have arguments if needed. It should call ..() where applicable so that parent constructors can be applied.

If you wish to create a New() proc for atoms with custom arguments, ensure the first argument is for the object's location. Example:

 obj/item/weapon/my_item/New(var/location, var/i)
   ..()
   //Whatever else you need to do

To make a general object use

 new /datum/test_datum

To make an atom (which usually has a locaiton)

 new /obj/item/weapon(src.loc)

For the custom example above, the code to create a new such object would be: The 5 is just an example of a value which could be assigned to the var/i in the constructor.

 new /obj/item/weapon/my_item(src.loc, 5)

Where src is the proc owner, which contains the line above. src.loc is the locaiton of the src object.

Del()

This proc gets called before an object's delection. It MUST call ..() at the end as the actual deletion is done in the root Del() proc.

An object is deleted by using the del(O) proc with O being the object to be deleted.

attack_hand(mob/M as mob)

Whenever a user (M) clicks on the object with an empty active hand

attack_paw(mob/M as mob)

Whenever a monkey (M) clicks the object with an empty active hand

If a custom attack_paw(mob/user) proc is not written for an atom, it defaults to calling attack_hand(user)

attack_ai(mob/user)

Whenever an AI or cyborg clicks the object with an empty active hand

If a custom attack_ai(mob/user) proc is not written for an atom, it defaults to calling attack_hand(user)

attack(mob/M as mob, mob/user as mob)

When the object is used to attack mob M by mob user

attackby(obj/item/W, mob/user)

When the object is being attacked by user with W (Example: If you click on wires with wirecutters)

ex_act(severity)

How the item reacts to explosions. Severity can either be 1, 2 or 3 with 1 being the most destructive.

blob_act()

How the item reacts to a blob (magma) attack

emp_act(severity)

How the item reacts to an EMP. Severity can either be 1 or 2 with 1 being the more powerful EMP surge.

Topic(href, href_list)

This one's called when you click a link in a pop-up window. Like when you increase the output of SMES cells. The href_list variable is the important one as it's a parsed version of the arguments you add into a link. To make a link in the pop-up window, add the following line to the text you display (dat in the example):

 dat += text("<A href='?src=\ref[src];select=[i]'>[src.name]</a><br>")

Check the code for more examples of this.

process()

This gets called for all objects on every tick. If possible, avoid it as it's processor heavy, but for some things it just can't be avoided.

SS13 common variable meanings

Datum

Datums have the smallest number of pre-defined variables. These are present in all objects in the game:

 type //The type of an object. If your object is of type /obj/item/weapon/shovel writing the following: new src.type(src.loc) will make another shovel in the same tile.
 parent_type //Parent type of /obj/item/weapon/shovel is /obj/item/weapon... seems streight-foward enough.
 tag //The tag is used to help you identify things when using several instances. It has to be set manually for each instance tho. Lazy coders and mappers resulted in not many tags being used. Instances in the map editor are sorted by tag.
 vars //List of object vars the datum has defined

Atom

These variables are shared by all areas, mobs, objs and turfs.

 contents //List of contents. Closets store their contents in this var as do all storage items. All the items on a turf are in the turf's contents var.
 density //If density is at 0, you can walk over the object, if it's set to 1, you can't.
 desc //Description. When you right-click and examine an object, this will show under the name.
 dir //Object direction. Sprites have a direction variable which can have 8 'legal' states. More info
 gender //not used
 icon //The dmi file where the sprite is saved. Must be written in single quotations (Example: 'items.dmi')
 icon_state //The name of the sprite in the dmi file. If it's not a valid name or is left blank, the sprite without a name in the dmi file will be used. If such a sprite doesn't exist it will default to being blank.
 invisibility //Invisibility is used to determine what you can and what you can't see. Check the code or wait for someone who knows how exactly this works to write it here.
 infra_luminosity //Only mecha use this
 underlays //List of images (see image() proc) which are underlayed under the current sprite
 overlays //List of images (see image() proc) which are overlayed over the current sprite
 loc //Contains a reference to the turf file where the object currently is.
 layer //A numerical variable which determins how objects are layered. Tables with a layer of 2.8 are always under most items which have a layer of 3.0. Layers go up to 20, which is reserved for HUD items.
 luminosity //How much the item will glow. Note that the picking up and dropping of luminous items needs to be specially handled. See flashlight code for an example.
 mouse_over_pointer //not used
 mouse_drag_pointer //(almost) not used
 mouse_drop_pointer //not used
 mouse_drop_zone //not used
 mouse_opacity //Used in a few places. Check the description in the reference page
 name //The name of the object which is displayed when you right click the object and in the bottom left of the screen when you hover your mouse over it.
 opacity //Whether you can see through/past it (glass, floor) when set to 0 or whether you can't (walls, mecha) when set to 1.
 pixel_x //How many pixels in the x direction should the sprite be offset from the starting set. See the APC's New() proc for an example and how fire alarms are defined on the map. pixel_x = -5 will move it 5 pixels to the left and pixel_x = 5 will move it 5 pixels to the right
 pixel_y //Same as pixel_y but in the y direction. Positive values move it to the north, negative to the south.
 pixel_z //Used in isometric maps, so it's not used in SS13
 suffix //Rarely used. See the reference page for more information
 text //How to represent the object on text clients. Not used.
 type //The type of the object
 vars //See Datum above
 verbs //The verbs you can use with the item. Verbs are the options in the right click menu.
 x //X position, read only. Set the loc variable to move it or use the inbulit functions.
 y //Y position, read only. 
 z //Z position (Which z-level it's on), read only.

Area

 var/requires_power = 1 //Areas which are to work without an APC (Such as centcom areas) should have this at 0. All other areas should have it at 1.
 var/music = null //Music to be played when you enter the area.
 luminosity = 0 //Areas which should be lit at all times (such as space and centcom) should have this at 1 as well as the sd_lighting var at 0
 var/sd_lighting = 0 //This var determines whether dynamic lighting is to be calculated for the area's tiles. Turn this to off only for areas which have the luminosity var set to 1

Most other variables exist only for technical reasons and should not be messed with unless done through existing procs, they are defined in:

 code/defines/area/Space Station 13 areas.dm

Mob

There is a huge amount of variables for mobs. Take a look at the following files:

 code/defines/mob/mob.dm
 code/defines/mob/dead/observer.dm
 code/defines/mob/living/living.dm
 code/defines/mob/living/carbon/carbon.dm
 code/defines/mob/living/carbon/human.dm
 code/defines/mob/living/carbon/monkey.dm
 code/defines/mob/living/silicon/silicon.dm
 code/defines/mob/living/silicon/ai.dm
 code/defines/mob/living/silicon/robot.dm

There are also additional files for aliens, larva, facehuggers and more there, but the files above will have most of the variables you might need.

Obj

 var/m_amt = 0	// How much metal the item has. Used to determine how much metal you get when feeding it into an autolathe and how much it costs to produce it at the lathe
 var/g_amt = 0	// How much glass the item has. Used to determine how much glass you get when feeding it into an autolathe and how much it costs to produce it at the lathe
 var/w_amt = 0	// waster amounts. Not used
 var/origin_tech = null //Used by R&D to determine what research bonuses it grants. See examples in item definitions in code.
 var/reliability = 100	//Used by SOME devices to determine how reliable they are. The number represents the percentual chance for them to work properly.
 var/unacidable = 0 //universal "unacidabliness" var, objects with this set to 1 cannot be destroyed by acids.
 var/throwforce = 0 //The amount of damage applies to a target when they're hit by the item.

More variables are defined in:

 code/defines/obj.dm

Item

Items are objs which can be picked up. They're divided into several categories according to their function.

/obj/item is defined in the following file:

 code/defines/obj.dm

It adds the following variables (Look at the file for more, but these are the more important ones):

 var/force = null //This determins how much damage the target takes when they're attacked by the item in hand. Small items usually have it at 0, medium ones between 5 and 10, rare and powerful items around 10-15 and two-handed items at 15 and more. Syndicate items have it even higher at 40 and more.
 var/item_state = null //This it the var that determines which sprite will be used for the item from icons/mob/items_lefthand.dmi and items_righthand.dmi.
 var/damtype = "brute" //Determines what damage type the item produces.
 var/health = null //Some items use this to determine when they'll break from use or damage. Not common tho.
 var/hitsound = null //Sound that's played when you hit something with the item. Not commonly used.
 var/w_class = 3.0 //Weight class.
   // w_class = 1 means it's an item that can fit in a pocket (diskette, pen, cigarette packet)
   // w_class = 2 means the item can't fit in pockets but can fit in a box (clipboard, analyzer, cleaner)
   // w_class = 3 means the item can't fit in a box but can fit in backpacks (box, rods, metal)
   // w_class = 4 means the item can't even fit in a backpack (packpack, pickaxe, fireaxe)
   // w_class = 5 is used but not for weight classes.
 var/wielded = 0 //Used for double-handed items which can be carried in one hand but needs to be wielded by two hands before they can be used. This is determined by code when wielding and unwielding. All items should start with this at 0.
 var/twohanded = 0 ///Set this to 1 if your item is two-handed.
 flags = FPRINT | TABLEPASS //Flags

Machinery

Defined in:

 code/defines/obj/machinery.dm

Machinery are objs which cannot be picked up and generally require power to operate. They have the following vars defined for all of them:

 var/use_power = 0 //Determines if and how much power the machine will use each tick.
   //use_power = 0 - no power is used
   //use_power = 1 - idle power is used
   //use_power = 2 - active power is used
 var/idle_power_usage = 0 //How many watts of power the machine will use each tick when use_power is set to 1
 var/active_power_usage = 0 //How many watts of power the machine will use each tick when use_power is set to 2
 var/power_channel = EQUIP //Determines which APC power category the device falls under. EQUIP, ENVIRON or LIGHT
 var/list/component_parts = null //A list of parts needed to construct the machine from a machine frame.

Turf

 var/intact = 1 //This determines if the turf will hide pipes, cable and such. Set to 1 to hide and to 0 to not hide them. Only pipes and wire with level set to 1 will be hidden. Set their level var to 2 to keep them from being hidden.
 var/blocks_air = 0 //Determines if the turf prevents air from passing (walls) if set to 1.

Other variables exist but they're tied to atmospherics code which is not to be touched as whenever anything is changed in it it results in a million things breaking.

 code/defines/turf.dm

Simulated

Simulated floors are tiles which simulate air movement and temperature. The station is made entirely from these while centcom is made from unsimulated floors to prevent massive and unneeded lag.

 var/wet = 0 //If this it a positive number, it is wet and you'll slip on it if you run.
 var/thermite = 0 //Will be set to 1 when thermite is poured on it.
Simulated floors
 var/icon_regular_floor = "floor" //Determines what icon the steel version of the floor should have. Determined at floor creation (New() proc). If the icon_state of the floor at that point is one from the global icons_to_ignore_at_floor_init var, then this variable is assigned the value "floor". The icons_to_ignore_at_floor_init list contains broken, plating, burnt and non-steel icon_states from icons/turf/floors.dmi
 heat_capacity = 10000 //When a fire (hotspot) on the tile exceeds this number, the floor has a chance of melting. The more the number is exceeded, the higher the chance of melting.
 var/broken = 0 //This mostly only determins if you'll get the tile back when you use the crowbar
 var/burnt = 0 //This mostly only determins if you'll get the tile back when you use the crowbar
 var/obj/item/stack/tile/floor_tile = new/obj/item/stack/tile/steel //What floor tile is on the tile

Simulated floors are defined in:

 code/game/turf.dm
Simulated walls

Doesn't really contain any special new variables.

Defined in:

 code/defines/turf.dm
Contribution Guides & Game Resources
General Guide to Setting Up a Server, Downloading the Source Code, Guide to Contributing to the Game, Game Resources category
Coding Basics of Coding in BYOND, SS13 for Experienced Programmers, [NanoUI]
Mapping Guide to Mapping
Spriting Guide to Spriting
Wiki Guide to Contributing to the Wiki, Style Guide