SetTransferZone
Category: Objects/Status
Since engine version: 4.6.5.0 CP
Description
Sets the transfer zone of an object. If the pathfinding trail of another object leads through this transfer zone (a transfer
zone is always considered completely passable in pathfinding) ControlTransfer calls will be made to the transfer zone object
for the passing clonk. In these calls, the necessary script commands should be given to the clonk so he can pass the object
and reach his destination.
Syntax
bool SetTransferZone
(int iX, int iY, int iWdt, int iHgt, object pObj);
Parameters
- iX:
-
X position of the top left corner of the new transfer zone, relative to the object center
- iY:
-
Y position of the top left corner of the new transfer zone, relative to the object center
- iWdt:
-
Width of the new transfer zone
- iHgt:
-
Height of the new transfer zone
- pObj:
-
[optional] Object the transfer zone of which you want to change. Can be 0 in local calls.
Remark
Transfer zones have to be set anew when the object has moved. Also, they should be set anew in response to a UpdateTransferZone
callback made by the engine.
Example
protected func Initialize() { return(UpdateTransferZone()); }
protected func UpdateTransferZone() { return(SetTransferZone(-GetX(), -GetY(), LandscapeWidth(), LandscapeHeight()));
protected func ControlTransfer(pClonk, iToX, iToY)
{
SetPosition(iToX, iToY, pClonk);
return(1);
}
Script for a cheat object: a clonk with a movement command will be immediately warped to the destination.
Sven2, June 2003