AB0333 Posted January 29, 2012 Share Posted January 29, 2012 Hello, I was playing with Sanny Builder, and I decided to write a small mission. I tried this long time ago but I gave up. After reading Dutchy's tut few times again, some things became a lot clearer to me. OK, so, this is how the mission SHOULD 'flow': Player stands into sphere> Mission name appears and small text box> Player picks up a bat, Tampa shows up and a text box > Mission isn't progressing until the player gets into car > Player drives to a checkpoint > Enemy spawns and player kills her > Mission Passed The problem appears after the player gets into car - the game freezes. Why? I have been trying to find the mistake but I couldn't. Here is it: DEFINE MISSIONS 2DEFINE MISSION 0 AT @INITIALDEFINE MISSION 1 AT @TUT_MISSION_1DEFINE EXTERNAL_SCRIPTS 0 // Use -1 in order not to compile AAA script//DEFINE SCRIPT {NAME} AT {LABEL} @DEFINE UNKNOWN_EMPTY_SEGMENT 0DEFINE UNKNOWN_THREADS_MEMORY 0{$VERSION 3.0.0000}var$PLAYER_CHAR: Playerend // var 03A4: name_thread 'MAIN' 01F0: set_max_wanted_level_to 6 0111: toggle_wasted_busted_check 0 00C0: set_current_time_hours_to 8 minutes_to 0 04E4: unknown_refresh_game_renderer_at 2488.56 -1666.84 03CB: set_rendering_origin_at 2488.56 -1666.84 13.38 0053: $PLAYER_CHAR = create_player #NULL at 2488.56 -1666.84 13.38 01F5: $PLAYER_ACTOR = create_player_actor $PLAYER_CHAR 07AF: $PLAYER_GROUP = player $PLAYER_CHAR group 0373: set_camera_directly_behind_player 01B6: set_weather 0 0001: wait 0 ms 087B: set_player $PLAYER_CHAR clothes_texture "PLAYER_FACE" model "HEAD" body_part 1 087B: set_player $PLAYER_CHAR clothes_texture "JEANSDENIM" model "JEANS" body_part 2 087B: set_player $PLAYER_CHAR clothes_texture "SNEAKERBINCBLK" model "SNEAKER" body_part 3 087B: set_player $PLAYER_CHAR clothes_texture "VEST" model "VEST" body_part 0 070D: rebuild_player $PLAYER_CHAR 01B4: toggle_player $PLAYER_CHAR can_move 1 016A: fade 1 time 0 04BB: select_interior 0 0629: change_integer_stat 181 to 4 016C: restart_if_wasted_at 2027.77 -1420.52 15.99 angle 137.0 town_number 0 016D: restart_if_busted_at 1550.68 -1675.49 14.51 angle 90.0 town_number 0 0180: set_on_mission_flag_to $ONMISSION // Note: your missions have to use the variable defined here 0004: $DEFAULT_WAIT_TIME = 25003E6: remove_text_box 0417: start_mission 0 // Initial wait 0// put your create_thread commands here00D7: create_thread @TUT_MISSIONS_SNIFFER :MAIN_LOOP0001: wait $DEFAULT_WAIT_TIME ms0002: jump @MAIN_LOOP // put your mods (threads) here:TUT_MISSIONS_SNIFFERthread "TUT_SNIFF"$MARKER_SWEET_HOUSE = Marker.CreateIconAndSphere(42, $X_SWEET_HOUSE, $Y_SWEET_HOUSE, $Z_SWEET_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 $X_SWEET_HOUSE $Y_SWEET_HOUSE $Z_SWEET_HOUSE 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 'INTRO_1' time 1000 style 2 // Big Smoke start_mission 1 end end until $TUT_MISSIONS_PASSED == 1marker.Disable($MARKER_SWEET_HOUSE)end_thread //-------------Mission 0---------------:INITIAL$TUT_MISSIONS_PASSED = 0$ONMISSION = 0$X_SWEET_HOUSE = 2515.07 $Y_SWEET_HOUSE = -1673.98 $Z_SWEET_HOUSE = 12.710629: change_integer_stat 225 to 999 end_thread//-------------Mission 1---------------// Mission wrapper:TUT_MISSION_1thread 'TUT 1' gosub @TUT_MISSION_1_MAIN if wasted_or_busted then gosub @TUT_MISSION_1_FAIL end end_thread //-------------------------------------:TUT_MISSION_1_MAIN//Load modelsmodel.Load(#BAT)model.Load(#BFYST)model.Load(#TAMPA)038B: load_requested_models :TUT_MISSION_1_LOADwait 0 ms if and model.Available(#BAT) model.Available(#BFYST) model.Available(#TAMPA)004D: jump_if_false @TUT_MISSION_1_LOAD 03E5: show_text_box 'HOSP_1'wait 400003E6: remove_text_box0213: $BAT = create_pickup #BAT type 3 at 2490.5598 -1658.3495 13.352803DC: [email protected] = create_marker_above_pickup $BATrepeatwait 0until 0214: pickup $BAT picked_up0674: set_car_model #TAMPA numberplate "AB0333_" $car_num = car.Create(#TAMPA,2488.56, -1666.84, 13.38)03E5: show_text_box 'HELP101'wait 500003E6: remove_text_box:CAR_PARTrepeatwait 0until Actor.InCar($PLAYER_ACTOR, $car_num)else_jump @CAR_PART :SPHERE0004: $coordinaat_x = 2100.96040004: $coordinaat_y = -1366.83690004: $coordinaat_z = 23.9844$coordinaat = Marker.CreateIconAndSphere(0, $coordinaat_x, $coordinaat_y, $coordinaat_z)if01AE: car $car_num in sphere 0 near_point $coordinaat_x $coordinaat_y radius 5.0 5.0 stopped004D: jump_if_false @SPHEREwait 0 [email protected] = Actor.Create(CIVFEMALE, #BFYST, 2094.3499, -1342.9515, 23.9844)Marker.Disable($coordinaat)Actor.Angle([email protected]) = 88.440187: $m2 = create_marker_above_actor [email protected]([email protected])= 100actor.Health([email protected]) = 25001B2: give_actor [email protected] weapon 5 ammo 1000 // Load the weapon model before using this01B9: set_actor [email protected] armed_weapon_to 505E2: if_actor [email protected] kill_actor $PLAYER_ACTOR then goto @TUT_MISSION_1_FAIL repeatwait 0 msuntil actor.Dead([email protected])0394: play_music 101E3: show_text_1number_styled GXT 'M_PASS' number 10000 time 5000 style 1 // MISSION PASSED!~n~~w~$~1~$TUT_MISSIONS_PASSED += 1Player.Money($PLAYER_CHAR) += 100000249: release_model #TAMPA0249: release_model #BAT0249: release_model #BFYSTMarker.Disable($m2)//-------------------------------------:TUT_MISSION_1_FAIL00BA: show_text_styled GXT 'M_FAIL' time 5000 style 1 // ~r~MISSION FAILED!// Hier kun je alles kwijt wat moet gebeuren als de missie gefaald is. Bv. bepaalde dingen weer terugdraaien0555: remove_weapon 31 from_actor $PLAYER_ACTOR return //-------------External script 0---------------// put your external scripts here Appreciate answers. Link to comment Share on other sites More sharing options...
DK22Pac Posted January 30, 2012 Share Posted January 30, 2012 (edited) Remove "else_jump @CAR_PART" Then create marker, then check if player in a marker. So, create marker BEFORE loop. And do not forgot about *wait* in a loop. Edited January 30, 2012 by DK22Pac Link to comment Share on other sites More sharing options...
AB0333 Posted January 30, 2012 Author Share Posted January 30, 2012 Is this what you meant? :CAR_PARTrepeatwait 0until Actor.InCar($PLAYER_ACTOR, $car_num) 0004: $coordinaat_x = 2100.96040004: $coordinaat_y = -1366.83690004: $coordinaat_z = 23.9844$coordinaat = Marker.CreateIconAndSphere(0, $coordinaat_x, $coordinaat_y, $coordinaat_z)if01AE: car $car_num in sphere 0 near_point $coordinaat_x $coordinaat_y radius 5.0 5.0 stoppedwait 0 mselse_jump @CAR_PART If so, it's not working. The game doesn't freeze now when I get into car, but sphere doesn't appear at all. Link to comment Share on other sites More sharing options...
Bad.boy! Posted January 30, 2012 Share Posted January 30, 2012 Use 1 if you want to show sphere, you used 0: 01AE: car $car_num in sphere 1 near_point $coordinaat_x $coordinaat_y radius 5.0 5.0 stopped Link to comment Share on other sites More sharing options...
AB0333 Posted January 30, 2012 Author Share Posted January 30, 2012 (edited) I did that now, still nothing. EDIT: Alright, never mind, i'll save the code somewhere to my HDD, I can't bother myself about it anymore, because one good friend of mine has died (his name is Winterferien), so school has begun and I don't have time for it atm, I'll scope it out sometime later. Thanks to all repliers. Edited January 31, 2012 by AB0333 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now