Game Development Community

This and %obj

by Bryce · in Technical Issues · 06/13/2007 (4:12 am) · 1 replies

[probably stupid question]

I see %this and %obj everywhere in my script. Can somebody tell me the difference between the two? I cant figure out exactly what they are referencing to!

[/probably stupid question]

#1
06/13/2007 (4:17 am)
%this is often used as the handle of the object that the function is being called on. e.g.

player::myFunction(%this)
{
    echo(%this.id());
    echo($player.id());
}

$player.myFunction();

This (should!) echo the same Id twice.

As for %obj, that depends on the function, hopefully the function will be commented telling you what %obj refers to.