GrabObjectInfo

Category: Objects / Crew
Since engine version: 1.0 OC

Description

Transfers the info section from one object to another. The info section contains name, rank, permanent physicals, etc. Using this command you can e.g. perform reincarnations by transferring the info section from a dead clonk to a live one.

Syntax

bool GrabObjectInfo(object from);

Parameter

from:
Object (clonk) of which to retrieve the info section.

Remark

This command implies a MakeCrewMember for the owning player. So the clonk should not already be a crew member - this would cause a new crew member info to be created and immediately discarded.

Example

protected func Death()
{
  var newclnk = CreateObject(GetID(), Random(LandscapeWidth())-GetX(), Random(LandscapeHeight())-GetY(), GetOwner());
  newclnk->GrabObjectInfo(this);
  return;
}
This part of a script would reincarnate a dead clonk at a random landscape position using the same name and physicals.
See also: CrewMember, GetCrew, Kill, MakeCrewMember, OCF_CrewMember
Sven2, 2002-05