Jump to content
    1. Welcome to GTAForums!

    1. GTANet.com

    1. GTA Online

      1. The Criminal Enterprises
      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

*DO NOT* SHARE MEDIA OR LINKS TO LEAKED COPYRIGHTED MATERIAL. Discussion is allowed.

[SA] Why is it crashing?


guferr
 Share

Recommended Posts

So, i've done some experimenting using car paths on some missions, i've been editing missions to do this, and so far now it was fine.

Then i tried to do it on a CLEO script, and it crashed.

I decided to remove everything from the script and reduce it to the most simple script, but it still crashes.

I've tried different paths and vehicles, all of them crash (and all of them work fine on missions). Note that i used the correct opcodes, the same ones used on the missions, and i also used the same routines (load paths, check if loaded, check if player is driving, getting the car handle and then assigning). I've also tried cleaning my CLEO folder, i rebooted my PC, but the problem is on the script, i just can't find where and how.

The code goes below.

Thanks

{$CLEO .cs}thread 'PATH' Int [email protected] //Car Handle07C0: load_path 289 //Load path               :PATH_1if87C1: not path 289 availableelse_jump @PATH_2  //Code only proceeds if path is loaded, it wouldn't even crash if it didn't loadwait 100jump @PATH_1 :PATH_2 wait 40  //Game doesn't load without a minimum wait time on this loop (load bar freezes when full)if     Actor.Driving($PLAYER_ACTOR)   else_jump @PATH_2  //Check player is driving, repeat if not wait 5000      //Wait 5s just so i can have time to see it enter the car03C0: [email protected] = actor $PLAYER_ACTOR car  //Set car handle05EB: assign_car [email protected] to_path 289     //Assign car to pathwait 10000                          //Let it ride on it for 10s 05EC: release_car [email protected] from_path      //Release itjump @PATH_2 
Edited by guferr
Link to comment
Share on other sites

:PATH_1if87C1: not path 289 availableelse_jump @PATH_2  //Code only proceeds if path is loaded, it wouldn't even crash if it didn't loadwait 100jump @PATH_1 

The 'wait' should be before the 'if' not after it?

Edited by ChopTheDog.
Link to comment
Share on other sites

The position of this wait doesn't make any difference, the code only crashes after i press the key combination, so the path was loaded.
Also, the wait was before the 'if' before, i put it there just to make clear that it's in case of the path wasn't loaded yet.

And yes, i have the newest CLEO and Sanny Builder.

I re-installed both past week, i'm using a fresh installation of win7, and everything is fine and working. There are no bugs or problems except for this one.

Edited by guferr
Link to comment
Share on other sites

{$CLEO .cs}

thread 'PATH'

07C0: load_path 289

while true

wait 0

if and

player.Defined(0)

07C1: path 289 available

then

if

actor.Driving($PLAYER_ACTOR)

then

break

end

end

end

03C0: [email protected] = actor $PLAYER_ACTOR car

05EB: assign_car [email protected] to_path 289

wait 10000

if

056E: car [email protected] defined

then

05EC: release_car [email protected] from_path

end

0873: release_path 289

0A93:

Edited by _DK
Link to comment
Share on other sites

{$CLEO .cs}thread 'PATH' (...)0873: release_path 2890A93:

 

 

 

So, apart from using a different structure and putting checks to verify if the player is defined and the actor is driving, what did you do to prevent it from crashing? I also used those checks before, i removed them to simplify the code, once i would assure those things for myself.

 

I tried editing it a little bit and it become even more fishy. Now it sometimes crash, and other times it doesn't even load. I've put a teleporting function just to verify when the first check loop finished (and if the car handle works), the car is teleported to 0,0,5. Then, 3s after, it should assign it to the path, but it crashes. And some times it doesn't even teleport, and doesn't crash too.

 

Here's the code

 

{$CLEO .cs}thread 'PATH'Int [email protected] 5000 //Just to avoid the intro while i skip it07C0: load_path 289while true    wait 50 //little wait time to slow it down    if and        07C1: path 289 available        Player.Defined($PLAYER_CHAR)        Actor.Driving($PLAYER_ACTOR)    then        break    //Only breaks the loop if all the conditions are true    endendwait 3000 //Wait 3s, just to have enough time to finish the entering animation and close the doors03C0: [email protected] = actor $PLAYER_ACTOR carCAr.PutAt([email protected], 0.0, 0.0, 5.0) //Teleport car. It also shows that the car handle is ok, otherwise it wouldn't teleportwait 3000 //Wait 3s again05EB: assign_car [email protected] to_path 289 //Assign car to path (Where it crashes)wait 10000 //Let it ride on it for 10 seconds05EC: release_car [email protected] from_path //Release car from path0873: release_path 289 //Release path0A93: end_custom_thread //End thread
Edited by guferr
Link to comment
Share on other sites

Hi ,

I fixed this for you.
This loops around.
Always going down path.

I made it simple for next time.

 

 

 

{$CLEO .cs}
$TEMPVAR_ACTOR_CAR = Actor.CurrentCar($PLAYER_ACTOR) /////////////////////////////////////////////////////
0811: $TEMPVAR_ACTOR_CAR = actor $PLAYER_ACTOR used_car
thread 'PATH'

:PATHTEST_1
wait 0
if AND
Player.Defined($PLAYER_CHAR)
$ONMISSION == 0
jf @PATHTEST_1
if
Player.Controllable($PLAYER_CHAR)
jf @PATHTEST_1

:PATHTEST_2
IF
ACTOR.Driving($PLAYER_ACTOR)
jf @PATHTEST_1
if
not Car.Wrecked($TEMPVAR_ACTOR_CAR)
jf @PATHTEST_1
if
not Actor.Dead($PLAYER_ACTOR)
jf @PATHTEST_1
07C0: load_path 289

:PATHTEST_3
if
87C1: not path 289 available
jf @PATHTEST_4
wait 0
jump @PATHTEST_3

:PATHTEST_4
05EB: assign_car $TEMPVAR_ACTOR_CAR to_path 289
WAIT 10000
0873: release_path 289

:PATHTEST_1001
jump @PATHTEST_1
END_THREAD

 

 

 

Link to comment
Share on other sites

You need to be more accurate with WAIT opcodes.

 

wait 3000 //Wait 3s, just to have enough time to finish the entering animation and close the doors03C0: [email protected] = actor $PLAYER_ACTOR car
What if player will leave the car in these 3 seconds?

 

07C1: path 289 availablePlayer.Defined($PLAYER_CHAR)Actor.Driving($PLAYER_ACTOR)
Use Player.Defined() before accessing to $PLAYER_ACTOR.

 

wait 10000 //Let it ride on it for 10 seconds05EC: release_car [email protected] from_path //Release car from path
Check if object/car/actor is available if you want to access it after WAIT opcode. Edited by _DK
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.