Understanding SS13 code: Difference between revisions

Jump to navigation Jump to search
m
no edit summary
imported>Rockdtben
(Created page with "Other related guides: SS13 for experienced programmers and Guide to mapping '''NOTE!!''' This guide uses terms very loosely. Experienced coders, please don't get at m...")
mNo edit summary
 
(6 intermediate revisions by one other user not shown)
Line 62: Line 62:
   var/a = list()
   var/a = list()


==== Other types ====
==== Other Types ====


If you wish to store a coin in somewhere in the variables of an object and use the coin's defined procs or variables, you'll have to define the variable in which you store the coin as a coin. The second example also creates a variable called D and fills it with a new coin.
If you wish to store a coin in somewhere in the variables of an object and use the coin's defined procs or variables, you'll have to define the variable in which you store the coin as a coin. The second example also creates a variable called D and sets it to a new coin.
   var/obj/item/weapon/coin/C
   var/obj/item/weapon/coin/C
   var/obj/item/weapon/coin/D = new/var/obj/item/weapon/coin(src)
   var/obj/item/weapon/coin/D = new/var/obj/item/weapon/coin(src)
Line 76: Line 76:
<br>[http://www.byond.com/members/?command=reference&path=mob%2Fvar Mob vars]
<br>[http://www.byond.com/members/?command=reference&path=mob%2Fvar Mob vars]


===== Direction (dir) var =====
=====Direction (dir) var=====
[http://www.byond.com/members/?command=reference&path=atom%2Fvar%2Fdir reference]
[http://www.byond.com/members/?command=reference&path=atom%2Fvar%2Fdir reference]


Line 97: Line 97:
Combining these numbers yields north-east (0101), north-west (1001), south-east (0110) and south-west (1010). Tho other combinations (east-west(1100), north-south (0011), north-east-west (1101) and such) are possible for special uses. Smoothwall code is an example.
Combining these numbers yields north-east (0101), north-west (1001), south-east (0110) and south-west (1010). Tho other combinations (east-west(1100), north-south (0011), north-east-west (1101) and such) are possible for special uses. Smoothwall code is an example.


===== Atom vars =====
=====Atom vars=====


These apply to all /obj, /turf, /area, /mob -type objects.
These apply to all /obj, /turf, /area, /mob -type objects.
Line 141: Line 141:
The double == is used to compare two values. It's most commonly used in the if statement. In the example above you can see we compared the variable a to 14 (a == 14). This determines how the if will react.
The double == is used to compare two values. It's most commonly used in the if statement. In the example above you can see we compared the variable a to 14 (a == 14). This determines how the if will react.


==== If statement ====
Comparison Operators
[http://www.byond.com/members/?command=reference&path=proc%2Fif reference]
[http://www.byond.com/members/?command=reference&path=proc%2Fif reference]


Line 147: Line 147:


Comparison operators include:
Comparison operators include:
<br>'''==''' Equals
<br>'''==''' Is Equal To
<br>'''!=''' Not Equals
<br>'''!=''' Is Not Equal To
<br>'''<''' Less than
<br>'''<''' Less than
<br>'''>''' More than
<br>'''>''' More than
Wiki Staff
6,188

edits

Navigation menu