Ground of Aces Scripting API
Public Member Functions | List of all members
ResourcesScriptApi Class Reference

This class is available under a global resources variable. More...

Public Member Functions

bool SpawnNextTo (uint voxelBasedObjectId, ResourceType type, int amount)
 Spawn a resource pile next to a voxel based entity. This will use the nearest available voxel. More...
 
bool SpoilPile (ResourceType type)
 Find a random pile of type and set its integrity to 0. More...
 

Detailed Description

This class is available under a global resources variable.

Member Function Documentation

◆ SpawnNextTo()

bool SpawnNextTo ( uint  voxelBasedObjectId,
ResourceType  type,
int  amount 
)
inline

Spawn a resource pile next to a voxel based entity. This will use the nearest available voxel.

Parameters
voxelBasedObjectIdID of the object that marks the position
typeType of the resource to spawn
amountAmount of the resource to spawn - this will be clamped to the pile capacity
Returns
true if successful, false if spawning failed (eg. entity with ID not found, no available space)

◆ SpoilPile()

bool SpoilPile ( ResourceType  type)
inline

Find a random pile of type and set its integrity to 0.

Parameters
typeResource type of the pile
Returns
true if successful, false if no pile of type exists