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

My script crashes my game!


Kriskers
 Share

Recommended Posts

If theres a crash, in your script, then where you start a topic? GTAFORUMS!

 

Anyways........ I am making a mod which spawns a plane and crashes it into a building, but my script crashes my game at the start!

 

Here is the code:

 

//-------------MAIN---------------thread 'CRASH' :CRASH_11wait 0 if   Player.Defined($PLAYER_CHAR)else_jump @CRASH_11 if 01B0:   car $PLAYER_ACTOR sphere 0 in_sphere 2385.574 -1618.506 133.5803 radius 500.0 500.5 500.0 stopped else_jump @CRASH_11 wait 5000 Model.Load(#AT400)Model.Load(#LAPD1)038B: load_requested_models :CRASH_96wait 0 if and  Model.Available(#AT400)  Model.Available(#LAPD1)else_jump @CRASH_96 [email protected] = Car.Create(#AT400, 2385.574, -1618.506, 133.5803)[email protected] = Marker.CreateAboveCar([email protected])00AE: set_car [email protected] traffic_behaviour_to 2 0129: [email protected] = create_actor_pedtype 23 model #LAPD1 in_car [email protected] driverseat 05D1: AS_actor [email protected] drive_car [email protected] to 1837.212 -1294.774 92.57082 speed 30.0 0 model #AT400 2 Marker.Disable([email protected])Model.Destroy(#AT400)0A93: end_custom_thread 

 

 

Whats wrong?

Link to comment
Share on other sites

spaceeinstein

There's something terribly wrong with this

01B0: car $PLAYER_ACTOR

Link to comment
Share on other sites

well......it doesnt crash and it even spawns an airplane but It doesnt fly and crash as I wanted,what is wrong?

Link to comment
Share on other sites

First of all, if you want it to fly it's a lot trickier than that what you made.

Second, you don't check if the vehicle is somewhere, so it will probably disappear before you want it to.

Third, "Model Destroy" doesn't mean that it will explode, it will just vanish. You have to use another opcode for that.

 

@spaceeinstein: I didn't even see that, lol. Shame on me.

Link to comment
Share on other sites

Firstly......could you explain how to make the plane fly then?

Secondly............how to check it?

Link to comment
Share on other sites

Making planes fly is quite tricky, really. There is no particular opcode for it.

 

 

070F: plane [email protected] fly_direction 180.0 altitude_between 200.0 and 200.0

 

 

You can use this to make a plane fly at a particular angle, while remaining within the specified altitudes.

 

But there is no opcode to make the plane fly to a specific place. And another problem is that planes can not be made to take off or land by using opcodes.

 

 

The only way to make proper plane movement is to create a .rrr path. You can use Seemann's 'carrec' CLEO to record a flight (that way you can drive the plane the way you want it to drive later). It will create an .rrr file which you can add to data\paths\carrec.img

 

You can then set the plane to fly that path with something like this:

 

 

07C0: load_path xxxrepeatwait 0until 07C1:   path xxx available05EB: assign_car $myplane to_path xxx

 

Link to comment
Share on other sites

Ummm....at 07C0: it says EXPECTED 1 PARAMS

I made it like this:

07C0: load_path carrec900.rrr

 

Link to comment
Share on other sites

 

But there is no opcode to make the plane fly to a specific place. And another problem is that planes can not be made to take off or land by using opcodes.

Actually, it is possible to make it with scm, although it isn't easy and takes a lot of testing. We did it for DYOM, where we couldn't use paths of course...

Link to comment
Share on other sites

 

But there is no opcode to make the plane fly to a specific place. And another problem is that planes can not be made to take off or land by using opcodes.

Actually, it is possible to make it with scm, although it isn't easy and takes a lot of testing. We did it for DYOM, where we couldn't use paths of course...

 

scm path? I figured that would mostly just apply to cars driving on roads, due the fact the params are a bit of a mismatch when it comes to aircraft.

 

It's nice to know, though. scm paths nearly have always failed me for cars driving on roads (due to other traffic and physics causing the car to loose track).

 

 

Ummm....at 07C0: it says EXPECTED 1 PARAMS

I made it like this:

07C0:  load_path carrec900.rrr

 

Yeah, you have to use an ID, not the filename.

 

Also, change the filename "carrec900.rrr" to "carrec835.rrr" (assuming your last carrec number is 834.

 

Then place the file in "data\paths\carrec.img"

 

Then use:

 

 

07C0:   load_path 835

 

Link to comment
Share on other sites

 

scm path? I figured that would mostly just apply to cars driving on roads, due the fact the params are a bit of a mismatch when it comes to aircraft.

No, it isn't with scm paths either, that doesn't work for planes. It's completely "new" code. Perhaps I'll make a tutorial for it. Although I'm not sure that it works for CLEO too, or at least, it is even more difficult.

Link to comment
Share on other sites

Anything to do with the huge hex...end structure in that mod?

 

Yes, I took a peek. Wanted to know how you managed to get it to read/write files so well.

Link to comment
Share on other sites

I believe I've used Car.DriveTo() for planes, but maybe I'm thinking of something else

Link to comment
Share on other sites

Anything to do with the huge hex...end structure in that mod?

 

Yes, I took a peek. Wanted to know how you managed to get it to read/write files so well.

No, the huge hex structures are inline storage locations for the texts that are defined ingame during design-mode, and that are displayed while playing the mission.

 

But I think we are going a bit offtopic now. wow.gif

Link to comment
Share on other sites

Well.....now it crashes when I go outside from the Johnson House!

Any ideas?

Link to comment
Share on other sites

Well..........here it is!

 

// This file was decompiled using sascm.ini published by Seemann (http://sannybuilder.com/files/SASCM.rar) on 13.10.2007

 

{$VERSION 3.1.0027}

{$CLEO .cs}

 

//-------------MAIN---------------

thread 'CRASH'

 

:CRASH_11

wait 0

if

Player.Defined($PLAYER_CHAR)

else_jump @CRASH_11

wait 5000

Model.Load(#AT400)

Model.Load(#LAPD1)

038B: load_requested_models

 

:CRASH_86

wait 0

if and

Model.Available(#AT400)

Model.Available(#LAPD1)

else_jump @CRASH_86

[email protected] = Car.Create(#AT400, 2385.574, -1618.506, 133.5803)

[email protected] = Marker.CreateAboveCar([email protected])

00AE: set_car [email protected] traffic_behaviour_to 2

0129: [email protected] = create_actor_pedtype 23 model #LAPD1 in_car [email protected] driverseat

07C0: load_path 835

repeat

wait 0

until 07C1: path 835 available

05EB: assign_car $AT400 to_path 835

Marker.Disable([email protected])

0A93: end_custom_thread

 

I also put the path_835 in carrec.img, was that right?

Link to comment
Share on other sites

Well.........now I cant see the plane moving, but it doesnt crash!

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.