Menu
Lumberyard
Developer Guide (Version 1.11)

ScriptBind_Boids

CryLua is deprecated and will be removed in a future version of Lumberyard.

These functions create simulated flocks of bird-like objects (boids) or other animals and control their behavior.

CanPickup

Syntax

Checks if the boid can be picked up.

Copy
Boids.CanPickup(flockEntity, boidEntity)

Parameter Description
flockEntity Valid entity table containing flock.
boidEntity Valid entity table containing boid.

CreateBugsFlock

Creates a bugs flock and binds it to the given entity.

Syntax

Copy
Boids.CreateBugsFlock(entity,paramsTable)

Parameter Description
entity Valid entity table.
paramTable Table with parameters for flock (see sample scripts).

CreateFishFlock

Creates a fish flock and binds it to the given entity.

Syntax

Copy
Boids.CreateFishFlock(entity,paramsTable)

Parameter Description
entity Valid entity table.
paramTable Table with parameters for flock (see sample scripts).

CreateFlock

Creates a flock of boids and binds it to the given entity.

Syntax

Copy
Boids.CreateFlock(entity,paramsTable)

Parameter Description
entity Valid entity table.
nType The type of flock. Possible values are Boids.FLOCK_BIRDS, Boids.FLOCK_FISH, or Boids.FLOCK_BUGS.
paramTable Table with parameters for flock (see sample scripts).

EnableFlock

Enables or disables a flock in the entity.

Syntax

Copy
Boids.EnableFlock(entity,paramsTable)

Parameter Description
entity Valid entity table containing flock.
bEnable Specify true to enable the flock; false to disable.

GetUsableMessage

Gets the appropriate localized UI message for the specified flock.

Syntax

Copy
Boids.GetUsableMessage(flockEntity)

Parameter Description
flockEntity Valid entity table containing flock.

OnBoidHit

Event that occurs on boid hit.

Syntax

Copy
Boids.OnBoidHit(flockEntity,boidEntity,hit)

Parameter Description
flockEntity Valid entity table containing flock.
boidEntity Valid entity table containing boid.
hit Valid entity table containing hit information.

OnPickup

Forwards the appropriate pickup action to the boid object.

Syntax

Copy
Boids.OnPickup(flockEntity, boidEntity, bPickup, fThrowSpeed)

Parameter Description
flockEntity Valid entity table containing flock.
boidEntity Valid entity table containing boid.
bPickup Pickup, or drop or throw.
fThrowSpeed Specifies the throw speed. By default, a value greater than 5.f kills the boid. This has no effect on the pickup action.

SetAttractionPoint

Sets the one time attraction point for the boids.

Syntax

Copy
Boids.SetAttractionPoint(entity,paramsTable)

Parameter Description
entity Valid entity table containing flock.
point The one time attraction point.

SetFlockParams

Sets the parameters of the flock for the specified entity.

Syntax

Copy
Boids.SetFlockParams(entity, paramsTable)

Parameter Description
entity Valid entity table containing flock.
paramTable Table with parameters for flock (see sample scripts).

SetFlockPercentEnabled

Specifies the percentage of boid objects that are rendered in flocks. You can use this to enable flocks gradually.

Syntax

Copy
Boids.SetFlockPercentEnabled(entity, paramsTable)

Parameter Description
entity Valid entity table containing flock.
nPercent Possible values are from 0 through 100. If 0, no boids are rendered; if 100, all boids are rendered.