Jump to content
    1. Welcome to GTAForums!

    1. GTANet.com

    1. GTA Online

      1. Los Santos Drug Wars
      2. Updates
      3. Find Lobbies & Players
      4. Guides & Strategies
      5. Vehicles
      6. Content Creator
      7. Help & Support
    2. Red Dead Online

      1. Blood Money
      2. Frontier Pursuits
      3. Find Lobbies & Outlaws
      4. Help & Support
    3. Crews

    1. Grand Theft Auto Series

      1. Bugs*
      2. St. Andrews Cathedral
    2. GTA VI

    3. GTA V

      1. Guides & Strategies
      2. Help & Support
    4. GTA IV

      1. The Lost and Damned
      2. The Ballad of Gay Tony
      3. Guides & Strategies
      4. Help & Support
    5. GTA San Andreas

      1. Classic GTA SA
      2. Guides & Strategies
      3. Help & Support
    6. GTA Vice City

      1. Classic GTA VC
      2. Guides & Strategies
      3. Help & Support
    7. GTA III

      1. Classic GTA III
      2. Guides & Strategies
      3. Help & Support
    8. Portable Games

      1. GTA Chinatown Wars
      2. GTA Vice City Stories
      3. GTA Liberty City Stories
    9. Top-Down Games

      1. GTA Advance
      2. GTA 2
      3. GTA
    1. Red Dead Redemption 2

      1. PC
      2. Help & Support
    2. Red Dead Redemption

    1. GTA Mods

      1. GTA V
      2. GTA IV
      3. GTA III, VC & SA
      4. Tutorials
    2. Red Dead Mods

      1. Documentation
    3. Mod Showroom

      1. Scripts & Plugins
      2. Maps
      3. Total Conversions
      4. Vehicles
      5. Textures
      6. Characters
      7. Tools
      8. Other
      9. Workshop
    4. Featured Mods

      1. Design Your Own Mission
      2. OpenIV
      3. GTA: Underground
      4. GTA: Liberty City
      5. GTA: State of Liberty
    1. Rockstar Games

    2. Rockstar Collectors

    1. Off-Topic

      1. General Chat
      2. Gaming
      3. Technology
      4. Movies & TV
      5. Music
      6. Sports
      7. Vehicles
    2. Expression

      1. Graphics / Visual Arts
      2. GFX Requests & Tutorials
      3. Writers' Discussion
      4. Debates & Discussion
    1. Announcements

    2. Support

    3. Suggestions

[HELP] Cleo Script not saving in to memory of the game


BilinmeyenBey
 Share

Recommended Posts

BilinmeyenBey

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

Dragomazing

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

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

Link to comment
Share on other sites

Dragomazing
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

BilinmeyenBey

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

OrionSR
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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • 1 User Currently Viewing
    0 members, 0 Anonymous, 1 Guest

×
×
  • Create New...

Important Information

By using GTAForums.com, you agree to our Terms of Use and Privacy Policy.