ID:152901
Jul 31 2005, 12:54 pm
|
|
I was wondering when should I use these and what are they used for?
|
Jul 31 2005, 12:57 pm (Edited on Apr 12 2007, 1:32 pm)
|
|
This should help you out.
|
In response to YMIHere
|
|
I still do not understand.
|
In response to Broly103
|
|
Stating excatly WHAT you don't understand would be better.
|
In response to DeathAwaitsU
|
|
DeathAwaitsU wrote:
Stating excatly WHAT you don't understand would be better. I don't understand what it means by doing normal movement checks,I don't know when its used either. |
Ok.
. is a variable that all procs/verbs have. This variable is what value is returned if the proc exits without you telling it to return. So in this case test() will return 1: mob/proc/test() However in this case test() will return 0: mob/proc/test() Ok. Now for ..() ..() is a sort of local proc. If you call it inside of a proc it will call the parent version of the proc. So in the following example a call to /mob/player's test() proc will output the following: Test One Test Two mob/proc/test() Now alternatively we could have called ..() after we outputted "Test Two" and the total output from that proc would have been: Test Two Test One Now for the . = ..() stuff. This isn't anything special. It's just setting . equal to the return value of the parent proc. Just like if you were to set any variable to the return value of any proc. So in the following example, the /mob/player's test() proc will return 1: mob/proc/test() One last thing you can do with it that some people don't realise is check the value of . . works like any other variable so you can check it's value in if() statements. So in the following example it return 1 and output: Testing... Test successful! mob/proc/test() |