Blockland Forums > Modification Help
UI Name Table for playertypes? [Solved]
<< < (3/4) > >>
Port:

--- Quote from: Greek2me on April 06, 2012, 12:12:47 AM ---That's risky, since people can name their datablocks anything.

--- End quote ---


--- Quote from: Port on April 06, 2012, 12:04:43 AM ---class name

--- End quote ---

Uh, what?
Greek2me:

--- Quote from: Port on April 06, 2012, 12:13:46 AM ---Uh, what?

--- End quote ---
MissionArea is for the map and is loaded after all add-ons but before any bricks.
Port:
People cannot "customize" the class name of their datablocks, and all the default class names end with "Data".
Greek2me:

--- Quote from: Port on April 06, 2012, 12:16:48 AM ---People cannot "customize" the class name of their datablocks, and all the default class names end with "Data".

--- End quote ---
Not true, there are many other class names. One example is "AudioProfile".

Anyway, my method completely works with these modifications:

--- Code: ---function SlayerClient_Support::getIDFromUiName(%uiName)
{
if(serverConnection.isLocal())
%group = datablockGroup;
else
%group = serverConnection;

%count = %group.getCount();
for(%i=0; %i < %count; %i++)
{
%obj = %group.getObject(%i);
if(%obj.getClassName() $= "MissionArea")
break;
if(%obj.uiName $= %uiName)
return %obj;
}
return -1;
}
--- End code ---
Port:

--- Quote from: Greek2me on April 06, 2012, 01:04:25 AM ---Not true, there are many other class names. One example is "AudioProfile".

--- End quote ---

I didn't sleep this night, I'm tired. But yes, I see what you mean.
Navigation
Message Index
Next page
Previous page

Go to full version