Level Script API: Difference between revisions

From DF21 Wiki
(Created page with "== Properties == === minLayer === * Get only * Gets the minimum map layer (signed integer) * Usage example: <code>int i = level.minLayer;</code> === maxLayer === * Get only * Gets the maximum map layer (signed integer) * Usage example: <code>int i = level.maxLayer;</code> === sectorCount === * Get only * Gets the total count of sectors (signed integer) * Usage example: <code>int i = level.sectorCount</code> === secretCount === * Get only * Gets the total count of secr...")
 
No edit summary
Line 1: Line 1:
Documentation for TFE Level Script API.
== Properties ==
== Properties ==
=== minLayer ===
=== minLayer ===
Line 20: Line 22:
* Usage example: <code>int i = level.secretCount</code>
* Usage example: <code>int i = level.secretCount</code>


=== texturetCount ===
=== textureCount ===
* Get only
* Get only
* Gets the total count of textures (signed integer)
* Gets the total count of textures (signed integer)
* Usage example: <code>int i = level.textureCount</code>
* Usage example: <code>int i = level.textureCount</code>


=== elevatorCount ===
* Get only
* Gets the total count of elevators (signed integer)
* Usage example: <code>int i = level.elevatorCount</code>
=== parallax ===
* Get only
* Gets the parallax (float2)
* Usage example:
<pre>
float2 pa = level.parallax;
float horzParallax = pa.x;
float vertParallax = pa.y;
</pre>
== Special sector getters ==
=== bossSector ===
* Gets the boss sector (Sector)
* Usage example: <code>Sector bossSect = level.bossSector;</code>
=== mohcSector ===
* Gets the mohc sector (Sector)
* Usage example: <code>Sector mohcSect = level.mohcSector;</code>
=== completeSector ===
* Gets the complete sector (Sector)
* Usage example: <code>Sector completeSect = level.completeSector;</code>


== Methods ==
=== getSector(int) ===
* Returns a sector
* Parameters: sector Id (int)
* Usage example: <code>Sector mySector = level.getSector(14);</code>


== Functions ==
=== getElevator(int) ===
=== getSector ===
* Returns an elevator
* Parameters: elevator Id (int)
* Usage example: <code>Elevator myElev = level.getElevator(9);</code>

Revision as of 23:38, 22 March 2025

Documentation for TFE Level Script API.

Properties

minLayer

  • Get only
  • Gets the minimum map layer (signed integer)
  • Usage example: int i = level.minLayer;

maxLayer

  • Get only
  • Gets the maximum map layer (signed integer)
  • Usage example: int i = level.maxLayer;

sectorCount

  • Get only
  • Gets the total count of sectors (signed integer)
  • Usage example: int i = level.sectorCount

secretCount

  • Get only
  • Gets the total count of secrets (signed integer)
  • Usage example: int i = level.secretCount

textureCount

  • Get only
  • Gets the total count of textures (signed integer)
  • Usage example: int i = level.textureCount

elevatorCount

  • Get only
  • Gets the total count of elevators (signed integer)
  • Usage example: int i = level.elevatorCount

parallax

  • Get only
  • Gets the parallax (float2)
  • Usage example:
float2 pa = level.parallax;
float horzParallax = pa.x;
float vertParallax = pa.y;

Special sector getters

bossSector

  • Gets the boss sector (Sector)
  • Usage example: Sector bossSect = level.bossSector;

mohcSector

  • Gets the mohc sector (Sector)
  • Usage example: Sector mohcSect = level.mohcSector;

completeSector

  • Gets the complete sector (Sector)
  • Usage example: Sector completeSect = level.completeSector;

Methods

getSector(int)

  • Returns a sector
  • Parameters: sector Id (int)
  • Usage example: Sector mySector = level.getSector(14);

getElevator(int)

  • Returns an elevator
  • Parameters: elevator Id (int)
  • Usage example: Elevator myElev = level.getElevator(9);