Unreleased – 454e3d8 · Diff · History
- added TR4 camera mode, which is similar to TR3 but more responsive to Lara's actions such as picking up items
- added the ability to paste commands in the developer console (with Ctrl+V)
- changed reflections UV mapping to be more correct
- changed outfits to support up to two braids per outfit; refer to migration notes
- changed the
/musicconsole command to list the available tracks when given no argument, as/sfxdoes;/music statusnow reports what is playing - fixed being unable to drop to the secret ledge in Jungle room 76 from the ledge above (#5818)
TR4
- added reflections
- fixed the camera snapping to elevation and angle changes in instances such as opening floor trapdoors
Lua
The Lua integration was rewritten and existing scripts will need updating; refer to migration notes.
- added a new Lua module,
trx.math, with the engine's own fixed-point trigonometry and theDEG_1,DEG_45,DEG_90andWALL_Lconstants - added a new Lua module,
trx.strings, withfuzzy_match()andregex_match() - added a new Lua module,
trx.locale, for the text the player reads, looked up by key - added
trx.locale.reload(), to reload the current language's text from disk - added a new Lua module,
trx.weather, to read and set the runtime weather - added new Lua game state,
trx.game.is_loadedandtrx.game.is_playable - added
trx.console.register(), so a script can add a console command of its own, with optionalaliasesthat dispatch but stay out of the command listing and show in the command's help - added
p, a global shorthand fortrx.console.log, and made the console log functions take any value, pretty-printing a table - added
trx.lara.cure_poison()andtrx.lara.extinguish(), to clear Lara's poison and put her out - made
trx.lara.is_burningwritable, so setting it lights Lara or puts her out - added
trx.lara.is_flying, to read and toggle the fly-mode cheat - added
trx.camera.is_flyby_activeandtrx.camera.cancel_flyby(), to see and stop a flyby sequence - added
trx.game.LevelType.TITLE, and ademolevel type to the game flow, which could not be named before - added
trx.game.play_gym(), to start the gym - added
trx.game.screenshot(), to save a screenshot - added
trx.game.end_level(), to end the current level - added
trx.items.spawn(), to place a new item in the level at runtime - added
trx.items.get(),trx.items.count(),trx.rooms.get(),trx.rooms.count()andtrx.objects.get(), replacing thefnnamespaces- addedtrx.rooms.find_valid_pos(), to nudge a position into valid room geometry - added item methods,
activate(),kill(),die(),shatter(),distance_to(),is_valid(),get_property(),set_property()andget_property_names() - added the writable Lua item field
is_one_shot - added object methods,
get_property(),set_property()andget_property_names() - added new Lua item fields,
anim_state,goal_anim_state,speed,fall_speed,gravity,collidable,mesh_bits,touch_bits,max_hit_points,was_hit,is_active,is_alive,is_hostileandis_killed, and madetimerwritable - added new Lua Lara state,
trx.lara.poison,trx.lara.electric,trx.lara.is_burning,trx.lara.is_crouched,trx.lara.is_climbing,trx.lara.water_status,trx.lara.gun_status,trx.lara.hit_direction,trx.lara.requested_gun,trx.lara.killed_loyal_itemand the dive, death, sprint and pose timers - added new Lua assault course functions,
trx.assault.finish(),trx.assault.is_running()andtrx.assault.is_visible(), and a new property,trx.assault.active_track - added new Lua config functions,
trx.config.override(),trx.config.restore()andtrx.config.is_overridden(), to change a setting without overwriting the player's own value - added new Lua level fields,
script_path,lara_outfit,music_track,water_particlesand the unobtainable pickup, kill and secret counts - added new Lua object fields,
loaded,is_intelligent,mesh_count,anim_count,radius,shadow_size,smartness,pivot_lengthandsemi_transparent - added new Lua catalog functions,
trx.catalog.to_slot()andtrx.catalog.from_slot(), to convert between a TRX id and the slot the current game's own files use for it - added new Lua enums,
trx.items.Status,trx.lara.WaterState,trx.lara.GunState,trx.game.LevelTable,trx.catalog.Contextandtrx.rooms.FlipStatus - added
trx.log.generic()and thetrx.log.LogLevelenum, to log at a level chosen at runtime - added the braid and crowbar constants to
trx.lara.ExtraMesh, which the engine had but never exposed - added indexing and the length operator to
trx.items,trx.roomsandtrx.objects, sotrx.items[0]is the first item and#trx.itemsis how many the level has - added
trx.api.strict(), which checks a script's arguments against the API's own declarations - worth turning on while writing a level, and leaving off in play - added
room:is_valid(), so a room handle held across a level change can be checked the way an item handle can - added the track to the assault course record functions, so the quad bike's records can be read and written at last
- added a new Lua string function,
trx.strings.collapse_ranges() - added
trx.music.tracks, the level's tracks astrx.music.Trackhandles keyed by id, each with:play()and:path() - added
trx.music.current_trackandtrx.music.looped_track, the playing and ambient tracks astrx.music.Trackhandles - added
trx.music.streams, the soundtrack's streams astrx.music.Streamhandles, each of which can be paused, resumed, sought and stopped on its own - added
trx.sound.samples, the level's samples astrx.sound.Samplehandles keyed by id, each with:play(),:stop()and itsvolume,range,randomnessandpitch - added
trx.sound.streams, the sound effects playing now astrx.sound.Streamhandles, each of which can be paused, resumed and stopped on its own - added a script watchdog: a script that runs for over 5 seconds without handing control back is stopped with a script error, where it used to freeze the game
- changed
trx.itemsandtrx.roomsto hand out opaque handles rather than{ idx = ... }tables, so a handle to a killed item now raises instead of silently addressing whatever took its slot - changed handles to compare equal when they name the same thing, so
trx.items[0] == trx.items[0] - changed
trx.itemsandtrx.roomsto count from zero, matching the item and room numbers level editors show, and madepairs()walk them keyed by that number - changed room handles to go stale at a level change rather than quietly naming a different room
- changed
trx.sound.play,trx.sound.stopandtrx.music.playto take a sound or track by catalog name, which works across games, rather than the level's own slot; the slot is reached through thesamples/trackshandles, andplayhands back the stream it starts - changed
trx.game.levelsandtrx.game.play_levelto leave out the gym, so numbering no longer shifts and the last level is reachable - changed
trx.apito hold onlystrictandis_strictonce sealed, andtrx.api.strict()to check handle method arguments too - changed a position table to require all three coordinates, rather than reading a missing one as zero
- changed
room.idxtoroom.num - changed the Lua level field
nametotitle - changed
trx.lara.extra_animto a boolean, where it used to be the relative animation number, or -1 - changed
item.object_idto be read-only - changed
trx.objects[id]to returnnilfor an unknown id, where it used to return an object that answered to nothing - changed
trx.config.get()to return the option's own type rather than always a string - changed
trx.events.detach()to return whether a handler was removed - changed
trx.eventshandlers to no longer receive a dummy argument inbefore_controlandafter_control - changed
trx.lara.meshandtrx.lara.extra_meshto declared enums,trx.lara.Meshandtrx.lara.ExtraMesh - changed the Lua logging functions to take a single message rather than a list of strings
- changed Lua enums to answer to a constant's name in any case, so
trx.catalog.objects.wolfandtrx.catalog.objects.WOLFare the same constant - changed Lua enums to be read-only, including the table
pairs()used to hand out; writing to one used to break every later lookup - changed writes that a field cannot hold to raise rather than truncate, so
item.hit_points = 99999no longer wraps - fixed a number too large for the engine wrapping into range rather than being refused, so
trx.items[4294967297]no longer reads as the first item - removed
trx.console.log.LogLevel, a duplicate oftrx.log.LogLevel - removed
trx.events.EventType - removed
trx.game.settings, which duplicatedtrx.config - removed
trx.music.play_track, an undocumented alias oftrx.music.play - removed the
trx.pickupmodule; its enum is nowtrx.items.PickupMode