View ScriptAPI Page
Download t1_scriptAPI.cpp
How to setup Angelscript IDE Codelite
T1_json2modbin.py: Python script to convert a json dictionary to a Turok 1 mod data file that can be used in scripting with Game.LoadModDataFile
.ctor <-- (actor properties from def are assigned here and Origin, Yaw and SectorIndex are set here) --- OnSpawn OnBeginLevel <--- (ALL actor properties from map are not setup until this point) OnRestore *Map Script 0 <--- (Called on PlayLoop tick 0) OnPostBeginLevel (*Note: Any spawned actor created after each of these events will not be called for that spawned actor. If spawned before/during then it will/might be called.) --- OnSleep OnWake OnTouch <--- called even if alseep OnCollide <--- called even if alseep OnTick <--- called only when awake --- OnMenuTick <--- called only when dummymenu active --- OnRemoved <--- called when actor is removed (Internally or through scripting). IsStale will return true immediately after this. --- OnActivate <--- called immediately after World.TriggerActorsByTID and when player enters event sector area only if AF_ACTIVATED is Off --- OnPreDamage <--- always called when damaged even after death. Call OverrideOnDamageValue on the actor if you need to override the damage value to prevent death. OnDeath <--- called only when actor dies (health > 0 and health - dmg <= 0). The actors Target TID is automatically used to trigger actors at this point. OnDamage <--- always called when damaged even after death. Health is reduced after this by dmg only if health was greater than 0 --- OnEndLevel <--- called when map unloads
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 Default Scripts 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
--Grunts-- Alt Stance is for holding two handed weapons Has Strong(anim_aiMelee1) and Weak(anim_aiAltMelee1) Melee Attacks Projectile Attack 1 = Shaman Wand Throw Fast Fireball (anim_aiRangeAttack1) Projectile Attack 2 = Pistol Fire (anim_aiRangeAttack2) Projectile Attack 3 = crouch rifle Fire (anim_aiRangeAttack7) Projectile Attack 4 = Nothing (anim_aiRangeAttack8) Projectile Attack 5 = Stand Rifle Fire (anim_aiRangeAttack5) Projectile Attack 6 = Pipe Blow (anim_aiRangeAttack6) Projectile Attack 7 = Grenade Throw (anim_aiRangeAttack3) Projectile Attack 8 = High Priest Homing Blue Flame (anim_aiRangeAttack4) Projectile Attack 9 = chest hadoken (anim_aiRangeAttack9) Projectile Attack 10 = Shaman Lightning Hands in Air (anim_aiRangeAttack10) --Raptor-- No Alt Stance Has Only Strong Melee Attacks Projectile Attack 1 = Plasma Shot (anim_aiRangeAttack1) --Purlin-- No Alt Stance Has Only Strong Melee Attacks Projectile Attack 1 = Fire Wrist Gun (anim_aiRangeAttack1) Projectile Attack 2 = Jump Smash (anim_aiRangeAttack2) Projectile Attack 7 = Ground Wave Smash (anim_aiRangeAttack3) --Stalker/Leaper-- No Alt Stance Has Only Strong Melee Attacks Projectile Attack 1 = Leap forward (anim_aiRangeAttack1) --Alien-- No Alt Stance Has Only Strong Melee Attacks Projectile Attack 1 = Fire Right Hand (anim_aiRangeAttack1) Projectile Attack 2 = Fire Left Hand (anim_aiRangeAttack2) --Beetle-- No Alt Stance Has Only Strong Melee Attacks Projectile Attack 1 = Leap forward (anim_aiRangeAttack1) --Crab-- No Alt Stance Has Strong and Weak Melee Attacks --Dinosaur-- No Alt Stance Has Only Strong Melee Attacks Projectile Attack 1 = Shoot Guns (anim_aiRangeAttack1) --Dragon Fly / Insect Flying-- No Alt Stance Has No Melee Attacks The Standing and Running Animations do damage attacks --Killer Plant-- No Alt Stance Has Only Strong Melee Attacks Projectile Attack 1 = Shoot (anim_aiRangeAttack1) --Mech-- No Alt Stance Has Only Strong Melee Attacks Projectile Attack 1 = Missle (anim_aiRangeAttack1) Projectile Attack 2 = Machine Gun (anim_aiRangeAttack2) --Rider-- No Alt Stance Has Only Strong Melee Attacks Projectile Attack 1 = Missle Fire (anim_aiRangeAttack1) Projectile Attack 7 = Rifle Fire (anim_aiRangeAttack3) --Sandworm-- No Alt Stance Has Only Strong Melee Attacks Projectile Attack 1 = Acid Spit (anim_aiRangeAttack1) --Turret-- No Alt Stance Has No Melee Attacks Projectile Attack 1 = Fire (anim_aiRangeAttack1)
Note: Time increases by GAME_FRAME_TIME (0.25f) every tick and is effected by the current GameSpeed. $idle // Does nothing and processes the next command $wait (time) // float time $random_wait (minTime, maxTime) // float minTime, maxTime. $trans (alpha) // float alpha 0..255. Sets object alpha (if material supports alpha) $fade_trans (alpha, time) // float alpha 0..255. float time. Lerps from current trans to new trans value. $color ({r g b}, brightness) // int rgb 0..255, float brightness 0..255 (rgb * brightness) $fade_color ({r g b}, brightness, time) // int rgb 0..255, float brightness 0..255 (rgb * brightness), float time. Lerps from current rgb/brightness to new rgb/brightness values. $scale ({x, y, z}, scaleTime) // float x, y, z. float scaleTime is unused, just always set to 255.0. Sets actors to scale. $fade_scale ({x, y, z}, scaleTime, time) // float x, y, z. float scaleTime is unused, just always set to 255.0. float time. Lerps from current scale to new scale. $play_sound (ID) // Play a sound by ID $repeat // Starts back at processing the first command again. $action (ID, {x y z w}) // Calls a script animation function by ID with x,y,z,w values passed into the function.
filter linear // Sets texture filter to linear (default = nearest) filter nearest // Sets texture filter to nearest (default = nearest) texture "fonts/bigfont.png" // path to font texture atlas. (default = kex default checker texture) padwidth 1.0 // Adds this amount to each characters width (default = 0.0) scale 1.0 // (default = 1.0) unicode // (default = ascii) noaccentoffset // Disables the y offset for accent characters. (default = draw accent characters with a y offset) // Hardcoded character accent y offsets: // 224-228 (offset 11) // 232-235 (offset 13) // 236-239 (offset 12) // 242-246 (offset 11) // 246 (offset 13) // 249-252 (offset 13) // 253 (offset 11) mapchar { // char x y width height O (draw top offset) // Leave a comment if you want but don't end any comment line with a backslash ( \ ) or the text preprocessor will think it's a line continuation and you'll have problems 48 0 0 24 32 0 // zero character }
sounds[1] = //number of sounds in this shader { { wavefile = "sounds/waves/talset/ashamed.wav" // the sound file path bOneInstancePerSource = 0 // if sound has a source then this can only be played if this sound is not being played. bLoop = 0 // loops the sound when it plays bEnableVolumeEnvelope = 0 // enable the volume_envelope lerp bEnablePitchEnvelope = 0 // enable the pitch_envelope lerp bFadeIfObstructed = 0 // on every other tick, if the sound has a source and CanSee player then keeps volume at normal, if can't see the player then fades out the volume. bUpdateNoEnvelope = 0 // NOT USED bLinkToEnvelope = 0 // NOT USED bFullVolume = 0 // always play sound at maximum volume with no positioning delay = 0 // delay time (in ticks) before will start playing the sound priority = 80 // when 64 sounds are being played, higher priority sounds will stop lower priority sounds in order to play. If there are no sounds it can override then will not play the sound. random = 1.000000 // if not 1: if playloop ticks bit 1 is set then won't play, OR if random value from 0.0 to 1.0 >= random then won't play. radioVolume = 2 // 0: dist = (GAME_SCALE * 200) * 0.75f, volume * 0.8f // 1 or any other value: dist = (GAME_SCALE * 200), volume * 1.0f // 2: dist = (GAME_SCALE * 200) * 1.2f, volume * 1.5f // 3: dist = (GAME_SCALE * 200) * 2.0f, volume * 1.5f volume_envelope = { max = 1.000000 // how much to scale the volume by (even if bEnableVolumeEnvelope is 0). Default is 1.0 if you don't include this. start = 1.000000 // lerp from end = 1.000000 // lerp to duration = 60 // lerp time envStartTime = 0 // Delay time (in ticks) before the volume will lerp from the start to the end value. } pitch_envelope = { max = 1.000000 // is always starting pitch value (even if bEnablePitchEnvelope is 0). Default is 1.0 if you don't include this. start = 1.000000 // lerp from end = 1.000000 // lerp to duration = 60 // lerp time envStartTime = 0 // Delay time (in ticks) before the pitch will lerp from the start to the end value. } } }
Float: player.groundForwardSpeed // Get and Set all these player variables using the kPuppet functions instead. player.groundBackwardSpeed player.groundStrafeSpeed player.groundForwardAccel player.groundBackwardAccel player.groundStrafeAccel player.groundDeaccel player.swimForwardSpeed player.swimBackwardSpeed player.swimStrafeSpeed player.swimForwardAccel player.swimBackwardAccel player.swimStrafeAccel player.swimDeaccel player.jumpMinSpeed player.jumpMaxSpeed player.jumpClimbSpeed Int: g_difficulty // Use Game.GetDifficulty or Game.SetDifficulty instead. g_startmap // The map to start on when starting a new game g_restartmap // The map to go to when restart game is called g_trainingmap // The map to go to when starting training or time trial g_creditsmap // The map to go to when starting the credits g_gallerymap // The map to go to when entering the gallery g_hubmapid // The map to go to when using the all keys cheat g_hubwarptid // The warp TID to warp to when using the all keys cheat chronoPieceFlags // Each bit indicates if that chrono piece has been picked up. Important: This key must be added through the scripts! player.overrideShadow // Get: Player.Actor().OverrideShadow() Set: Player.Actor().SetOverrideShadow(); 0=none, 1=Force Disable shadow, 2=Force Enable shadow player.overrideWalkRun // Get: Player.Actor().OverrideWalkRun() Set: Player.Actor().SetOverrideWalkRun(); 0=none, 1=Force Disable Walk OverrideFogType // Set: Game.OverrideFogType(); Get: GameVariables.GetInt("OverrideFogType", result); 0=none, 1=force Radial, 2=force Plane OverridePerPolyCollision // Set: Game.OverridePerPolyCollision(); Get: GameVariables.GetInt("OverridePerPolyCollision", result); 0=none, 1=force disable, 2=force enable ConfirmMenuResult // Get: GameVariables.GetInt("ConfirmMenuResult", result); Set: GameVariables.SetValue("ConfirmMenuResult", "0"); g_loadedgame // Check OnBeginLevel. value is the save slot from 1 to 16. any other value is game was not loaded. Is set to 0 after Map Script 0 is called. Bool: g_newgame // is set to 1 when starting a newgame. Check OnBeginLevel. g_resetboss // is set to 1 when warping to the boss using the warp boss cheats. This sets them to their initial state. Is set back to 0 after OnPostBeginLevel is called. g_timetrial // is set to 1 when selecting time trial from the menu. Is set back to 0 after OnPostBeginLevel is called. DisableUnderwaterMusic // Use GameVariables.SetValue("DisableUnderwaterMusic", "1"); DisableWaterReflection // Use GameVariables.SetValue("DisableWaterReflection", "1");
Easy: - Damage enemies receive is scaled by 1.4 - Damage bosses receive is scaled by 1.1 - Enemies animation speed is normal. - AnimScalar() = 1.0 - BlendScalar() = 10.0 - Normal enemy reaction times - Normal chance to do range attacks - Enemies drop items Normal: - Damage enemies receive is scaled by 1.0 - Damage bosses receive is scaled by 1.0 - Enemies animation speed is normal. - AnimScalar() = 1.0 - BlendScalar() = 10.0 - Normal enemy reaction times - Normal chance to do range attacks - Enemies drop items Hard: - Damage enemies receive is scaled by 0.7 - Damage bosses receive is scaled by 0.9 - Enemies animation speed is fast. - AnimScalar() = 0.85 - BlendScalar() = 6.0 - Fast enemy reaction times - High chance to do range attacks - Enemies do NOT drop items Hardcore: - Damage enemies receive is scaled by 0.7 - Damage bosses receive is scaled by 0.9 - Enemies animation speed is very fast. - AnimScalar() = 0.6 - BlendScalar() = 4.0 - Very fast enemy reaction times - Very High chance to do range attacks - Enemies do NOT drop items - Enemies turn twice as fast