BilinmeyenBey Posted April 24 Share Posted April 24 So I made a mission. Everythin works fine. However when I save the mission, it re-appears the sphere. Like in the game, I want it to not appear again. Game re-thinks that player did not complete this mission and not saves that data in the game memory, how to fix it? The script: {$CLEO .cs} 0000: NOP Model.Load(#BALLAS1) Model.Load(#BALLAS3) Model.Load(#BALLAS2) Model.Load(#TEC9) Model.Load(#BURRITO) Model.Load(3383) 038B: load_requested_models :Noname_47 wait 0 if Player.Defined($PLAYER_CHAR) else_jump @Noname_47 :DIDHEPASSEDTHISMISSION wait 0 if $BALLASBUILDING_PASSED == 1 jf @CHECKAGAIN jump @LASTLYMARKER :CHECKAGAIN wait 0 if 00FE: actor $PLAYER_ACTOR sphere 0 in_sphere 2352.751 -1484.5194 24.0 radius 15.0 15.0 15.0 jf @CHECKAGAIN Car.Create($BALLAS_GANGCAR, #BURRITO, 2350.7507 -1479.249 23.9454) // BALLAS GANG ATTACK Car.Angle($BALLAS_GANGCAR) = 150.0 Marker.CreateAboveCar($BALLAS_GANGCARMARKER, $BALLAS_GANGCAR) 0165: set_marker $BALLAS_GANGCARMARKER color_to 0 03E5: show_text_box 'ATK_INT' // You can wreck this ~r~Gang Vehicle~w~ to start a Gang Attack. :HEISHERE wait 0 if Car.Wrecked($BALLAS_GANGCAR) jf @HEISHERE wait 2000 Player.CanMove($PLAYER_CHAR, False) Marker.Disable($BALLAS_GANGCARMARKER) Player.ClearWantedLevel($PLAYER_CHAR) Player.SetMinWantedLevel($PLAYER_CHAR, 0) 01F0: set_max_wanted_level_to 0 wait 5000 fade 0 0 wait 200 fade 1 2000 // SPAWNS Actor.Create($BALLAS_GANGATTACK1, 4, #BALLAS1, 2351.5684, -1487.3564, 24.0) // BALLAS ATTACKER 1 Actor.Create($BALLAS_GANGATTACK2, 4, #BALLAS3, 2349.1274, -1483.9368, 24.0) // BALLAS ATTACKER 2 Actor.Create($BALLAS_GANGATTACK3, 4, #BALLAS3, 2349.022, -1490.4224, 24.0) // BALLAS ATTACKER 3 // ANGLE Actor.Angle($BALLAS_GANGATTACK1) = 90.0 Actor.Angle($BALLAS_GANGATTACK2) = 90.0 Actor.Angle($BALLAS_GANGATTACK3) = 90.0 // MARKERS Marker.CreateAboveActor($BALLAS_GANGATKMARKER1, $BALLAS_GANGATTACK1) 0165: set_marker $BALLAS_GANGATKMARKER1 color_to 0 Marker.CreateAboveActor($BALLAS_GANGATKMARKER2, $BALLAS_GANGATTACK2) 0165: set_marker $BALLAS_GANGATKMARKER2 color_to 0 Marker.CreateAboveActor($BALLAS_GANGATKMARKER3, $BALLAS_GANGATTACK3) 0165: set_marker $BALLAS_GANGATKMARKER3 color_to 0 // WEAPONS 01B2: give_actor $BALLAS_GANGATTACK1 weapon 28 ammo 60 01B2: give_actor $BALLAS_GANGATTACK2 weapon 28 ammo 60 01B2: give_actor $BALLAS_GANGATTACK3 weapon 28 ammo 60 // ATTACK 05E2: AS_actor $BALLAS_GANGATTACK1 kill_actor $PLAYER_ACTOR 05E2: AS_actor $BALLAS_GANGATTACK2 kill_actor $PLAYER_ACTOR 05E2: AS_actor $BALLAS_GANGATTACK3 kill_actor $PLAYER_ACTOR Player.CanMove($PLAYER_CHAR, True) // FREE PLAYER :ONEMORECHECK wait 0 if Player.Defined($PLAYER_CHAR) else_jump @ONEMORECHECK :THEYALLDIED if and Actor.Dead($BALLAS_GANGATTACK1) Actor.Dead($BALLAS_GANGATTACK2) Actor.Dead($BALLAS_GANGATTACK3) jf @ONEMORECHECK Player.CanMove($PLAYER_CHAR, False) Marker.Disable($BALLAS_GANGATKMARKER1) Marker.Disable($BALLAS_GANGATKMARKER2) Marker.Disable($BALLAS_GANGATKMARKER3) 00BA: text_styled 'ATK_PAS' time 2000 style 1 0623: add 1 to_integer_stat 192 0394: play_music 2 wait 2000 Player.CanMove($PLAYER_CHAR, True) //EVERYTHING DONE, NOW FOR THE BUSSINESS IS HIS Marker.Disable($BALLAS_BICON) Marker.CreateIconWithoutSphere($BALLAS_BICONNEW, 19, 2352.3528, -1485.08, 24.0) // OWNED $BALLASINCOME_START = 1 $BALLASBUILDING_PASSED = 1 :LASTLYMARKER // ENTRANCE MARKERS 0A40: $ENTRACEMARKERBUYE = create_entrance_marker_at 2353.1836 -1484.9637 25.0 color 14 :ENTRANCE wait 0 if 00FE: actor $PLAYER_ACTOR sphere 0 in_sphere 2352.9424 -1484.9611 24.0 radius 1.0 1.0 1.0 on_foot jf @ENTRANCE 0860: link_actor $PLAYER_ACTOR to_interior 3 04BB: select_interior 3 00A1: put_actor $PLAYER_ACTOR at 516.0602 -13.2367 1004.0125 0A19: display_zone_text "EMPENT4" // Drugs Building // OBJECTS SECTION Object.Create($BALBUSSINESS_PROP1, 2567, 524.9011, -13.694, 1008.0125) 0177: set_object $BALBUSSINESS_PROP1 Z_angle_to 90.0 Object.Create($BALBUSSINESS_PROP2, 2567, 519.3714, -13.8772, 1008.0125) 0177: set_object $BALBUSSINESS_PROP2 Z_angle_to 90.0 Object.Create($BALBUSSINESS_PROP3, 955, 525.8824 -7.1691 1003.0125) 0177: set_object $BALBUSSINESS_PROP3 Z_angle_to 270.0 Object.Create($BALBUSSINESS_PROP4, 3383, 511.2195, -17.6776, 1008.0125) 0177: set_object $BALBUSSINESS_PROP4 Z_angle_to 0.0 Object.Create($BALBUSSINESS_PROP5, 3383, 516.2291, -13.629, 1008.0125) 0177: set_object $BALBUSSINESS_PROP5 Z_angle_to 90.0 Object.Create($BALBUSSINESS_PROP6, 2008, 506.709, -12.2254, 1008.0125) 0177: set_object $BALBUSSINESS_PROP6 Z_angle_to 90.0 Object.Create($BALBUSSINESS_PROP7, 1671, 507.2152, -11.683, 1008.0125) 0177: set_object $BALBUSSINESS_PROP7 Z_angle_to 270.0 jump @WHATTHEf*ck :WHATTHEf*ck wait 0 if 00FE: actor $PLAYER_ACTOR sphere 0 in_sphere 515.9494 -16.8618 1004.0125 radius 1.0 1.0 1.0 on_foot jf @WHATTHEf*ck 0860: link_actor $PLAYER_ACTOR to_interior 0 04BB: select_interior 0 00A1: put_actor $PLAYER_ACTOR at 2349.3047 -1484.4655 24.0 //OBJECT SECTION BUT DE-SPAWNER Object.Destroy($BALBUSSINESS_PROP1) Object.Destroy($BALBUSSINESS_PROP2) Object.Destroy($BALBUSSINESS_PROP3) Object.Destroy($BALBUSSINESS_PROP4) Object.Destroy($BALBUSSINESS_PROP5) Object.Destroy($BALBUSSINESS_PROP6) Object.Destroy($BALBUSSINESS_PROP7) // OBJECT SECTION BUT REMOVE REFERENCE Object.RemoveReferences($BALBUSSINESS_PROP1) Object.RemoveReferences($BALBUSSINESS_PROP2) Object.RemoveReferences($BALBUSSINESS_PROP3) Object.RemoveReferences($BALBUSSINESS_PROP4) Object.RemoveReferences($BALBUSSINESS_PROP5) Object.RemoveReferences($BALBUSSINESS_PROP6) Object.RemoveReferences($BALBUSSINESS_PROP7) jump @ENTRANCE 0A93: terminate_this_custom_script Link to comment Share on other sites More sharing options...
Dragomazing Posted April 26 Share Posted April 26 I think because that is just cleo mod and not part of main.scm. Also commands such as > if Player.Defined($PLAYER_CHAR) < will always repeat the code because player is always defined. Link to comment Share on other sites More sharing options...
ZAZ Posted April 27 Share Posted April 27 22 hours ago, Dragomazing said: Also commands such as > if Player.Defined($PLAYER_CHAR) < will always repeat the code because player is always defined. You're wrong player is NOT always defined player is not defined if player is wasted or busted or if he is in cutscene or at gamestart before he is created It is important to put if Player.Defined($PLAYER_CHAR) check before any code is used that have $PLAYER_CHAR or $PLAYER_ACTOR as parameter CLEO MODS CLEO Script Tutorial Link to comment Share on other sites More sharing options...
Dragomazing Posted April 27 Share Posted April 27 1 hour ago, ZAZ said: You're wrong player is NOT always defined player is not defined if player is wasted or busted or if he is in cutscene or at gamestart before he is created It is important to put if Player.Defined($PLAYER_CHAR) check before any code is used that have $PLAYER_CHAR or $PLAYER_ACTOR as parameter If wasted or busted player is not defined ONLY when black screen show up, what is just few seconds. In many cutscenes player IS DEFINED. So game will just restart all cleo scripts after wasted, busted or some cutscenes, but that is not solution of BilinmeyenBey's problem. Link to comment Share on other sites More sharing options...
ZAZ Posted April 27 Share Posted April 27 3 hours ago, Dragomazing said: what is just few seconds yes, for these few seconds it should avoid crashes 3 hours ago, Dragomazing said: but that is not solution of BilinmeyenBey's problem. no is not CLEO MODS CLEO Script Tutorial Link to comment Share on other sites More sharing options...
BilinmeyenBey Posted April 28 Author Share Posted April 28 OK y'all. So I done some magic. And fixed it. Using enable_thread_saving or also know as save this custom script. It works. So when I save my game, game remembers the Global Variables and it always jumps ahead. Link to comment Share on other sites More sharing options...
OrionSR Posted April 28 Share Posted April 28 2 hours ago, BilinmeyenBey said: So when I save my game, game remembers the Global Variables and it always jumps ahead. No, not really. With thread saving, cleo remembers where your thread left off, trapped in one of your wait loops. When the script restarts it won't bother to check $BALLASBUILDING_PASSED. Something else in the main scripts is probably using the same variables as your script. Or rather, your script is trying to alter something needed by the game. Inventing your own custom global variable names is a really bad idea. Sanny will assign them to the next available unnamed variable number. Since all global variables are owned by the main.scm script you will likely run into conflicts. Try using local variables instead of globals. Don't alter global variables with cleo scripts without researching exactly how that variable is used in game. 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