serabella Posted June 19, 2011 Share Posted June 19, 2011 I have tried to create a simple mission by using the stripped scm, however, the game crashes when I walk into the sphere. What's wrong? I'm a noob at coding and can't see what's wrong.There might be many errors... // This file was decompiled using sascm.ini published by Seemann (http://sannybuilder.com/files/SASCM.rar) on 13.10.2007DEFINE OBJECTS 1DEFINE OBJECT SANNY BUILDER 3.04 DEFINE MISSIONS 2DEFINE MISSION 0 AT @NONAME_1 // Initial 1DEFINE MISSION 1 AT @TUT_1 // Initial 2DEFINE EXTERNAL_SCRIPTS 0 // Use -1 in order not to compile AAA scriptDEFINE UNKNOWN_EMPTY_SEGMENT 0DEFINE UNKNOWN_THREADS_MEMORY 0{$VERSION 3.1.0027}//-------------MAIN---------------thread 'MAIN' 01F0: set_max_wanted_level_to 6 set_wb_check_to 0 00C0: set_current_time_hours_to 8 minutes_to 0 030D: set_max_progress 25004E4: unknown_refresh_game_renderer_at -1294.0391 -2164.1428Camera.SetAtPos(-1294.0391 -2164.1428 21.9449)$PLAYER_CHAR = Player.Create(#NULL, -1294.0391, -2164.1428, 21.9449)$PLAYER_ACTOR = Actor.EmulateFromPlayer($PLAYER_CHAR)07AF: $PLAYER_GROUP = player $PLAYER_CHAR group Camera.SetBehindPlayerset_weather 0 wait 0 Player.SetClothes($PLAYER_CHAR, "PLAYER_FACE", "HEAD", Head)Player.SetClothes($PLAYER_CHAR, "JEANSDENIM", "JEANS", Legs)Player.SetClothes($PLAYER_CHAR, "SNEAKERBINCBLK", "SNEAKER", Shoes)Player.SetClothes($PLAYER_CHAR, "VEST", "VEST", Torso)Player.Build($PLAYER_CHAR)Player.CanMove($PLAYER_CHAR) = Truefade 1 0 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 $DEFAULT_WAIT_TIME = 250 03E6: remove_text_box start_mission 0 // Initial 1wait 0 create_thread_wb @TUT_SNIFF :MAIN_312wait $DEFAULT_WAIT_TIME jump @MAIN_312 :TUT_SNIFFthread "TUT_SNIFF" $MARKER_SWEET_HOUSE = Marker.CreateIconAndSphere(15, -1298.8942, -2103.5229, 24.4741):TUT_SNIFF_29wait $DEFAULT_WAIT_TIME if and Player.Defined($PLAYER_CHAR) $ONMISSION == 0 jf @TUT_SNIFF_138 if and00FF: actor $PLAYER_ACTOR sphere 0 in_sphere -1298.8942 -2103.5229 24.4741 radius 1.0 1.0 2.0 on_foot Player.Controllable($PLAYER_CHAR) $TUT_MISSIONS_PASSED == 0 jf @TUT_SNIFF_138 $ONMISSION = 1 00BA: show_text_styled GXT 'INTRO_1' time 1000 style 2 // Big Smokestart_mission 1 // Initial 2:TUT_SNIFF_138 $TUT_MISSIONS_PASSED == 1 jf @TUT_SNIFF_29 Marker.Disable($MARKER_SWEET_HOUSE)end_thread //-------------Mission 0---------------// Originally: Initial 1:NONAME_1$TUT_MISSIONS_PASSED = 0 $ONMISSION = 0 0629: change_integer_stat 225 to 999 end_thread //-------------Mission 1---------------// Originally: Initial 2:TUT_1thread 'TUT 1' gosub @TUT_1_47 if wasted_or_busted jf @TUT_1_38 gosub @TUT_1_290 :TUT_1_38gosub @TUT_1_315 end_thread :TUT_1_47Model.Load(#SILENCED)Model.Load(#MALE01)Model.Load(#CHNSAW)038B: load_requested_models :TUT_1_67wait 0 if and Model.Available(#SILENCED) Model.Available(#MALE01) Model.Available(#CHNSAW)jf @TUT_1_67 01B2: give_actor $PLAYER_ACTOR weapon 23 ammo 10 // Load the weapon model before using this 01B9: set_actor $PLAYER_ACTOR armed_weapon_to 23 $SPHERE_CJ_HOUSE = Marker.CreateIconAndSphere(1, 1644.3525, -2233.532, 29.5777):SPHERE_1if and0102: actor $PLAYER_ACTOR in_sphere -1644.3525 -2233.532 29.5777 radius 1.2 1.2 3.0 sphere 1 stopped_on_foot004D: jump_if_false @SPHERE_10002: jump @SPHERE_2:SPHERE_2Marker.Disable($SPHERE_CJ_HOUSE)009A: = [email protected] create_actor_pedtype 4 model #MALE01 at -1719.1403 -2235.2185 50.0126 009A: = [email protected] create_actor_pedtype 4 model #MALE01 at -1723.187 -2223.1687 52.482201B2: give_actor [email protected] weapon 9 ammo 60 // Load the weapon model before using this01B2: give_actor [email protected] weapon 9 ammo 60 // Load the weapon model before using this0223: set_actor [email protected] health_to 15000223: set_actor [email protected] health_to 1500:TUT_1_238 Actor.Dead($ACTOR_1) Actor.Dead($ACTOR_2)0394: play_music 1 $TUT_MISSIONS_PASSED += 1030C: progress_made += 101E3: show_text_1number_styled GXT 'M_PASS' number 10000 time 5000 style 1 // MISSION PASSED!~n~~w~$~1~return :TUT_1_29000BA: show_text_styled GXT 'M_FAIL' time 5000 style 1 // ~r~MISSION FAILED!0555: remove_weapon 23 from_actor $PLAYER_ACTOR return :TUT_1_315$ONMISSION = 0 Marker.Disable($MARKER_1)Marker.Disable($MARKER_2)Player.WantedLevel($PLAYER_CHAR) = 0Model.Destroy(#MALE01)Model.Destroy(#SILENCED)Model.Destroy(#CHNSAW)mission_cleanup return Link to comment Share on other sites More sharing options...
serabella Posted June 19, 2011 Author Share Posted June 19, 2011 ah noticed an error, I had forgot to change the @2 & @3 to $actor_1 & $actor_2, changed that now but it still crashes Link to comment Share on other sites More sharing options...
aStiffSausage Posted June 19, 2011 Share Posted June 19, 2011 ah noticed an error, I had forgot to change the @2 & @3 to $actor_1 & $actor_2, changed that now but it still crashes Ahh you also forgot to use edit button Link to comment Share on other sites More sharing options...
ZAZ Posted June 19, 2011 Share Posted June 19, 2011 it needs a wait here :SPHERE_1wait 0 /// <----------------------if and0102: actor $PLAYER_ACTOR in_sphere -1644.3525 -2233.532 29.5777 radius 1.2 1.2 3.0 sphere 1 stopped_on_foot004D: jump_if_false @SPHERE_10002: jump @SPHERE_2 and what should be this? :TUT_1_238 Actor.Dead($ACTOR_1) Actor.Dead($ACTOR_2) CLEO MODS CLEO Script Tutorial Link to comment Share on other sites More sharing options...
serabella Posted June 19, 2011 Author Share Posted June 19, 2011 thanks ZAZ, the game doesn't crash now but the mission doesn't work closely to what I want. Here's what the mission is about: 1: Enter the sphere in front of where you start, this will trigger the mission. 2: An icon will appear on the radar, showing you were to go. 3: Follow the icon and appear outside of shady cabin, there's a sphere. Walk into it to spawn 2 guys with chainsaws. 4: Kill the guys to complete the mission. My mission is like this: 1: Trigger the mission, no icon appears, just the sphere outside shady cabin. When, I walk into it, I complete the mission. Why? What's wrong? DEFINE OBJECTS 1DEFINE OBJECT SANNY BUILDER 3.04 DEFINE MISSIONS 2DEFINE MISSION 0 AT @NONAME_1 // Initial 1DEFINE MISSION 1 AT @TUT_1 // Initial 2DEFINE EXTERNAL_SCRIPTS 0 // Use -1 in order not to compile AAA scriptDEFINE UNKNOWN_EMPTY_SEGMENT 0DEFINE UNKNOWN_THREADS_MEMORY 0{$VERSION 3.1.0027}//-------------MAIN---------------thread 'MAIN' 01F0: set_max_wanted_level_to 6 set_wb_check_to 0 00C0: set_current_time_hours_to 8 minutes_to 0 030D: set_max_progress 25004E4: unknown_refresh_game_renderer_at -1294.0391 -2164.1428Camera.SetAtPos(-1294.0391 -2164.1428 21.9449)$PLAYER_CHAR = Player.Create(#NULL, -1294.0391, -2164.1428, 21.9449)$PLAYER_ACTOR = Actor.EmulateFromPlayer($PLAYER_CHAR)07AF: $PLAYER_GROUP = player $PLAYER_CHAR group Camera.SetBehindPlayerset_weather 0 wait 0 Player.SetClothes($PLAYER_CHAR, "PLAYER_FACE", "HEAD", Head)Player.SetClothes($PLAYER_CHAR, "JEANSDENIM", "JEANS", Legs)Player.SetClothes($PLAYER_CHAR, "SNEAKERBINCBLK", "SNEAKER", Shoes)Player.SetClothes($PLAYER_CHAR, "VEST", "VEST", Torso)Player.Build($PLAYER_CHAR)Player.CanMove($PLAYER_CHAR) = Truefade 1 0 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 $DEFAULT_WAIT_TIME = 250 03E6: remove_text_box start_mission 0 // Initial 1wait 0 create_thread_wb @TUT_SNIFF :MAIN_312wait $DEFAULT_WAIT_TIME jump @MAIN_312 :TUT_SNIFFthread "TUT_SNIFF" $MARKER_SWEET_HOUSE = Marker.CreateIconAndSphere(15, -1298.8942, -2103.5229, 24.4741):TUT_SNIFF_29wait $DEFAULT_WAIT_TIME if and Player.Defined($PLAYER_CHAR)$ONMISSION == 0 jf @TUT_SNIFF_138 if and00FF: actor $PLAYER_ACTOR sphere 0 in_sphere -1298.8942 -2103.5229 24.4741 radius 1.0 1.0 2.0 on_foot Player.Controllable($PLAYER_CHAR)$TUT_MISSIONS_PASSED == 0 jf @TUT_SNIFF_138 $ONMISSION = 1 00BA: show_text_styled GXT 'INTRO_1' time 1000 style 2 // Big Smokestart_mission 1 // Initial 2:TUT_SNIFF_138$TUT_MISSIONS_PASSED == 1 jf @TUT_SNIFF_29 Marker.Disable($MARKER_SWEET_HOUSE)end_thread //-------------Mission 0---------------// Originally: Initial 1:NONAME_1$TUT_MISSIONS_PASSED = 0 $ONMISSION = 0 0629: change_integer_stat 225 to 999 end_thread //-------------Mission 1---------------// Originally: Initial 2:TUT_1thread 'TUT 1' gosub @TUT_1_47 if wasted_or_busted jf @TUT_1_38 gosub @TUT_1_290 :TUT_1_38gosub @TUT_1_315 end_thread :TUT_1_47Model.Load(#SILENCED)Model.Load(#MALE01)Model.Load(#CHNSAW)038B: load_requested_models :TUT_1_67wait 0 if and Model.Available(#SILENCED) Model.Available(#MALE01) Model.Available(#CHNSAW)jf @TUT_1_67 01B2: give_actor $PLAYER_ACTOR weapon 23 ammo 10 // Load the weapon model before using this 01B9: set_actor $PLAYER_ACTOR armed_weapon_to 23 02A7: $SPHERE_CJ_HOUSE = create_icon_marker_and_sphere 0 at -1644.3525 -2233.532 29.5777 :SPHERE_1wait 0if and0102: actor $PLAYER_ACTOR in_sphere -1644.3525 -2233.532 29.5777 radius 1.2 1.2 3.0 sphere 1 stopped_on_foot004D: jump_if_false @SPHERE_10002: jump @SPHERE_2:SPHERE_2Marker.Disable($SPHERE_CJ_HOUSE)009A: = $ACTOR_1 create_actor_pedtype 4 model #MALE01 at -1719.1403 -2235.2185 50.0126 009A: = $ACTOR_2 create_actor_pedtype 4 model #MALE01 at -1723.187 -2223.1687 52.482201B2: give_actor $ACTOR_1 weapon 9 ammo 60 // Load the weapon model before using this01B2: give_actor $ACTOR_2 weapon 9 ammo 60 // Load the weapon model before using this0223: set_actor $ACTOR_1 health_to 15000223: set_actor $ACTOR_2 health_to 15000187: $MARKER_1 = create_marker_above_actor $ACTOR_10187: $MARKER_2 = create_marker_above_actor $ACTOR_2:TUT_1_238if Actor.Dead($ACTOR_1) Actor.Dead($ACTOR_2)0394: play_music 1 $TUT_MISSIONS_PASSED += 1030C: progress_made += 101E3: show_text_1number_styled GXT 'M_PASS' number 10000 time 5000 style 1 // MISSION PASSED!~n~~w~$~1~return :TUT_1_29000BA: show_text_styled GXT 'M_FAIL' time 5000 style 1 // ~r~MISSION FAILED!0555: remove_weapon 23 from_actor $PLAYER_ACTOR return :TUT_1_315$ONMISSION = 0 Marker.Disable($MARKER_1)Marker.Disable($MARKER_2)Player.WantedLevel($PLAYER_CHAR) = 0Model.Destroy(#MALE01)Model.Destroy(#SILENCED)Model.Destroy(#CHNSAW)mission_cleanup return 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