i dont quite fully understand what the difference between
var/atom/A
and
atom/var/A
is. i know that the first one is just a variable, and the second is a variable that can be set for all atoms right?
ID:161174
Jun 6 2008, 1:55 pm
|
|
In response to GhostAnime
|
|
Put really, really simply.
atom/var/a gives atoms a variable with the name 'a' var/atom/a gives the var owner a variable which will contain an atom, tada! |
Brasuil wrote:
i dont quite fully understand what the difference between This declares (creates) a global or local variable (depending on where you put it) named A. It is defined as of the /atom type. Example: proc/myproc() atom/var/A This declares an object variable (a variable that belongs to an object). The variable is named A and is present on all objects of the /atom type. This variable's type is not defined. Since this syntax seems to confuse you, this is the same as doing: atom The '/' path operator is just a shortcut instead of using another indentation level. |
In response to DarkBelthazor
|
|
oooh i get it so if you define a var/mob/M, youll get a variable that is a mob, but if you define mob/var/M youll give all mobs a variable...
|
var/atom/a <-- The variable 'a' is assigned globally assigned (per say) and is thought as "atom/a"
So let's take the following into consideration:
Lets say for the above we created the Sword and equipped it, setting wep and wep2 = the sword object.
In Attack(), wep.atk will give us an error because the variable atk has not been defined globally (remember, wep is defined as var/wep).
wep2.atk works perfectly since wep2 is referring to the path /obj/Weapon, which has the atk variable.