Badger8

ScriptAPI

Mar 11th, 2019
375
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 17.47 KB | None | 0 0
  1. Level Editor Properties
  2. --For Grunts Only--
  3. Projectile Attack 1 = Shaman Throw Fast Fireball
  4. Projectile Attack 2 = Pistol Fire
  5. Projectile Attack 3 = Machinegun Fire
  6. Projectile Attack 4 = ??? Nothing
  7. Projectile Attack 5 = Machinegun Fire/plasma fire(alternate moves)
  8. Projectile Attack 6 = Pipe Blow
  9. Projectile Attack 7 = Grenade Throw
  10. Projectile Attack 8 = ??? Some melee attack
  11. Projectile Attack 9 = chest hadoken
  12. Projectile Attack 10 = Shaman Lightning Hands in Air
  13.  
  14. Drop Item Masks
  15. 1: Explosive shells
  16. 2: Grenade
  17. 3: Medium Health
  18. 4: Full Health
  19. 5: Ultra Health
  20. 6: Small Health
  21. 7: Large Health
  22. 8: Minigun ammo
  23. 9: Mortal Wound
  24. 10: 4 Rockets
  25. 11: Shotgun Shells
  26. 12: Energy Cell
  27. 13: Large Energy Cell
  28. 14: Clip
  29.  
  30. GruntVariants
  31. GV_GENERIC = 0,
  32. GV_GENERIC_AXE = 1,
  33. GV_GENERIC_CLUB = 2,
  34. GV_COMMANDER_SPEAR = 3,
  35. GV_COMMANDER_RIFLE1 = 4,
  36. GV_COMMANDER_RIFLE2 = 5,
  37. GV_COMMANDER_RIFLE3 = 6,
  38. GV_GENERIC_RIFLE = 7,
  39. GV_COMMANDER_RIFLE4 = 8,
  40. GV_POACHER_KNIFE = 9,
  41. GV_POACHER_PISTOL1 = 10,
  42. GV_POACHER_PISTOL2 = 11,
  43. GV_POACHER_RIFLE = 12,
  44. GV_POACHER_SHOTGUN = 13,
  45. GV_WARRIOR_BONE = 14,
  46. GV_WARRIOR_DART = 15,
  47. GV_WARRIOR_SPEAR = 16,
  48. GV_SHAMAN = 17,
  49. GV_CYBORG_PULSE_RIFLE = 18,
  50. GV_CYBORG_KNIFE = 19,
  51. GV_CYBORG_SPEAR = 20,
  52. GV_DEMON_AXE = 21,
  53. GV_DEMON_SPEAR = 22,
  54. GV_DEMON_HANDS = 23,
  55. GV_DEMON_LORD = 24,
  56. GV_GENERIC_HANGING = 25,
  57.  
  58. $0 = "music/track01.ogg" //jungle
  59. $1 = "music/track07.ogg" //Catacombs
  60. $2 = "music/track08.ogg" //Caves
  61. $3 = "music/track04.ogg" //Boss Battle
  62. $4 = "music/track13.ogg" //final confrontation
  63. $5 = "music/track14.ogg" //Campaigner
  64. $6 = "music/track02.ogg" //the Hub
  65. $7 = "music/track09.ogg" //tree top village
  66. $8 = "music/track11.ogg" //the lost land
  67. $9 = "music/track12.ogg" //cyborg T-Rex
  68. $11 = "music/track10.ogg" //Lost Land Caves
  69. $13 = "music/track03.ogg" //ancient city
  70. $14 = "music/track05.ogg" //The Ruins
  71. $100 = "music/track06.ogg" // underwater theme
  72.  
  73. //------------------------------------------------------------------------------------------------------------------------
  74. | Execution Order of ScriptObject Events:
  75. //------------------------------------------------------------------------------------------------------------------------
  76. .ctor <-- (actor properties from def are assigned here and Origin, Yaw and SectorIndex are set here)
  77. ---
  78. OnSpawn
  79. OnBeginLevel <--- (ALL actor properties from map are not setup until this point)
  80. OnRestore
  81. *Map Script 0 <--- (Called on PlayLoop tick 0)
  82. OnPostBeginLevel
  83. (*Note: Any spawned actor created after each of these events will not be called for that spawned actor.
  84. If spawned before/during then it will/might be called.)
  85. ---
  86. OnSleep
  87. OnWake
  88. OnTouch
  89. OnCollide
  90. OnTick <--- called only when awake
  91. ---
  92. OnActivate <--- called immediately after World.TriggerActorsByTID and when player enters event sector area only if AF_ACTIVATED is Off
  93. ---
  94. OnDeath <--- called only when actor dies. The actors Target TID is automatically used to trigger actors at this point.
  95. OnDamage <--- always called when damaged even after death
  96. ---
  97. OnEndLevel <--- Can not call any map scripts at this point
  98.  
  99. ScriptObject
  100. void OnSpawn() - Required for all ScriptObject
  101. void OnBeginLevel()
  102. void OnRestore()
  103. void OnPostBeginLevel()
  104. void OnSleep()
  105. void OnWake()
  106. void OnTouch(kActor @theActorThatTouchedMe) //called even if alseep
  107. void OnCollide(kCModel@) //called even if alseep
  108. void OnTick() - Required for all ScriptObject
  109. void OnActivate()
  110. void OnDeactivate() //Never used
  111. void OnDeath(kActor @killer, kDictMem @damageDef) //called only when actor dies
  112. void OnDamage(kActor @instigator, kDictMem @damageDef, const int damage) //always called even after death
  113. void OnEndLevel()
  114.  
  115. ScriptObjectWeapon
  116. void OnBeginFire()
  117. void OnFire()
  118. void OnEndFire()
  119. void OnLower()
  120. void OnRaise()
  121. void OnHoldster()
  122.  
  123. ScriptObjectPlayer
  124. void OnPickup(kActor @pickup)
  125. void OnArmorDamage(kActor @instigator, kDictMem @damageDef, const int damage)
  126. void OnEnterWater()
  127.  
  128. kAnimState
  129. void Blend(const int animID, float speed, float blend, int AnimStateFlags)
  130. void Set(const int animID, float speed, int AnimStateFlags)
  131. const int CurrentFrame(void)
  132. const int NumFrames(void)
  133. const float PlayTime(void)
  134. const float TrackTime(void)
  135. bool IsPlaying(const int animID)
  136. bool CheckAnimID(const int animID) - checks if animID exists
  137. const int PlayingID(void)
  138. void Stop(void)
  139. void Pause(void)
  140. void Resume(void)
  141. const bool Stopped(void)
  142. const bool Blending(void)
  143. const bool Looping(void)
  144. const bool CycleCompleted(void)
  145. void ChangeSpeed(const float speed)
  146. void SetLastFrame(const bool execActions = false) //if execActions is true, runs all key frame actions in the animation
  147.  
  148. kRenderModel
  149. void SetModel(const kStr &in modelPath, const kStr &in modelAnimPath)
  150. void SetRotationOffset(const int nodeIndex, const float rads, const float x, const float y, const float z)
  151. void SetRotationOffset(const int nodeIndex, const kQuat &in rotation)
  152. void SetTexture(const int section, const int textureID)
  153. void SetVisibility(const int node, const bool visible)
  154. void HideSection(const int node, const int section, const bool hide)
  155. void AddTrailEffect(const kStr &in trailName, const int nodeIndex)
  156. void RemoveTrailEffect(void) //removes all trail effects
  157. const int GetNumAttachedTrails(void)
  158. kVec3 &Offset(void)
  159.  
  160. kScriptObject
  161. ref &obj;
  162.  
  163. kActor, kPuppet, kWeapon, kAI
  164. const bool IsStale() - Is the object removed
  165. kAngle &Yaw()
  166. kAngle &Pitch()
  167. kAngle &Roll()
  168. kVec3 &Origin()
  169. kVec3 &Scale()
  170. kVec3 &PrevOrigin()
  171. void SetTarget(kActor@)
  172. kActor @GetTarget(void)
  173. void SetSector(const uint sectorIndex)
  174. void Remove(void)
  175. kVec3 &Velocity(void)
  176. kVec3 &Movement(void)
  177. kQuat &Rotation(void)
  178. int16 &Health(void)
  179. int &Type(void)
  180. int &ImpactType(void)
  181. int &ModelVariation(void)
  182. uint &Flags(void)
  183. const uint SpawnFlags1(void)
  184. const uint SpawnFlags2(void)
  185. const uint SpawnFlags3(void)
  186. const int TID(void)
  187. float &Radius(void)
  188. float &Height(void)
  189. float &StepHeight(void)
  190. float &WallRadius(void)
  191. float &Gravity(void)
  192. float &Friction(void)
  193. float &AnimSpeed(void)
  194. float &BounceDamp(void)
  195. float &FloorHeight(void)
  196. float &CeilingHeight(void)
  197. const int SectorIndex(void)
  198. const int AreaID(void)
  199. bool InstanceOf(const kStr &in className)
  200. void PlaySound(const kStr &in soundPath)
  201. void PlaySoundWithLookupID(const int soundID)
  202. void StopSound(void)
  203. void StopLoopingSounds(void)
  204. const int GameTicks(void)
  205. kAnimState &AnimState(void)
  206. kRenderModel @RenderModel(void)
  207. const bool InWater(void)
  208. bool CheckPosition(const kVec3 &in location) //checks if the actor can move to this location
  209. bool CheckPosition(const float angle, const float distance) //call CheckPosition(kVec3 location) with location being: Actor.Origin() + (angle*distance*actor.Radius())
  210. float GetTurnYaw(const kVec3 &in lookAtLocation)
  211. float GetAvoidanceAngle(const kVec3 &in lookAtLocation, const float distance)
  212. const float GetWaterHeight(void)
  213. const bool CanSee(kActor@ actor, const uint excludeClipFlags = 0) //excludeClipFlags to ignore/disable
  214. uint &ClipFlags(void)
  215. kDictMem @Definition(void)
  216. bool OnGround(void)
  217. const int GetWaterLevel(void)
  218. kActor @CastToActor(void)
  219. kAI @CastToAI(void)
  220. void SpawnProjectile(const kStr &in fxPath, const kVec3 &in location, const kVec3 &in targetLocation, const float maxAngle)
  221. void MeleeObject(const kStr &in damageType, const kVec3 &in offset, const float radius)
  222. void SpawnFx(const kStr &in fxPath, const kVec3 &in position)
  223. void SpawnFx(const kStr &in fxPath, const kVec3 &in position, const kQuat &in rotation)
  224. kVec3 GetTransformedVector(const kVec3 &in vector)
  225. float DistanceToPoint(const kVec3 &in point) //calls DistanceToPoint(x,y,z)
  226. float DistanceToPoint(const float x, const float y, const float z) //actors point is in the center
  227. void InflictGenericDamage(kActor@ inflictor, const int damage)
  228. void InteractActorsAtPosition(const kVec3 &in pos, const kStr &in callbackFunc, const float arg1 = 0, const float arg2 = 0, const float arg3 = 0, const float arg4 = 0)
  229. kScriptObject @ScriptObject(void)
  230. void MoveToPosition(const float x, const float y)
  231. bool RandomDecision(const int randomBit)
  232. void SetPosition(const kVec3 &in position)
  233. const int16 SpawnParams(const int paramID)
  234. //(0) Target ID -32768..32767
  235. //(1) Trigger Anim 0..255
  236. //(2) Health -32768..32767
  237. //(3) Max Regenerations -32768..32767
  238. //(4) Attach Chance 0..255
  239. //(5) Texture -128..127
  240. //(6) Params 2 -128..127
  241. //(7) Params 1 -128..127
  242. const float GetCeilingHeight(void)
  243. const float GetFloorHeight(void)
  244. void RunFxEvent(const kStr &in fxEventName)
  245. const int GetSectorIndexAtLocation(const kVec3 &in position, uint excludeClipFlags = 0)
  246. void MarkPersistentBit(const bool clear)
  247. const bool IsPersistentMarked(void)
  248. void SetHeadTrackTarget(kActor@ actor)
  249. kVec3 TransformToOwnerPosition(void)
  250. kVec3 TransformToOwnerPosition(const kVec3 &in vector)
  251. void FireProjectile(const kStr &in fxPath, const float x, const float y, const float z, const bool adjustToPerspective = false)
  252. const bool CanSee(kPuppet@ puppet, const uint excludeClipFlags = 0)
  253. float &ViewHeight(void)
  254. float &RecoilPitch(void)
  255. const float LandingViewOffset(void)
  256. uint &PlayerFlags(void)
  257. void QuietNoiseAlert(void)
  258. void LoudNoiseAlert(void)
  259.  
  260. kAI
  261. uint &AIFlags(void)
  262.  
  263. EnumAnimStateFlags
  264. ANF_BLEND = 1
  265. ANF_LOOP = 2
  266. ANF_STOPPED = 4
  267. ANF_NOINTERRUPT = 8
  268. ANF_ROOTMOTION = 16
  269. ANF_PAUSED = 32
  270. ANF_CYCLECOMPLETED = 64
  271. ANF_LINEARBLEND = 128
  272.  
  273. EnumActorFlags
  274. AF_SOLID = (1 << 0) // can be collided
  275. AF_DORMANT = (1 << 1) // if on then is asleep (won't be updated onTick) else is awake
  276. AF_SNAPTOFLOOR = (1 << 2) // adjust z-axis to floor on spawn
  277. AF_CLIMBWALLS = (1 << 3) // allows entering of wall sectors
  278. AF_WOUNDEDMORTALLY = (1 << 4) // special case for spawning special items
  279. AF_CASTSHADOW = (1 << 5) //
  280. AF_TRIGGERSTUFF = (1 << 6) // allow triggering of event sectors
  281. AF_HIDDEN = (1 << 7) // don't draw but continue updating. can't be collided
  282. AF_ACTIVATED = (1 << 8) // was triggered
  283. AF_DISABLED = (1 << 9) // don't update animations
  284. AF_ENTEREDAREAEVENT = (1 << 10) // just entered a trigger sector
  285. AF_REMOVEONCOMPLETION = (1 << 11) // remove after finishing a special animation
  286. AF_NOBLOOD = (1 << 12) //
  287. AF_AVOIDWATER = (1 << 13) // clip against edges linking to water sectors
  288. AF_FLOATINWATERONDEATH = (1 << 14) // rise to the surface while dead
  289. AF_DEAD = (1 << 15) // actor is dead
  290. AF_STATIONARY = (1 << 16) // sniper
  291. AF_ALIGNTOFLOOR = (1 << 17) // rotate along slopes
  292. AF_NODRAW = (1 << 18) //
  293. AF_NONSHOOTABLE = (1 << 19) //
  294. AF_FULLVOLUME = (1 << 20) // all sounds coming from this actor will be heard at full volume
  295. AF_CANBETOUCHED = (1 << 21) // allow invoking the OnTouch callback
  296. AF_IGNORESOUNDEVENTS = (1 << 22)
  297. AF_TRIGGERANIMATION = (1 << 23) // play special animation on trigger/spawn
  298. AF_HOLDTRIGGERANIM = (1 << 24) // pause special animation until triggered (is also invincible)
  299. AF_TRIGGERNAIMDELAY = (1 << 25) // delay a bit before starting special animation
  300. AF_STAYINWATER = (1 << 26) // can't exit water sectors
  301. AF_ALWAYSACTIVE = (1 << 27) // never sleep or go dormant
  302. AF_COLLIDEDWITHWALL = (1 << 28) // collided with an edge. cleared at every OnTick call
  303. AF_INVINCIBLE = (1 << 29) //OnDamage and OnDeath are never called
  304. AF_ALLOWTINYENEMYCHEAT = (1 << 30)
  305. AF_NOMOVEMENT = (1 << 31) // will not do collision movement
  306.  
  307. EnumPlayerFlags
  308. PF_NOCLIP = 1
  309. PF_FLY = 2
  310. PF_DEAD = 4
  311. PF_GOD = 8
  312. PF_JUMPING = 16
  313. PF_HASJUMPED = 32
  314. PF_INWARPAREA = 64
  315. PF_CLIMBTHRUST = 128
  316. PF_NOAIRFRICTION = 256
  317. PF_CRAWLING = 512
  318. PF_PREVENTDEATHCAM = 1024
  319. PF_FIREDPROJECTILE = 2048
  320. PF_DEATHPITFALL = 4096
  321.  
  322. EnumAIFlags
  323. AIF_ATTACKING = (1 << 0), //Already defined // playing an attacking animation
  324. AIF_WASSOLID = (1 << 1), //Already defined
  325. AIF_FIRSTATTACK = (1 << 2),
  326. AIF_HEARDLOUDNOISE = (1 << 3),
  327. AIF_BLOWNAWAY = (1 << 4), //Already defined // being blown away by explosion
  328. AIF_GOBACKTOLEASH = (1 << 5),
  329. AIF_RESURRECT = (1 << 6),
  330. AIF_FEIGNDEATH = (1 << 7),
  331. AIF_REGENERATE = (1 << 8),
  332. AIF_SEETARGET = (1 << 9),
  333. AIF_NOCHASE = (1 << 10), //Already defined // disable chase logic
  334. AIF_REGENERATEANIM = (1 << 11),
  335. AIF_NOTHINK = (1 << 12), //Already defined // don't run ai logic
  336. AIF_RUNNING = (1 << 13), //Already defined // Is playing running animation
  337. AIF_GETATTENTION = (1 << 14),
  338. AIF_REGENANIMDELAY = (1 << 15),
  339. AIF_HEARDQUIETNOISE = (1 << 16),
  340. AIF_AWAYFROMLEASH = (1 << 17),
  341. AIF_TELEPORTAWAY = (1 << 18), // playing teleport out animation
  342. AIF_TELEPORTMOVESLOW = (1 << 19), // chasing while underground
  343. AIF_TELEPORTING = (1 << 20), //Already defined // in teleport state. ignore all chase logic
  344. AIF_TELEPORTIN = (1 << 21), // playing teleport in animation
  345. AIF_WAITFORCYCLE = (1 << 22), // prevent other animations from interrupting until the current one finishes
  346. AIF_DAMAGEPANIC = (1 << 23) // become aggressive when target is outside it's active threshold (good for forcing AI to attack their target)
  347.  
  348. EnumImpactType
  349. IT_DEFAULT
  350. IT_WATER
  351. IT_METAL
  352. IT_STONE
  353. IT_FLESH_HUMAN
  354. IT_FLESH_CREATURE
  355. IT_FLESH_UNDEAD //AKA IT_FLESH_WATER
  356. IT_LAVA
  357. IT_SLIME
  358. IT_FORCEFIELD
  359.  
  360. kDict
  361. void Add(const kStr &in, const kStr &in)
  362. void Empty(void)
  363. void SetValue(const kStr &in, const kStr &in)
  364. const bool HasKey(const kStr &in)
  365. bool GetFloat(const kStr &in, float &out, const float defaultValue = 0)
  366. bool GetInt(const kStr &in, int &out, const int defaultValue = 0)
  367. bool GetBool(const kStr &in, bool &out, const bool defaultValue = false)
  368. bool GetString(const kStr &in, kStr &out)
  369. bool GetVector(const kStr &in, kVec3 &out)
  370.  
  371. kDictMem
  372. bool GetFloat(const kStr &in, float &out, const float defaultValue = 0)
  373. bool GetInt(const kStr &in, int &out, const int defaultValue = 0)
  374. bool GetBool(const kStr &in, bool &out, const bool defaultValue = false)
  375. bool GetString(const kStr &in, kStr &out)
  376. bool GetVector(const kStr &in, kVec3 &out)
  377.  
  378. kSelectionListInt
  379. void AddItem(int item, const int weight)
  380. int& Select(const bool useSystemRand = false)
  381. void Reset(void)
  382. const uint GetNumEntries(void)
  383. &opAssign(const kSelectionListInt &in otherSelectionListInt)
  384.  
  385. kSelectionListFloat
  386. &opAssign(const kSelectionListFloat &in otherSelectionListFloat)
  387.  
  388. GameVariables
  389. void GetInt(const kStr &in, int &out, int defaultValue = 0);
  390. void GetFloat(const kStr &in, float &out, float defaultValue = 0.0f);
  391. void GetBool(const kStr &in, bool &out, bool defaultValue = false);
  392. void GetVector(const kStr &in, kVec3 &out);
  393. void SetValue(const kStr &in, const kStr &in);
  394.  
  395. Game
  396. void StartTimer(void)
  397. void StopTimer(void)
  398. void RemoveTimer(void)
  399. void CallDelayedMapScript(const kStr &in funcName, kActor @instigator, const float delay)
  400. void CallDelayedMapScript(const int scriptID, kActor @instigator, const float delay)
  401. void HaltMapScript(const int scriptID)
  402. void PlayMusic(const kStr &in path, const bool loop)
  403. void StopMusic(void)
  404. void Restart(void)
  405. void PrintLine(const kStr &in text, const int lineNumber, const int visibleFrameTime = 120)
  406. void PrintHelp(const kStr &in localizedKey, const bool endGame = false)
  407. void ChangeMap(const kStr &in path)
  408. void ShowMainMenu(void)
  409. const int GetMapNumberFromName(const kStr &in mapName)
  410. const int GetCurrentMapID(void)
  411. const int GetDifficulty(void) //calls gameVariables.GetInt("g_difficulty")
  412. bool GetHubKeyInfo(const uint hubID, int &out nKeys, int &out remainingKeys, int &out keyBits)
  413. void SpawnFx(const kStr &in fxPath, kActor@ source, const kVec3 &in velocity, const kVec3 &in origin, const kQuat &in rotation)
  414. void SpawnFx(const kStr &in fxPath, kPuppet@ source, const kVec3 &in velocity, const kVec3 &in origin, const kQuat &in rotation)
  415. void SpawnFx(const kStr &in fxPath, kActor@ source, const kVec3 &in origin, const kQuat &in rotation)
  416. void SpawnFx(const kStr &in fxPath, kPuppet@ source, const kVec3 &in origin, const kQuat &in rotation)
  417. void SpawnFx(const kStr &in fxPath, kActor@ source, const kVec3 &in origin, const float yaw, const float pitch)
  418. void SpawnFx(const kStr &in fxPath, kPuppet@ source, const kVec3 &in origin, const float yaw, const float pitch)
  419. void SpawnFx(const kStr &in fxPath, const kVec3 &in origin, const int sectorIndex)
  420. kStr GetLocalizedText(const kStr &in key)
  421.  
  422. ActorFactory
  423. kActor@ Spawn(const int actorID, const float x, const float y, const float z, const float yaw, const int sector = -1)
  424. kActor@ Spawn(const kStr &in actorName, const float x, const float y, const float z, const float yaw, const int sector = -1)
  425.  
  426. PlayLoop
  427. const int Ticks(void)
  428. const void TagActorForBossBar(kActor@ actor)
  429. void RemoveBossActor(void)
  430. void CheckKeys(void)
  431. void StartWarp(kActor@, const int tagID, const int mapID)
  432. void StartFreeWarp(kActor@, const kVec3 &in origin, const float yaw, const int sectorID, const int mapID)
  433. void HandlePlayerDeath(const bool loseLife = true)
  434.  
  435. Player
  436. const uint16 Buttons(void)
  437. const kPuppet @Actor(void)
  438. void ConsumeAmmo(const int ammo)
  439. const int GetAmmo(const int weaponID)
  440. const int GetAltAmmo(const int weaponID)
  441. const bool HasAmmo(const int weaponID)
  442. const bool HasAltAmmo(const int weaponID)
  443. const bool HasAltAmmo(void)
  444. const bool HasWeapon(const int weaponID)
  445. const int CurrentWeapon(void)
  446. const bool GiveWeapon(const int weaponID, const int ammo) // returns true if gave ammo else returns false because already has full primary ammo
  447. void Lock(void)
  448. void Unlock(void)
  449. int16 &Armor(void)
  450. void Victory(const int warpActorID = -1, const int mapID = -1)
  451. const bool Locked(void)
  452. const kPlayer &Owner(void)
  453.  
  454. Global Constants
  455. const float GAME_DELTA_TIME
  456. const float GAME_SCALE
  457. const float GAME_FRAME_TIME
  458. const float GAME_FRAME_UNIT
  459. const float GAME_SECONDS
  460.  
  461. Camera
  462. void StartCinematic(const uint EnumCameraFlags = 12)
  463. void StopCinematic(void)
  464. const int CinematicState(void)
  465. //0 = not in cinema
  466. //1 = fading out from player to start cinema
  467. //2 = fading in cinema
  468. //3 = playing cinema
  469. //4 = fading out cinema
  470. //5 = Fading in from cinema to player
  471. //6 = Resumng Game to player
  472. const void SetLookAtActor(kActor@ actor)
  473. void ClearLookAtActor(void)
  474. void SetRotateEyeVector(const kVec3 &in vector)
  475. void SetFinalView(const int view) //view must be un range 0..2
  476. void SetRotationTrack(const int trackID, const float startAngle, const float destAngle, const float startDistance, const float destDistance,
  477. const float startHeight = 0, const float destHeight = 0, const float startLookHeight = 0, const float destLookHeight = 0)
  478. void SetPositionTrack(const int trackID, const kVec3 &in startMovePoint, const kVec3 &in endMovePoint, const kVec3 &in startLookPoint, const kVec3 &in endLookPoint)
  479. void TweenPositionTrack(const int trackID, const float time)
  480. void TweenRotationTrack(const int trackID, const kVec3 &in, const float time)
  481. void AutoPlayPositionTrack(const int trackID, const float time, const int EnumCameraLerpType)
  482. void AutoPlayRotationTrack(const int trackID, const float time, const int EnumCameraLerpType)
  483. void AutoPlayBlendTrack(const int trackID, const int blendTrack1ID, const int blendTrack2ID, const float time, const int EnumCameraLerpType)
  484. void SetEyeView(const kVec3 &in position)
  485. void SetFocusView(const kVec3 &in position)
  486. void ZoomEyeViewToPosition(const kVec3 &in position, const float speed)
  487. void ZoomFocusViewToPosition(const kVec3 &in position, const float speed)
  488. kVec3 GetEyeView(void)
  489. kVec3 GetFocusView(void)
  490. void ClearFinalView(void)
  491. void ClearViewTracks(void)
  492. const bool UserInterrupted(void)
  493. const bool Active(void)
  494. const bool ViewingFromCamera(void)
  495. const kVec3 &Tremor(void)
  496. kVec3 origin
  497. kAngle yaw
  498. kAngle pitch
  499. kAngle roll
  500. float fov
  501. float lookZOffset
  502.  
  503. World
  504. kActor @GetActorByTID(const int tagID, const int typeFilter = -1) //if typeFilter is -1 checks any type otherwise only returns the actor of that type
  505. const bool TriggerActorsByTID(kActor@ typeFilter, const int tagID)
  506. void ChangeAreaFlag(const int areaID, const uint EnumAreaFlags, const bool active) //DO NOT USE
  507. void FloodFillAreaFlags(const int sectorIndex, const uint areaFlags, const bool active) //DO NOT USE
  508. void FloodFillAreaFlags(const kVec3 &in origin, const uint areaFlags, const bool active) //use this or
  509. void FloodMatchingAreaFlags(const int sectorIndex, const uint areaFlags, const bool active) //use this
  510. const uint GetAreaFlags(const int areaID)
  511. const void ChangeAreaWaterHeight(const int areaID, const float height)
  512. const int16 GetAreaArg(const int areaID, const int arg)
  513. const void ChangeAreaArg(const int areaID, const int arg, const int16 value)
  514. // though args can be used for anything, they are typically used in this fashion:
  515. //
  516. // 0: warp ID
  517. // 1: warp level ID or trigger sound ID
  518. // 2: checkpoint ID
  519. // 3: tag ID
  520. // 4: floor damage hit points
  521. // 5: floor damage rate
  522. void ChangeSectorHeight(const int sector, const float height)
  523.  
  524. kCModel
  525. kVec3 &InterceptVector(void) - Returns the vector that intersected the collided geometry
  526. kVec3 &ContactNormal(void) - Returns the normalized vector of the collided surface
  527. const float &Fraction(void) - returns the 0.0 - 1.0 range of the point of intersection from start to end trace. (If fraction is == 1.0 then no intersection occured.)
  528. const uint ClipResult(void) - specifies the type of intersection (flags)
  529. kActor @ContactActor(void) - handle pointer to actor that was collided (null if none was collided)
  530.  
  531. The kCModel(CModel) global stores collision results when certain actor methods are called. Those methods are as follows:
  532. GetSectorIndexAtLocation
  533. const bool CanSee(kActor@, const uint = 0)
  534. MoveToPosition
  535. SpawnProjectile
  536. bool CheckPosition(const kVec3 &in)
  537.  
  538. enum ClipResultFlags
  539. CRF_NOCOLLISION = 0,
  540. CRF_FLOOR = (1<<0), // made contact with a floor
  541. CRF_CEILING = (1<<1), // made contact with a ceiling
  542. CRF_WALL = (1<<2), // made contact with an edge (sector edge that isn't linked to another sector)
  543. CRF_OBJECT = (1<<3), // made contact with an actor
  544. CRF_MESH = (1<<4), // made contact with a static object
  545. CRF_ADJUST = (1<<5), // z-axis was adjusted (ceiling or floor)
  546. CRF_WALLRADIUS = (1<<6) // made contact with an edge during the wall radius collision test
  547.  
  548. EnumPlayerButtons
  549. BC_ATTACK
  550. BC_JUMP
  551. BC_FORWARD
  552. BC_BACKWARD
  553. BC_STRAFELEFT
  554. BC_STRAFERIGHT
  555. BC_WEAPONRIGHT
  556. BC_WEAPONLEFT
  557. BC_MAPZOOMIN
  558. BC_MAPZOOMOUT
  559.  
  560. EnumDifficulty
  561. DIFFICULTY_EASY
  562. DIFFICULTY_NORMAL
  563. DIFFICULTY_HARD
  564. DIFFICULTY_HARDCORE
  565.  
  566. EnumClipFlags
  567. CF_CLIPEDGES = (1 << 0) // clip movement against edges that don't link to sectors
  568. CF_IGNOREBLOCKERS = (1 << 1) // don't clip edges belonging to blocking sectors
  569. CF_DROPOFF = (1 << 2) // allows passing through platforms or ledges
  570. CF_NOENTERWATER = (1 << 3) // block all edges that links to a water sector
  571. CF_NOEXITWATER = (1 << 4) // block all edges that links to a non-water sector
  572. CF_NOCLIPSTATICS = (1 << 5) // don't collide with static models
  573. CF_NOCLIPACTORS = (1 << 6) // don't collide with dynamic objects/actors
  574. CF_WALKWALLS = (1 << 7) // don't restrict movement to steep slopes
  575. CF_COLLIDEFLOORS = (1 << 8) // project and clip movement against non-flat floors
  576. CF_HITSCAN = (1 << 9) // performs a single-pass trace. useful for hitscans
  577. CF_ALLOWCLIMB = (1 << 10) // collide with sectors flagged as climbable
  578. CF_ALLOWCRAWL = (1 << 11) // collide with sectors flagged as crawlable
  579. CF_NOSTEPDOWN = (1 << 12) // don't clamp z-axis when walking down slopes
  580. CF_NOSLOPESTEP = (1 << 13) // don't project z-axis movement along slopes
  581. CF_COLLIDEHEIGHT = (1 << 14) // clip against ceilings
  582. CF_COLLIDECORPSES = (1 << 15) // clip against actors flagged as dead
  583. CF_NOEXITWALLS = (1 << 16) // clip all edges, regardless if they link to another sector or not
  584. CF_NOCOLLIDEFUNC = (1 << 17) // don't invoke the OnCollide callback on the moving object
  585. CF_NOFLOORADJUST = (1 << 18) // don't keep z-axis above floor plane
  586. CF_NOCEILINGADJUST = (1 << 19) // don't keep z-axis below ceiling plane
  587. CF_COLLIDEWATER = (1 << 20) // clip movement against the water surface
  588. CF_USEWALLRADIUS = (1 << 21) // clip and project movement away from walls based on wall radius
  589. CF_NOCLIPTARGETACTORS = (1 << 22) // don't clip actors that are targeted by moving object
  590. CF_COLLIDETRIGGERS = (1 << 23) // block edges belonging to a trigger
  591. CF_STANDONOBJECTS = (1 << 24) // allow vertical clipping of objects
  592. CF_GREASESLIDEOBJECTS = (1 << 25) // always keep movement projected away from collided objects
  593. CF_ALLOWRESTRICTEDAREAS = (1 << 26) // don't collide with edges belonging to a restricted sector
  594. CF_COLLIDECLIFFS = (1 << 27) // collide with non-walkable floors
  595. CF_CHECKLINKEDBRIDGES = (1 << 28) // do extensive checks against overlapping bridge sectors
  596. CF_POLYCOLLISION = (1 << 29) // clip movement against all model polygons of an object
  597.  
  598. EnumWaterLevel
  599. WLT_INVALID - Not in water area
  600. WLT_OVER - in water area and over the water height
  601. WLT_BETWEEN - in water area and floating above the water
  602. WLT_UNDER - in water area and under the water height
  603.  
  604. EnumCameraLerpType
  605. CMLT_NONE
  606. CMLT_LINEAR
  607. CMLT_LINEARLOOP
  608. CMLT_COSINE
  609. CMLT_COSINE_POW
  610.  
  611. EnumCameraFlags
  612. CMF_NO_INITIAL_FADEOUT = 1 << 0
  613. CMF_NO_LETTERBOX = 1 << 1
  614. CMF_LOCK_PLAYER = 1 << 2
  615. CMF_UNLOCK_PLAYER_ON_FINISH = 1 << 3
  616. CMF_INITIAL_FADEIN = 1 << 4
  617. CMF_SHOW_CREDITS = 1 << 5
  618. CMF_CHANGE_MAP_AFTER_FADE = 1 << 6
  619. CMF_SHOW_HIDDEN_OBJECTS = 1 << 7
  620.  
  621. uint EnumAreaFlags
  622. AAF_WATER = 1 << 0
  623. AAF_BLOCK = 1 << 1
  624. AAF_TOGGLE = 1 << 2
  625. AAF_CLIFF = 1 << 3
  626. AAF_CLIMB = 1 << 4
  627. AAF_ONESIDED = 1 << 5 //Bridge
  628. AAF_CEILING = 1 << 6
  629. AAF_CRAWL = 1 << 7
  630. AAF_ENTERCRAWL = 1 << 8
  631. AAF_HIDDEN = 1 << 9
  632. AAF_ENTERED = 1 << 10 //Not shown in Editor
  633. AAF_SECRET = 1 << 11 //not defined
  634. AAF_RESTRICTED = 1 << 12
  635. AAF_SLOPETEST = 1 << 13
  636. AAF_DEATHPIT = 1 << 14
  637. AAF_MAPPED = 1 << 15
  638. AAF_EVENT = 1 << 16
  639. AAF_REPEATABLE = 1 << 17
  640. AAF_TELEPORT = 1 << 18
  641. AAF_DAMAGE = 1 << 19
  642. AAF_DRAWSKY = 1 << 20
  643. AAF_TELEPORTAIR = 1 << 21
  644. AAF_LAVA = 1 << 22
  645. AAF_EVENTSOUND = 1 << 23
  646. AAF_ANTIGRAVITY = 1 << 24
  647. AAF_LADDER = 1 << 25
  648. AAF_CHECKPOINT = 1 << 26
  649. AAF_SAVEGAME = 1 << 27
  650. AAF_WARPRETURN = 1 << 28
  651. AAF_SHALLOWWATER = 1 << 29
  652. AAF_DRAWSUN = 1 << 30
  653. AAF_STOREWARPRETURN = uint(1 << 31) //not defined. Make it const uint instead of an enum which is always an int. Can also use 2147483648 or 0x80000000
  654.  
  655.  
  656. Math
  657. float Sin(float)
  658. float Cos(float)
  659. float Tan(float)
  660. float ATan2(float, float)
  661. float Fabs(float)
  662. float ACos(float)
  663. float Sqrt(float)
  664. int Abs(int)
  665. float Ceil(float)
  666. float Floor(float)
  667. float Log(float)
  668. float Pow(float, float)
  669. float Deg2Rad(float)
  670. float Rad2Deg(float)
  671. float InvSqrt(float)
  672. float IncMax(const float val, const float inc, const float dest) //returns val + inc and never goes above or below dest value
  673. int SysRand(void)
  674. int Rand(void)
  675. uint8 RandByte(void)
  676. int RandMax(const int) //exculsive
  677. float NLerp(const float, const float, const float)
  678. float RandFloat(void)
  679. float RandCFloat(void)
  680. float RandRange(const float, const float)
  681. void Clamp(float &out, const float, const float)
  682. float Lerp(float start, const float end, const float time)
  683. float CosTween(const float)
  684. float CosArc(const float)
  685. float pi
  686. kVec3 vecZero
  687.  
  688. kVec3
  689. void Contructor(float x, float y, float z)
  690. void Contructor(const kVec3 &in)
  691. kVec3 &Normalize(void)
  692. kVec3 Cross(const kVec3 &in)
  693. const float Dot(const kVec3 &in)
  694. const float Unit(void)
  695. const float UnitSq(void)
  696. const float Distance(const kVec3 &in)
  697. const float DistanceSq(const kVec3 &in)
  698. const kStr ToString(void)
  699. float ToYaw(void)
  700. float ToPitch(void)
  701. void Clear(void)
  702. void Set(const float, const float, const float)
  703. kVec3 Lerp(const kVec3 &in, const float)
  704. const kVec3 &Lerp(const kVec3 &in, const float)
  705. kVec3 &Randomize(const float)
  706. kVec3 &CubicCurve(const kVec3 &in end, const float time, const kVec3 &in point)
  707. kVec3 &QuadraticCurve(const kVec3 &in end, const float time, const kVec3 &in point1, const kVec3 &in point2)
  708. kVec3 opAdd(const kVec3 &in)
  709. kVec3 &opAddAssign(const kVec3 &in)
  710. kVec3 opNeg(void)
  711. kVec3 opSub(const kVec3 &in)
  712. kVec3 &opSubAssign(const kVec3 &in)
  713. kVec3 opMul(const kVec3 &in)
  714. kVec3 opMul(const float val)
  715. kVec3 &opMulAssign(const kVec3 &in)
  716. kVec3 &opMulAssign(const float)
  717. kVec3 opDiv(const kVec3 &in)
  718. kVec3 opDiv(const float val)
  719. kVec3 &opDivAssign(const kVec3 &in)
  720. kVec3 &opAssign(const kVec3 &in)
  721. float opIndex(uint)
  722. const float opIndex(uint)
  723. float x
  724. float y
  725. float z
  726.  
  727. kQuat
  728. void Contructor(float x, float y, float z, float w)
  729. void Contructor(float w, kVec3 &in)
  730. void Contructor(const kQuat &in)
  731. kQuat &Normalize(void)
  732. kQuat opAdd(const kQuat &in)
  733. kQuat opSub(const kQuat &in)
  734. kQuat opMul(const kQuat &in)
  735. kQuat &opAssign(const kQuat &in)
  736. kVec3 opMul(const kQuat &in)
  737. kVec3 &opMulAssign(const kQuat &in)
  738. kQuat ToQuaternion(void)
  739. float w
  740. kQuat ToQuat(void)
  741.  
  742. kAngle
  743. void Contructor(float)
  744. void Contructor(const kAngle &in)
  745. float Diff(const float)
  746. float Diff(const kAngle &in)
  747. float Interpolate(const float, const float)
  748. kAngle opAdd(const float)
  749. const kAngle &opAddAssign(const float)
  750. kAngle opSub(const float)
  751. const kAngle &opSubAssign(const float)
  752. kAngle opAdd(const kAngle &in)
  753. const kAngle &opAddAssign(const kAngle &in)
  754. kAngle opSub(const kAngle &in)
  755. const kAngle &opSubAssign(kAngle &in)
  756. kAngle &opAssign(const float)
  757. kAngle &opAssign(const kAngle &in)
  758. kAngle opNeg(void)
  759. const float opImplConv(void)
  760.  
  761. kStr
  762. void Contructor(const kStr &in str)
  763. const int IndexOf(const kStr &in pattern)
  764. const uint Hash(void)
  765. int Atoi(void)
  766. float Atof(void)
  767. kStr &ToUpper(void)
  768. kStr &ToLower(void)
  769. int8 opIndex(const int)
  770. bool opEquals(const kStr& in)
  771. kStr &opAssign(const kStr &in)
  772. kStr opAdd(bool)
  773. kStr opAdd(int)
  774. kStr opAdd(float)
  775. kStr opAdd(const kStr &in)
  776. kStr &opAddAssign(const kStr &in)
  777. kStr &opAddAssign(bool)
  778.  
  779. Sys
  780. void Print(const kStr &in message)
  781. void Warning(const kStr &in message)
  782. int VideoWidth(void)
  783. int VideoHeight(void)
  784. int Mouse_X(void)
  785. int Mouse_Y(void)
  786. const bool GetCvarValue(const kStr &in cvarName, kStr &out result)
Add Comment
Please, Sign In to add comment