Quantcast
Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
    1. Welcome to GTAForums!

    1. GTANet.com

    1. GTA Online

      1. The Cayo Perico Heist
      2. The Diamond Casino Heist
      3. Find Lobbies & Players
      4. Guides & Strategies
      5. Vehicles
      6. Content Creator
      7. Help & Support
    2. Red Dead Online

      1. Frontier Pursuits
      2. Find Lobbies & Outlaws
      3. Help & Support
    3. Crews

    1. Red Dead Redemption 2

      1. PC
      2. Help & Support
    2. Red Dead Redemption

    1. Grand Theft Auto Series

    2. GTA VI

      1. St. Andrews Cathedral
    3. GTA V

      1. Guides & Strategies
      2. Help & Support
    4. GTA IV

      1. The Lost and Damned
      2. The Ballad of Gay Tony
      3. Guides & Strategies
      4. Help & Support
    5. GTA San Andreas

      1. Guides & Strategies
      2. Help & Support
    6. GTA Vice City

      1. Guides & Strategies
      2. Help & Support
    7. GTA III

      1. Guides & Strategies
      2. Help & Support
    8. Portable Games

      1. GTA Chinatown Wars
      2. GTA Vice City Stories
      3. GTA Liberty City Stories
    9. Top-Down Games

      1. GTA Advance
      2. GTA 2
      3. GTA
    1. GTA Mods

      1. GTA V
      2. GTA IV
      3. GTA III, VC & SA
      4. Tutorials
    2. Red Dead Mods

      1. Documentation
    3. Mod Showroom

      1. Scripts & Plugins
      2. Maps
      3. Total Conversions
      4. Vehicles
      5. Textures
      6. Characters
      7. Tools
      8. Other
      9. Workshop
    4. Featured Mods

      1. Design Your Own Mission
      2. OpenIV
      3. GTA: Underground
      4. GTA: Liberty City
      5. GTA: State of Liberty
    1. Rockstar Games

    2. Rockstar Collectors

    1. Off-Topic

      1. General Chat
      2. Gaming
      3. Technology
      4. Movies & TV
      5. Music
      6. Sports
      7. Vehicles
    2. Expression

      1. Graphics / Visual Arts
      2. GFX Requests & Tutorials
      3. Writers' Discussion
      4. Debates & Discussion
    3. Gangs

    1. Announcements

    2. Support

    3. Suggestions

elsewhat

Research into recording player actions and replaying the

Recommended Posts

elsewhat

For the next major release of Scene Director https://www.gta5-mods.com/scripts/scene-directorI'm planning to implement a feature for recording the actions of the player and replaying them automatically afterwards.

 

Unfortunately, I'm having some issues with playing back player movements.

 

In the API there are three different ways of playing back player movements:

  1. AI::TASK_FOLLOW_WAYPOINT_RECORDING
  2. AI::TASK_GO_STRAIGHT_TO_COORD
  3. AI::TASK_FOLLOW_POINT_ROUTE

Alternative 1: AI::TASK_FOLLOW_WAYPOINT_RECORDING

AI::TASK_FOLLOW_WAYPOINT_RECORDING is the one used most in the scripts. Unfortunately, it requires that the waypoints are read from resources (x64f.rdf/levels/gta5/waypointrec.rdf).

Example:

AI::REQUEST_WAYPOINT_RECORDING("agency3a_michael_5");....AI::TASK_FOLLOW_WAYPOINT_RECORDING(0, "agency3a_michael_5", 0, 296, -1);

Would be interesting to find out how and where the waypoint recordings are stored. But since I need to record actions on the fly it is not really an alternative.

 

Alternative 2 AI::TASK_GO_STRAIGHT_TO_COORD

 

This API works quite well, but the ped pauses once he's finished one task, before continuing to the next. Since I need to record 1-5 waypoint pr second for a smooth motion, it doesn't work in my case.

Here's my working code for it (actorRecording is the vector I've stored the recorded Vector3 locations)

//Attempt: AI::TASK_GO_STRAIGHT_TO_COORD - Kind of works, but the actor pauses between each coord before moving to the nextTaskSequence actorSeq;AI::OPEN_SEQUENCE_TASK(&actorSeq);    //0xec17e58, 0xbac0f10b, 0x3f67c6af, 0x422d7a25, 0xbd8817db, 0x916e828c -> "motionstate_idle", "motionstate_walk", "motionstate_run", "motionstate_actionmode_idle", and "motionstate_actionmode_walk"//not really necessaryAI::TASK_FORCE_MOTION_STATE(0, 0xbac0f10b, 0);for (int i =0; i < actorRecording.size(); i++) {    ActorRecordingItem recordingItem = actorRecording[i];    AI::TASK_GO_STRAIGHT_TO_COORD(0, recordingItem.getLocation().x, recordingItem.getLocation().y, recordingItem.getLocation().z, 2.0f, -1, recordingItem.getHeading(), 0);}AI::CLOSE_SEQUENCE_TASK(actorSeq);AI::TASK_PERFORM_SEQUENCE(actorPed, actorSeq);AI::CLEAR_SEQUENCE_TASK(&actorSeq);

Alternative 3: AI::TASK_FOLLOW_POINT_ROUTE

 

This one is also used a handful of times in the scripts. It should be trivial to implement but it just doesn't work as it should.

The TASK_EXTEND_ROUTE commands are ignored. Instead the the ped runs to coordinates x=0, y=0.

If you don't issue any TASK_EXTEND_ROUTE commands, the ped does nothing.

 

Below is my current code. The parameters here to TASK_EXTEND_ROUTE are currently double (a futile experiment based on that the scripts use double), but the same effect happens if they're float (ie Vector3.x/y/z).

I also find it a bit strange that the TASK_EXTEND_ROUTE is never directly connected to TASK_FOLLOW_POINT_ROUTE.

TaskSequence actorSeq;AI::OPEN_SEQUENCE_TASK(&actorSeq);AI::TASK_FLUSH_ROUTE();AI::TASK_EXTEND_ROUTE(1379.367554, 3173.189209, 40.455093);AI::TASK_EXTEND_ROUTE(1380.481201, 3170.556885, 40.426697);AI::TASK_EXTEND_ROUTE(1383.024658, 3164.550049, 40.414001);AI::TASK_FOLLOW_POINT_ROUTE(0, 2.0f, 0);AI::CLOSE_SEQUENCE_TASK(actorSeq);AI::TASK_PERFORM_SEQUENCE(actorPed, actorSeq);AI::CLEAR_SEQUENCE_TASK(&actorSeq);

Any input from other mod makers on what works or not? I hope we can get AI::TASK_FOLLOW_POINT_ROUTE to work

Edited by elsewhat

Share this post


Link to post
Share on other sites
XMOD1

Why not just record the player key press + release and re-enforcing them with AI::TASK_FOLLOW?

Share this post


Link to post
Share on other sites
elsewhat

Recording of player state/actions is working fine. The issue is with how to playback these actions afterwards.

Remember I need to playback different actions for each of the actors (currently supporting 9 actors).

 

Which native are you refering to when you say AI::TASK_FOLLOW ?

I dont't know of any native which accepts key presses as input.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • 2 Users Currently Viewing
    0 members, 0 Anonymous, 2 Guests

×
×
  • Create New...

Important Information

By using GTAForums.com, you agree to our Terms of Use and Privacy Policy.