Turok
 
Loading...
Searching...
No Matches
kWorld Class Reference

Public Member Functions

kActor GetActorByTID (const int tagID, const int typeFilter=- 1) const
 if typeFilter is -1 checks any type otherwise only returns the actor of that type
 
bool TriggerActorsByTID (kActor@ instigator, const int tagID)
 Triggers an actor (that is not the instigator) that has the same tagID. Returns true if triggered an actor.
 
void ChangeAreaFlag (const int areaID, const uint flags, const bool active)
 (EnumAreaFlags) Only sets the areaID flags and not the sector flags. Should most likely prefer using FloodMatchingAreaFlags so the sectors get set as well.
 
void FloodFillAreaFlags (const int sectorIndex, const uint flags, const bool active)
 (EnumAreaFlags) Sets flags on all adjacent sectors until it finds a sector that has the flags already set (or cleared if active is false)
 
void FloodFillAreaFlags (const kVec3 &in origin, const uint flags, const bool active)
 (EnumAreaFlags) Calls FloodMatchingAreaFlags with FindNextClosestSector(origin) sector.
 
void FloodMatchingAreaFlags (const int sectorIndex, const uint flags, const bool active)
 (EnumAreaFlags) Sets flags on all adjacent sectors with matching areaID.
 
const uint GetAreaFlags (const int areaID) const
 EnumAreaFlags.
 
const int GetAreaFloorImpact (const int areaID) const
 EnumImpactType.
 
const int GetAreaWallImpact (const int areaID) const
 EnumImpactType.
 
void ChangeAreaFloorImpact (const int areaID, const int value)
 value: EnumImpactType
 
void ChangeAreaWallImpact (const int areaID, const int value)
 value: EnumImpactType
 
void ChangeAreaWaterHeight (const int areaID, const float height)
 WaterHeight is stored per area, not per sector or per vertex.
 
const int16 GetAreaArg (const int areaID, const int arg) const
 Returns an area arg value.
 
void ChangeAreaArg (const int areaID, const int arg, const int16 value)
 
void ChangeSectorHeight (const int sectorIndex, const float height)
 Changes all sectors floor vertices with the same areaID to the height.
 
void ChangeSectorCeilingHeight (const int sectorIndex, const float height)
 Changes all sectors ceilng vertices with the same areaID to the height.
 
void ChangeSectorCeilingHeightVertices (const int sectorIndex, const float height, const int ptMask=7)
 Changes only the sector ceiling vertices(specfied using the ptMask) to the height.
 
void ChangeSectorHeightVertices (const int sectorIndex, const float height, const int ptMask=7)
 Changes only the sector floor vertices(specfied using the ptMask) to the height.
 
const int FindNextClosestSector (const kVec3 &in origin)
 
void GetSectorCorners (const int sectorIndex, kVec3 &out pt1, kVec3 &out pt2, kVec3 &out pt3, kVec3 &out heights) const
 Get the Sectors vertex position and height Link 1 is pt1 to pt3 Link 2 is pt2 to pt1 Link 3 is pt3 to pt2.
 
void GetSectorLinks (const int sectorIndex, int &out sectorIndex1, int &out sectorIndex2, int &out sectorIndex3) const
 Get the 3 sectors links. -1 means there was no sector linked to that edge. Link 1 is pt1 to pt3 Link 2 is pt2 to pt1 Link 3 is pt3 to pt2.
 
const uint GetSectorNumBridges (const int sectorIndex) const
 number of bridge sectors this sector has
 
const int GetSectorBridge (const int sectorIndex, const uint bridge) const
 Get the sector of the bridge. Use GetSectorNumBridges to loop through them all.
 
const int GetSectorAreaID (const int sectorIndex) const
 
const int GetNumSectors () const
 
const int GetNumAreas () const
 
const int GetNumActors () const
 number of actors that are in the current maps data
 
const int GetSectorFlags (const int sectorIndex) const
 Returns a 16 bit unsigned integer. Only the first 16 area flags (up to AAF_MAPPED) are used for sectors.
 
void SetSectorFlags (const int sectorIndex, const int flags)
 Keep in mind sector flags are a 16 bit unsigned integer and only the first 16 area flags (up to AAF_MAPPED) are used for sector flags.
 

Detailed Description

Definition at line 1395 of file t1_scriptAPI.cpp.

Member Function Documentation

◆ ChangeAreaArg()

void kWorld::ChangeAreaArg ( const int areaID,
const int arg,
const int16 value )
Parameters
areaID
arg
though args can be used for anything, they are typically used in this fashion:
0: warp ID
1: warp level ID or trigger sound ID
2: checkpoint ID
3: tag ID
4: floor damage hit points
5: floor damage rate
Hardcoded:
0: AAF_TELEPORT: WarpID
1: AAF_TELEPORT: WarpLevelID, AAF_EVENT and AAF_EVENTSOUND: soundID to play when player enters sector
2: AAF_CHECKPOINT or AAF_SAVEGAME: CheckpointID
3: AAF_EVENT: tag ID
4: Not used
5: AAF_SECRET: the secret index value (set automatically when level loads starting at 0. Conflicts with AAF_DAMAGE (so I guess no secrets should be placed on damaga sectors))
Default Scripts:
0: Not used
1: Not used
2: Not used
3: Not used
4: AAF_DAMAGE: amount of damage to do to the player when they're on the ground
5: Always used as floor damage delay no matter the AAF flags. Should be used with AAF_DAMAGE only. 1 second = 1024
@ AAF_CHECKPOINT
@ AAF_EVENT
@ AAF_DAMAGE
@ AAF_SAVEGAME
@ AAF_EVENTSOUND
@ AAF_TELEPORT
@ AAF_SECRET
value

◆ ChangeAreaFlag()

void kWorld::ChangeAreaFlag ( const int areaID,
const uint flags,
const bool active )

(EnumAreaFlags) Only sets the areaID flags and not the sector flags. Should most likely prefer using FloodMatchingAreaFlags so the sectors get set as well.

◆ ChangeAreaFloorImpact()

void kWorld::ChangeAreaFloorImpact ( const int areaID,
const int value )

◆ ChangeAreaWallImpact()

void kWorld::ChangeAreaWallImpact ( const int areaID,
const int value )

◆ ChangeAreaWaterHeight()

void kWorld::ChangeAreaWaterHeight ( const int areaID,
const float height )

WaterHeight is stored per area, not per sector or per vertex.

◆ ChangeSectorCeilingHeight()

void kWorld::ChangeSectorCeilingHeight ( const int sectorIndex,
const float height )

Changes all sectors ceilng vertices with the same areaID to the height.

◆ ChangeSectorCeilingHeightVertices()

void kWorld::ChangeSectorCeilingHeightVertices ( const int sectorIndex,
const float height,
const int ptMask = 7 )

Changes only the sector ceiling vertices(specfied using the ptMask) to the height.

◆ ChangeSectorHeight()

void kWorld::ChangeSectorHeight ( const int sectorIndex,
const float height )

Changes all sectors floor vertices with the same areaID to the height.

◆ ChangeSectorHeightVertices()

void kWorld::ChangeSectorHeightVertices ( const int sectorIndex,
const float height,
const int ptMask = 7 )

Changes only the sector floor vertices(specfied using the ptMask) to the height.

◆ FindNextClosestSector()

const int kWorld::FindNextClosestSector ( const kVec3 &in origin)

◆ FloodFillAreaFlags() [1/2]

void kWorld::FloodFillAreaFlags ( const int sectorIndex,
const uint flags,
const bool active )

(EnumAreaFlags) Sets flags on all adjacent sectors until it finds a sector that has the flags already set (or cleared if active is false)

◆ FloodFillAreaFlags() [2/2]

void kWorld::FloodFillAreaFlags ( const kVec3 &in origin,
const uint flags,
const bool active )

(EnumAreaFlags) Calls FloodMatchingAreaFlags with FindNextClosestSector(origin) sector.

◆ FloodMatchingAreaFlags()

void kWorld::FloodMatchingAreaFlags ( const int sectorIndex,
const uint flags,
const bool active )

(EnumAreaFlags) Sets flags on all adjacent sectors with matching areaID.

◆ GetActorByTID()

kActor kWorld::GetActorByTID ( const int tagID,
const int typeFilter = - 1 ) const

if typeFilter is -1 checks any type otherwise only returns the actor of that type

◆ GetAreaArg()

const int16 kWorld::GetAreaArg ( const int areaID,
const int arg ) const

Returns an area arg value.

Parameters
areaID
arg
though args can be used for anything, they are typically used in this fashion:
0: warp ID
1: warp level ID or trigger sound ID
2: checkpoint ID
3: tag ID
4: floor damage hit points
5: floor damage rate
Hardcoded:
0: AAF_TELEPORT: WarpID
1: AAF_TELEPORT: WarpLevelID, AAF_EVENT and AAF_EVENTSOUND: soundID to play when player enters sector
2: AAF_CHECKPOINT or AAF_SAVEGAME: CheckpointID
3: AAF_EVENT: tag ID
4: Not used
5: AAF_SECRET: the secret index value (set automatically when level loads starting at 0. Conflicts with AAF_DAMAGE (so I guess no secrets should be placed on damaga sectors))
Default Scripts:
0: Not used
1: Not used
2: Not used
3: Not used
4: AAF_DAMAGE: amount of damage to do to the player when they're on the ground
5: Always used as floor damage delay no matter the AAF flags. Should be used with AAF_DAMAGE only. 1 second = 1024

◆ GetAreaFlags()

const uint kWorld::GetAreaFlags ( const int areaID) const

◆ GetAreaFloorImpact()

const int kWorld::GetAreaFloorImpact ( const int areaID) const

◆ GetAreaWallImpact()

const int kWorld::GetAreaWallImpact ( const int areaID) const

◆ GetNumActors()

const int kWorld::GetNumActors ( ) const

number of actors that are in the current maps data

◆ GetNumAreas()

const int kWorld::GetNumAreas ( ) const

◆ GetNumSectors()

const int kWorld::GetNumSectors ( ) const

◆ GetSectorAreaID()

const int kWorld::GetSectorAreaID ( const int sectorIndex) const

◆ GetSectorBridge()

const int kWorld::GetSectorBridge ( const int sectorIndex,
const uint bridge ) const

Get the sector of the bridge. Use GetSectorNumBridges to loop through them all.

◆ GetSectorCorners()

void kWorld::GetSectorCorners ( const int sectorIndex,
kVec3 &out pt1,
kVec3 &out pt2,
kVec3 &out pt3,
kVec3 &out heights ) const

Get the Sectors vertex position and height Link 1 is pt1 to pt3 Link 2 is pt2 to pt1 Link 3 is pt3 to pt2.

Parameters
sectorIndex
pt1
pt2
pt3
heightsx is the height of pt1, y is the height of pt2, z is the height of pt3.

◆ GetSectorFlags()

const int kWorld::GetSectorFlags ( const int sectorIndex) const

Returns a 16 bit unsigned integer. Only the first 16 area flags (up to AAF_MAPPED) are used for sectors.

◆ GetSectorLinks()

void kWorld::GetSectorLinks ( const int sectorIndex,
int &out sectorIndex1,
int &out sectorIndex2,
int &out sectorIndex3 ) const

Get the 3 sectors links. -1 means there was no sector linked to that edge. Link 1 is pt1 to pt3 Link 2 is pt2 to pt1 Link 3 is pt3 to pt2.

Parameters
sectorIndex
sectorIndex1
sectorIndex2
sectorIndex3a sectorIndex with -1 is no sector.

◆ GetSectorNumBridges()

const uint kWorld::GetSectorNumBridges ( const int sectorIndex) const

number of bridge sectors this sector has

◆ SetSectorFlags()

void kWorld::SetSectorFlags ( const int sectorIndex,
const int flags )

Keep in mind sector flags are a 16 bit unsigned integer and only the first 16 area flags (up to AAF_MAPPED) are used for sector flags.

◆ TriggerActorsByTID()

bool kWorld::TriggerActorsByTID ( kActor@ instigator,
const int tagID )

Triggers an actor (that is not the instigator) that has the same tagID. Returns true if triggered an actor.