github LostArtefacts/TRX latest
Development snapshot

one hour ago

Unreleased454e3d8 · 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 /music console command to list the available tracks when given no argument, as /sfx does; /music status now 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 the DEG_1, DEG_45, DEG_90 and WALL_L constants
  • added a new Lua module, trx.strings, with fuzzy_match() and regex_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_loaded and trx.game.is_playable
  • added trx.console.register(), so a script can add a console command of its own, with optional aliases that dispatch but stay out of the command listing and show in the command's help
  • added p, a global shorthand for trx.console.log, and made the console log functions take any value, pretty-printing a table
  • added trx.lara.cure_poison() and trx.lara.extinguish(), to clear Lara's poison and put her out
  • made trx.lara.is_burning writable, 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_active and trx.camera.cancel_flyby(), to see and stop a flyby sequence
  • added trx.game.LevelType.TITLE, and a demo level 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() and trx.objects.get(), replacing the fn namespaces- added trx.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() and get_property_names()
  • added the writable Lua item field is_one_shot
  • added object methods, get_property(), set_property() and get_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_hostile and is_killed, and made timer writable
  • 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_item and the dive, death, sprint and pose timers
  • added new Lua assault course functions, trx.assault.finish(), trx.assault.is_running() and trx.assault.is_visible(), and a new property, trx.assault.active_track
  • added new Lua config functions, trx.config.override(), trx.config.restore() and trx.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_particles and the unobtainable pickup, kill and secret counts
  • added new Lua object fields, loaded, is_intelligent, mesh_count, anim_count, radius, shadow_size, smartness, pivot_length and semi_transparent
  • added new Lua catalog functions, trx.catalog.to_slot() and trx.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.Context and trx.rooms.FlipStatus
  • added trx.log.generic() and the trx.log.LogLevel enum, 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.rooms and trx.objects, so trx.items[0] is the first item and #trx.items is 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 as trx.music.Track handles keyed by id, each with :play() and :path()
  • added trx.music.current_track and trx.music.looped_track, the playing and ambient tracks as trx.music.Track handles
  • added trx.music.streams, the soundtrack's streams as trx.music.Stream handles, each of which can be paused, resumed, sought and stopped on its own
  • added trx.sound.samples, the level's samples as trx.sound.Sample handles keyed by id, each with :play(), :stop() and its volume, range, randomness and pitch
  • added trx.sound.streams, the sound effects playing now as trx.sound.Stream handles, 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.items and trx.rooms to 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.items and trx.rooms to count from zero, matching the item and room numbers level editors show, and made pairs() 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.stop and trx.music.play to take a sound or track by catalog name, which works across games, rather than the level's own slot; the slot is reached through the samples/tracks handles, and play hands back the stream it starts
  • changed trx.game.levels and trx.game.play_level to leave out the gym, so numbering no longer shifts and the last level is reachable
  • changed trx.api to hold only strict and is_strict once sealed, and trx.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.idx to room.num
  • changed the Lua level field name to title
  • changed trx.lara.extra_anim to a boolean, where it used to be the relative animation number, or -1
  • changed item.object_id to be read-only
  • changed trx.objects[id] to return nil for 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.events handlers to no longer receive a dummy argument in before_control and after_control
  • changed trx.lara.mesh and trx.lara.extra_mesh to declared enums, trx.lara.Mesh and trx.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.wolf and trx.catalog.objects.WOLF are 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 = 99999 no 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 of trx.log.LogLevel
  • removed trx.events.EventType
  • removed trx.game.settings, which duplicated trx.config
  • removed trx.music.play_track, an undocumented alias of trx.music.play
  • removed the trx.pickup module; its enum is now trx.items.PickupMode

Don't miss a new TRX release

NewReleases is sending notifications on new releases.