CastObjectsX

Category: Objects / Creation
Since engine version: 4.9.7.0 CR

Description

Casts the specified amount of objects at the specified position at the given speed in the specified angle. In local calls the created objects will have the owner of the calling object.

Syntax

int CastObjectsX (id  id, int  iNumber, int  iLevel, int  iX, int  iY, int angs, int angw);

Parameters

id:
Type of objects to be casted
iNumber:
Number of objects.
iLevel:
Velocity of the objects
iX:
[opt] X casting position. In local calls offset to the calling object.
iY:
[opt] Y casting position. In local calls offset to the calling object.
angs:
Cast angle
angw:

Example

var num=GetVertexNum()-1;
CastObjectsX(SPRK,1,20,GetVertex(num, 0)-GetX(), GetVertex(num, 1)-GetY(),90);
				
Creates a spark at the last vertex of a line casting it upwards. With multiple calls this will create the same effect as a lightning strike.
See also: CastObjects, CreateObject
Fulgen / Clonk Wiki, Juli 2016