GetPortrait

Category: Objects / Display
Since engine version: 4.9.5.0 CE

Description

Retrieves name or id of the portrait of a crew member.

Syntax

any GetPortrait (object pObj, bool fGetID, bool fGetPermanent);

Parameters

pObj:
[opt] Object of which you want to retrieve portrait information. Can be 0 in local calls.
fGetID:
[opt] If true, the function returns the id of the definition from which the portrait was taken. Otherwise, the name of the portrait.
fGetPermanent:
[opt] If true, the function returns the values of the object's permanent portrait. Otherwise, the values of the currently used portrait which might be temporary.

Remark

If the crew member has an individually stored portrait, the function returns "custom" and the id NONE. Also see the table and description of the fCopyGfx parameter in SetPortrait

Examples

if(!WildcardMatch(GetPortrait(0, 0, 1), "?") )
  SetPortrait("random", 0, GetPortrait(0, 1, 1), 1);
        
Assigns a random portrait to this clonk if the name of the current portrait is not just an index (i.e. "1", "2", "3") but a full portrait name (i.e. "Armored1", "Armored2").
SetPortrait(GetPortrait(0, 0, 1), 0, GetPortrait(0, 1, 1) );
        
Restores the default portrait of a clonk in case it was changed by a SetPortrait call.
See also: SetPortrait
Clonk-Karl, Dezember 2005