Quantcast
Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
    1. Welcome to GTAForums!

    1. GTANet.com

    1. GTA Online

      1. Los Santos Summer Special
      2. The Diamond Casino Heist
      3. Find Lobbies & Players
      4. Guides & Strategies
      5. Vehicles
      6. Content Creator
      7. Help & Support
    2. Red Dead Online

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

    1. Red Dead Redemption 2

      1. PC
      2. Gameplay
      3. Missions
      4. Help & Support
    2. Red Dead Redemption

    1. Grand Theft Auto Series

    2. GTA 6

      1. St Andrews Cathedral
    3. GTA V

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

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

    6. GTA Vice City Stories

    7. GTA Liberty City Stories

    8. GTA San Andreas

      1. Guides & Strategies
      2. Help & Support
    9. GTA Vice City

      1. Guides & Strategies
      2. Help & Support
    10. GTA III

      1. Guides & Strategies
      2. Help & Support
    11. Top Down Games

      1. GTA Advance
      2. GTA 2
      3. GTA
    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. DYOM
      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
    3. Gangs

    1. Announcements

    2. Support

    3. Suggestions

Sign in to follow this  
Kriskers

My script crashes my game!

Recommended Posts

Kriskers

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?

Share this post


Link to post
Share on other sites
spaceeinstein

There's something terribly wrong with this

01B0: car $PLAYER_ACTOR

Share this post


Link to post
Share on other sites
Kriskers

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

Share this post


Link to post
Share on other sites
Dutchy3010

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.

Share this post


Link to post
Share on other sites
Kriskers

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

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

Share this post


Link to post
Share on other sites
Deji

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

 

Share this post


Link to post
Share on other sites
Kriskers

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

I made it like this:

07C0: load_path carrec900.rrr

 

Share this post


Link to post
Share on other sites
Dutchy3010

 

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...

Share this post


Link to post
Share on other sites
Deji

 

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

 

Share this post


Link to post
Share on other sites
Dutchy3010

 

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.

Share this post


Link to post
Share on other sites
Deji

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.

Share this post


Link to post
Share on other sites
james227uk

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

Share this post


Link to post
Share on other sites
Dutchy3010
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

Share this post


Link to post
Share on other sites
Kriskers

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

Any ideas?

Share this post


Link to post
Share on other sites
Kriskers

Bump!

Share this post


Link to post
Share on other sites
Dutchy3010

It is useful to show your full code after the changes you made.

Share this post


Link to post
Share on other sites
Kriskers

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?

Share this post


Link to post
Share on other sites
Dutchy3010

Assigning "$AT400" to a path is a bit difficult. wink.gif The variable of the AT400 is [email protected]

Share this post


Link to post
Share on other sites
Kriskers

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

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

  • 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.