Quantcast

Jump to content

» «
Photo

[SA|CLEO] Need some help in traffic paths.

5 replies to this topic
truthfinder
  • truthfinder

    Player Hater

  • Members
  • Joined: 02 Oct 2016
  • Russia

#1

Posted 4 weeks ago Edited by truthfinder, 4 weeks ago.

Hi everyone! Coded up my script for autodriving to waypoint, even implemented some kind of "path refreshing," and everything seems to be working, but that thing gets lost, if the waypoint is too far from me. Is there any opcode to... idk... store all points along path to waypoint, or make the car drive only along paths? Something like that. Any help would be appreciated.

Oh, and also, is it possible to "enable" car engine sounds while CJ is "autodriving?"

0000: NOP 

Thread 'NICEAUTODRIVER'

var 
$autopilotactivated : Integer
end

:Check
wait 0 
if 
Actor.Driving($PLAYER_ACTOR)
jf @Check
[email protected] = Actor.CurrentCar($PLAYER_ACTOR)      
0AB6: store_target_marker_coords_to [email protected] [email protected] [email protected] // IF and SET
02C1: store_to [email protected] [email protected] [email protected] car_path_coords_closest_to [email protected] [email protected] [email protected]
if
$autopilotactivated == 1
then jump @IsThere
end   
jump @Normal

:Normal
wait 0
if 
0ab0: key_pressed 90
jf @Fast                
00AE: set_car [email protected] traffic_behaviour_to 0
Car.SetMaxSpeed([email protected], 15.0)    
0423: set_car [email protected] improved_handling_to 0.5 // (float)
018C: play_sound 1058 at 0.0 0.0 0.0
wait 100
jump @IsThere

:Fast
wait 0
if 
0ab0: key_pressed 88
jf @CheckStop 
00AE: set_car [email protected] traffic_behaviour_to 2
Car.SetMaxSpeed([email protected], 30.0)               
0423: set_car [email protected] improved_handling_to 1.5 // (float)       
018C: play_sound 1058 at 0.0 0.0 0.0      
wait 100
jump @IsThere 

:CheckStop
wait 0
if and
$autopilotactivated == 1
0ab0: key_pressed 67
jf @Check
wait 100
jump @Stop

:IsThere
wait 0
if
$autopilotactivated == 1
then wait 100
end
if    
0100:   actor $PLAYER_ACTOR in_sphere [email protected] [email protected] [email protected] radius 15.0 15.0 15.0 sphere 0 in_car
jf @Drive
jump @Stop

:Drive
wait 0                     
Car.DriveTo([email protected], [email protected], [email protected], [email protected])
$autopilotactivated = 1 
jump @CheckStop

:Stop
wait 0
Car.SetMaxSpeed([email protected], 0.0)       
wait 1000                                            
0423: set_car [email protected] improved_handling_to 1.0 // (float)
072A: put_actor $PLAYER_ACTOR into_car [email protected] driverseat 
018C: play_sound 1058 at 0.0 0.0 0.0   
$autopilotactivated = 0   
jump @Check

skatefilter5
  • skatefilter5

    Controlling Both Players

  • Members
  • Joined: 30 Apr 2016
  • Canada

#2

Posted 4 weeks ago Edited by skatefilter5, 4 weeks ago.

maybe put a ped as driving then set wait to 500 then destroy actor and set the car's engine on and the lights on too and it works, it use to happen with this script  the ghost car http://www.gtainside...r-scary-version maybe take that for the example


truthfinder
  • truthfinder

    Player Hater

  • Members
  • Joined: 02 Oct 2016
  • Russia

#3

Posted 4 weeks ago

Thanks a lot! I'm not sure if it helps the paths problem, though... Givin it a try.


truthfinder
  • truthfinder

    Player Hater

  • Members
  • Joined: 02 Oct 2016
  • Russia

#4

Posted 3 weeks ago Edited by truthfinder, 3 weeks ago.

Thx a lot! I managed to create player's clone as a driver, and now can hear all the sounds. But the paths problem still remains...

 

EDIT: Can't get that sh*t to disappear. What's wrong?

0337: set_actor $PLAYER_ACTOR visibility 0
0619: enable_actor $PLAYER_ACTOR collision_detection 0 
072B: put_actor $PLAYER_ACTOR into_car [email protected] passengerseat -1
0665: get_actor $PLAYER_ACTOR model_to [email protected]
[email protected] = Actor.CreateAsDriver(CivMale, [email protected], [email protected])
0ABE:   vehicle [email protected] engine_on                 
Car.DriveTo([email protected], [email protected], [email protected], [email protected])
$autopilotactivated = 1 

Sanmodder
  • Sanmodder

    Fan script

  • Members
  • Joined: 11 Sep 2017
  • Poland

#5

Posted 3 weeks ago

 

Thx a lot! I managed to create player's clone as a driver, and now can hear all the sounds. But the paths problem still remains...

 

EDIT: Can't get that sh*t to disappear. What's wrong?

0337: set_actor $PLAYER_ACTOR visibility 0
0619: enable_actor $PLAYER_ACTOR collision_detection 0 
072B: put_actor $PLAYER_ACTOR into_car [email protected] passengerseat -1
0665: get_actor $PLAYER_ACTOR model_to [email protected]
[email protected] = Actor.CreateAsDriver(CivMale, [email protected], [email protected])
0ABE:   vehicle [email protected] engine_on                 
Car.DriveTo([email protected], [email protected], [email protected], [email protected])
$autopilotactivated = 1 

 

player in this way can not be made invisible
it would be too easy
so you can only invisible actors
try this
you only need all the parts of the body
0784: set_player $ PLAYER_CHAR textureCRC 0 modelCRC 0 bodypart 16
0784: set_player $ PLAYER_CHAR textureCRC 0 modelCRC 0 bodypart 17


truthfinder
  • truthfinder

    Player Hater

  • Members
  • Joined: 02 Oct 2016
  • Russia

#6

Posted 3 weeks ago Edited by truthfinder, 3 weeks ago.

 

 

Thx a lot! I managed to create player's clone as a driver, and now can hear all the sounds. But the paths problem still remains...

 

EDIT: Can't get that sh*t to disappear. What's wrong?

0337: set_actor $PLAYER_ACTOR visibility 0
0619: enable_actor $PLAYER_ACTOR collision_detection 0 
072B: put_actor $PLAYER_ACTOR into_car [email protected] passengerseat -1
0665: get_actor $PLAYER_ACTOR model_to [email protected]
[email protected] = Actor.CreateAsDriver(CivMale, [email protected], [email protected])
0ABE:   vehicle [email protected] engine_on                 
Car.DriveTo([email protected], [email protected], [email protected], [email protected])
$autopilotactivated = 1 

 

player in this way can not be made invisible
it would be too easy
so you can only invisible actors
try this
you only need all the parts of the body
0784: set_player $ PLAYER_CHAR textureCRC 0 modelCRC 0 bodypart 16
0784: set_player $ PLAYER_CHAR textureCRC 0 modelCRC 0 bodypart 17

 

This stuff only nudes my char. 

 

Edit: That's my code. It's working. 

0665: get_actor $PLAYER_ACTOR model_to [email protected]
0619: enable_actor $PLAYER_ACTOR collision_detection 0 
0337: set_actor $PLAYER_ACTOR visibility 0       
[email protected] = Actor.Create(CivMale, [email protected], 0.0, 0.0, 0.0)
[email protected] = Actor.Create(CivMale, [email protected], 0.0, 0.0, 0.0)
[email protected] = Actor.Create(CivMale, [email protected], 0.0, 0.0, 0.0)
[email protected] = Actor.Create(CivMale, [email protected], 0.0, 0.0, 0.0)   
0619: enable_actor [email protected] collision_detection 0 
0619: enable_actor [email protected] collision_detection 0 
0619: enable_actor [email protected] collision_detection 0  
0337: set_actor [email protected] visibility 0       
0337: set_actor [email protected] visibility 0       
0337: set_actor [email protected] visibility 0               
0430: put_actor [email protected] into_car [email protected] passenger_seat -1
0430: put_actor [email protected] into_car [email protected] passenger_seat -1
0430: put_actor [email protected] into_car [email protected] passenger_seat -1          
072B: put_actor $PLAYER_ACTOR into_car [email protected] passengerseat -1
072A: put_actor [email protected] into_car [email protected] driverseat
0ABE:   vehicle [email protected] engine_on                 
Car.DriveTo([email protected], [email protected], [email protected], [email protected])
$autopilotactivated = 1 
  • Sanmodder likes this




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users