GTAGames.nl

Een complete missie maken (GTA San Andreas)

Van WikiGTA - De Nederlandse Grand Theft Auto Walkthrough!
Ga naar: navigatie, zoeken

Hoofdpagina > Modding > Modding Tutorial List > Een complete missie maken


In deze tutorial van JGuntherS wordt je geleerd een missie te maken aan de hand van een voorbeeld, de missie "Shooting the Balla". Het plot van de missie is als volgt: je krijgt een auto, daarmee moet je naar het station in Los Santos rijden. Vlakbij het station krijg je een filmpje, waarin je ziet hoe je naar het station rijdt. Eenmaal daar aangekomen, moet je een Balla neerschieten.

De missie is geschreven in Sanny Builder. Je moet al een beetje overweg kunnen met Sanny Builder en het script, anders is het aangeraden om eerst makkelijkere tutorials door te lezen. Ook moet je om kunnen gaan met de GXT-editor, en als je dat niet kunt, dan kun je de voorgebakken GXT gebruiken.

Benodigdheden

Voorbereiding

In deze tutorial wordt gebruik gemaakt van een licht gemodificeerde (gestripte) main.scm. Kopieer de volgende code:

DEFINE OBJECTS 0
DEFINE MISSIONS 0
DEFINE EXTERNAL_SCRIPTS -1 // Use -1 to not write AAA script
DEFINE UNKNOWN_EMPTY_SEGMENT 0
DEFINE UNKNOWN_THREADS_MEMORY 0

// --------------------
// THE STRIPPED MAIN THREAD
// contains initial info
// --------------------
thread 'MAIN'
 var
  $PLAYER_CHAR: Player
  $PLAYER_ACTOR: Actor 
  $ON_MISSION: Integer
 end // var
01F0: set_max_wanted_level_to 6
042C: set_total_missions_to 1 
030D: set_total_mission_points_to 1 
set_wb_check_to 0 
00C0: set_current_time 8 0 
04E4: unknown_refresh_game_renderer_at 2488.5601 -1666.84 
Camera.SetAtPos(2488.5601, -1666.84, 13.38)
$PLAYER_CHAR = Player.Create(#NULL, 2488.5601, -1666.84, 13.38)
$PLAYER_ACTOR = Actor.EmulateFromPlayer($PLAYER_CHAR)
Camera.SetBehindPlayer
set_weather 0          
wait 0 
0180: set_on_mission_flag_to $ON_MISSION
$PLAYER_CHAR.SetClothes("PLAYER_FACE", "HEAD", Head)
$PLAYER_CHAR.SetClothes("JEANSDENIM", "JEANS", Legs)
$PLAYER_CHAR.SetClothes("SNEAKERBINCBLK", "SNEAKER", Shoes)
$PLAYER_CHAR.SetClothes("VEST", "VEST", Torso)
$PLAYER_CHAR.Build
$PLAYER_CHAR.CanMove = True
fade 1 (out) 0                    
select_interior 0
0629: change_stat 181 (islands unlocked) to  4
016C: restart_if_wasted at 2027.77 -1420.52 15.99 angle 137.0 unknown 0
016D: restart_if_busted at 1550.68 -1675.49 14.51 angle 90.0 unknown 0

end_thread

De startthread

We beginnen met de startthread van de missie, deze thread wordt niet verder uitgelegd, dat laten we aan jezelf over. Het eerste wat we moeten doen is aangeven waar de missie staat, bij het DEFINE MISSION-blok. Zet de startthread gewoon onderaan de main.scm.

// --------------------------
// Tutorialmissie startthread
// Shooting the Balla 
// Gemaakt door JGuntherS 
// ---------------------------

:StrtTh1
 var
    $MarkerX: Float
    $MarkerY: Float
    $MarkerZ: Float
    $MarkerH: Marker
    $MarkerOn: Float
    $MissionRunning: Integer
    $MTried: Integer
    $MPassed: Integer
 end    
thread 'StrtTh'
$MarkerX = 2492.378
$MarkerY = -1667.843
$MarkerZ = 13.34375

:StrtTh1_0
$MarkerH.CreateIconAndSphere(34, $MarkerX, $MarkerY, $MarkerZ)
$MarkerOn = 1

:StrtTh1_2
wait 100
if
   $ON_MISSION == 0
jf @StrtTh1_5
if and
   $ON_MISSION == 0
   $MarkerOn == 0
jf @StrtTh1_3
$MarkerH.CreateIconAndSphere(34, $MarkerX, $MarkerY, $MarkerZ)
$MarkerOn = 1

:StrtTh1_3
wait 0
if
   $PLAYER_CHAR.Defined
jf @StrtTh1_3
if
   00FF: actor $PLAYER_ACTOR 0 ()near_point_on_foot $MarkerX $MarkerY $MarkerZ radius 3.0 3.0 2.0
jf @StrtTh1_2
if
   $PLAYER_CHAR.Controllable
jf @StrtTh1_2
$MarkerH.Disable
$MarkerOn = 0
$PLAYER_CHAR.CanMove = false
00BA: text_styled 'MsName' 1500 ms 2 // Dit is een GXT-entry, die "Shooting the Balla" bevat. Deze GXT-entry moet in de table MAIN
fade 0 1500
wait 1500
start_mission 0

:StrtTh1_4
wait 10
if
   $MTried == 1
jf @StrtTh1_4
$MTried = 0
if
   $MPassed == 1
jf @StrtTh1_2
00BE: text_clear_all
03E6: remove_text_box
01E3: text_1number_styled 'M_PASS' 1000 5000 ms 1
0318: set_latest_mission_passed 'MsName' // Dit is een GXT-entry, die "Shooting the Balla" bevat. Deze GXT-entry moet in de table MAIN
030C: set_mission_points += 1
0394: play_music 1
$PLAYER_CHAR.Money += 1000
$PLAYER_CHAR.ClearWantedLevel
end_thread

:StrtTh1_5
if
   $MarkerOn == 1
jf @StrtTh1_2
$MarkerH.Disable
$MarkerOn = 0
jump @StrtTh1_2

De missie - het frame

Nu komt de missie zelf, eerst de frame: We adviseren je om een paar dingen over te typen, zodat je vertrouwd raakt met de code-helpers van Sanny. Later kun je gaan knippen en plakken wat je wilt.

DEFINE OBJECTS 0
DEFINE MISSIONS 1
DEFINE MISSION 0 AT @ShTBal
DEFINE EXTERNAL_SCRIPTS -1 // Use -1 to not write AAA script
DEFINE UNKNOWN_EMPTY_SEGMENT 0
DEFINE UNKNOWN_THREADS_MEMORY 0

// --------------------
// THE STRIPPED MAIN THREAD
// contains initial info
// --------------------
thread 'MAIN'
 var
  $PLAYER_CHAR: Player
  $PLAYER_ACTOR: Actor 
  $ON_MISSION: Integer
 end // var
01F0: set_max_wanted_level_to 6
042C: set_total_missions_to 1 
030D: set_total_mission_points_to 1 
set_wb_check_to 0 
00C0: set_current_time 8 0 
04E4: unknown_refresh_game_renderer_at 2488.5601 -1666.84 
Camera.SetAtPos(2488.5601, -1666.84, 13.38)
$PLAYER_CHAR = Player.Create(#NULL, 2488.5601, -1666.84, 13.38)
$PLAYER_ACTOR = Actor.EmulateFromPlayer($PLAYER_CHAR)
Camera.SetBehindPlayer
set_weather 0          
wait 0 
0180: set_on_mission_flag_to $ON_MISSION
$PLAYER_CHAR.SetClothes("PLAYER_FACE", "HEAD", Head)
$PLAYER_CHAR.SetClothes("JEANSDENIM", "JEANS", Legs)
$PLAYER_CHAR.SetClothes("SNEAKERBINCBLK", "SNEAKER", Shoes)
$PLAYER_CHAR.SetClothes("VEST", "VEST", Torso)
$PLAYER_CHAR.Build
$PLAYER_CHAR.CanMove = True
fade 1 (out) 0                    
select_interior 0
0629: change_stat 181 (islands unlocked) to  4
016C: restart_if_wasted at 2027.77 -1420.52 15.99 angle 137.0 unknown 0
016D: restart_if_busted at 1550.68 -1675.49 14.51 angle 90.0 unknown 0
create_thread @StrtTh1

end_thread

// --------------------------
// Tutorialmissie startthread
// Shooting the Balla 
// Gemaakt door JGuntherS 
// ---------------------------

:StrtTh1
 var
    $MarkerX: Float
    $MarkerY: Float
    $MarkerZ: Float
    $MarkerH: Marker
    $MarkerOn: Float
    $MissionRunning: Integer
    $MTried: Integer
    $MPassed: Integer
 end    
thread 'StrtTh'
$MarkerX = 2492.378
$MarkerY = -1667.843
$MarkerZ = 13.34375

:StrtTh1_0
$MarkerH.CreateIconAndSphere(34, $MarkerX, $MarkerY, $MarkerZ)
$MarkerOn = 1

:StrtTh1_2
wait 100
if
   $ON_MISSION == 0
jf @StrtTh1_5
if and
   $ON_MISSION == 0
   $MarkerOn == 0
jf @StrtTh1_3
$MarkerH.CreateIconAndSphere(34, $MarkerX, $MarkerY, $MarkerZ)
$MarkerOn = 1

:StrtTh1_3
wait 0
if
   $PLAYER_CHAR.Defined
jf @StrtTh1_3
if
   00FF: actor $PLAYER_ACTOR 0 ()near_point_on_foot $MarkerX $MarkerY $MarkerZ radius 3.0 3.0 2.0
jf @StrtTh1_2
if
   $PLAYER_CHAR.Controllable
jf @StrtTh1_2
$MarkerH.Disable
$MarkerOn = 0
$PLAYER_CHAR.CanMove = false
00BA: text_styled 'MsName' 1500 ms 2
fade 0 1500
wait 1500
start_mission 0

:StrtTh1_4
wait 10
if
   $MTried == 1
jf @StrtTh1_4
$MTried = 0
if
   $MPassed == 1
jf @StrtTh1_2
00BE: text_clear_all
03E6: remove_text_box
01E3: text_1number_styled 'M_PASS' 1000 5000 ms 1
0318: set_latest_mission_passed 'MsName'
030C: set_mission_points += 1
0394: play_music 1
$PLAYER_CHAR.Money += 1000
$PLAYER_CHAR.ClearWantedLevel
end_thread

:StrtTh1_5
if
   $MarkerOn == 1
jf @StrtTh1_2
$MarkerH.Disable
$MarkerOn = 0
jump @StrtTh1_2 

// --------------------------
// Tutorialmissie
// Shooting the Balla
// Gemaakt door JGuntherS
// ---------------------------

:ShTBal
 var
    1@: Car // Greenwood
    2@: Marker // Marker
    3@: Actor // De Balla
    4@: Marker // Marker
    5@: Car // Cameradummy
    6@: Float // X-positie van de speler
    7@: Float // Y-positie van de speler
    8@: Float // Z-positie van de speler
 end
gosub @ShTBalC
if 0
   wasted_or_busted
jf @ShTBalD
gosub @ShTBalF

:ShTBalD
gosub @ShTBalCleanup
end_thread

:ShTBalC
thread 'ShTBal'
$ON_MISSION = 1
increment_mission_attempts
054C: use_GXT_table 'TutMiss'
#GREENWOO.Load
#BALLAS1.Load
#TEC9.Load
#COLT45.Load
:ShTBalC_1
if or
   not #GREENWOO.Available
   not #BALLAS1.Available
   not #TEC9.Available
   not #COLT45.Available
jf @ShTBalC_2
wait  0 
jump @ShTBalC_1
:ShTBalC_2
0395: clear_area 1 at  2432.172 -1673.413  13.63506 range 2.0 
1@.Create(#GREENWOO, 2432.172, -1673.413, 13.63506)
1@.Angle = 0.0
2@.CreateAboveCar(1@)
07E0: set_marker 2@ type_to 1   
wait 3000
03E6: remove_text_box
fade 1 1500
wait 1500
$PLAYER_CHAR.CanMove = true
:ShTBalC_3
00BC: text_highpriority 'INCAR' 1000 ms 1
wait 10
if
  $PLAYER_CHAR.Defined
jf @ShTBalC_3
if
  not 1@.Wrecked
jf @ShTBalCarW
if
  $PLAYER_ACTOR.InCar(1@)
jf @ShTBalC_3
2@.Disable
0395: clear_area 1 at  1791.6609 -1914.6604 13.3952 range 2.0
3@.Create(Mission1, #BALLAS1, 1791.6609, -1914.6604, 13.3952)
0350: unknown_actor 3@ not_scared_flag 1
01B2: give_actor 3@ weapon 32 ammo 99999
01B9: set_actor 3@ armed_weapon_to  32
3@.WeaponAccuracy = 50
3@.SetImmunities(1, 1, 1, 1, 1)
3@.LockInCurrentPosition = true
0638: AS_actor 3@ stay_put 1
:ShTBalC_3a
4@.CreateAboveActor(3@)
2@.Disable
:ShTBalC_4
00BE: text_clear_all
03E6: remove_text_box
wait 10
if
  $PLAYER_CHAR.Defined
jf @ShTBalC_4
if
  not 1@.Wrecked
jf @ShTBalCarW
if
  $PLAYER_ACTOR.InCar(1@)
jf @ShTBalC_4_Car
if
  00EE: actor $PLAYER_ACTOR 0 near_point 1791.6609 -1914.6604 radius 150.0 150.0
jf @ShTBalC_4
jump @ShTBalC_5
:ShTBalC_4_Car
4@.Disable
2@.CreateAboveCar(1@)
07E0: set_marker 2@ type_to 1 
:ShTBalC_4_CarA
wait 10
00BC: text_highpriority 'INCAR' 1000 ms 1 
if
  not 1@.Wrecked
jf @ShTBalCarW   
if
  not $PLAYER_ACTOR.InCar(1@)
jf @ShTBalC_3a
jump @ShTBalC_4_CarA
:ShTBalC_5
$PLAYER_CHAR.CanMove = false
fade 0 1000
wait 1000
01B2: give_actor $PLAYER_ACTOR weapon 22 ammo 100
01B9: set_actor $PLAYER_ACTOR armed_weapon_to  22
02A3: toggle_widescreen 1
5@.Create(#GREENWOO, 1819.8458, -1900.9407, 54.4286)
5@.LockInCurrentPosition = true
067A: put_camera_on_car 5@ offset 0.0 0.0 -10.0 point_to_car 1@ tilt 0.0 2  
01EB: set_car_density_to 0.0
03DE: set_pedestrians_density_multiplier_to 0.0 
$PLAYER_ACTOR.StorePos(6@, 7@, 8@)
0395: clear_area 1 at  6@ 7@ 8@ range 200.0
1@.DriveTo(1814.5135, -1890.4872, 13.4141)
1@.SetMaxSpeed(10.0)
fade 1 750
wait 750
:ShTBalC_5a
wait 10
if  
  $PLAYER_CHAR.Defined
jf @ShTBalC_5a
if
  not 1@.Wrecked
jf @ShTBalCarW
if
  00EE: actor $PLAYER_ACTOR 0 near_point 1814.5135 -1890.4872 radius 2.0 2.0
jf @ShTBalC_5a
1@.DriveTo(1801.6609, -1914.6604, 13.3952)

:ShTBalC_6
wait 10
if  
  $PLAYER_CHAR.Defined
jf @ShTBalC_6
if
  not 1@.Wrecked
jf @ShTBalCarW
if
  00EE: actor $PLAYER_ACTOR 0 near_point 1801.6609 -1914.6604 radius 4.0 4.0
jf @ShTBalC_6
wait 1000
05CD: AS_actor $PLAYER_ACTOR exit_car 1@
wait 1000
fade 0 1000
wait 1000
02A3: toggle_widescreen 0
Camera.Restore_WithJumpCut
Camera.SetBehindPlayer
5@.Destroy
3@.LockInCurrentPosition = false
3@.SetImmunities(0, 0, 0, 0, 0)
01EB: set_car_density_to 1.0
03DE: set_pedestrians_density_multiplier_to 1.0 
fade 1 1000
wait 1000
$PLAYER_CHAR.CanMove = true
05E2: AS_actor 3@ kill_actor $PLAYER_ACTOR
00BC: text_highpriority 'KILLB' 1000 ms 1
:ShTBalC_7
wait 10
if
  3@.Dead
jf @ShTBalC_7
jump @ShTBalP
:ShTBalCarW
00BC: text_highpriority 'CARW' 1000 ms 1 
jump @ShTBalF
:ShTBalP
$MPassed = 1
$MTried = 1
jump @ShTBalCleanup
:ShTBalF
00BA: text_styled 'M_FAIL'  5000 ms  1 // MISSION FAILED!
$MPassed = 0
:ShTBalCleanup
1@.RemoveReferences
2@.Disable
3@.RemoveReferences
4@.Disable
$MTried = 1
$ON_MISSION = 0
#GREENWOO.Destroy
#BALLAS1.Destroy
#TEC9.Destroy
#COLT45.Destroy
mission_cleanup
return

Hiermee heb je de tutorial voltooid!