Jump to content
    1. Welcome to GTAForums!

    1. GTANet.com

    1. GTA Online

      1. Los Santos Drug Wars
      2. Updates
      3. Find Lobbies & Players
      4. Guides & Strategies
      5. Vehicles
      6. Content Creator
      7. Help & Support
    2. Red Dead Online

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

    1. Grand Theft Auto Series

      1. Bugs*
      2. St. Andrews Cathedral
    2. GTA VI

    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. Classic GTA SA
      2. Guides & Strategies
      3. Help & Support
    6. GTA Vice City

      1. Classic GTA VC
      2. Guides & Strategies
      3. Help & Support
    7. GTA III

      1. Classic GTA III
      2. Guides & Strategies
      3. 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. Red Dead Redemption 2

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

    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
    1. Announcements

    2. Forum Support

    3. Suggestions

[SA] 07E7 and scmpath. How to make a loop ?


vladvo
 Share

Recommended Posts

Can't make the car to repeat the path. Nothing helps, tried all posible flags for 07E7. 0643: doesn't seem to work.

Same with 06BB - the car gets to the second point and stops.

The lines that are commented (//) don't have any impact at all.

Is it even possible to make the car go non-stop with scmpath ?


At the same time, a char on foot goes back and forth without any additional codes. (05D8: AS_assign_scmpath to_actor [email protected] flags  6 2)

 

0615: define_action_sequences [email protected] 
05D6: clear_scmpath
05D7: add_point_to_scmpath -227.2650 -234.0898 1.4219
05D7: add_point_to_scmpath -216.8668 -239.9779 1.4219
0643: set_AS_pack [email protected] loop 1
0616: define_action_sequences_end [email protected]
//06BB: set_actor [email protected] drive_car [email protected] speed 20.0 along_SCM_path
07E7: AS_assign_scmpath_to_actor [email protected] in_car [email protected] speed 20.0 flags 2 0 2 
//0618: assign_actor [email protected] to_action_sequences [email protected]

//061B: remove_references_to_AS_pack [email protected]

Link to comment
Share on other sites

These opcodes can only be used for actor animations -"packs"
0615: 0643: 0616: 0618: 061B:

Spoiler
0615: define_AS_pack_begin 0@
0605: actor -1 perform_animation_sequence "STR_B2C" from_file "STRIP"  4.0  0  0  0  1 -1 ms  
0605: actor -1 perform_animation_sequence "DNCE_M_A" from_file "DANCING"  4.0  0  0  0  1 -1 ms
0605: actor -1 perform_animation_sequence "STR_B2C" from_file "STRIP"  4.0  0  0  0  1 -1 ms
0605: actor -1 perform_animation_sequence "DNCE_M_A" from_file "DANCING"  4.0  0  0  0  1 -1 ms
0605: actor -1 perform_animation_sequence "STR_B2C" from_file "STRIP"  4.0  0  0  0  1 -1 ms
0605: actor -1 perform_animation_sequence "DAN_LOOP_A" from_file "DANCING"  4.0  0  0  0  1 -1 ms
0605: actor -1 perform_animation_sequence "DNCE_M_D" from_file "DANCING"  4.0  0  0  0  1 -1 ms 
0643: set_AS_pack 0@ loop 1
0616: define_AS_pack_end 0@
0618: assign_actor $PLAYER_ACTOR to_AS_pack 0@



061B: remove_references_to_AS_pack 0@

 

 

But not for car driving

 

 

Define a scmpath for the driver

 

Set first opcode 05D6: to clear first a possibly created previous scmpath
Than set new coords for the scmpath and use opcode 07E7: to let the driver drive along this path
This function can also ignore the paths (like using 04e0: car [email protected] abandon_path_radius)
and let the driver drive the car directly to the given point

It's depending from the setting in the flags

0 0 5 let it drive on paths

2 0 5 ignore the paths

////////////////////  the drive-to commands --vv----
05D6: clear_scmpath
05D7: add_point_to_scmpath  2353.1528 -1658.6493 13.384
05D7: add_point_to_scmpath  2431.7739 -1674.7444 13.6643
07E7: AS_assign_scmpath_to_actor 2@ in_car 1@ speed  20.0 flags  0  0  5
////////////////////  the drive-to commands --^^----

 

Car drive scripts in practice

To write a car drive script in practice with a longer specific route needs a more complex script,
which checks if the car reached the destination to can submit the new destination.

Because you can not check the same destination coords which you want to submit when the car reached it,
you must use access checks(checking vars to build sections)

Fourthermore it needs to check if the car do airborns because it looses the coord information
and we must give this information again in this case

A check if the car is fliped or wrecked makes allways sense, because it can not continue the route and the script should cancel the action in this case
R* use in the main.scm a stuck car check, but this function don't work in Cleo
a check if the car speed is smaller than 1.0 can help

 

 

The script below teleport the player to the SF airport on a motorbike and spawns an opponent driver on motorbike who drives around the airort building.

Go outside to the exterior map and press Backspace then follow the opponent driver to see what he do

07E7: AS_assign_scmpath_to_actor is used

The driver falls from bike sometimes and enters again his ride to continue the drive

Alternativ you can activte the opcode 08C6: set_actor [email protected]  stay_on_bike 1

To restart the script needs to leave the aiport, you must have a distance of 700.0 units to the startpoint

 

{$CLEO .cs}
:scmpath_1
03A4: name_thread 'SCMP'

:scmpath_3
0001: wait 0 ms
if
0256: player $PLAYER_CHAR defined
jf @scmpath_3
077E: 0@ = active_interior
if  and
0038:   0@ ==  0  // integer values
0AB0:   key_pressed 8//----------------------------------------Backspace  
jf @scmpath_3
016A: fade  0 ()  250 ms
0001: wait 250 ms
01B4: set_player $PLAYER_CHAR frozen_state  0 (frozen)
0362: remove_actor $PLAYER_ACTOR from_car_and_place_at -1338.5  -408.1  14.1
0173: set_actor $PLAYER_ACTOR z_angle_to  90.8
0001: wait  500 ms
0247: request_model #NRG500
0247: request_model #MAFFA

:scmpath_5
0001: wait  0 ms
if  and
0248:   model #NRG500 available
0248:   model #MAFFA available
jf @scmpath_5
00A5: 1@ = create_car #NRG500 at -1333.5  -408.1  14.1
0175: set_car 1@ z_angle_to  280.0
0224: set_car 1@ health_to  2000
00A5: 7@ = create_car #NRG500 at -1354.5  -419.1  14.1
0175: set_car 7@ z_angle_to  280.0
0224: set_car 7@ health_to  2000
020A: set_car  7@ door_status_to 4
02AC: set_car 7@ immunities  1  1  1  1  1
01EC: make_car 7@ very_heavy  1
0129: 9@ = create_actor  24 #MAFFA in_car 7@ driverseat
0223: set_actor 9@ health_to  3000
04E4: unknown_refresh_game_renderer_at  -1333.5  -408.1
03CB: set_camera  -1333.5  -408.1  14.1
029B: 23@ = init_object 1655 at -1576.02  -202.34  13.76
0177: set_object 23@ z_angle_to  270.0
01C7: remove_object_from_mission_cleanup_list 23@
0382: set_object 23@ collision_detection  1
029B: 24@ = init_object 1655 at -1597.9  -506.5  21.7
0177: set_object 24@ z_angle_to  270.0
01C7: remove_object_from_mission_cleanup_list 24@
0382: set_object 24@ collision_detection  1
029B: 25@ = init_object 1655 at -1375.9  -581.5  13.69
0177: set_object 25@ z_angle_to  270.0
01C7: remove_object_from_mission_cleanup_list 25@
0382: set_object 25@ collision_detection  1
029B: 26@ = init_object 1655 at -1374.9  -585.5  13.69
0177: set_object 26@ z_angle_to  270.0
01C7: remove_object_from_mission_cleanup_list 26@

0382: set_object 26@ collision_detection  1
0177: set_object 23@ z_angle_to  135.0
0177: set_object 24@ z_angle_to  225.0
0177: set_object 25@ z_angle_to  280.0
0177: set_object 26@ z_angle_to  280.0
0186: 29@ = create_marker_above_car 7@ 
07E0: set_marker 29@ type_to 1

0249: release_model #NRG500
0249: release_model #MAFFA
04e0: car 7@ abandon_path_radius 200
00AD: set_car 7@ max_speed_to  100.0
04BA: set_car 7@ speed_instantly  30.0
00AF: set_car 7@ driver_behaviour_to  1
00AE: unknown_set_car 7@ to_ignore_traffic_lights  2
0001: wait  250 ms
036A: put_actor $PLAYER_ACTOR in_car 1@
0001: wait  250 ms
016A: fade  1 ()  1000 ms
0001: wait  1000 ms
0373: set_camera_directly_behind_player
02EB: restore_camera_with_jumpcut
01B4: set_player $PLAYER_CHAR frozen_state  1 (unfrozen)
0006: 15@ =  0  // integer values
0006: 16@ =  0  // integer values
0006: 20@ =  20000  // floating-point values
0006: 19@ =  0  // integer values
0007: 11@ =  -1320.48  // floating-point values
0007: 12@ =  -407.1  // floating-point values
0007: 13@ =  13.76  // floating-point values
00A7: car 7@ drive_to  11@ 12@ 13@
00AD: set_car 7@ max_speed_to  1.0
04e0: car 7@ abandon_path_radius 250
08C6: set_actor 9@  stay_on_bike 1





:scmpath_7
0001: wait 0 ms
if
0256: player $PLAYER_CHAR defined
jf @scmpath_7

0050: gosub @scmpath_sub_3

if  and
8119:   NOT   car 1@ wrecked
8119:   NOT   car 7@ wrecked
8118:   NOT   actor 9@ dead
jf @scmpath_7
if
00FE:   actor $PLAYER_ACTOR  0 ()near_point -1333.5  -408.1  14.1 radius  650.5  650.5  50.5
jf @scmpath_12
jump @scmpath_7

:scmpath_12
0164: disable_marker 29@
01C3: remove_references_to_car 1@  // Like turning a car into any random car
01C3: remove_references_to_car 7@  // Like turning a car into any random car
01C2: remove_references_to_actor 9@  // Like turning an actor into a random pedestrian
0108: destroy_object 23@
0108: destroy_object 24@
0108: destroy_object 25@
0108: destroy_object 26@
jump @scmpath_3


:scmpath_sub_3
if
8119:   NOT   car 7@ wrecked
jf @scmpath_sub_109
if
00DB:   actor 9@ in_car 7@
jf @scmpath_sub_99
if
0039:   19@ ==  1  // integer values
jf @scmpath_sub_10
0006: 19@ =  0  // integer values
jump @scmpath_sub_100

:scmpath_sub_10
if
0039:   15@ ==  0  // integer values
jf @scmpath_sub_11
if
01AF:   car 7@  0 ()near_point 11@ 12@ 13@ radius  5.2  5.2  5.0
jf @scmpath_sub_11
0006: 15@ =  1  // integer values
05D6: clear_scmpath
0007: 11@ =  -1181.78  // floating-point values
0007: 12@ =  -331.30  // floating-point values
0007: 13@ =  13.76  // floating-point values
000A: 16@ +=  0  // integer values
0007: 17@ =  100.0  // floating-point values
0007: 18@ =  20.0  // floating-point values
05D7: add_point_to_scmpath 11@ 12@ 13@
jump @scmpath_sub_100

:scmpath_sub_11
if
0039:   15@ ==  1  // integer values
jf @scmpath_sub_12
if
01AF:   car 7@  0 ()near_point 11@ 12@ 13@ radius  15.2  15.2  5.0
jf @scmpath_sub_12
00AD: set_car 7@ max_speed_to  10.0
0006: 15@ =  2  // integer values
05D6: clear_scmpath
0007: 11@ =  -1282.1  // floating-point values
0007: 12@ =  -159.3  // floating-point values
0007: 13@ =  13.76  // floating-point values
000A: 16@ +=  0  // integer values
0007: 17@ =  100.0  // floating-point values
0007: 18@ =  20.0  // floating-point values
05D7: add_point_to_scmpath 11@ 12@ 13@
jump @scmpath_sub_100


:scmpath_sub_12
if
0039:   15@ ==  2  // integer values
jf @scmpath_sub_13
if
01AF:   car 7@  0 ()near_point 11@ 12@ 13@ radius  15.2  15.2  5.0
jf @scmpath_sub_13
00AD: set_car 7@ max_speed_to  25.0
0006: 15@ =  3  // integer values
05D6: clear_scmpath
0007: 11@ =  -1498.78  // floating-point values
0007: 12@ =  -138.30  // floating-point values
0007: 13@ =  13.76  // floating-point values
000A: 16@ +=  0  // integer values
0007: 17@ =  100.0  // floating-point values
0007: 18@ =  20.0  // floating-point values
05D7: add_point_to_scmpath 11@ 12@ 13@
jump @scmpath_sub_100

:scmpath_sub_13
if
0039:   15@ ==  3  // integer values
jf @scmpath_sub_14
if
01AF:   car 7@  0 ()near_point 11@ 12@ 13@ radius  8.2  8.2  5.0
jf @scmpath_sub_14
00AD: set_car 7@ max_speed_to  25.0
0006: 15@ =  4  // integer values
05D6: clear_scmpath
0007: 11@ =  -1576.78  // floating-point values
0007: 12@ =  -202.30  // floating-point values
0007: 13@ =  13.76  // floating-point values
000A: 16@ +=  0  // integer values
0007: 17@ =  100.0  // floating-point values
0007: 18@ =  20.0  // floating-point values
05D7: add_point_to_scmpath 11@ 12@ 13@
jump @scmpath_sub_100



:scmpath_sub_14
if
0039:   15@ ==  4  // integer values
jf @scmpath_sub_15
if
01AF:   car 7@  0 ()near_point 11@ 12@ 13@ radius  5.2  5.2  5.0
jf @scmpath_sub_15
0006: 15@ =  5  // integer values
05D6: clear_scmpath
0007: 11@ =  -1694.78  // floating-point values
0007: 12@ =  -352.30  // floating-point values
0007: 13@ =  13.9  // floating-point values
000A: 16@ +=  0  // integer values
0007: 17@ =  100.0  // floating-point values
0007: 18@ =  20.0  // floating-point values
05D7: add_point_to_scmpath 11@ 12@ 13@
jump @scmpath_sub_100

:scmpath_sub_15
if
0039:   15@ ==  5  // integer values
jf @scmpath_sub_16
if
01AF:   car 7@  0 ()near_point 11@ 12@ 13@ radius  15.2  15.2  5.0
jf @scmpath_sub_16
00AD: set_car 7@ max_speed_to  10.0
0006: 15@ =  6  // integer values
05D6: clear_scmpath
0007: 11@ =  -1691.78  // floating-point values
0007: 12@ =  -409.30  // floating-point values
0007: 13@ =  13.9  // floating-point values
000A: 16@ +=  0  // integer values
0007: 17@ =  40.0  // floating-point values
0007: 18@ =  10.0  // floating-point values
05D7: add_point_to_scmpath 11@ 12@ 13@
00AE: unknown_set_car 7@ to_ignore_traffic_lights  2
jump @scmpath_sub_100

:scmpath_sub_16
if
0039:   15@ ==  6  // integer values
jf @scmpath_sub_17
if
01AF:   car 7@  0 ()near_point 11@ 12@ 13@ radius  8.2  8.2  5.0
jf @scmpath_sub_17
00AD: set_car 7@ max_speed_to  0.0
0006: 15@ =  7  // integer values
05D6: clear_scmpath
0007: 11@ =  -1519.78  // floating-point values
0007: 12@ =  -580.30  // floating-point values
0007: 13@ =  13.76  // floating-point values
000A: 16@ +=  0  // integer values
0007: 17@ =  100.0  // floating-point values
0007: 18@ =  0.0  // floating-point values
05D7: add_point_to_scmpath 11@ 12@ 13@
00AE: unknown_set_car 7@ to_ignore_traffic_lights  2
jump @scmpath_sub_100

:scmpath_sub_17
if
0039:   15@ ==  7  // integer values
jf @scmpath_sub_18
if
01AF:   car 7@  0 ()near_point 11@ 12@ 13@ radius  15.2  15.2  5.0
jf @scmpath_sub_18
00AD: set_car 7@ max_speed_to  5.0
01EB: set_car_density_to  0.0
0006: 15@ =  8  // integer values
05D6: clear_scmpath
0007: 11@ =  -1299.78  // floating-point values
0007: 12@ =  -565.30  // floating-point values
0007: 13@ =  13.76  // floating-point values
000A: 16@ +=  0  // integer values
0007: 17@ =  100.0  // floating-point values
0007: 18@ =  20.0  // floating-point values
05D7: add_point_to_scmpath 11@ 12@ 13@
jump @scmpath_sub_100


:scmpath_sub_18
if
0039:   15@ ==  8  // integer values
jf @scmpath_sub_109
if
01AF:   car 7@  0 ()near_point 11@ 12@ 13@ radius  25.2  25.2  5.0
jf @scmpath_sub_109
00AD: set_car 7@ max_speed_to  0.0
0006: 15@ =  1  // integer values
000A: 16@ +=  1  // integer values
05D6: clear_scmpath
0007: 11@ =  -1181.78  // floating-point values
0007: 12@ =  -331.30  // floating-point values
0007: 13@ =  13.76  // floating-point values
0007: 17@ =  100.0  // floating-point values
0007: 18@ =  20.0  // floating-point values
05D7: add_point_to_scmpath 11@ 12@ 13@

if
0039:   16@ ==  2  // integer values
jf @scmpath_sub_100
00BC: text_highpriority 'BJ_LOSE'  5000 ms  1
jump @scmpath_sub_100


:scmpath_sub_99
if
0039:   19@ ==  0  // integer values
jf @scmpath_sub_109
00AD: set_car 7@ max_speed_to  0.0
05CB: actor_goto_and_enter_car 9@ 7@  5000 
0006: 19@ =  1  // integer values
jump @scmpath_sub_109

:scmpath_sub_100
07E7: AS_assign_scmpath_to_actor 9@ in_car 7@ speed 17@ flags 2 0 3
03F0: text_draw_toggle  0
0006: 33@ =  0  // integer values
jump @scmpath_sub_109



:scmpath_sub_102
if
01F3:   car 7@ airborne
jf @scmpath_sub_103
0007: 18@ =  0.0  // floating-point values
04BA: set_car 7@ speed_instantly  18@
07E7: AS_assign_scmpath_to_actor 9@ in_car 7@ speed 17@ flags 2 0 3
jump @scmpath_sub_103

:scmpath_sub_103
if
01AF:   car 7@  0 ()near_point 11@ 12@ 13@ radius  30.2  30.2  5.0
jf @scmpath_sub_104
jump @scmpath_sub_105

:scmpath_sub_104
02E3: 20@ = car 7@ speed
if
81F3:   NOT   car 7@ airborne
jf @scmpath_sub_106
if  and
0021:   20@ >  30.0  // floating-point values
0019:   33@ >  700  // integer values
jf @scmpath_sub_105
04BA: set_car 7@ speed_instantly  50.0

:scmpath_sub_105
if
0019:   33@ >  2000  // integer values
jf @scmpath_sub_109

:scmpath_sub_106
0006: 33@ =  0  // integer values


:scmpath_sub_109
0051: return

 

 

 

 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • 1 User Currently Viewing
    0 members, 0 Anonymous, 1 Guest

×
×
  • Create New...

Important Information

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