Description

to edit the NEW Race mission script of the posted source text

NewRace_source_txt for BWMissionBuilder

 

First I copied the original CPRACE mission script and changed the labels from

:CPRACE_

to

:NEWRAC_

and from

:M_35_1

to

:RC_77_1

and added NEWRAC mission script as new mission

DEFINE MISSION 0 AT ££RC_77_1 ; originally: NEW Race Tournament / 8-track / Dirt Track

The New Race mission script starts here:

;-------------Mission 0---------------
; Originally: Race Tournament / 8-track / Dirt Track

:RC_77_1
0050: gosub £RC_77_20
00D6: if  0
0112:   wasted_or_busted
004D: jump_if_false £RC_77_7
00BC: text_highpriority 'RACES25'  5000 ms  1
0002: jump £RC_77_18

and ends here

:NEWRAC_5509
0005: $562(3) =  1701.69  ;; floating-point values
0005: $566(3) =  1649.193  ;; floating-point values
0005: $570(3) =  9.6296  ;; floating-point values
0004: $10493 =  0  ;; integer values
0004: $2332 =  0  ;; integer values
0004: $ON_MISSION =  0  ;; integer values
00D8: mission_cleanup
0051: return

 

 

 

The add of the mission starter thread:

004F: create_thread ££Ownrace_1

 

:Ownrace_1
03A4: name_thread 'TRACE'
0004: $2209 =  0  ;; integer values
0570: $x529 = create_asset_radar_marker_with_icon  53 at -1643.1 1288.6 7.1
018B: show_on_radar $x529  2

:Ownrace_2
0001: wait  0 ms
00D6: if  0
0256:   player $PLAYER_CHAR defined
004D: jump_if_false ££Ownrace_2
00D6: if  0
0038:   $ON_MISSION ==  0  ;; integer values
004D: jump_if_false ££Ownrace_2
077E: $ACTIVE_INTERIOR = active_interior
00D6: if  1
0038:   $ACTIVE_INTERIOR ==  0  ;; integer values
03EE:   player $PLAYER_CHAR controllable
004D: jump_if_false ££Ownrace_2

:Ownrace_89;Los Santos
00D6: if  0
00FE:   actor $PLAYER_ACTOR  0 ()near_point  1777.53 -1697.3402 13.4807 radius  30.0  30.0  20.0
004D: jump_if_false ££Ownrace_90
00D6: if  0
00FE:   actor $PLAYER_ACTOR  1 (in-sphere)near_point 1777.53 -1697.3402 13.4807 radius  5.2  5.2  5.0
004D: jump_if_false ££Ownrace_90
00BA: text_styled 'race_1'  1000 ms  2
04AE: unknown $2209 radar_icon_or_model  0
0004: $121 =  1  ;; integer values
0002: jump ££Ownrace_94

:Ownrace_90;San Fierro
00D6: if  0
00FE:   actor $PLAYER_ACTOR  0 ()near_point  -1917.0907 294.5054 41.1 radius  30.0  30.0  20.0
004D: jump_if_false ££Ownrace_91
00D6: if  0
00FE:   actor $PLAYER_ACTOR  1 (in-sphere)near_point -1917.0907 294.5054 41.1 radius  5.2  5.2  5.0
004D: jump_if_false ££Ownrace_91
00BA: text_styled 'race_1'  1000 ms  2
04AE: unknown $2209 radar_icon_or_model  1
0004: $121 =  1  ;; integer values
0002: jump ££Ownrace_94

:Ownrace_91;
00D6: if  0
00FE:   actor $PLAYER_ACTOR  0 ()near_point  1649.3352 912.5413 10.7 radius  30.0  30.0  20.0
004D: jump_if_false ££Ownrace_93
00D6: if  0
00FE:   actor $PLAYER_ACTOR  1 (in-sphere)near_point 1649.3352 912.5413 10.7 radius  5.2  5.2  5.0
004D: jump_if_false ££Ownrace_93
00BA: text_styled 'race_1'  1000 ms  2
04AE: unknown $2209 radar_icon_or_model  2
0004: $121 =  1  ;; integer values
0002: jump ££Ownrace_94

:Ownrace_93;San Fierro-Extra-
00D6: if  21
00FE:   actor $PLAYER_ACTOR  0 ()near_point  -1826.2 1290.96 22.6 radius  30.0  30.0  20.0
00FE:   actor $PLAYER_ACTOR  0 ()near_point  -1643.0088 1288.6865 7.1 radius  30.0  30.0  20.0
004D: jump_if_false ££Ownrace_95
00D6: if  21
00FE:   actor $PLAYER_ACTOR  1 (in-sphere)near_point -1826.2 1290.96 22.6 radius  5.2  5.2  5.0
00FE:   actor $PLAYER_ACTOR  1 (in-sphere)near_point -1643.0088 1288.6865 7.1 radius  5.2  5.2  5.0
004D: jump_if_false ££Ownrace_95
04AE: unknown $2209 radar_icon_or_model  3
0004: $121 =  1  ;; integer values

:Ownrace_94
00D6: if  0
00DF:   actor $PLAYER_ACTOR driving
004D: jump_if_false ££Ownrace_95
00D6: if  1 
84C8:   NOT   actor $PLAYER_ACTOR driving_flying_vehicle
84A7:   NOT   actor $PLAYER_ACTOR driving_boat
004D: jump_if_false ££Ownrace_95
0001: wait 50 ms
03C0: $Gcar1 = actor $PLAYER_ACTOR car
0441: $Gmodel1 = car $Gcar1 model
0A30: repair_car $Gcar1
020A: set_car  $Gcar1 door_status_to 0
0519: lock_vehicle $Gcar1 in_current_position  1
0001: wait 1000 ms
0519: lock_vehicle $Gcar1 in_current_position  0
0004: $ON_MISSION =  1  ;; integer values
01B4: set_player $PLAYER_CHAR frozen_state  0 (frozen)
0417: start_mission  0   ; Originally: Race Tournament / 8-track / Dirt Track

:Ownrace_95
0002: jump ££Ownrace_2

 

3 start points are next to the original SA race starter points
in Los Santos, San Fierro and Las Ventureas
2 start points are near the Carsaloon in Ottos Autohaus in San Fieero

The Mission starter thread includes settings for preselection
They are still the same as in the original race script / CPRACE

$121 $2209 $352

$121 is the top switch to select 2 ways in the first check of the NEWRAC mission script

 

1.
0004: $121 = 0 ;; will skip the first check of the NEWRAC mission script
and starts directly the race without select menue
In assocition with $121 = 0 you must set the value for the Jump table

04AE: unknown $352 radar_icon_or_model 25;;-25-8-Track

Exemble:

0004: $121 = 0 ;; integer values
04AE: unknown $352 radar_icon_or_model 7;;-7-;Farewell my love

 

2.
0004: $121 = 1 ;;lead the player into the first check of the NEWRAC mission script
In assocition with $121 = 1 you must set the value for select menue

04AE: unknown $2209 radar_icon_or_model 0;;-0-LS-Race

4 ways are possible
04AE: unknown $2209 radar_icon_or_model 0;;-0-LS-Race;;shows the associated race map txd
04AE: unknown $2209 radar_icon_or_model 1;;-1-SF-Race;;shows the associated race map txd
04AE: unknown $2209 radar_icon_or_model 2;;-2-LV-Race;;shows the associated race map txd

This setting, 3 , is in original CPRACE for the Air-Race
04AE: unknown $2209 radar_icon_or_model 3;;-3- Top Menue

But in NEWRAC mission script it starts my injected Top Menue
to select between
-8-Track,
DirtTrack
and the other races

By selecting other races the Top menue close and the original menue with associated race map txd pops up
But in this case are all races available
No, i mean its possible to get all
In my script I limited to race 18
The spot is in this part:

:NEWRAC_M4
00D6: if  0
0039:   @9 ==  3  ;; integer values
004D: jump_if_false £NEWRAC_M5
00D6: if  0
03EE:   player $PLAYER_CHAR controllable
004D: jump_if_false £NEWRAC_M7
0050: gosub £NEWRAC_M66
0004: $121 =  1  ;; integer values
0006: @50 =  0  ;; integer values
0006: @51 =  18  ;; integer values
0004: $352 =  12  ;; integer values
0001: wait  1000 ms
0002: jump £NEWRAC_30

these settings give the value for viewable race map txd

0006: @50 = 0 ;; integer values
0006: @51 = 18 ;; integer values

and

0004: $352 = 12 ;;
lets start the menue with race 12;san fierro fastlane

change it to
0006: @50 = 0 ;; integer values
0006: @51 = 24 ;; integer values

to can play the Air-races

But in the NEWRAC mission it isnt possible playing with flying vehicles
Because the Mission starter select to start the mission
only if CJ is in a car or on motorbike

The info pool of the Air races now are free to insert
own race settings (coords, counts of NPC cars and checkpoints)
if you wonna keep the other original races

 

The jump table $352 is the main selector to choose a race:

0871: init_jump_table $352 total_jumps  27  0 £NEWRAC_4786 jumps  0 £NEWRAC_2139  1 £NEWRAC_2200  2 £NEWRAC_2249  3 £NEWRAC_2322  4 £NEWRAC_2395  5 £NEWRAC_2474  6 £NEWRAC_2574 
0872: jump_table_jumps  7 £NEWRAC_2671  8 £NEWRAC_2781  9 £NEWRAC_2897  10 £NEWRAC_2970  11 £NEWRAC_3046  12 £NEWRAC_3110  13 £NEWRAC_3174  14 £NEWRAC_3313  15 £NEWRAC_3455 
0872: jump_table_jumps  16 £NEWRAC_3552  17 £NEWRAC_3643  18 £NEWRAC_3740  19 £NEWRAC_3819  20 £NEWRAC_3936  21 £NEWRAC_4134  22 £NEWRAC_4356  23 £NEWRAC_4449  24 £NEWRAC_4542 
0872: jump_table_jumps  25 £NEWRAC_4638  26 £NEWRAC_4703 -1 £NEWRAC_4786 -1 £NEWRAC_4786 -1 £NEWRAC_4786 -1 £NEWRAC_4786 -1 £NEWRAC_4786 -1 £NEWRAC_4786 -1 £NEWRAC_4786

 

The one of the original race script / CPRACE:

0871: init_jump_table $352 total_jumps  27  0 £CPRACE_4786 jumps  0 £CPRACE_2139  1 £CPRACE_2200  2 £CPRACE_2249  3 £CPRACE_2322  4 £CPRACE_2395  5 £CPRACE_2474  6 £CPRACE_2574 
0872: jump_table_jumps  7 £CPRACE_2671  8 £CPRACE_2781  9 £CPRACE_2897  10 £CPRACE_2970  11 £CPRACE_3046  12 £CPRACE_3110  13 £CPRACE_3174  14 £CPRACE_3313  15 £CPRACE_3455 
0872: jump_table_jumps  16 £CPRACE_3552  17 £CPRACE_3643  18 £CPRACE_3740  19 £CPRACE_3819  20 £CPRACE_3936  21 £CPRACE_4134  22 £CPRACE_4356  23 £CPRACE_4449  24 £CPRACE_4542 
0872: jump_table_jumps  25 £CPRACE_4638  26 £CPRACE_4703 -1 £CPRACE_4786 -1 £CPRACE_4786 -1 £CPRACE_4786 -1 £CPRACE_4786 -1 £CPRACE_4786 -1 £CPRACE_4786 -1 £CPRACE_4786 

By start of the race a go_sub command will read it and jumps to the given label

for exemble this setting
04AE: unknown $352 radar_icon_or_model 12;san fierro fastlane
jumps to

:NEWRAC_3110;;;san fierro fastlane
0007: @454 = -2657.164  ;; floating-point values
0007: @536 =  1153.872  ;; floating-point values
0007: @618 =  34.7396  ;; floating-point values
0007: @455 = -2593.221  ;; floating-point values
0007: @537 =  1217.854  ;; floating-point values
0007: @619 =  34.7402  ;; floating-point values
0007: @456 = -2312.288  ;; floating-point values
0007: @538 =  1176.387  ;; floating-point values
0007: @620 =  49.608  ;; floating-point values
0007: @457 = -2157.193  ;; floating-point values
0007: @539 =  1268.196  ;; floating-point values
0007: @621 =  26.0127  ;; floating-point values
0007: @458 = -1959.526  ;; floating-point values
0007: @540 =  1287.205  ;; floating-point values
0007: @622 =  6.7514  ;; floating-point values
0007: @459 = -1741.076  ;; floating-point values
0007: @541 =  1325.298  ;; floating-point values
0007: @623 =  6.083  ;; floating-point values
0007: @460 = -1759.865  ;; floating-point values
0007: @542 =  1269.147  ;; floating-point values
0007: @624 =  8.8598  ;; floating-point values
0007: @461 = -1884.242  ;; floating-point values
0007: @543 =  1160.69  ;; floating-point values
0007: @625 =  45.0107  ;; floating-point values
0007: @462 = -1897.101  ;; floating-point values
0007: @544 =  960.1686  ;; floating-point values
0007: @626 =  34.7366  ;; floating-point values
0007: @463 = -1998.178  ;; floating-point values
0007: @545 =  841.1865  ;; floating-point values
0007: @627 =  45.0219  ;; floating-point values
0007: @464 = -2189.258  ;; floating-point values
0007: @546 =  808.5273  ;; floating-point values
0007: @628 =  56.0602  ;; floating-point values
0007: @465 = -2389.186  ;; floating-point values
0007: @547 =  808.6409  ;; floating-point values
0007: @629 =  34.7495  ;; floating-point values
0007: @466 = -2589.692  ;; floating-point values
0007: @548 =  808.5219  ;; floating-point values
0007: @630 =  49.5411  ;; floating-point values
0007: @467 = -2711.488  ;; floating-point values
0007: @549 =  812.8809  ;; floating-point values
0007: @631 =  48.9309  ;; floating-point values
0007: @468 = -2750.894  ;; floating-point values
0007: @550 =  890.6993  ;; floating-point values
0007: @632 =  65.8952  ;; floating-point values
0007: @469 = -2653.912  ;; floating-point values
0007: @551 =  1157.345  ;; floating-point values
0007: @633 =  34.7386  ;; floating-point values
0006: @250 =  16  ;; integer values
0006: @256 =  6  ;; integer values
04AF: @700 = unknown_wav_reference  7 
04AF: @701 = unknown_wav_reference  7 
04AF: @702 = unknown_wav_reference  7 
04AF: @703 = unknown_wav_reference  7 
04AF: @704 = unknown_wav_reference  7
04AF: @705 = unknown_wav_reference  7 
04AF: @716 = unknown_wav_reference  559 
04AF: @717 = unknown_wav_reference  589 
04AF: @718 = unknown_wav_reference  559 
04AF: @719 = unknown_wav_reference  565 
04AF: @720 = unknown_wav_reference  558 
04AF: @721 = unknown_wav_reference  522;602<<--Player_actor_car 
0050: gosub £NEWRAC_4968
0002: jump £NEWRAC_4786

The first coords setting are the start place

0007: @454 = -2657.164 ;; X-coord
0007: @536 = 1153.872 ;; Y-coord
0007: @618 = 34.7396 ;; Z-coord

 

0006: @250 = 16 ;; integer values
this is the setting for the count of racing checkpoints


0006: @256 = 6 ;; integer values
this is the setting for the count of NPC cars


@700 - @705 are model IDs for actors
@716 - @720 are in originaly model IDs for NPC cars
@721 is in originaly the model ID of the player car

the setting for the cars are doesnt matter in the NEWRAC mission script
Because I changed something in the heart of the mission script
to let you start all races with that car you like

 

Edit now the values of the preselection
change

0006: @50 = 0 ;; integer values
0006: @51 = 18 ;; integer values

into
0006: @50 = 0 ;; integer values
0006: @51 = 19 ;; integer values


and edit the coords of the first Air race info pool
:NEWRAC_3819
You will find the coords setting of me for the SAkina mountain mod
Test it or overwrite it with your own coords.

Or edit an other info pool that you like
and make shure that the preselection can start your race

Start the race ingame in SF near Ottos Autohaus to switch in the Top menue
and choose the race you want.

Note:
The race script needs one more thread of original main to work
Its CASHWIN_1

The command in the race mission script is
004F: create_thread ££CASHWIN_1 5000 5000

 

little info about the selector entries:

0004: $121 = 0 ;; integer values
04AE: unknown $352 radar_icon_or_model 0;;-0-;Cesar in LS süd
04AE: unknown $352 radar_icon_or_model 7;;-7-;Farewell my love
04AE: unknown $352 radar_icon_or_model 8;;-8-;Farewell my love
04AE: unknown $352 radar_icon_or_model 12;;-12-san fierro fastlane
04AE: unknown $352 radar_icon_or_model 13;;-13-san fierro hills
04AE: unknown $352 radar_icon_or_model 25;;-25-8-Track
04AE: unknown $352 radar_icon_or_model 26;;-26-DirtTrack

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

0004: $121 = 1 ;; integer values
04AE: unknown $2209 radar_icon_or_model 0;;-0-LS-Races
04AE: unknown $2209 radar_icon_or_model 1;;-1-SF-Races
04AE: unknown $2209 radar_icon_or_model 2;;-2-LV-Races
04AE: unknown $2209 radar_icon_or_model 3;;-3-Top menue

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

 

 

To let you start all races with that car you like
i made a lttle hocus pokus

First the player car will be registrated in the mission starter thread

03C0: $Gcar1 = actor $PLAYER_ACTOR car
0441: $Gmodel1 = car $Gcar1 model
0A30: repair_car $Gcar1
020A: set_car  $Gcar1 door_status_to 0
0519: lock_vehicle $Gcar1 in_current_position  1
0001: wait 1000 ms
0519: lock_vehicle $Gcar1 in_current_position  0
0004: $ON_MISSION =  1  ;; integer values
01B4: set_player $PLAYER_CHAR frozen_state  0 (frozen)
0417: start_mission  0   ; Originally: Race Tournament / 8-track / Dirt Track

And in the part of creating cars of the race mission script the car for CJ will be destroyed
and replaced with $Gcar1
then $Gcar1 will be made equal to @379(@442,16i)

:NEWRAC_1055
00A5: @379(@442,16i) = create_car $Gmodel1 at @331(@442,16f) @347(@442,16f) @363(@442,16f)
00D6: if  0
0038:   $352 ==  8  ;; integer values
004D: jump_if_false £NEWRAC_1060
06E7: @36 = add_car_component #WHEEL_OR1 to_car @379(@442,16i) 

:NEWRAC_1060
00D6: if  0
8039:   NOT   @209 == -1  ;; integer values
004D: jump_if_false £NEWRAC_1064
0229: set_car @379(@442,16i) color_to @209(@442,6i) @215(@442,6i)

:NEWRAC_1064
0792: $PLAYER_ACTOR;remove_actor  from_vehicle
0001: wait 1000 ms
0174: $Z_a_rc = car @379(@442,16i) z_angle
00AA: store_car @379(@442,16i) position_to $X_k_rc $Y_k_rc $Z_k_rc
0001: wait  0 ms
00A6: destroy_car @379(@442,16i)
0001: wait  0 ms
00AB: put_car $Gcar1 at $X_k_rc $Y_k_rc $Z_k_rc
0175: set_car $Gcar1 z_angle_to $Z_a_rc
0519: lock_vehicle $Gcar1 in_current_position  0
0001: wait  0 ms
008B: @379(@442,16i) = $Gcar1  ;; integer values and handles
036A: put_actor $PLAYER_ACTOR in_car @379(@442,16i)
0001: wait 250 ms
00D6: if  0 
047A:   actor $PLAYER_ACTOR driving_a_motorbike
004D: jump_if_false £NEWRAC_1064a
01EB: set_car_density_to  0.7 
0002: jump £NEWRAC_1065

:NEWRAC_1064a
01EB: set_car_density_to  0.1

:NEWRAC_1065
0840: link_car @379(@442,16i) to_interior @221 
0175: set_car @379(@442,16i) z_angle_to $72
00D6: if  21
081F: @716(@442,16i) 
0820: @716(@442,16i) 
004D: jump_if_false £NEWRAC_1073
0519: lock_vehicle @379(@442,16i) in_current_position  1
04BA: set_car @379(@442,16i) speed_instantly  10.0

:NEWRAC_1073
0373: set_camera_directly_behind_player
02EB: restore_camera_with_jumpcut
016A: fade  1 (back)  500 ms