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. Help & Support
    2. Red Dead Redemption

    1. Grand Theft Auto Series

    2. GTA VI

      1. St. Andrews Cathedral
    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. Guides & Strategies
      2. Help & Support
    6. GTA Vice City

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

      1. Guides & Strategies
      2. 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. 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
    3. Gangs

    1. Announcements

    2. Support

    3. Suggestions

EAZYJ

Car spawning in area script, no effect in game

Recommended Posts

EAZYJ

Hello,

(Btw sorry, I don't know how to add scmlog.log if someone could tell me)

 

I'm building a new game from the start (took a semi-empty main.scm) and I wanted to make a script that if you're near your home, a car will spawn near it.

 

But when I compile the game doesn't spawn the car when I'm in the area for some reason. I put this just after the thread 'INITIAL'.

 

I don't want to make something very complex, just a system that if you're near a point, the car spawns.

 

Any help would be much appreciated thanks!

 //------------------------------ BART's VEHICLE ----------------------------- :VEHICULE_TAR_01thread 'VEHICULE_TAR' :VEHICULE_TAR_11wait 0if   Player.Defined($PLAYER_CHAR)else_jump @VEHICULE_TAR_11if   $VEHICULE_TAR == 0else_jump @VEHICULE_TAR_11if00EC:   actor $PLAYER_ACTOR sphere 0 near_point 1354.2948 -629.085 109.13 radius 100.0 100.0else_jump @[email protected] VEHICULE_TAR_07 :VEHICULE_TAR_07wait 0Model.Load(#SULTAN)038B: load_requested_modelsif     Model.Available(#SULTAN)   jf @VEHICULE_TAR_07jump @VEHICULE_TAR_34  :VEHICULE_TAR_34wait [email protected] = Car.Create(560, 1360.2467, -620.3789, 109.13)0229: set_car [email protected] primary_color_to 39 secondary_color_to 39$VEHICULE_TAR == 1jump @VEHICULE_TAR_39 :VEHICULE_TAR_39 wait 0if 00EC:  not actor $PLAYER_ACTOR sphere 0 near_point 1354.2948 -629.085 109.13 radius 100.0 100.0else_jump @VEHICULE_TAR_39 $VEHICULE_TAR == 0jump @VEHICULE_TAR_11 end_thread  

Share this post


Link to post
Share on other sites
deltaCJ

Start with this:

https://www.gtamodding.com/wiki/Create_a_script

 

You should switch to $CLEO plugin. It's much easier since the save game remains intact unlike modifying the main.scm.

 

 

Nah, he said he wants to make a new whole game (probably why he named it "Bart's Car"

 

 

But the problem is that you put @jump

:VEHICULE_TAR_11wait 0if   Player.Defined($PLAYER_CHAR)else_jump @VEHICULE_TAR_11if   $VEHICULE_TAR == 0else_jump @VEHICULE_TAR_11if00EC:   actor $PLAYER_ACTOR sphere 0 near_point 1354.2948 -629.085 109.13 radius 100.0 100.0else_jump @[email protected] VEHICULE_TAR_07
Edited by deltaCJ

Share this post


Link to post
Share on other sites
EAZYJ

Thanks for the help,

 

Yeah but I said I want to build a new game, I got a main.scm with deleted missions and I want to make my own. I read CLEO can't store global variable so it won't help.

 

The game crashed when I put the create_thread at the top, so there might be something wrong with my script ?

 

deltaCJ, exactly, but even without the @ which was a mistake, it crashes

 create_thread @VEHICULE_TAR //-----------------MAIN---------------------------$VEHICULE_TAR == 0//-----------------VEHICULE TAR-------------------  :VEHICULE_TARthread 'VEHICULE_TAR' jump @VEHICULE_TAR_19 :VEHICULE_TAR_19wait 0 if    Player.Defined($PLAYER_CHAR)else_jump @VEHICULE_TAR_19 if   $VEHICULE_TAR == 0 else_jump @VEHICULE_TAR_19 if 00EC:   actor $PLAYER_ACTOR sphere 0 near_point 1354.295 -629.085 109.13 radius 100 100.0 else_jump @VEHICULE_TAR_19 jump @VEHICULE_TAR_102  :VEHICULE_TAR_102wait 0 Model.Load(#SULTAN)038B: load_requested_models if    Model.Available(#SULTAN)else_jump @VEHICULE_TAR_102 jump @VEHICULE_TAR_136  :VEHICULE_TAR_136wait 0 [email protected] = Car.Create(540, 1360.247, -620.3789, 109.13)0229: set_car [email protected] primary_color_to 39 secondary_color_to 34   $VEHICULE_TAR == 1 jump @VEHICULE_TAR_186  :VEHICULE_TAR_186wait 0 if 00EC:   actor $PLAYER_ACTOR sphere 0 near_point 1354.295 -629.085 109.13 radius 100 100.0 else_jump @VEHICULE_TAR_186   $VEHICULE_TAR == 0 jump @VEHICULE_TAR_19 end_thread  
Edited by EAZYJ

Share this post


Link to post
Share on other sites
deltaCJ

Does it crash when you start game or when you are by the house?

Share this post


Link to post
Share on other sites
EAZYJ

I made the character spawn near the house. So when I start new game, after loading it crashes.

 

Even if I spawn the character at 0.0 0.0 0.0 it's the same

Share this post


Link to post
Share on other sites
deltaCJ

Send your whole script (Main and all)

Share this post


Link to post
Share on other sites
deltaCJ

Okay, What i need you to do, is that everytime you open sanny builder, do not open the main.scm, open the .TXT that sanny builder makes.

Share this post


Link to post
Share on other sites
EAZYJ

Yes I should, it's a bad habbit I have.

 

So do you need anything else? What should I do to make the script work?

Share this post


Link to post
Share on other sites
deltaCJ

You created the wrong model.

 

Not 540, it's 560.

 

EDIT: Also, 00EC opcode has 3d Coords, it needs to be 2d (Only X AND Y coords)

Edited by deltaCJ

Share this post


Link to post
Share on other sites
EAZYJ

Ok thanks for the info but it still crashes the game... Or sometimes it works "label VEHICULE_TAR not found", I'm a bit lost sorry. :/

 

and for me it says Car.Create #SULTAN instead of the id, not you?

Share this post


Link to post
Share on other sites
deltaCJ

Fixed Script:

:VEHICULE_TARthread 'VEHICULE_TAR'Model.Load(#SULTAN)038B: load_requested_modelsjump @VEHICULE_TAR_11 :VEHICULE_TAR_11wait 0if   Player.Defined($PLAYER_CHAR)jf @VEHICULE_TAR_11if 00EC:   actor $PLAYER_ACTOR sphere 0 near_point 1354.2948 -629.085 radius 100.0 100.0jf @VEHICULE_TAR_11$VEHICULE_TAR == 1jump @VEHICULE_TAR_07 :VEHICULE_TAR_07wait 0if     Model.Available(#SULTAN)   jf @VEHICULE_TAR_07jump @VEHICULE_TAR_34  :VEHICULE_TAR_34wait [email protected] = Car.Create(560, 1360.2467, -620.3789, 109.13)0229: set_car [email protected] primary_color_to 39 secondary_color_to 39jump @VEHICULE_TAR_39 :VEHICULE_TAR_39 wait 0if     80EC:  not actor $PLAYER_ACTOR sphere 0 near_point 1354.2948 -629.085 109.13 radius 100.0 100.0jf @VEHICULE_TAR_39 $VEHICULE_TAR == 0if$VEHICULE_TAR == 0jf @VEHICULE_TAR_39car.Destroy([email protected])jump @VEHICULE_TAR_11 end_thread 

Share this post


Link to post
Share on other sites
EAZYJ

Still crashing...

 

When I delete create_thread @VEHICULE_TAR at the top of the script, it's not crashing when I start the game.

 

EDIT: I think I get it, when I compile it deletes some information like the label, how to avoid it? AND it shows me some new errors like "Label ENTEXT_206 not found"

Edited by EAZYJ

Share this post


Link to post
Share on other sites
deltaCJ

Still crashing...

 

When I delete create_thread @VEHICULE_TAR at the top of the script, it's not crashing when I start the game.

 

EDIT: I think I get it, when I compile it deletes some information like the label, how to avoid it? AND it shows me some new errors like "Label ENTEXT_206 not found"

 

If it's not the VEHICULE_TAR script, then it's some thing else in the .SCM

 

EDIT: also, once again when you compile + copy, it compiles and makes a .txt for you.

Stop opening the compiled archive.

Edited by deltaCJ

Share this post


Link to post
Share on other sites
EAZYJ

Ok, I fixed it. It wasn't the script itself that made the game crash but where it was placed.

 

I placed it at the end so everything was f*cked up when I compiled.

It should go where the other threads are located.

 

+ Your script has a mistake in it, when you get away from the zone with the car it kills you. (since it destroys the car) But I'll fix it.

 

Thanks for your help anyway!

Edited by EAZYJ

Share this post


Link to post
Share on other sites
deltaCJ

Ok, I fixed it. It wasn't the script itself that made the game crash but where it was placed.

 

I placed it at the end so everything was f*cked up when I compiled.

It should go where the other threads are located.

 

+ Your script has a mistake in it, when you get away from the zone with the car it kills you. (since it destroys the car) But I'll fix it.

 

Thanks for your help anyway!

 

 

Ah, my bad about that tiny mistake, and yes always put your created_thread (s) under the main, and never under the missions

Share this post


Link to post
Share on other sites
ZAZ

 

Fixed Script:

:VEHICULE_TARthread 'VEHICULE_TAR'Model.Load(#SULTAN)038B: load_requested_modelsjump @VEHICULE_TAR_11 :VEHICULE_TAR_11wait 0if   Player.Defined($PLAYER_CHAR)jf @VEHICULE_TAR_11if 00EC:   actor $PLAYER_ACTOR sphere 0 near_point 1354.2948 -629.085 radius 100.0 100.0jf @VEHICULE_TAR_11$VEHICULE_TAR == 1jump @VEHICULE_TAR_07 :VEHICULE_TAR_07wait 0if     Model.Available(#SULTAN)   jf @VEHICULE_TAR_07jump @VEHICULE_TAR_34  :VEHICULE_TAR_34wait [email protected] = Car.Create(560, 1360.2467, -620.3789, 109.13)0229: set_car [email protected] primary_color_to 39 secondary_color_to 39jump @VEHICULE_TAR_39 :VEHICULE_TAR_39 wait 0if     80EC:  not actor $PLAYER_ACTOR sphere 0 near_point 1354.2948 -629.085 109.13 radius 100.0 100.0jf @VEHICULE_TAR_39 $VEHICULE_TAR == 0if$VEHICULE_TAR == 0jf @VEHICULE_TAR_39car.Destroy([email protected])jump @VEHICULE_TAR_11 end_thread 

 

fixed script?

 

what should that be

jf @VEHICULE_TAR_11$VEHICULE_TAR == 1 <------------- ?????jump @VEHICULE_TAR_07

 

jf @VEHICULE_TAR_39 $VEHICULE_TAR == 0  <------------------ ????if

Share this post


Link to post
Share on other sites
deltaCJ

It's a switch, it was in authors original script. If it works fine for me and him, it's fixed.

Share this post


Link to post
Share on other sites
EAZYJ

It was confusing at the beginning, I wanted to make some sort of Global Variable to declare if the car can spawn or not. But I used a local variable instead.

 

Let me know if you have any advices regarding that.

Share this post


Link to post
Share on other sites
ZAZ

It's a switch, it was in authors original script. If it works fine for me and him, it's fixed.

 

it should be a switch but double equal signe is a condition

it's an invalid conditional check without else_jump

it should have only one equal signe

$VEHICULE_TAR = 1
$VEHICULE_TAR = 0
Edited by ZAZ
  • Like 1

Share this post


Link to post
Share on other sites
deltaCJ

Ah good eye, didn't see tht

Share this post


Link to post
Share on other sites
EAZYJ

Thanks for the info ZAZ. :)

Edited by EAZYJ

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.


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