Quantcast

Jump to content

» «
Photo

main.scm crashes

16 replies to this topic
gta3masta5000
  • gta3masta5000

    Boredom.... All the time...

  • Members
  • Joined: 28 Apr 2012
  • United-States

#1

Posted 24 August 2013 - 01:39 AM

Ok, it's not the main.scm itself as the game works fine, but it has something to do with my mission (the only mission I'm working on so far). It is simple (kinda) and I don't know what it wrong with it. I took a lot of help from this tutorial. I just don't see what's wrong with it. I have it so it loads external scripts and submissions. Here's my mission code:
CODE
DEFINE MISSIONS 36
all the other missions defined here
DEFINE MISSION 35 AT @TUT_1            // my mission
So my mission is defined.

CODE
00D7: create_thread @TUT_SNIFF // without extra params
The sniffer thread as mentioned in the tutorial.

CODE
016A: fade 0 time 0
042C: set_total_missions_to 30
030D: set_max_progress 30
01F0: set_max_wanted_level_to 6
0111: set_wasted_busted_check 0
00C0: set_current_time_hours_to 6 minutes_to 0
04E4: unknown_refresh_game_renderer_at 2485.22 -1672.941
03CB: set_rendering_origin_at 2485.22 -1672.941 13.73
0053: $PLAYER_CHAR = create_player #NULL at 2485.22 -1672.941 13.73
07AF: $PLAYER_GROUP = player $PLAYER_CHAR group
01F5: $PLAYER_ACTOR = get_player_actor $PLAYER_CHAR
0373: set_camera_directly_behind_player
0173: set_actor $PLAYER_ACTOR Z_angle_to 180.0
0998: add_respect 1000
062A: change_float_stat 165 to 800.0
062A: change_float_stat 23 to 800.0
062A: change_float_stat 21 to 200.0
062A: change_float_stat 160 to 1000.0
062A: change_float_stat 223 to 1000.0
062A: change_float_stat 229 to 1000.0
062A: change_float_stat 230 to 1000.0
0629: change_integer_stat 225 to 1000
0629: change_integer_stat 22 to 1000
0629: change_integer_stat 156 to 1000
062A: change_float_stat 81 to 1000.0
0629: change_integer_stat 64 to 1000
01E8: create_forbidden_for_cars_cube_cornerA -1761.95 507.8931 35.0533 cornerB -1751.36 531.5917 41.3335
0004: $LOWR_CONT_SCRIPT_LAUNCHED = 0
0180: set_on_mission_flag_to $ONMISSION // Note: your missions have to use the variable defined here
0629: change_integer_stat 65 to 1000
062A: change_float_stat 69 to 1000.0
062A: change_float_stat 70 to 1000.0
062A: change_float_stat 71 to 1000.0
062A: change_float_stat 72 to 1000.0
062A: change_float_stat 73 to 1000.0
062A: change_float_stat 74 to 1000.0
062A: change_float_stat 75 to 1000.0
062A: change_float_stat 76 to 1000.0
062A: change_float_stat 77 to 1000.0
062A: change_float_stat 78 to 1000.0
062A: change_float_stat 79 to 1000.0
0629: change_integer_stat 181 to 1
0629: change_integer_stat 181 to 1
0629: change_integer_stat 181 to 2
0629: change_integer_stat 181 to 3
0629: change_integer_stat 181 to 4
0A1F: increase_float_stat 24 by 500.0
0330: set_player $PLAYER_CHAR infinite_run 1
Figured I'd show you that, in case it helped.

CODE
00D6: if
0256:   player $PLAYER_CHAR defined
004D: jump_if_false @TUT_SNIFF_264
Reference to the sniffer thread. This is gonna be a long post... Sorry! There are a lot of sniffer references.

CODE
:TUT_SNIFF
03A4: name_thread "TUT_SNIFF"
02A7: $439 = create_icon_marker_and_sphere $ICON_CJ at $X_JOHNSON_HOUSE $Y_JOHNSON_HOUSE $Z_JOHNSON_HOUSE

:TUT_SNIFF_30
0001: wait $DEFAULT_WAIT_TIME ms
00D6: if and
0256:   player $PLAYER_CHAR defined
0038:   $ONMISSION == 0
004D: jump_if_false @TUT_SNIFF_232
00D6: if and
00FF:   actor $PLAYER_ACTOR sphere 0 in_sphere 2495.245 -1686.825 13.51453 radius 1.0 1.0 2.0 on_foot
03EE:   player $PLAYER_CHAR controllable
0038:   $TUT_MISSIONS_PASSED == 0
004D: jump_if_false @TUT_SNIFF_145
0004: $ONMISSION = 1
00BA: show_text_styled GXT 'MYMISS_1' time 1000 style 2  // My Mission
0417: start_mission 35  // My Mission

:TUT_SNIFF_145
00D6: if and
00FF:   actor $PLAYER_ACTOR sphere 0 in_sphere 2487.8443743466537 -1677.3892961556473 13.42036 radius 1.0 1.0 2.0 on_foot
03EE:   player $PLAYER_CHAR controllable
0038:   $TUT_MISSIONS_PASSED == 1
004D: jump_if_false @TUT_SNIFF_232
0004: $ONMISSION = 1
00BA: show_text_styled GXT 'MYMISS_2' time 1000 style 2  // Hey!
0417: start_mission 2  // Intro

:TUT_SNIFF_232
0038:   $TUT_MISSIONS_PASSED == 2
004D: jump_if_false @TUT_SNIFF_30
0164: disable_marker $MARKER_SWEET_HOUSE
004E: end_thread

:TUT_SNIFF_253
0002: jump @TUT_SNIFF_264

:TUT_SNIFF_260
090F: end_external_script 70 (CARPARK1)

:TUT_SNIFF_264
0002: jump @MAIN_4308
Sniffer. Works fine.

CODE
//-------------Mission 35---------------
// Originally: My Mission

:TUT_1
03A4: name_thread 'TUT 1'
0050: gosub @CUTSCENE
00D6: if
0112:   wasted_or_busted // mission only
004D: jump_if_false @TUT_1_38
0050: gosub @MODEL_312


//---------------------
//Start Cutscene
//---------------------
:CUTSCENE
03BC: $begin = create_sphere_at 2495.245 -1686.825 13.51453 radius 1.0

repeat
wait 0
until 00FE:   actor $PLAYER_ACTOR sphere 0 in_sphere 2495.245 -1686.825 13.51453 radius 1.0 1.0 1.0

Player.CanMove($PLAYER_CHAR, false)

//---------------------
//Load Models
//---------------------

model.Load(#army)
model.Load(#patriot)
model.load(#m4)
023C: load_special_actor 'SWEET' as 1 // models 290-299
023C: load_special_actor 'KENDL' as 2 // models 290-299
023C: load_special_actor 'CESAR' as 3 // models 290-299
038B: load_requested_models

:load_check
wait 0
if and
model.available(#army)
model.available(#patriot)
model.available(#m4)
023D:   special_actor 1 loaded
023D:   special_actor 2 loaded
023D:   special_actor 3 loaded
else_jump @load_check

//---------------------
//Spawn everything in fade
//---------------------

fade 0 500
repeat
wait 0
until 816B:   not fading
02A3: enable_widescreen 1
03BD: destroy_sphere $begin

Car.Create($car, #patriot, 2503.0217, -1672.2841, 13.3594)
Car.Angle($car) = 82.3844

0129: 1@ = create_actor_pedtype 23 model #army in_car $car driverseat
01C8: 2@ = create_actor_pedtype 23 model #army in_car $car passenger_seat 0
01C8: 3@ = create_actor_pedtype 23 model #army in_car $car passenger_seat 1
01C8: 4@ = create_actor_pedtype 23 model #army in_car $car passenger_seat 2

01B2: give_actor 1@ weapon 31 ammo 60 // Load the weapon model before using this
01B2: give_actor 2@ weapon 31 ammo 60 // Load the weapon model before using this
01B2: give_actor 3@ weapon 31 ammo 60 // Load the weapon model before using this
01B2: give_actor 4@ weapon 31 ammo 60 // Load the weapon model before using this


009A: 5@ = create_actor_pedtype 4 model #SPECIAL01 at 2479.1279 -1680.2635 13.338
Actor.Angle(5@) = 359.6866
009A: 6@ = create_actor_pedtype 4 model #SPECIAL02 at 2477.7996 -1678.5049 13.3386
Actor.Angle(6@) = 266.6259
009A: 7@ = create_actor_pedtype 4 model #SPECIAL03 at 2479.3577 -1676.2166 13.337
Actor.Angle(7@) = 176.3852
00A1: put_actor $PLAYER_ACTOR at 2480.9185 -1678.2045 13.3404
Actor.Angle($PLAYER_ACTOR) = 98.7008

04ED: load_animation "GANGS"

repeat
wait 0
until 04EE:   animation "GANGS" loaded

0605: actor 5@ perform_animation_sequence "PRTIAL_GNGTLKA" IFP_file "GANGS" 4.0 loop 1 0 0 0 time -1
0605: actor 6@ perform_animation_sequence "PRTIAL_GNGTLKB" IFP_file "GANGS" 4.0 loop 1 0 0 0 time -1
0605: actor 7@ perform_animation_sequence "PRTIAL_GNGTLKC" IFP_file "GANGS" 4.0 loop 1 0 0 0 time -1
0605: actor $PLAYER_ACTOR perform_animation_sequence "PRTIAL_GNGTLKC" IFP_file "GANGS" 4.0 loop 1 0 0 0 time -1

Camera.SetPosition(2472.7151, -1681.5944, 16.9041, 0.0, 0.0, 0.0)
Camera.PointAt(2494.2827, -1669.9541, 13.3359, 2)
wait 2000
00A7: car $car drive_to 2487.1799 -1670.8324 13.3359
fade 1 500
repeat
wait 0
until 816B:   not fading

//---------------------
//Behaviour after fade
//---------------------

repeat
wait 10
until 01AE:   car $car sphere 0 near_point 2487.1799 -1670.8324 radius 3.0 3.0 stopped

0160: set_camera_point_at 2494.2827 -1669.9541 9.3359 mode 2

05CD: AS_actor 1@ exit_car $car
05CD: AS_actor 2@ exit_car $car
05CD: AS_actor 3@ exit_car $car
05CD: AS_actor 4@ exit_car $car

0635: AS_actor 1@ aim_at_actor $PLAYER_ACTOR -1 ms
0635: AS_actor 2@ aim_at_actor $PLAYER_ACTOR -1 ms
0635: AS_actor 3@ aim_at_actor $PLAYER_ACTOR -1 ms
0635: AS_actor 4@ aim_at_actor $PLAYER_ACTOR -1 ms

074D: AS_actor $PLAYER_ACTOR turns_to_and_look_at_actor 1@ timelimit -1
074D: AS_actor 5@ turns_to_and_look_at_actor 1@ timelimit -1
074D: AS_actor 6@ turns_to_and_look_at_actor 1@ timelimit -1
074D: AS_actor 7@ turns_to_and_look_at_actor 1@ timelimit -1

wait 2500

05C4: AS_actor $PLAYER_ACTOR hands_up -1 ms
05C4: AS_actor 5@ hands_up -1 ms
05C4: AS_actor 6@ hands_up -1 ms
05C4: AS_actor 7@ hands_up -1 ms

wait 5000

//---------------------
//Cleanup
//---------------------

fade 0 500
repeat
wait 0
until 816B:   not fading


00A6: destroy_car $car
009B: destroy_actor 1@
009B: destroy_actor 2@
009B: destroy_actor 3@
009B: destroy_actor 4@


0687: clear_actor $PLAYER_ACTOR task
Player.CanMove($PLAYER_CHAR, true)
0373: set_camera_directly_behind_player
02EB: restore_camera_with_jumpcut
02A3: enable_widescreen 0

wait 2000

fade 1 500
repeat
wait 0
until 816B:   not fading
jump @MODEL  

:TUT_1_38
0050: gosub @MODEL_330
004E: end_thread

:MODEL
03A4: name_thread 'MODEL'
0247: load_model #GREENWOO
0247: load_model #MICRO_UZI
0247: load_model #BFYST
038B: load_requested_models

:MODEL_27
00D6: if or
8248:   not model #GREENWOO available
8248:   not model #MICRO_UZI available
8248:   not model #BFYST available
004D: jump_if_false @MODEL_63
0001: wait 0 ms
0002: jump @MODEL_27

:MODEL_63
0674: set_car_model #GREENWOO numberplate "YOURCAR"
00A5: $GREENWOOD = create_car #GREENWOO at 2458.248 -1659.026 13.3047
0175: set_car $GREENWOOD Z_angle_to 270.0
0224: set_car $GREENWOOD health_to 1000
0186: $M1 = create_marker_above_car $GREENWOOD
0165: set_marker $m1 color_to 4
01B2: give_actor $PLAYER_ACTOR weapon 28 ammo 1000 // Load the weapon model before using this
01B9: set_actor $PLAYER_ACTOR armed_weapon_to 28
05CA: AS_actor 5@ enter_car $GREENWOOD passenger_seat 0 10000 ms
05CA: AS_actor 6@ enter_car $GREENWOOD passenger_seat 1 10000 ms
05CA: AS_actor 7@ enter_car $GREENWOOD passenger_seat 2 10000 ms  
jump @mymissmain

:mymissmain
010D: set_player $PLAYER_CHAR wanted_level_to 4
00BC: show_text_highpriority GXT 'MYMISS_3' time 4000 flag 1
if
00DD:   actor $PLAYER_ACTOR driving_car_with_model #GREENWOO
02A7: $ICON_SPHERE_CJ = create_icon_marker_and_sphere 62 at 723.2675 -1160.0251 16.7114
00BC: show_text_highpriority GXT 'MYMISS_4' time 4000 flag 1
if
0103:   actor $PLAYER_ACTOR in_sphere 723.2675 -1160.0251 16.7114 radius 4.0 4.0 6.0 sphere 0 stopped_in_car
jump @CUTSCENE_2

:CUTSCENE_2
if
Player.CanMove($PLAYER_CHAR, false)
jf @CUTSCENE_2
jump @animload

:animload
04ED: load_animation "SEAT_TALK_01"
repeat
wait 0
until 04EE:   animation "SEAT_TALK_01" loaded
0719: enable_dialogue_mode
0717: assign_actor 7@ to_dialogue_mode
0605: actor 7@ perform_animation_sequence "SEAT_idle" IFP_file "SEAT_TALK_01" 10.0 loop 1 0 0 0 time -1 // versionA
00BC: show_text_highpriority GXT 'MYMISS_5' time 10000 flag 1
0967: actor 7@ move_mouth 10000 ms
08ED: remove_actor 7@ from_dialogue_mode
0633: AS_actor 5@ exit_car
0633: AS_actor 6@ exit_car
0633: AS_actor 7@ exit_car
009B: destroy_actor 5@
009B: destroy_actor 6@
009B: destroy_actor 7@
0002: jump @MODEL_241


:MODEL_144
0001: wait 0 ms
00DB:   actor $PLAYER_ACTOR in_car $GREENWOOD
004D: jump_if_false @MODEL_144
0164: disable_marker $M1
0004: $COORDINATE_X = 2100.96
0004: $COORDINATE_Y = -1366.837
0004: $COORDINATE_Z = 23.9844
02A7: $COORDINATE = create_icon_marker_and_sphere 0 at $COORDINATE_X $COORDINATE_Y $COORDINATE_Z

:MODEL_214
0001: wait 0 ms
00D6: if
0119:   car $GREENWOOD wrecked
004D: jump_if_false @MODEL_241
0002: jump @MODEL_63

:MODEL_241
0001: wait 0 ms
00D6: if
01AE:   car $GREENWOOD sphere 0 near_point $COORDINATE_X $COORDINATE_Y radius 5.0 5.0 stopped
004D: jump_if_false @MODEL_214
0394: play_music 1
0109: player $PLAYER_CHAR money += 10000
01E3: show_text_1number_styled GXT 'M_PASS' number 10000 time 5000 style 1  // MISSION PASSED!~n~~w~$~1~
0051: return

:MODEL_312
00BA: show_text_styled GXT 'M_FAIL' time 5000 style 1  // ~r~MISSION FAILED!
0051: return

:MODEL_330
0004: $ONMISSION = 0
0164: disable_marker $VICTIM_MARKER
010D: set_player $PLAYER_CHAR wanted_level_to 0
0249: release_model #BFYST
0249: release_model #BMYST
00D8: mission_cleanup
0051: return
My mission. It crashes after the cutscene you see at the top.

CODE

//---------------------
//Start Cutscene
//---------------------
:CUTSCENE
03BC: $begin = create_sphere_at 2495.245 -1686.825 13.51453 radius 1.0

repeat
wait 0
until 00FE:   actor $PLAYER_ACTOR sphere 0 in_sphere 2495.245 -1686.825 13.51453 radius 1.0 1.0 1.0

Player.CanMove($PLAYER_CHAR, false)

//---------------------
//Load Models
//---------------------

model.Load(#army)
model.Load(#patriot)
model.load(#m4)
023C: load_special_actor 'SWEET' as 1 // models 290-299
023C: load_special_actor 'KENDL' as 2 // models 290-299
023C: load_special_actor 'CESAR' as 3 // models 290-299
038B: load_requested_models

:load_check
wait 0
if and
model.available(#army)
model.available(#patriot)
model.available(#m4)
023D:   special_actor 1 loaded
023D:   special_actor 2 loaded
023D:   special_actor 3 loaded
else_jump @load_check

//---------------------
//Spawn everything in fade
//---------------------

fade 0 500
repeat
wait 0
until 816B:   not fading
02A3: enable_widescreen 1
03BD: destroy_sphere $begin

Car.Create($car, #patriot, 2503.0217, -1672.2841, 13.3594)
Car.Angle($car) = 82.3844

0129: 1@ = create_actor_pedtype 23 model #army in_car $car driverseat
01C8: 2@ = create_actor_pedtype 23 model #army in_car $car passenger_seat 0
01C8: 3@ = create_actor_pedtype 23 model #army in_car $car passenger_seat 1
01C8: 4@ = create_actor_pedtype 23 model #army in_car $car passenger_seat 2

01B2: give_actor 1@ weapon 31 ammo 60 // Load the weapon model before using this
01B2: give_actor 2@ weapon 31 ammo 60 // Load the weapon model before using this
01B2: give_actor 3@ weapon 31 ammo 60 // Load the weapon model before using this
01B2: give_actor 4@ weapon 31 ammo 60 // Load the weapon model before using this


009A: 5@ = create_actor_pedtype 4 model #SPECIAL01 at 2479.1279 -1680.2635 13.338
Actor.Angle(5@) = 359.6866
009A: 6@ = create_actor_pedtype 4 model #SPECIAL02 at 2477.7996 -1678.5049 13.3386
Actor.Angle(6@) = 266.6259
009A: 7@ = create_actor_pedtype 4 model #SPECIAL03 at 2479.3577 -1676.2166 13.337
Actor.Angle(7@) = 176.3852
00A1: put_actor $PLAYER_ACTOR at 2480.9185 -1678.2045 13.3404
Actor.Angle($PLAYER_ACTOR) = 98.7008

04ED: load_animation "GANGS"

repeat
wait 0
until 04EE:   animation "GANGS" loaded

0605: actor 5@ perform_animation_sequence "PRTIAL_GNGTLKA" IFP_file "GANGS" 4.0 loop 1 0 0 0 time -1
0605: actor 6@ perform_animation_sequence "PRTIAL_GNGTLKB" IFP_file "GANGS" 4.0 loop 1 0 0 0 time -1
0605: actor 7@ perform_animation_sequence "PRTIAL_GNGTLKC" IFP_file "GANGS" 4.0 loop 1 0 0 0 time -1
0605: actor $PLAYER_ACTOR perform_animation_sequence "PRTIAL_GNGTLKC" IFP_file "GANGS" 4.0 loop 1 0 0 0 time -1

Camera.SetPosition(2472.7151, -1681.5944, 16.9041, 0.0, 0.0, 0.0)
Camera.PointAt(2494.2827, -1669.9541, 13.3359, 2)
wait 2000
00A7: car $car drive_to 2487.1799 -1670.8324 13.3359
fade 1 500
repeat
wait 0
until 816B:   not fading

//---------------------
//Behaviour after fade
//---------------------

repeat
wait 10
until 01AE:   car $car sphere 0 near_point 2487.1799 -1670.8324 radius 3.0 3.0 stopped

0160: set_camera_point_at 2494.2827 -1669.9541 9.3359 mode 2

05CD: AS_actor 1@ exit_car $car
05CD: AS_actor 2@ exit_car $car
05CD: AS_actor 3@ exit_car $car
05CD: AS_actor 4@ exit_car $car

0635: AS_actor 1@ aim_at_actor $PLAYER_ACTOR -1 ms
0635: AS_actor 2@ aim_at_actor $PLAYER_ACTOR -1 ms
0635: AS_actor 3@ aim_at_actor $PLAYER_ACTOR -1 ms
0635: AS_actor 4@ aim_at_actor $PLAYER_ACTOR -1 ms

074D: AS_actor $PLAYER_ACTOR turns_to_and_look_at_actor 1@ timelimit -1
074D: AS_actor 5@ turns_to_and_look_at_actor 1@ timelimit -1
074D: AS_actor 6@ turns_to_and_look_at_actor 1@ timelimit -1
074D: AS_actor 7@ turns_to_and_look_at_actor 1@ timelimit -1

wait 2500

05C4: AS_actor $PLAYER_ACTOR hands_up -1 ms
05C4: AS_actor 5@ hands_up -1 ms
05C4: AS_actor 6@ hands_up -1 ms
05C4: AS_actor 7@ hands_up -1 ms

wait 5000

//---------------------
//Cleanup
//---------------------

fade 0 500
repeat
wait 0
until 816B:   not fading


00A6: destroy_car $car
009B: destroy_actor 1@
009B: destroy_actor 2@
009B: destroy_actor 3@
009B: destroy_actor 4@


0687: clear_actor $PLAYER_ACTOR task
Player.CanMove($PLAYER_CHAR, true)
0373: set_camera_directly_behind_player
02EB: restore_camera_with_jumpcut
02A3: enable_widescreen 0
This one. I have no idea why! It just either crashes or freezes. IDK what to do. Help me please!

ZAZ
  • ZAZ

    Kernlochbohrer

  • Members
  • Joined: 10 Jan 2005
  • European-Union

#2

Posted 24 August 2013 - 12:49 PM

some totally wrong conditional checks and in this case is your check building a loop
CODE
:CUTSCENE_2
if
Player.CanMove($PLAYER_CHAR, false)
jf @CUTSCENE_2

it wanna jump back to CUTSCENE_2

if code is looping requires to start with wait after the loopadress
CODE
:CUTSCENE_2
wait 0



this isn't a conditonal code and can't be used in a conditional check
CODE
Player.CanMove($PLAYER_CHAR, false)


this would be the working check:
CODE
:CUTSCENE_2
wait 0
if
09E7:   player $PLAYER_CHAR not_frozen
jf @CUTSCENE_2



These checks are also wrong and won't work (game don't waits till $PLAYER_ACTOR is in GREENWOOD)
because the else-jump instruction is missing
CODE
if
00DD:   actor $PLAYER_ACTOR driving_car_with_model #GREENWOO
02A7: $ICON_SPHERE_CJ = create_icon_marker_and_sphere 62 at 723.2675 -1160.0251 16.7114
00BC: show_text_highpriority GXT 'MYMISS_4' time 4000 flag 1
if
0103:   actor $PLAYER_ACTOR in_sphere 723.2675 -1160.0251 16.7114 radius 4.0 4.0 6.0 sphere 0 stopped_in_car
jump @CUTSCENE_2



it needs to build loops to wait if $PLAYER_ACTOR is in GREENWOOD
CODE
:mymissmain
010D: set_player $PLAYER_CHAR wanted_level_to 4
00BC: show_text_highpriority GXT 'fem_ok' time 4000 flag 1

:mymissmain_1
wait 0
if
00DD:   actor $PLAYER_ACTOR driving_car_with_model #GREENWOO
else_jump @mymissmain_1

02A7: $ICON_SPHERE_CJ = create_icon_marker_and_sphere 62 at 723.2675 -1160.0251 16.7114
00BC: show_text_highpriority GXT 'fem_on' time 4000 flag 1

:mymissmain_2
wait 0
if
0103:   actor $PLAYER_ACTOR in_sphere 723.2675 -1160.0251 16.7114 radius 4.0 4.0 6.0 sphere 0 stopped_in_car
else_jump @mymissmain_2
jump @CUTSCENE_2





"SEAT_idle" isn't a animation of ifp file "SEAT_TALK_01" but "ped"

ifp file "ped" may not be loaded

animation can't be executed because actors should exit car and will be destroyed


CODE
:animload
04ED: load_animation "SEAT_TALK_01"
repeat
wait 0
until 04EE:   animation "SEAT_TALK_01" loaded

//this will be read in a millisecond vv
0719: enable_dialogue_mode
0717: assign_actor 7@ to_dialogue_mode
0605: actor 7@ perform_animation_sequence "SEAT_idle" IFP_file "SEAT_TALK_01" 10.0 loop 1 0 0 0 time -1 // versionA
00BC: show_text_highpriority GXT 'MYMISS_5' time 10000 flag 1
0967: actor 7@ move_mouth 10000 ms
08ED: remove_actor 7@ from_dialogue_mode
0633: AS_actor 5@ exit_car
0633: AS_actor 6@ exit_car
0633: AS_actor 7@ exit_car
009B: destroy_actor 5@
009B: destroy_actor 6@
009B: destroy_actor 7@
0002: jump @MODEL_241




this works:
CODE
:CUTSCENE_2
wait 0
if
09E7:   player $PLAYER_CHAR not_frozen
jf @CUTSCENE_2
jump @animload

:animload
wait 0
if and
00DB:   actor $PLAYER_ACTOR in_car 5@
00DB:   actor $PLAYER_ACTOR in_car 6@
00DB:   actor $PLAYER_ACTOR in_car 7@
jf @animload

0605: actor 7@ perform_animation_sequence "SEAT_idle" IFP_file "ped" 10.0 loop 1 0 0 0 time -1 // versionA
0002: jump @MODEL_241

gta3masta5000
  • gta3masta5000

    Boredom.... All the time...

  • Members
  • Joined: 28 Apr 2012
  • United-States

#3

Posted 24 August 2013 - 01:10 PM Edited by gta3masta5000, 24 August 2013 - 02:13 PM.

Love ya ZAZ! I got it to where the mission no longer starts but the sphere and icon show... (I made a copy of my GTA SA folder so I can play GTA SA and work on my total conversion). Ummmm.... Hmmm... I can't figure out how to get the mission to start now..... I'm working on it, though! I might have the
CODE
00FF:   actor $PLAYER_ACTOR sphere 0 in_sphere 2487.8443743466537 -1677.3892961556473 13.42036 radius 1.0 1.0 2.0 on_foot
coordinates wrong... IDK, though.
Here's my (recently) updated sniffer thread (updated to only sniff one mission).
CODE
// $TUT_MISSION_PASSED has to be cleared (0).
// When you pass the mission, you have to raise $TUT_MISSIONS_PASSED.
:TUT_MISSIONS_SNIFFER
thread "TUT_SNIFF"
$X_JOHNSON_HOUSE = 2487.8443743466537  
$Y_JOHNSON_HOUSE = -1677.3892961556473
$Z_JOHNSON_HOUSE = 13.42036
02A7: $439 = create_icon_marker_and_sphere $ICON_CJ at $X_JOHNSON_HOUSE $Y_JOHNSON_HOUSE $Z_JOHNSON_HOUSE
repeat
wait $DEFAULT_WAIT_TIME
if and
  player.Defined($PLAYER_CHAR)
  $ONMISSION == 0
then
  if and
    00FF:   actor $PLAYER_ACTOR sphere 0 in_sphere 2487.8443743466537 -1677.3892961556473 13.42036 radius 1.0 1.0 2.0 on_foot
    Player.Controllable($PLAYER_CHAR)
    $TUT_MISSIONS_PASSED == 0
  then
    $ONMISSION = 1
    00BA: show_text_styled GXT 'MYMISS_1' time 1000 style 2  
   start_mission 35
  end
FIXED! It works! Anyway, IDK why, but instead of saying to get to a safe place like I want, the marker and icon for Sweet's car just stay there and to get rid of the wanted level, you have to go to the pay N' spray... That's not what I want. How do I do this?

gta3masta5000
  • gta3masta5000

    Boredom.... All the time...

  • Members
  • Joined: 28 Apr 2012
  • United-States

#4

Posted 24 August 2013 - 05:24 PM

Would it be possible to do this without the sniffer thread? If so, how? Would it be easier?

ZAZ
  • ZAZ

    Kernlochbohrer

  • Members
  • Joined: 10 Jan 2005
  • European-Union

#5

Posted 24 August 2013 - 05:56 PM

QUOTE (gta3masta5000 @ Saturday, Aug 24 2013, 18:24)
Would it be possible to do this without the sniffer thread? If so, how? Would it be easier?

- you could add the start mission code in the main thread instead adding a sniffer, but then the user don't have the option to walk into red marker

- your mission script is really small so you can make it also as normal thread instead "define mission, add mission sniffer, add mission"
this makes also more sense to learn writing scripts

gta3masta5000
  • gta3masta5000

    Boredom.... All the time...

  • Members
  • Joined: 28 Apr 2012
  • United-States

#6

Posted 24 August 2013 - 06:03 PM

QUOTE (ZAZ @ Saturday, Aug 24 2013, 17:56)
QUOTE (gta3masta5000 @ Saturday, Aug 24 2013, 18:24)
Would it be possible to do this without the sniffer thread? If so, how? Would it be easier?

- you could add the start mission code in the main thread instead adding a sniffer, but then the user don't have the option to walk into red marker

- your mission script is really small so you can make it also as normal thread instead "define mission, add mission sniffer, add mission"
this makes also more sense to learn writing scripts

Well, with the fact of it being small, it's because I'm still learning mission making. It will get bigger, though. That idea will be good for an intro, though. I still can't get the icon and sphere in Vinewood (the one where I want the player to have to drive to) to appear. The player gets in the car with his friends and the marker on the car goes away (as does the icon, naturally), but no icon or marker in Vinewood, leaving the player to drive like a maniac with probably at least 2 flat tires to pay N' spray to lose the wanted level, so the mission never ends. On that note, I also can't figure out how to make it so getting the friends killed or the car wrecked fail the mission. I have tried everything for that. Also, I really appreciate your helpfulness, ZAZ.

gta3masta5000
  • gta3masta5000

    Boredom.... All the time...

  • Members
  • Joined: 28 Apr 2012
  • United-States

#7

Posted 24 August 2013 - 06:22 PM

Is the mission trigger
CODE
:MissionTrigger 0001: wait 0 ms 00D6: if 0256: player $PLAYER_CHAR defined 004D: jump_if_false @MissionTriggerEnd 00D6: if 0038: $ONMISSION == 0 004D: jump_if_false @MissionTriggerEnd 00D6: if // Place your condition to start your mission 004D: jump_if_false @MissionTriggerEnd 0417: start_mission ### 0004: $ONMISSION = 1

   MissionTriggerEnd

0002: jump @MissionTrigger
(taken from here) any different than the sniffer?

ZAZ
  • ZAZ

    Kernlochbohrer

  • Members
  • Joined: 10 Jan 2005
  • European-Union

#8

Posted 24 August 2013 - 07:58 PM Edited by ZAZ, 24 August 2013 - 08:04 PM.

QUOTE (gta3masta5000 @ Saturday, Aug 24 2013, 19:03)
Well, with the fact of it being small, it's because I'm still learning mission making.
Learn scripting by writing small scripts, only simple threads

QUOTE
It will get bigger, though. That idea will be good for an intro, though.
you can't write such a big mission script that you need to do it as mission script
don't try it, you will get a script full of failures and problems

QUOTE
I still can't get the icon and sphere in Vinewood (the one where I want the player to have to drive to) to appear. The player gets in the car with his friends and the marker on the car goes away (as does the icon, naturally), but no icon or marker in Vinewood, leaving the player to drive like a maniac with probably at least 2 flat tires to pay N' spray to lose the wanted level, so the mission never ends.
this (opcode 02A7) shows an icon on radar and a red sphere, if mission mode = 0
CODE
02A7: $439 = create_icon_marker_and_sphere $ICON_CJ at $X_JOHNSON_HOUSE $Y_JOHNSON_HOUSE $Z_JOHNSON_HOUSE

but the parameters have variables
i don't know if you have declared the variables anywhere in your main
if not, then the variables are zero because all variables are 0 by default

this works:
CODE
0005: $X_JOHNSON_HOUSE = 2495.214
0005: $Y_JOHNSON_HOUSE = -1687.03
0005: $Z_JOHNSON_HOUSE = 12.5144
02A7: $439 = create_icon_marker_and_sphere 15 at $X_JOHNSON_HOUSE $Y_JOHNSON_HOUSE $Z_JOHNSON_HOUSE


this don't work
CODE
02A7: $ICON_SPHERE_CJ = create_icon_marker_and_sphere 62 at 723.2675 -1160.0251 16.7114

because it's while mission mode, but...
... opcode 02A7 works only if mission mode = 0


QUOTE
I also can't figure out how to make it so getting the friends killed or the car wrecked fail the mission. I have tried everything for that.
It needs to build a loop with conditional checks to check if actors are dead or car is wrecked
CODE
:Loop
wait 0
if and
0118:   actor 5@ dead
0118:   actor 6@ dead
0118:   actor 7@ dead
else_jump @check2
jump @fail

:check2
wait 0
if
0119:   car $GREENWOOD wrecked
else_jump @Loop
jump @fail



QUOTE (gta3masta5000 @ Saturday, Aug 24 2013, 19:22)
Is the mission trigger
CODE
:MissionTrigger 0001: wait 0 ms 00D6: if 0256: player $PLAYER_CHAR defined 004D: jump_if_false @MissionTriggerEnd 00D6: if 0038: $ONMISSION == 0 004D: jump_if_false @MissionTriggerEnd 00D6: if // Place your condition to start your mission 004D: jump_if_false @MissionTriggerEnd 0417: start_mission ### 0004: $ONMISSION = 1

   MissionTriggerEnd

0002: jump @MissionTrigger
(taken from here) any different than the sniffer?

this template lost the formation by adding into website
in code format will it look like this:
CODE
:MissionTrigger
0001: wait 0 ms
00D6: if
0256: player $PLAYER_CHAR defined
004D: jump_if_false @MissionTriggerEnd
00D6: if
0038: $ONMISSION == 0
004D: jump_if_false @MissionTriggerEnd
00D6: if
// Place your condition to start your mission
004D: jump_if_false @MissionTriggerEnd
0417: start_mission
0004: $ONMISSION = 1

//  MissionTriggerEnd

0002: jump @MissionTrigger

it's uncomplete

gta3masta5000
  • gta3masta5000

    Boredom.... All the time...

  • Members
  • Joined: 28 Apr 2012
  • United-States

#9

Posted 24 August 2013 - 08:22 PM

QUOTE (ZAZ @ Saturday, Aug 24 2013, 19:58)
Learn scripting by writing small scripts, only simple threads

Ok, I understand what your saying. I'm saying that I understand quite a bit of the scripting basics, and with all the tutorials out there and the help of you and the other helpful people here on GTA Forums, my knowledge grows each day. I am not new to sanny builder or any of it's concepts, but I am new to mission making with sanny builder.

QUOTE
you can't write such a big mission script that you need to do it as mission script
don't try it, you will get a script full of failures and problems

Ok, is this one directed at the fact I'm trying to make a mission or the fact that I said it's a good idea for an intro? What I meant by that was an intro for my total conversion (which is, obviously, WIP as this is the first mission). When this mission is complete, I can use it as a template for my others. I will obviously need variety, though.


QUOTE
this (opcode 02A7) shows an icon on radar and a red sphere, if mission mode = 0
CODE
02A7: $439 = create_icon_marker_and_sphere $ICON_CJ at $X_JOHNSON_HOUSE $Y_JOHNSON_HOUSE $Z_JOHNSON_HOUSE

but the parameters have variables
i don't know if you have declared the variables anywhere in your main
if not, then the variables are zero because all variables are 0 by default

this works:
CODE
0005: $X_JOHNSON_HOUSE = 2495.214
0005: $Y_JOHNSON_HOUSE = -1687.03
0005: $Z_JOHNSON_HOUSE = 12.5144
02A7: $439 = create_icon_marker_and_sphere 15 at $X_JOHNSON_HOUSE $Y_JOHNSON_HOUSE $Z_JOHNSON_HOUSE


this don't work
CODE
02A7: $ICON_SPHERE_CJ = create_icon_marker_and_sphere 62 at 723.2675 -1160.0251 16.7114

because it's while mission mode, but...
... opcode 02A7 works only if mission mode = 0
Oh... I didn't know. The tutorials out there don't mention this s*!t, so I had no idea. You should write a tutorial explaining a lot of the things the tutorials out there don't. smile.gif

QUOTE
It needs to build a loop with conditional checks to check if actors are dead or car is wrecked
CODE
:Loop
wait 0
if and
0118:   actor 5@ dead
0118:   actor 6@ dead
0118:   actor 7@ dead
else_jump @check2
jump @fail

:check2
wait 0
if
0119:   car $GREENWOOD wrecked
else_jump @Loop
jump @fail
Huh, yet another. I tell you, man, you should consider that.
QUOTE
You should write a tutorial explaining a lot of the things the tutorials out there don't. smile.gif


QUOTE
this template lost the formation by adding into website
in code format will it look like this:
CODE
:MissionTrigger
0001: wait 0 ms
00D6: if
0256: player $PLAYER_CHAR defined
004D: jump_if_false @MissionTriggerEnd
00D6: if
0038: $ONMISSION == 0
004D: jump_if_false @MissionTriggerEnd
00D6: if
// Place your condition to start your mission
004D: jump_if_false @MissionTriggerEnd
0417: start_mission
0004: $ONMISSION = 1

//  MissionTriggerEnd

0002: jump @MissionTrigger
Yeah, I noticed it lost formation only after I hit the submit button. Heh.


QUOTE
it's uncomplete
I understand that, but if I complete it, can I use it? Would it be easier than the sniffer or is it the same? From what I can tell, the sniffer does not allow me to place conditions (either that or he just didn't label the spot to place them).

gta3masta5000
  • gta3masta5000

    Boredom.... All the time...

  • Members
  • Joined: 28 Apr 2012
  • United-States

#10

Posted 24 August 2013 - 08:43 PM

What if I use these separately (to make the sphere in Vinewood)

CODE
02A8: $marker03 = create_marker 0 at 723.2675 -1160.0251 16.7114
0 is the icon I want it to be smile.gif small yellow square smile.gif

and

CODE
03BC: 10@ = create_sphere_at 723.2675 -1160.0251 16.7114 radius 5.0


If I use these together, will it work? Do either of these work with the $onmission = 1 flag?

gta3masta5000
  • gta3masta5000

    Boredom.... All the time...

  • Members
  • Joined: 28 Apr 2012
  • United-States

#11

Posted 24 August 2013 - 09:10 PM

It worked! I just need to get the last cutscene working properly. smile.gif Thx for all your help, man!

ZAZ
  • ZAZ

    Kernlochbohrer

  • Members
  • Joined: 10 Jan 2005
  • European-Union

#12

Posted 24 August 2013 - 10:17 PM

About red sphere: location checks have an integrated sphereparameter
example:
red sphere in Grovestreet teleports on to roof of CJ's house
CODE

:Teleport_1
03A4: name_thread 'TELE'

:Teleport_2
wait 0
if
0256:   player $PLAYER_CHAR defined
jf @Teleport_2
if
00FF:   actor $PLAYER_ACTOR sphere 1 in_sphere 2493.5 -1682.5 13.35 radius 1.0 1.0 1.0 on_foot
jf @Teleport_2
00A1: put_actor $PLAYER_ACTOR at 2524.5  -1677.5  19.95
jump @Teleport_2


The red marker (sphere) will be displayed by opcode 00FF:, 2. parameter: sphere 1 (sphere 0 don't show a red sphere)
Furthermore is it very important to have 0 ms wait time as maximum in the Loop
With more than 0 ms wait time it won't display a red sphere
Example:
CODE
:Teleport_2
wait 10
now the sphere won't be shown


Also is it important to know that there are limits for spheres
Look in Sanny Builder Help: SCM Documentation: GTA Limits

There are several opcodes which show a sphere

Just to create a sphere
CODE
03BC: 1@ = create_sphere_at 2493.5  -1682.5  13.35 radius 1.0
//eventual needs to remove the sphere at any time
03BD: destroy_sphere 1@

Radarmarker with sphere
CODE
02A7: 0@ = create_icon_marker_and_sphere 35 at 2493.5  -1682.5  13.35
//as well as
0570: 1@ = create_asset_radar_marker_with_icon  35 at -2007.8 189.1 27.5
//eventual needs to remove the marker at any time
0164: disable_marker 0@
0164: disable_marker 1@

Location checks for actor
CODE
00FE:   actor $PLAYER_ACTOR sphere 1 in_sphere 2493.5  -1682.5  13.35 radius 15.0 15.0 15.0
00FF:   actor $PLAYER_ACTOR sphere 1 in_sphere 2493.5  -1682.5  13.35 radius 1.0 1.0 2.0 on_foot
0100:   actor $PLAYER_ACTOR in_sphere 2493.5  -1682.5  13.35 radius 4.0 4.0 4.0 sphere 1 in_car
0101:   actor $PLAYER_ACTOR in_sphere 2493.5  -1682.5  13.35 radius 5.0 5.0 3.0 sphere 1 stopped
0102:   actor $PLAYER_ACTOR in_sphere 2493.5  -1682.5  13.35 radius 1.2 1.2 3.0 sphere 1 stopped_on_foot
0103:   actor $PLAYER_ACTOR in_sphere 2493.5  -1682.5  13.35 radius 4.0 4.0 6.0 sphere 1 stopped_in_car

0104:   actor $PLAYER_ACTOR near_actor 1@ radius 15.0 15.0 15.0 sphere 1
0105:   actor $PLAYER_ACTOR near_actor 1@ radius 5.0 5.0 2.0 sphere 1 on_foot

Location checks for car
CODE
01AD:   car 1@ sphere 1 near_point 2493.5  -1682.5 radius 6.0 6.0
01AE:   car 1@ sphere 1 near_point 2493.5  -1682.5 radius 3.0 3.0 stopped
01AF:   car 1@ sphere 1 in_sphere 2493.5  -1682.5 radius 0.2 0.2 1.0
01B0:   car 1@ sphere 1 in_sphere 2493.5  -1682.5  13.35 radius 4.0 4.0 4.0 stopped


The location checks with integrated sphereparameter are more useful in praxis but consider to have 0 ms wait time as maximum in the Loop

gta3masta5000
  • gta3masta5000

    Boredom.... All the time...

  • Members
  • Joined: 28 Apr 2012
  • United-States

#13

Posted 24 August 2013 - 10:34 PM

QUOTE (ZAZ @ Saturday, Aug 24 2013, 22:17)
About red sphere: location checks have an integrated sphereparameter
example:
red sphere in Grovestreet teleports on to roof of CJ's house
CODE

:Teleport_1
03A4: name_thread 'TELE'

:Teleport_2
wait 0
if
0256:   player $PLAYER_CHAR defined
jf @Teleport_2
if
00FF:   actor $PLAYER_ACTOR sphere 1 in_sphere 2493.5 -1682.5 13.35 radius 1.0 1.0 1.0 on_foot
jf @Teleport_2
00A1: put_actor $PLAYER_ACTOR at 2524.5  -1677.5  19.95
jump @Teleport_2


The red marker (sphere) will be displayed by opcode 00FF:, 2. parameter: sphere 1 (sphere 0 don't show a red sphere)
Furthermore is it very important to have 0 ms wait time as maximum in the Loop
With more than 0 ms wait time it won't display a red sphere
Example:
CODE
:Teleport_2
wait 10
now the sphere won't be shown


Also is it important to know that there are limits for spheres
Look in Sanny Builder Help: SCM Documentation: GTA Limits

There are several opcodes which show a sphere

Just to create a sphere
CODE
03BC: 1@ = create_sphere_at 2493.5  -1682.5  13.35 radius 1.0
//eventual needs to remove the sphere at any time
03BD: destroy_sphere 1@

Radarmarker with sphere
CODE
02A7: 0@ = create_icon_marker_and_sphere 35 at 2493.5  -1682.5  13.35
//as well as
0570: 1@ = create_asset_radar_marker_with_icon  35 at -2007.8 189.1 27.5
//eventual needs to remove the marker at any time
0164: disable_marker 0@
0164: disable_marker 1@

Location checks for actor
CODE
00FE:   actor $PLAYER_ACTOR sphere 1 in_sphere 2493.5  -1682.5  13.35 radius 15.0 15.0 15.0
00FF:   actor $PLAYER_ACTOR sphere 1 in_sphere 2493.5  -1682.5  13.35 radius 1.0 1.0 2.0 on_foot
0100:   actor $PLAYER_ACTOR in_sphere 2493.5  -1682.5  13.35 radius 4.0 4.0 4.0 sphere 1 in_car
0101:   actor $PLAYER_ACTOR in_sphere 2493.5  -1682.5  13.35 radius 5.0 5.0 3.0 sphere 1 stopped
0102:   actor $PLAYER_ACTOR in_sphere 2493.5  -1682.5  13.35 radius 1.2 1.2 3.0 sphere 1 stopped_on_foot
0103:   actor $PLAYER_ACTOR in_sphere 2493.5  -1682.5  13.35 radius 4.0 4.0 6.0 sphere 1 stopped_in_car

0104:   actor $PLAYER_ACTOR near_actor 1@ radius 15.0 15.0 15.0 sphere 1
0105:   actor $PLAYER_ACTOR near_actor 1@ radius 5.0 5.0 2.0 sphere 1 on_foot

Location checks for car
CODE
01AD:   car 1@ sphere 1 near_point 2493.5  -1682.5 radius 6.0 6.0
01AE:   car 1@ sphere 1 near_point 2493.5  -1682.5 radius 3.0 3.0 stopped
01AF:   car 1@ sphere 1 in_sphere 2493.5  -1682.5 radius 0.2 0.2 1.0
01B0:   car 1@ sphere 1 in_sphere 2493.5  -1682.5  13.35 radius 4.0 4.0 4.0 stopped


The location checks with integrated sphereparameter are more useful in praxis but consider to have 0 ms wait time as maximum in the Loop

Thanks, man! One more thing. The second cutscene (the ending one) doesn't work properly. I have made a few changes to add an army guy in grove street looking around thanks to this. The cutscene never starts (or ends, for that matter), but rather it just freezes the car in place and stays there forever (but does remove the 4-star wanted level like I wanted). Any help?

CODE
:mymissmain
03A4: NAME_THREAD 'MYMISS'
010D: set_player $PLAYER_CHAR wanted_level_to 4
00BC: show_text_highpriority GXT 'MYTAB2' time 4000 flag 1
gosub @mymissmain_1

:mymissmain_1
wait 0
if
00DD:   actor $PLAYER_ACTOR driving_car_with_model #GREENWOO  
else_jump @mymissmain_1
0164: disable_marker $m1
02A8: $m2 = create_marker 0 at 723.2675 -1160.0251 16.7114  
03BC: 10@ = create_sphere_at 723.2675 -1160.0251 16.7114 radius 5.0
00BC: show_text_highpriority GXT 'MYTAB3' time 4000 flag 1
jump @mymissmain_2

:mymissmain_2
wait 0
if
0100:   actor $PLAYER_ACTOR in_sphere 723.2675 -1160.0251 16.7114 radius 5.0 5.0 5.0 sphere 1 in_car
else_jump @mymissmain_2
03BD: destroy_sphere 10@
0164: disable_marker $m2
jump @CUTSCENE_2

:CUTSCENE_2
03A4: name_thread 'CUT2'
wait 0
if
09E7:   player $PLAYER_CHAR not_frozen
jf @CUTSCENE_2
jump @animload

:animload
wait 0
Player.CanMove($PLAYER_CHAR, false)
if and
00DB:   actor $PLAYER_ACTOR in_car 5@
00DB:   actor $PLAYER_ACTOR in_car 6@
00DB:   actor $PLAYER_ACTOR in_car 7@
jf @animload

04ED: load_animation "CAR_CHAT"
04ED: load_animation "PED"
0605: actor 7@ perform_animation_sequence "CAR_TALKM_IN" IFP_file "CAR_CHAT" 10.0 loop 1 0 0 0 time -1 // versionA
Camera.SetPosition(2472.7151, -1681.5944, 16.9041, 0.0, 0.0, 0.0)
Camera.PointAt(2494.2827, -1669.9541, 13.3359, 2)
00BC: show_text_highpriority GXT 'MYTAB4' time 4000 flag 1
009A: 33@ = create_actor_pedtype 23 model #ARMY at 2487.1799, -1670.8324, 13.3359 0.0 0.0 0.0
0605: actor 33@ perform_animation_sequence "XPRESSSCRATCH" IFP_file "PED" 4.0 loop 1 0 0 0 time -1  
0002: jump @TUT_MISSION_1_PASSED


The stuff where it says 'MYTAB#' (# being the number) is my custom text in my custom "American.gxt" (which, BTW, does not work either). I created it using SAGXTeditor and the .ini file is generated automatically (I love that). Any help? BTW, when you post a working code for me, please, keep the coordinates the same! Otherwise, you're doing great! biggrin.gif You're a really helpful person (I hope you're a person tounge.gif), but putting different coordinates confuses me, leading to more questions as I tend to screw more stuff up. Believe me, it's not you, it's my brain. If my brain could handle it, I wouldn't have a problem with it. That's all. smile.gif Once this last cutscene is finished, my first main.scm mission will be finished. biggrin.gif biggrin.gif Thanks again for all your help!

ZAZ
  • ZAZ

    Kernlochbohrer

  • Members
  • Joined: 10 Jan 2005
  • European-Union

#14

Posted 25 August 2013 - 12:37 PM

QUOTE (gta3masta5000 @ Saturday, Aug 24 2013, 23:34)
CODE
:mymissmain
03A4: NAME_THREAD 'MYMISS'
010D: set_player $PLAYER_CHAR wanted_level_to 4
00BC: show_text_highpriority GXT 'MYTAB2' time 4000 flag 1
gosub @mymissmain_1

:mymissmain_1
wait 0
if
00DD:   actor $PLAYER_ACTOR driving_car_with_model #GREENWOO  
else_jump @mymissmain_1
0164: disable_marker $m1
02A8: $m2 = create_marker 0 at 723.2675 -1160.0251 16.7114  
03BC: 10@ = create_sphere_at 723.2675 -1160.0251 16.7114 radius 5.0
00BC: show_text_highpriority GXT 'MYTAB3' time 4000 flag 1
jump @mymissmain_2

:mymissmain_2
wait 0
if
0100:   actor $PLAYER_ACTOR in_sphere 723.2675 -1160.0251 16.7114 radius 5.0 5.0 5.0 sphere 1 in_car
else_jump @mymissmain_2
03BD: destroy_sphere 10@
0164: disable_marker $m2
jump @CUTSCENE_2

:CUTSCENE_2
03A4: name_thread 'CUT2'
wait 0
if
09E7:   player $PLAYER_CHAR not_frozen
jf @CUTSCENE_2
jump @animload

:animload
wait 0
Player.CanMove($PLAYER_CHAR, false)
if and
00DB:   actor $PLAYER_ACTOR in_car 5@
00DB:   actor $PLAYER_ACTOR in_car 6@
00DB:   actor $PLAYER_ACTOR in_car 7@
jf @animload

04ED: load_animation "CAR_CHAT"
04ED: load_animation "PED"
0605: actor 7@ perform_animation_sequence "CAR_TALKM_IN" IFP_file "CAR_CHAT" 10.0 loop 1 0 0 0 time -1 // versionA
Camera.SetPosition(2472.7151, -1681.5944, 16.9041, 0.0, 0.0, 0.0)
Camera.PointAt(2494.2827, -1669.9541, 13.3359, 2)
00BC: show_text_highpriority GXT 'MYTAB4' time 4000 flag 1
009A: 33@ = create_actor_pedtype 23 model #ARMY at 2487.1799, -1670.8324, 13.3359 0.0 0.0 0.0
0605: actor 33@ perform_animation_sequence "XPRESSSCRATCH" IFP_file "PED" 4.0 loop 1 0 0 0 time -1  
0002: jump @TUT_MISSION_1_PASSED

:mymissmain
03A4: NAME_THREAD 'MYMISS'
010D: set_player $PLAYER_CHAR wanted_level_to 4
00BC: show_text_highpriority GXT 'MYTAB2' time 4000 flag 1

gosub @mymissmain_1 <-- only to lead into a subscript which ends with return

--------

:mymissmain_1
wait 0
if
00DD: actor $PLAYER_ACTOR driving_car_with_model #GREENWOO
else_jump @mymissmain_1
0164: disable_marker $m1
02A8: $m2 = create_marker 0 at 723.2675 -1160.0251 16.7114 <--use again $m1 because it's unused after 0164:
03BC: 10@ = create_sphere_at 723.2675 -1160.0251 16.7114 radius 5.0 <-- no need
00BC: show_text_highpriority GXT 'MYTAB3' time 4000 flag 1
jump @mymissmain_2

-----------

:CUTSCENE_2
03A4: name_thread 'CUT2'<-- never register a thread inside of a thread
wait 0
if
09E7: player $PLAYER_CHAR not_frozen <-- useless check
jf @CUTSCENE_2
jump @animload

:animload
wait 0
Player.CanMove($PLAYER_CHAR, false) <-- totally bullsh*t
if and
00DB: actor $PLAYER_ACTOR in_car 5@
00DB: actor $PLAYER_ACTOR in_car 6@
00DB: actor $PLAYER_ACTOR in_car 7@
jf @animload


009A: 33@ = create_actor_pedtype 23 model #ARMY at 2487.1799, -1670.8324, 13.3359 0.0 0.0 0.0 <-- totally wrong


----------
1.
33@ is used as internal timer
2.
wrong because of comma and too much parameter
009A: 33@ = create_actor_pedtype 23 model #ARMY at 2487.1799, -1670.8324, 13.3359 0.0 0.0 0.0
correct:
009A: 5@ = create_actor_pedtype 4 model #SPECIAL01 at 2479.1279 -1680.2635 13.338
also correct by writing Classes instead with opcode:
5@ = Actor.Create(Mission1, #ARMY, 2487.1799, -1670.8324, 13.3359)

-------------

33@ and 32@ is always used as internal time and can't be used for other things
content of 33@ and 32@ is counting permanently in millisecond
you can restore 33@ and 32@
CODE
33@ = 0
and then check if 5 seconds are passed with this check:
CODE
if
33@ > 5000
jf @next


-------------
gosub
The gosub command leads the reading process to an excluded subscript.
Excluded means, the codes of the subscript are not binded in code order of our thread.
CODE
0050: gosub @Subscript

The subscript must end with return and only subscripts may end with return
CODE
0051: return


If the subscript ends with 0051: return, our thread then continues with reading the codes after the 0050: gosub command

Example: script below shows blue smoke infront of player_actor
press SPRINT KEY to change the color into red

CODE
:Smokesubscript
03A4: name_thread 'Smokesub'

//smoke color setup (blue)
21@ = 0.0
22@ = 0.0
23@ = 1.0
24@ = 1.0


:Thread
wait  0
if
0256: player $PLAYER_CHAR defined
jf @Thread
if
00E1:   player 0 pressed_key 16//-----------------------press SPRINT KEY
jf @smoke
gosub @Subscript
// reading process continue reading here as soon as return was read
00BA: text_styled 'fem_ok'  1000 ms  4

:smoke
04C4: create_coordinate 1@ 2@ 3@ from_actor $PLAYER_ACTOR offset 0.0 2.0  0.5
095C: create_smoke_at 1@ 2@ 3@ velocity 0.0 0.0 5.0 RGBA 21@ 22@ 23@ 24@ size 0.2 last_factor 0.1
jump @Thread

//

:Subscript
// new smoke color setup (red)
21@ = 1.0
22@ = 0.0
23@ = 0.0
24@ = 1.0
return





The mission script construct contains only subscripts
-first gosub leads to the main mission subscript and will be terminated as soon as return was read
-second gosub leads to the mission fail subscript if player is wasted or busted and will be terminated as soon as return was read
-third gosub leads to mission cleanup subscript and will be terminated as soon as return was read
then the mission ends with the code 004E: end_thread

maybe you're wondering that is also a mission passed subscript
it needs just to jump from main mission subscript into the mission passed subscript
also can you jump from main mission subscript into the mission fail subscript, if a friend was killed for example

also does gta_sa.exe terminate the main mission subscript in case if player dies or get arrested
this requires a correct setup of the mission



Very important is that you clean the game at misson end
Actors must be destroyed or remove the reference
same for cars and objects
markers must be removed
CODE
009B: destroy_actor 1@
009B: destroy_actor 2@
009B: destroy_actor 3@
009B: destroy_actor 4@
009B: destroy_actor 5@
009B: destroy_actor 6@
009B: destroy_actor 7@
009B: destroy_actor 8@
04EF: release_animation "CAR_CHAT"
0164: disable_marker $m1
01C3: remove_references_to_car $car // Like turning a car into any random car
04EF: release_animation "GANGS"
therefor the cleanup subscript

The problem of your mission is, that you destroy some actors later and spawn then some other stuff
but everthing must be cleaned in the cleanup subscript
and if player dies before the army actor will be destroyed or before the marker is shown, then the codes of the cleanup don't match with the stuff of the missionscript
it needs a solution



It's too difficult to tell you how to correct your script and it would confuse
I show you how i would write it
I use a var $LEVEL = 0 and check it's value to subdivide the mission in sequences or "Level"
Then i can clean the stuff in the cleanup depending to the Level
I can use the var also to build sequences in one Loop instead making 5 Loops
CODE
:TUT_1
03A4: name_thread "MISTEMP"  

gosub @MissT_main_1
if
0112:   wasted_or_busted
else_jump @MissT_end
gosub @MissT_fail                    

:MissT_end
gosub @MissT_cleanup
004E: end_thread


//Begin of main missionscript
:MissT_main_1
0317: increment_mission_attempts//here starts the missionscript
0004: $ONMISSION =  1

// cutscene start
Player.CanMove($PLAYER_CHAR, false)
01B9: set_actor $PLAYER_ACTOR armed_weapon_to 0

model.Load(#army)
model.Load(#patriot)
model.load(#m4)
023C: load_special_actor 'SWEET' as 1 // models 290-299
023C: load_special_actor 'KENDL' as 2 // models 290-299
023C: load_special_actor 'CESAR' as 3 // models 290-299
038B: load_requested_models

:load_check1
wait 0
if and
model.available(#army)
model.available(#patriot)
model.available(#m4)
023D:   special_actor 1 loaded
023D:   special_actor 2 loaded
023D:   special_actor 3 loaded
else_jump @load_check1

//Spawn everything in fade
fade 0 500
wait 500

Car.Create($car, #patriot, 2503.0217, -1672.2841, 13.3594)
Car.Angle($car) = 82.3844

0129: 1@ = create_actor_pedtype 23 model #army in_car $car driverseat
01C8: 2@ = create_actor_pedtype 23 model #army in_car $car passenger_seat 0
01C8: 3@ = create_actor_pedtype 23 model #army in_car $car passenger_seat 1
01C8: 4@ = create_actor_pedtype 23 model #army in_car $car passenger_seat 2

01B2: give_actor 1@ weapon 31 ammo 60 // Load the weapon model before using this
01B2: give_actor 2@ weapon 31 ammo 60 // Load the weapon model before using this
01B2: give_actor 3@ weapon 31 ammo 60 // Load the weapon model before using this
01B2: give_actor 4@ weapon 31 ammo 60 // Load the weapon model before using this


009A: 5@ = create_actor_pedtype 4 model #SPECIAL01 at 2479.1279 -1680.2635 13.338
Actor.Angle(5@) = 359.6866
009A: 6@ = create_actor_pedtype 4 model #SPECIAL02 at 2477.7996 -1678.5049 13.3386
Actor.Angle(6@) = 266.6259
009A: 7@ = create_actor_pedtype 4 model #SPECIAL03 at 2479.3577 -1676.2166 13.337
Actor.Angle(7@) = 176.3852
00A1: put_actor $PLAYER_ACTOR at 2480.9185 -1678.2045 13.3404
Actor.Angle($PLAYER_ACTOR) = 98.7008

04ED: load_animation "GANGS"

repeat
wait 0
until 04EE:   animation "GANGS" loaded

0605: actor 5@ perform_animation_sequence "PRTIAL_GNGTLKA" IFP_file "GANGS" 4.0 loop 1 0 0 0 time -1
0605: actor 6@ perform_animation_sequence "PRTIAL_GNGTLKB" IFP_file "GANGS" 4.0 loop 1 0 0 0 time -1
0605: actor 7@ perform_animation_sequence "PRTIAL_GNGTLKC" IFP_file "GANGS" 4.0 loop 1 0 0 0 time -1
0605: actor $PLAYER_ACTOR perform_animation_sequence "PRTIAL_GNGTLKC" IFP_file "GANGS" 4.0 loop 1 0 0 0 time -1

$LEVEL =  0
Camera.SetPosition(2472.7151, -1681.5944, 16.9041, 0.0, 0.0, 0.0)
Camera.PointAt(2494.2827, -1669.9541, 13.3359, 2)
wait 2000
00A7: car $car drive_to 2487.1799 -1670.8324 13.3359
02A3: enable_widescreen 1
fade 1 500
// after fade

repeat
wait 0
if
0119:   car $car wrecked
then
return
end
until 01AF:   car $car sphere 0 in_sphere 2487.1799 -1670.8324 13.33 radius 3.0 3.0 3.0

0160: set_camera_point_at 2494.2827 -1669.9541 9.3359 mode 2
05CD: AS_actor 1@ exit_car $car
05CD: AS_actor 2@ exit_car $car
05CD: AS_actor 3@ exit_car $car
05CD: AS_actor 4@ exit_car $car

0635: AS_actor 1@ aim_at_actor $PLAYER_ACTOR -1 ms
0635: AS_actor 2@ aim_at_actor $PLAYER_ACTOR -1 ms
0635: AS_actor 3@ aim_at_actor $PLAYER_ACTOR -1 ms
0635: AS_actor 4@ aim_at_actor $PLAYER_ACTOR -1 ms

074D: AS_actor $PLAYER_ACTOR turns_to_and_look_at_actor 1@ timelimit 2500
074D: AS_actor 5@ turns_to_and_look_at_actor 1@ timelimit -1
074D: AS_actor 6@ turns_to_and_look_at_actor 1@ timelimit -1
074D: AS_actor 7@ turns_to_and_look_at_actor 1@ timelimit -1
33@ = 0// restore internal timer 33@

repeat
wait 0
until 33@ > 2500 // use internal timer 33@ to wait for more then 1 second


05C4: AS_actor $PLAYER_ACTOR hands_up -1 ms
if
8118:   not actor 5@ dead
then
05C4: AS_actor 5@ hands_up -1 ms
end
if
8118:   not actor 6@ dead
then
05C4: AS_actor 6@ hands_up -1 ms
end
if
8118:   not actor 7@ dead
then
05C4: AS_actor 7@ hands_up -1 ms
end
33@ = 0// restore internal timer 33@

repeat
wait 0
until 33@ > 5000// use internal timer 33@ to wait for more then 1 second

// cutscene end

fade 0 500
wait 500

0247: load_model #GREENWOO
0247: load_model #MICRO_UZI
0247: load_model #BFYST

:load_check2
wait 0
if and
0248:    model #GREENWOO available
0248:    model #MICRO_UZI available
0248:    model #BFYST available
004D: jump_if_false @load_check2

009B: destroy_actor 1@
009B: destroy_actor 2@
009B: destroy_actor 3@
009B: destroy_actor 4@
$LEVEL =  1
00A6: destroy_car $car
0674: set_car_model #GREENWOO numberplate "YOURCAR"
00A5: $car = create_car #GREENWOO at 2458.248 -1659.026 13.3047
0175: set_car $car Z_angle_to 270.0
0224: set_car $car health_to 1000
0186: $M1 = create_marker_above_car $car
07E0: set_marker $M1 type_to 1
01B2: give_actor $PLAYER_ACTOR weapon 28 ammo 1000 // Load the weapon model before using this
05CA: AS_actor 5@ enter_car $car passenger_seat 0 10000 ms
05CA: AS_actor 6@ enter_car $car passenger_seat 1 10000 ms
05CA: AS_actor 7@ enter_car $car passenger_seat 2 10000 ms


0687: clear_actor $PLAYER_ACTOR task
Player.CanMove($PLAYER_CHAR, true)
0373: set_camera_directly_behind_player
02EB: restore_camera_with_jumpcut
02A3: enable_widescreen 0

wait 500
fade 1 500

010D: set_player $PLAYER_CHAR wanted_level_to 4
00BC: show_text_highpriority GXT 'fem_on' time 4000 flag 1

// actionscript start
// only one Loop
:mymissmain_1
wait 0
if  and
8119:   not car $car wrecked
8118:   not actor 5@ dead
8118:   not actor 6@ dead
8118:   not actor 7@ dead
else_jump @MissT_fail
if
$LEVEL ==  1
else_jump @mymissmain_2
if and
00DB:   actor 5@ in_car $car
00DB:   actor 6@ in_car $car
00DB:   actor 7@ in_car $car
jf @mymissmain_1

model.Load(#army)
038B: load_requested_models
04ED: load_animation "CAR_CHAT"

repeat
wait 0
until 04EE:   animation "CAR_CHAT" loaded

0605: actor 7@ perform_animation_sequence "carfone_loopA" IFP_file "CAR_CHAT" 4.0 loop 1 0 0 0 time -1 // versionA
00BC: show_text_highpriority GXT 'fem_on' time 4000 flag 1
009A: 8@ = create_actor_pedtype 23 model #ARMY at 2487.1799 -1670.8324 13.3359
0605: actor 8@ perform_animation_sequence "XPRESSSCRATCH" IFP_file "PED" 4.0 loop 1 0 0 0 time -1
$LEVEL =  2
wait 500
Camera.SetPosition(2472.7151, -1681.5944, 16.9041, 0.0, 0.0, 0.0)
Camera.PointAt(2494.2827, -1669.9541, 13.3359, 2)
wait 1000
0373: set_camera_directly_behind_player
02EB: restore_camera_with_jumpcut

:mymissmain_2
if
$LEVEL ==  2
else_jump @mymissmain_3
if
00DB:   actor $PLAYER_ACTOR in_car $car  
else_jump @mymissmain_1
0164: disable_marker $m1
018A: $m1 = create_checkpoint_at 723.2675 -1160.0251 16.7114
00BC: show_text_highpriority GXT 'fem_ok' time 4000 flag 1
$LEVEL =  3

:mymissmain_3
if
$LEVEL ==  3
else_jump @mymissmain_1
if
0100:   actor $PLAYER_ACTOR in_sphere 723.2675 -1160.0251 16.7114 radius 5.0 5.0 5.0 sphere 1 in_car
else_jump @mymissmain_1

// actionscript end
// now the code run into mission passed block vv



:MissT_pass
010D: set_player $PLAYER_CHAR wanted_level_to 0
0394: play_music 1
0109: player $PLAYER_CHAR money += 10000
01E3: show_text_1number_styled GXT 'M_PASS' number 10000 time 5000 style 1  // MISSION PASSED!~n~~w~$~1~
return


:MissT_fail
00BA: text_styled 'M_FAIL'  5000 ms  1
return



:MissT_cleanup
Player.CanMove($PLAYER_CHAR, true)
0373: set_camera_directly_behind_player
02EB: restore_camera_with_jumpcut
if
$LEVEL ==  0
else_jump @MissT_clean_1
009B: destroy_actor 1@
009B: destroy_actor 2@
009B: destroy_actor 3@
009B: destroy_actor 4@

:MissT_clean_1
if or
$LEVEL ==  1
$LEVEL ==  2
$LEVEL ==  3
else_jump @MissT_clean_2
0164: disable_marker $m1

:MissT_clean_2
if or
$LEVEL ==  2
$LEVEL ==  3
else_jump @MissT_clean_3
009B: destroy_actor 8@
04EF: release_animation "CAR_CHAT"


:MissT_clean_3
009B: destroy_actor 5@
009B: destroy_actor 6@
009B: destroy_actor 7@
01C3: remove_references_to_car $car // Like turning a car into any random car
04EF: release_animation "GANGS"  
0004: $ONMISSION =  0
00D8: mission_cleanup
return

gta3masta5000
  • gta3masta5000

    Boredom.... All the time...

  • Members
  • Joined: 28 Apr 2012
  • United-States

#15

Posted 25 August 2013 - 12:48 PM

Works good! Only thing.... (AFAIK because I wasn't able to complete it yet because the car blew up) is when you get in the car it shows the cutscene I want to happen after you reach the marker in Vinewood.... and I want it to show longer as well.

ZAZ
  • ZAZ

    Kernlochbohrer

  • Members
  • Joined: 10 Jan 2005
  • European-Union

#16

Posted 25 August 2013 - 04:27 PM

QUOTE (gta3masta5000 @ Sunday, Aug 25 2013, 13:48)
Works good! Only thing.... (AFAIK because I wasn't able to complete it yet because the car blew up) is when you get in the car it shows the cutscene I want to happen after you reach the marker in Vinewood.... and I want it to show longer as well.

that's your job, i don't know what you wanna show, it's from your last scriptsnippet of your previous post

gta3masta5000
  • gta3masta5000

    Boredom.... All the time...

  • Members
  • Joined: 28 Apr 2012
  • United-States

#17

Posted 25 August 2013 - 04:46 PM

Alright, I'll work on it.




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users