EntityDescriptor

Inherits from Entity

function  EntityDescriptor()

Returns

 A new instance of EntityDescriptor

## Properties

```
           function

```

Returns

 nothing

```
           function

```

Returns

 nothing

```
           function

```

Returns

 nothing

```
           function bool

```

Inherited from Entity

```
           function var

```

Inherited from Entity

```
           function

```

Inherited from Entity

Returns

 nothing

```
           function BlockPlan

```

Inherited from Entity

```
           function var

```

Inherited from Entity

```
           function double...

```

Inherited from Entity

```
           function var

```

Inherited from Entity

```
           function double...

```

Inherited from Entity

```
           function

```

Inherited from Entity

Returns

 nothing

```
           function

```

Inherited from Entity

Returns

 nothing

```
           function

```

Inherited from Entity

Returns

 nothing

```
           function

```

Inherited from Entity

Returns

 nothing

```
           function

```

Inherited from Entity

Returns

 nothing

```
           function Box

```

Inherited from Entity

```
           function Sphere

```

Inherited from Entity

```
           function

```

Inherited from Entity

Returns

 nothing

```
           function

```

Inherited from Entity

Returns

 nothing

```
           function

```

Inherited from Entity

Returns

 nothing

```
           function int...

```

Inherited from Entity

```
           function var

```

Inherited from Entity

```
           function var

```

Inherited from Entity

```
           function var

```

Inherited from Entity

```
           function var

```

Inherited from Entity

```
           function var

```

Inherited from Entity

```
           function var

```

Inherited from Entity

```
           function var

```

Inherited from Entity

```
           function var

```

Inherited from Entity

```
           function var

```

Inherited from Entity

```
           function

```

Inherited from Entity

Returns

 nothing

```
           function

```

Inherited from Entity

Returns

 nothing

```
           function

```

Inherited from Entity

Returns

 nothing

```
           function

```

Inherited from Entity

Returns

 nothing

```
           function var

```

Inherited from Entity

```
           function int...

```

Inherited from Entity

```
           function Material

```

Inherited from Entity

```
           function var

```

Inherited from Entity

```
           function int

```

 Register a callback in the entity. The callback receiver has to be inside the same sector for the registration to succeed. The callback will be removed if either the entity or the receiver leaves the sector or gets destroyed. Inherited from Entity

Parameters

```
           callbackName The name of the callback

           functionName The name of the function that will be executed in the script when the callback happens

```

Returns

 0 on success, 1 if the registration failed

```
           function int

```

### unregisterCallback

(string callbackName, string functionName)

Inherited from Entity

```
           function Matrix, int...

```

### getTurretPositions

(TurretTemplate turret, int number)

Inherited from Entity

```
           function var

```

### addTurret

(TurretTemplate turret, Matrix position, int part)

Inherited from Entity

```
           function Entity

```

### getTurret

(int index)

Inherited from Entity

```
           function Entity...

```

### getTurrets

()

Inherited from Entity

```
           function var

```

### getNumArmedTurrets

()

Inherited from Entity

```
           function var

```

### getNumUnarmedTurrets

()

Inherited from Entity

```
           function var

```

### isTurretAllowed

(TurretTemplate turret)

Inherited from Entity

```
           function var

```

### getFreeArbitraryTurrets

()

Inherited from Entity

```
           function var

```

### getFreeArmedTurrets

()

Inherited from Entity

```
           function var

```

### getFreeUnarmedTurrets

()

Inherited from Entity

```
           function var

```

### getAllowedArbitraryTurrets

()

Inherited from Entity

```
           function var

```

### getAllowedUnarmedTurrets

()

Inherited from Entity

```
           function var

```

### getAllowedArmedTurrets

()

Inherited from Entity

```
           function var

```

### getAttachedBlockIndex

()

Inherited from Entity

```
           function var

```

### getTurretSize

()

Inherited from Entity

```
           function var

```

### getTurretTurningSpeed

()

Inherited from Entity

```
           function var

```

### isManned

()

Inherited from Entity

```
           function

```

### setTurretSize

(float in)

Inherited from Entity

Returns

 nothing

```
           function

```

### setTurretTurningSpeed

(float in)

Inherited from Entity

Returns

 nothing

```
           function

```

### setAttachedBlockIndex

(int in)

Inherited from Entity

Returns

 nothing

```
           function

```

### setManned

(bool in)

Inherited from Entity

Returns

 nothing

```
           function var, var, table<in, in>, string>

```

### canAddCrew

(int number, int profession, bool change)

Inherited from Entity

```
           function

```

### changeCrew

(int number, int profession)

Inherited from Entity

Returns

 nothing

```
           function

```

### addCrew

(int number, CrewMan crewman)

Inherited from Entity

Returns

 nothing

```
           function

```

### removeCrew

(int number, CrewMan crewman)

Inherited from Entity

Returns

 nothing

```
           function var

```

### getCrewMembers

(int profession)

Inherited from Entity

```
           function

```

### addCargo

(TradingGood good, int amount)

 Adds cargo to the entity. If the amount specified exceeds the maximum capacity of the cargo bay, as much cargo as still fits in will be added. Inherited from Entity

Parameters

```
           good TradingGood that is to be added.

           amount The amount of cargo that should be added.

```

Returns

 nothing

```
           function

```

### removeCargo

(var good, int amount)

 Removes cargo from the entity. When given a TradingGood, an exact check for that good will be performed. When given a string, only a name check will be performed, and which cargo will be removed first is undefined if there are multiple goods with the same name. An example would be Energy Cells vs. Stolen Energy Cells. The 'name' property is the same, but the 'stolen' property is different. Inherited from Entity

Parameters

```
           good Either a TradingGood or a string with the name of a good.

           amount The amount of cargo that should be removed. If this is more than there is on the ship, all specified cargo will be removed.

```

Returns

 nothing

```
           function

```

### destroyCargo

(float volume)

 Destroys cargo. The destruction distribution is generally equal over all goods. Inherited from Entity

Parameters

```
           volume The amount of volume that should be destroyed.

```

Returns

 nothing

```
           function TradingGood, int...

```

### getCargo

(unsigned int n)

Inherited from Entity

```
           function table<TradingGood, int>

```

### getCargos

()

Inherited from Entity

```
           function table<TradingGood, int>

```

### findCargos

(string name)

 Finds all cargos with the given name. Inherited from Entity

Parameters

```
           name A string that will be matched with the 'name' property of the cargos.

```

Returns

 A map containing all matching goods, with the good as key and amount as value.

```
           function var

```

### getCargoAmount

(var name)

 Counts all goods of the given type. When given a string, it will match the 'name' property of the goods. When given a TradingGood it will match the exact good. Inherited from Entity

Parameters

```
           name Either a TradingGood or a string containing the name of a trading good.

```

Returns

 The number of goods

```
           function var

```

### resolveScriptPath

(string path)

Inherited from Entity

```
           function var...

```

### invokeFunction

(string scriptName, string functionName, var... arguments)

 Invokes a function in a script of the entity. Use this function to invoke functions from one script in another script. The first return value of the function is an integer indicating whether or not the call was successful. When it was, this integer is followed by the return values of the invoked function. Inherited from Entity

Parameters

```
           scriptName The name of the script containing the function

           functionName The name of the function that will be executed

           arguments An arbitrary list of arguments that will be given to the invoked function. Only numbers, strings and nil are supported here.

```

Returns

 Returns at least 1 value indicating if the call succeeded:
 0 The call was successful. In this case, the return values of the script are returned in addition to the call result, following the call result.
 1 The call failed because the entity with the specified index does not exist or has no scripting component.
 2 The call failed because it came from another sector than the entity is in.
 3 The call failed because the given script was not found in the entity.
 4 The call failed because the given function was not found in the script.

```
           function var

```

### addScript

(string scriptPath, var... arguments)

 Adds a new script to an entity Inherited from Entity

Parameters

```
           scriptPath The path of the script that should be added

           arguments An arbitrary number of arguments that will be given to the 'initialize' function of the added script

```

Returns

 0 on success, 1 if the entity could not be found

```
           function var

```

### addScriptOnce

(string scriptPath, var... arguments)

Inherited from Entity

```
           function

```

### removeScript

(var script)

Inherited from Entity

Returns

 nothing

```
           function var

```

### hasScript

(string name)

Inherited from Entity

```
           function table<int, string>

```

### getScripts

()

Inherited from Entity

```
           function vec3

```

### getRandomDockingPosition

(float radius)

Inherited from Entity

```
           function bool

```

### isDocked

(Entity other)

Inherited from Entity

```
           function vec3...

```

### getDockingPositions

()

 Lists all docking positions that the entity has Inherited from Entity

Returns

 A list of vec3s where every 2 values represent a dock. The first value is the local position, the second value is the local direction of the dock.

```
           function int...

```

### getDamageContributors

()

 Lists all factions that contributed damage to the entity Inherited from Entity

Returns

 Indices of all factions that contributed damage to the entity

```
           function int...

```

### getDamageContributorPlayers

()

 Lists all players that contributed damage to the entity Inherited from Entity

Returns

 Indices of all players that contributed damage to the entity

```
           function var

```

### hyperspaceBlocked

()

Inherited from Entity

```
           function

```

### blockHyperspace

(float time)

Inherited from Entity

Returns

 nothing

```
           function var

```

### getValue

(string key)

 Retrieves a custom value saved in the entity with the given key Inherited from Entity

Parameters

```
           key A string that serves as the name of the value

```

Returns

 The value if the key exists, otherwise nil

```
           function table<string, var>

```

### getValues

()

 Retrieves all key-value pairs of custom values of the entity Inherited from Entity

Returns

 A table containing all custom key-value pairs

```
           function

```

### setValue

(string key, var value)

 Sets a custom value Inherited from Entity

Parameters

```
           key A string that serves as the name of the value

           value The value to save. Must be bool, number, string or nil. If nil is given, the value will be deleted.

```

Returns

 nothing

```
           function

```

### setTitle

(string , string\_pair... )

Inherited from Entity

Returns

 nothing

```
           function

```

### setTitleArguments

(string\_pair... )

Inherited from Entity

Returns

 nothing

```
           function table<string, string>

```

### getTitleArguments

()

Inherited from Entity