Turok EX Modding Guide

Scripts kActorFactory

object for spawning actors into the world

stored in global var ActorFactory

Methods

kActor@ Spawn( int actorID, float x, float y, float z, float yaw, int sector = -1 )

kActor@ Spawn( kStr& actorName, float x, float y, float z, float yaw, int sector = -1 )

spawn an actor at the given global coordinates, with the given rotation (in radians)

The default sector will leave the actor "outside" the level's nav mesh. If you need the actor to interact with the level or other actors, it'll likely be necessary to provide a proper sector, either by using kActor::SectorIndex() of another actor in the same sector, or more generally with kActor::GetSectorIndexAtLocation().

actor names and IDs are defined in defs/actors/, and IDs are enumerated in turokActorTypes in scripts/common.txt

returns a handle to the actor that was spawned