Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds the ability to load and play cutscene #3276

Open
1 task done
gta191977649 opened this issue Dec 23, 2023 · 4 comments
Open
1 task done

Adds the ability to load and play cutscene #3276

gta191977649 opened this issue Dec 23, 2023 · 4 comments
Labels
enhancement New feature or request

Comments

@gta191977649
Copy link
Contributor

Is your feature request related to a problem? Please describe.

The original game engine has a ability to load & play cutscene from anim\cuts.img archive, implementing by related opcodes

  • LOAD_CUTSCENE 02E4: Loads the data for the specified cutscene
  • START_CUTSCENE 02E4 : Starts the loaded cutscene
  • SET_CUTSCENE_OFFSET 0244: Sets the position for a cutscene
  • CLEAR_CUTSCENE 02EA Returns true if the cutscene has finished
  • HAS_CUTSCENE_FINISHED 02E9 Returns true if the cutscene has finished
  • WAS_CUTSCENE_SKIPPED 056A: Returns true if the cutscene was skipped
  • HAS_CUTSCENE_LOADED 06B9 : Returns true if the cutscene has finished loading
  • GET_CUTSCENE_OFFSET 08D1: Stores the offset of the currently loaded cutscene
  • GET_CUTSCENE_TIME 02E8: Returns the time in milliseconds passed since the cutscene has started (02E7)

Why not we also implementing them in MTA SA? also we can add the ability to loads custom cutscene from file since the R* harded coded them in a table, however this table just a lookup table for reference the audio stream related to cutscene.

Describe the solution you'd like

Describe the solution you'd like

The proposed solution involves implementing a comprehensive Lua API in MTA:SA that closely mirrors the cutscene functionality of the original game engine. This API would provide scripters with the ability to load, control, and interact with cutscenes, enhancing the storytelling and immersive experience within custom game modes. Key functions to be implemented include:

  1. loadCutscene(filename): Loads a cutscene from a specified file. This function expands the capability to include custom cutscenes, not just those hardcoded in the game. The filename parameter refers to the custom file that contains the cutscene data.

  2. startCutscene(): Begins the playback of the loaded cutscene. This function is crucial for initiating the cutscene once it is loaded into the game.

  3. setCutsceneOffset(x, y, z): Sets the position for the cutscene. This function allows for the adjustment of the cutscene's starting point in the game world, giving scripters the flexibility to place cutscenes in different locations.

  4. clearCutscene(): Terminates the current cutscene. This function is necessary for scenarios where the cutscene needs to be stopped before it concludes naturally.

  5. hasCutsceneFinished(): Checks if the cutscene has finished playing. Returns true if the cutscene is complete, enabling scripters to trigger subsequent events or actions.

  6. wasCutsceneSkipped(): Determines if the cutscene was skipped by the player. This is important for gameplay flow, allowing alternative pathways or reactions based on player choices.

  7. hasCutsceneLoaded(): Verifies if the cutscene has finished loading. This ensures that the gameplay proceeds smoothly without interruptions due to loading delays.

  8. getCutsceneOffset(): Retrieves the current offset of the loaded cutscene. Useful for debugging or for scripted events that need to synchronize with specific cutscene moments.

  9. getCutsceneTime(): Returns the elapsed time since the cutscene started. This can be used for timing other in-game events in relation to the cutscene's progression.

In addition to these functions, the API should include comprehensive documentation and examples. This will help scripters to understand and effectively use the new cutscene capabilities in their custom game modes.

The implementation of this feature would significantly enhance the MTA:SA experience by enabling more dynamic and engaging storytelling elements within the game.

Describe alternatives you've considered

No response

Additional context

No response

Security Policy

  • I have read and understood the Security Policy and this issue is not about a cheat or security vulnerability.
@gta191977649 gta191977649 added the enhancement New feature or request label Dec 23, 2023
@sbx320
Copy link
Member

sbx320 commented Jan 4, 2024

This is fairly easy to implement in Lua directly (in fact I did so a long time ago). Also we'd need to implement some form of tooling to create GTA cutscenes, which could just be loaded from JSON.

@gta191977649
Copy link
Contributor Author

This is fairly easy to implement in Lua directly (in fact I did so a long time ago). Also we'd need to implement some form of tooling to create GTA cutscenes, which could just be loaded from JSON.

Any examples for that? As far i know cutscene animations stores in ifp as well, they can be load as normal animations, but the bone will resulting incorrect if just apply it directly on normal in-game characters. Furthermore seems some animations can also attach to objects, but i don't i think mta's animations is able to do that as well.

@ALBANDER2022

This comment was marked as spam.

@TracerDS

This comment was marked as resolved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants