Turok EX Modding Guide

Scripts kWorld

class relating to the level itself, and its occupants

stored in global var World

Map Structure

A map's floor plan is made up of areas. Each area is triangulated into sectors. You can get an actor's area and sector with kActor::AreaID() and kActor::SectorIndex(), respectively, or the sector at an arbitrary point with kActor::GetSectorIndexAtLocation().

You can enable a debug sector visualization with showcollision, and a readout containing the player's current sector with statplayloop.

Methods

kActor@ GetActorByTID( int tagID, int type = -1 )

get the first actor with a given tag ID and type (if specified)

bool TriggerActorsByTID( kActor@ a, int tagID )

uint GetAreaFlags( int areaID )

bit field of area flags:

void FloodMatchingAreaFlags( int sector, uint flags, bool bSet )

void FloodFillAreaFlags( kVec3& loc, uint flags, bool bSet )

set or clear the given flags in an area based on a sector or point inside it

void ChangeSectorHeight( int sector, float height )

change the physical floor height of the area sector is part of, but not the visual floor height

void ChangeAreaWaterHeight( int areaID, float height )

change physical water height of an area, but not visual water height

int16 GetAreaArg( int areaID, int arg )

void ChangeAreaArg( int areaID, int arg, int16 value )

generic space for various area properties

typical arg usage:

  1. warp ID
  2. warp level ID or event sound ID
  3. checkpoint ID
  4. tag ID
  5. floor damage hit points
  6. floor damage rate