-
Notifications
You must be signed in to change notification settings - Fork 2
TAS Movie API
API for the extra functionality availiable in the TAS movie scripts
- All movie config options are in the
MOVIE_CONFIG
table - Accessed like so
MOVIE_CONFIG.fps
- All options MUST be defined in the first frame of the movie (so before the first
movie.frame_advance
call) - Make sure if the
is_global_scope
option is enabled, the options are defined in the global scope and not in the main script coroutine
The FPS of the movie, this is used to calculate the frametime
The frametime of the movie, this is applied to the first frame of the movie
- Using a string to set this will use the invariant DateTime format to start the movie in that system time
- Using a value will set the time by ticks
- Enabling this will unwrap the main script coroutine into the global scope, basically letting you use the lua script in its raw form
- Make sure to return a coroutine function from the main script, which will be used as the main script coroutine
- The seed to use for the random number generator on soft restart
- The type of update to use on frame advance, it is case insensitive
- Types
- Update - Updates before frame update either
MonoBehaviour.Update
or input system update - FixedUpdate - Updates before fixed update either
MonoBehaviour.FixedUpdate
or input update - Both - Both of the above
- Update - Updates before frame update either
- Types
Contains methods used to register / unregister a concurrent method
Registers a method to concurrently run along with the main script coroutine
This will also run the method for the current frame if the post_update
flag is set to false
- method
- The method to be ran
- post_update - DEFAULT = false
- Boolean on running before the execution of the main script coroutine, or after
- By default, its false so it will run before the main script coroutine
- arg0 - OPTIONAL
- Default argument to pass to the method
- Overload so you don't have to put anything in if no arguments are present
- If you don't match the number of arguments as same as the function signature, it will throw an exception on most occasions
-
Return
- A unique identifier object to distinguish a registered concurrent method
Registers a method to concurrently run along with the main script coroutine, but will only run once
Rest is the same as register()
Unregisters a concurrently running method\
NOTE: If the pre_update
flag is set for a method, it will run for that frame if you try unregistering from the main coroutine
- register_uid
- The unique identifier object that was returned from
register
- The unique identifier object that was returned from
Used for manipulating the keyboard
Holds a key down
- key
- The key to hold down
- A string of the key name which is the enum from here
Releases a key
- key
- The key to release
- A string of the key name which is the enum from here
Clears all keys that are currently held down
Used for manipulating the mouse
Holds the left mouse button
- hold - DEFAULT = true
- Boolean on whether to click or not
- If false, it will release the button
Holds the right mouse button
- hold - DEFAULT = true
- Boolean on whether to click or not
- If false, it will release the button
Holds the middle mouse button
- hold - DEFAULT = true
- Boolean on whether to click or not
- If false, it will release the button
Moves the mouse to a position
- x
- The x position to move to
- y
- The y position to move to
Moves the mouse to a position relative to the current position
- x
- The x offset to move to
- y
- The y offset to move to
Sets the scroll speed
- x
- The x scroll speed
- y
- The y scroll speed
Used for manipulating the controller
Holds a controller button down
- button
- The button name in string to be held down
Releases a controller button
- button
- The button name in string to be released
Clears all buttons that are currently held down
Sets the value of an axis
- axis
- The axis name in string to set the value of
- value
- The value to set the axis to
Game environment, used for changing the game environment
The current FPS of the game, you can read / write to this
NOTE: Setting this will apply the change on the next frame (so after the frame_advance call on the main coroutine)
The current frametime of the game, you can read / write to this
NOTE: Setting this will apply the change on the next frame (so after the frame_advance call on the main coroutine)
Sets the update type of the game
- type
- The update type to set the game to
- Types
- Update - Updates before
MonoBehaviour.Update
- FixedUpdate - Updates before
MonoBehaviour.FixedUpdate
- Both - Both of the above
- Update - Updates before
Used to control movie playback
Sets the current playback speed of the movie
- speed_multiplier
- The speed multiplier to set the playback speed to
- Setting this to 0 will run the game as fast as possible\
- Setting this to 1 will run the game at 1x speed\
- Setting this to 0.5 will run the game at 0.5x speed, etc
- The speed multiplier to set the playback speed to
Alias for coroutine.yield()
- count - OPTIONAL
- The number of times to yield (or advance the frame in the movie)
- If passing nothing or nil, it will yield once
- It WILL fail with an error if you pass any type other than a number or nil
Starts capturing the movie
You don't need to call stop_capture()
at the end of the script, it will automatically stop the capture when the script ends
- args - OPTIONAL
- A table of arguments to pass to the capture, using lua's named arguments
- If not passed, it will use the default arguments
- If passed, it will use the arguments passed in
- Table args
- fps - DEFAULT = 60
- The FPS to capture the movie at
- width - DEFAULT = 1920
- The width of the rendered movie
- height - DEFAULT = 1080
- The height of the rendered movie
- path - DEFAULT = output.mp4
- The path to save the movie to
- fps - DEFAULT = 60
Stops capturing the movie
Provides read only access to unity side
Finds unity objects by type
- type_name - string
- The C# type name of the object to find. It would be ideal to include the namespace
- Example:
UnityEngine.GameObject
GUI controls for UniTAS
Shows or hides the UniTAS overlays
bool, read/write