ID:159349
 
Okay, all i want to do, is on Login(), check if the Area's "day" variable is 1 or 0, and set see_in_dark to an appropiate variable.

But i've been trying for ages and haven't been suceeding. Any help?
Really if you don`t know how to do this you should really read the guide, this is just about as simple as it gets...

mob
Login()
..()
if(day)
see_in_dark=(însert var here)


In response to Mr.DJ7
Error: day is an undefined var.

Likewise, i had already tried that.
You can access the area that a given atom is in by utilizing the loc var; look it up in the DM Reference. A turf's loc is the area that contains it.
In response to Kaioken
I'm not asking that, i want the mob/Login() to check if the area/day is 1 or not.

Maybe i need to do this differently..
In response to NeonJ
You obviously need to have a method to access the area itself before you can actually access any of its vars, which is then 'cake. Provided you want to check the specific area the player mob is in (make sure he is on the map first), what I've said is suitable - otherwise, globally grabbing a reference to a single instance of a given area type can be done through a call to locate(), which may be.
In response to NeonJ
You have to define day as a variable.
Duh.
In response to Mr.DJ7
That wouldn't have to do with his error; your code itself was simply problematic. It'd have worked to access the day var if it was on a global or src <small>(on /mob for this case)</small> level (due to Dream Maker's "src autocompletion feature"), but as the OP said it's a var under /area, and so the compiler can't find any appropriate var in the scope you're trying to use it on, so it's undefined.
You have to actually reference an area in some way in order to access an area's var. Duh. :P
In response to Kaioken
Eh, i saved it on a global var now and it's working fine. :D

Talk about taking the long way 'round!

EDIT: No it isn't, i didn't realise it broke.

Now i need to get the global event to change the usr's see_in_dark but it wont let me. D: