Quantcast

Jump to content

» «
Photo

PIT maneuver

No replies to this topic
HeresOtis
  • HeresOtis

    Trick

  • Members
  • Joined: 29 Apr 2011

#1

Posted 10 May 2012 - 02:57 AM

How does the game detect if a car has been PITted like in driving school where you have to do a PIT maneuver on a car?
I gathered this snippet of coding from main.scm and trying to understand it:
CODE
06A2: get_car 435@ velocity_in_direction_XYZ 357@ 358@ 359@ // 435@ is the car that has to be pitted
0087: 364@ = 357@ // (float)
006B: 364@ *= 357@ // (float)
0087: 365@ = 358@ // (float)
006B: 365@ *= 358@ // (float)
0087: 361@ = 364@ // (float)
005B: 361@ += 365@ // (float)
01FB: 360@ = square_root 361@
02F8: get_car 435@ Z_angle_cosine_to 355@
02F9: get_car 435@ Z_angle_sine_to 356@
0087: 364@ = 357@ // (float)
006B: 364@ *= 355@ // (float)
0087: 365@ = 358@ // (float)
006B: 365@ *= 356@ // (float)
0087: 362@ = 364@ // (float)
005B: 362@ += 365@ // (float)
0087: 364@ = 362@ // (float)
006B: 364@ *= 362@ // (float)
0087: 365@ = 361@ // (float)
0063: 365@ -= 364@ // (float)
01FB: 363@ = square_root 365@
0087: 364@ = 363@ // (float)
0073: 364@ /= 362@ // (float)
if
 364@ > 2.2
else_jump @STEAL1_5041
Car.SetAnimation(435@, 6, 2000) // idk what animation this is, I looked on the GTAG documentation but this wasn't on the list of animations
40@ = 3
49@ = 0
jump @STEAL1_5055

:STEAL1_5041
40@ = 2
49@ = 0

:STEAL1_5055
if
 40@ == 3
else_jump @STEAL1_5187
if
  not Car.Wrecked(435@)
else_jump @STEAL1_5187
00BE: text_clear_all
0687: clear_actor 443@ task
Car.SetMaxSpeed(435@, 0.0)
00BC: show_text_highpriority GXT 'STL1_05' time 5000 flag 1  // ~s~Steal the ~b~car~s~.
03CD: disable_car 435@ stuck_check
Marker.Disable(436@)
436@ = Marker.CreateAboveCar(435@)
07E0: set_marker 436@ type_to 1
if
01C1:   car 435@ stopped
else_jump @STEAL1_5187
05CF: AS_actor 443@ exit_car 435@ when_at 438@ 439@ 440@
34@ = 3

This code was used on mission Zeroing In where you have to follow the woman's pink car and steal it.




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users