GrabObjectInfo

Category: Objects / Crew
Since engine version: 4.9.1.0 GWE

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 pFrom, object pTo);

Parameters

pFrom:
Object (clonk) of which to retrieve the info section.
pTo:
[opt] Object (clonk) of which to set the info section. Can be 0 in local calls.

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 Death:
  var newclnk = CreateObject(GetID(), Random(LandscapeWidth())-GetX(), Random(LandscapeHeight())-GetY(), GetOwner());
  GrabObjectInfo(this(), newclnk);
  return(1);
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, Mai 2002