Author Topic: How to identify current datablock  (Read 2441 times)

What is the code to identify someone's current datablock?
I'm working on this add-on where it temporarily switches
their datablock to something, and then it goes black to the default
playertype. Is there a way to see what their playertype is beforehand
so that it will just switch back?

%obj.getDataBlock();

For future reference, you can do dump(); to get a list of functions pertaining to the object type.

For example, say I wanted to get all the functions for MY player object:
findclientbyname(lego).player.dump();
« Last Edit: September 11, 2016, 02:09:01 AM by --LegoPepper-- »

object.dataBlock also works. dataBlock is case sensitive.

is that like the only case sensitive thing in TS? cause I can't think of any other examples that I've heard of

is that like the only case sensitive thing in TS? cause I can't think of any other examples that I've heard of
I'm pretty sure it's just a way to get at the "datablock" field without triggering a syntax error for using the keyword inappropriately.

Just stick with object.getDatablock();, that's what getter methods are there for.

is that like the only case sensitive thing in TS? cause I can't think of any other examples that I've heard of

Using the new keyword is also case sensitive if I remember correctly.

is that like the only case sensitive thing in TS? cause I can't think of any other examples that I've heard of
Defining new things, including datablocks, functions, packages, and objects, all require to be lowercase.
But referencing an object's datablock needs to be dataBlock
Pretty sure you also can't name any variable or object new.

Pretty sure you also can't name any variable or object new.

try these:
%obj = new scriptobject("new");
%obj.n["ew"] = "blah";
%obj.dump();

try these:
%obj = new scriptobject("new");
%obj.n["ew"] = "blah";
%obj.dump();
torque is heck

correct response: torque.n["ew"] = 1;

Can't even new.delete();
Gotta nameToID("new").delete();

Can't even new.delete();
Gotta nameToID("new").delete();

"new".delete();