Understanding SS13 code: Difference between revisions
Understanding SS13 code (view source)
Revision as of 14:06, 30 October 2014
, 14:06, 30 October 2014→Other types
imported>Cheridan |
imported>Cheridan |
||
Line 62: | Line 62: | ||
var/a = list() | var/a = list() | ||
==== | ==== Typecasting ==== | ||
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 | 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) |