# SetPortrait

Objects
Display
4.9.5.0 CE
bool
string portrait Name of the portrait to be set. This will load the image file "PortraitX.png" (X being replaced with the specified name). This parameter can handle the following special values:

Value
Meaning
"none"
Portrait will be removed.
"random"
A random portrait will be selected from all available portraits.
"custom"
The portrait will be set to the object's individually stored portrait, if available.

id source_definition Definition from which you want to load the portrait. If not specified, the portrait will be loaded from the definition of the object.
bool permanent If 'true' the new portrait setting will be stored in the player file and used in future rounds. Otherwise the portrait setting will be discarded at the end of the round.
bool copy_gfx Copies the image of the new portrait to the player file and sets the portrait to "custom". In this way, the portrait will still be available even if the definition from which it was originally loaded is not available in a given round. On the other hand, with this setting it is impossible to determine from which source the portrait was originally loaded.
Changes the portrait of the crew member at runtime.
FindObject
(0, 0,0,0,0, OCF_CrewMember)->SetPortrait("random");
Assigns a random portrait to the clonk.
SetPortrait(GetPortrait(0, 0, 1), GetPortrait(0, 1, 1) );
Restores the default portrait of a clonk in case it was changed by a SetPortrait call.
GetPortrait
Clonk-Karl
2005-12