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

    1. Red Dead Redemption 2

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

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

      1. Recruitment
    2. Events

    1. GTA Online

      1. Diamond Casino & Resort
      2. DLC
      3. Find Lobbies & Players
      4. Guides & Strategies
      5. Vehicles
      6. Content Creator
      7. Help & Support
    2. Grand Theft Auto Series

    3. GTA 6

    4. GTA V

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

      1. Episodes from Liberty City
      2. Multiplayer
      3. Guides & Strategies
      4. Help & Support
      5. GTA IV Mods
    6. GTA Chinatown Wars

    7. GTA Vice City Stories

    8. GTA Liberty City Stories

    9. GTA San Andreas

      1. Guides & Strategies
      2. Help & Support
      3. GTA SA Mods
    10. GTA Vice City

      1. Guides & Strategies
      2. Help & Support
      3. GTA VC Mods
    11. GTA III

      1. Guides & Strategies
      2. Help & Support
      3. GTA III Mods
    12. Top Down Games

      1. GTA Advance
      2. GTA 2
      3. GTA
    13. Wiki

      1. Merchandising
    1. GTA Modding

      1. GTA V
      2. GTA IV
      3. GTA III, VC & SA
      4. Tutorials
    2. Mod Showroom

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

      1. DYOM
      2. OpenIV
      3. GTA: Underground
      4. GTA: Liberty City
      5. GTA: State of Liberty
    1. Red Dead Redemption

    2. Rockstar Games

    1. Off-Topic

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

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

    2. Forum Support

    3. Site Suggestions

Sign in to follow this  
Ricky12

Vehichle spawning [CLEO]

Recommended Posts

Ricky12

 

{$CLEO .cs}:ammocars014B: [email protected] = init_parked_car_generator 530 -1 -1  1 alarm 0 door_lock 0 0 10000 at 355.221 2469.67 15.91 angle 140.0014C: set_parked_car_generator [email protected] cars_to_generate_to 101014B: [email protected] = init_parked_car_generator 433 -1 -1  1 alarm 0 door_lock 0 0 10000 at 361.841 2451.82 15.98 angle 90.0014C: set_parked_car_generator [email protected] cars_to_generate_to 101014B: [email protected] = init_parked_car_generator 470 -1 -1  1 alarm 0 door_lock 0 0 10000 at 361.841 2443.02 15.98 angle 90.0014C: set_parked_car_generator [email protected] cars_to_generate_to 10109E2: [email protected] = parked_car_generator_w_numberplate #ELEGY color  24  40  1 alarm  0 door_lock  0  0  10000 plate "___C_J__" at -2034.54  170.235  28.1953 angle -90.0014C: set_parked_car_generator [email protected] cars_to_generate_to  1010A93: end_custom_thread

 

 

This is my script, which is named parkedcars.cs

It lies in the folder GTA San Andreas\cleo

 

As you may see I'm trying to spawn a couple of cars, however when i start up my game, they aren't there confused.gif

 

 

My question is simple, why doesn't the cars spawn where i want them to, and how can i make this script work?

 

 

 

Also, i was able to do these carspawns before i installed CLEO. I'm quite new to CLEO at the moment... whatsthat.gif

Edited by Ricky12

Share this post


Link to post
Share on other sites
Dutchy3010

I think your problem isn't with your code, but with the engine of SA. The ground of the cars isn't created yet, because the distance between that place and the player is to big. I didn't test it, but I hope the following will work:

 

 

{$CLEO .cs}:ammocarsrepeatwait 0until 00FE:   actor $PLAYER_ACTOR sphere 0 in_sphere 361.841 2451.82 15.98 radius 15.0 15.0 15.0 014B: [email protected] = init_parked_car_generator 530 -1 -1  1 alarm 0 door_lock 0 0 10000 at 355.221 2469.67 15.91 angle 140.0014C: set_parked_car_generator [email protected] cars_to_generate_to 101014B: [email protected] = init_parked_car_generator 433 -1 -1  1 alarm 0 door_lock 0 0 10000 at 361.841 2451.82 15.98 angle 90.0014C: set_parked_car_generator [email protected] cars_to_generate_to 101014B: [email protected] = init_parked_car_generator 470 -1 -1  1 alarm 0 door_lock 0 0 10000 at 361.841 2443.02 15.98 angle 90.0014C: set_parked_car_generator [email protected] cars_to_generate_to 10109E2: [email protected] = parked_car_generator_w_numberplate #ELEGY color  24  40  1 alarm  0 door_lock  0  0  10000 plate "___C_J__" at -2034.54  170.235  28.1953 angle -90.0014C: set_parked_car_generator [email protected] cars_to_generate_to  1010A93: end_custom_thread

 

Of course car [email protected] will have the same problem with this code, because it is a long distance between that car and the others. But this is just an example. wink.gif

I don't know if an angle with a - is possible in the code, but you can also use 270, because that's the same.

Share this post


Link to post
Share on other sites
Ricky12

"A jump to zero offset found", nope didn't work...

 

and about @4, if this had worked then i would have to make another script for that car alone?

 

EDIT:

i fixed the "zero offset" thingy by adding "0000:" in the beginning, however it still doesn't work, no cars spawn suicidal.gif

Edited by Ricky12

Share this post


Link to post
Share on other sites
Dutchy3010

I'm really sorry, but I think I talked nonsense. I did confuse it with a create.car opcode. I don't think this is the problem.

 

I changed the coords, now the four cars will spawn at Grove Street, and it works!

 

user posted image

 

EDIT: I tried your code, and it works for me...

 

user posted image

Edited by Dutchy3010

Share this post


Link to post
Share on other sites
Ricky12

Noo...?

 

Tried the code.

No car spawns in Grove either confused.gif

 

EDIT:

Well, it seems im a better newbie than i thought, appearantly my code works... shame my computer/game/whatever somehow messes up so that the cars don't spawn on my game sad.gif

 

Really strange though, it worked with regular .scm coding

 

EDIT2:

 

Nice tuxedo btw biggrin.gif

Edited by Ricky12

Share this post


Link to post
Share on other sites
Dutchy3010

I do think that your CLEO isn't installed or working properly, because the codes work for me.

Share this post


Link to post
Share on other sites
Ricky12

Well, i followed ZAZ's tutorial in the beginning, when i installed CLEO, and the directory is there, and when i start Sanny Builder, it tells me that the newest CLEO is installed already, so i really have no idea

Edited by Ricky12

Share this post


Link to post
Share on other sites
Ricky12

Think i might want to reinstall CLEO, and see if the problem solves itself. However i actually don't know how to uninstall CLEO, any help here would be great tounge.gif

 

Really irritating me that this doesn't work only on my computer

Share this post


Link to post
Share on other sites
NTAuthority
I think your problem isn't with your code, but with the engine of SA. The ground of the cars isn't created yet, because the distance between that place and the player is to big.

Car generators are streaming, they'll only spawn if the required collisions are loaded as well. I think you're talking about normal cars smile.gif

Share this post


Link to post
Share on other sites
Ricky12

Well, as you can see above, dutchy already tested my code, and it works as it should, it seems the problem is that my CLEO isn't installed properly.

 

So i was thinking of reinstalling the CLEO, as mentioned above... :

 

Think i might want to reinstall CLEO, and see if the problem solves itself. However i actually don't know how to uninstall CLEO, any help here would be great tounge.gif

 

Really irritating me that this doesn't work only on my computer

Share this post


Link to post
Share on other sites
Dutchy3010
I think your problem isn't with your code, but with the engine of SA. The ground of the cars isn't created yet, because the distance between that place and the player is to big.

Car generators are streaming, they'll only spawn if the required collisions are loaded as well. I think you're talking about normal cars smile.gif

Please look through the whole topic before replying:

 

 

I'm really sorry, but I think I talked nonsense. I did confuse it with a create.car opcode. I don't think this is the problem.

Share this post


Link to post
Share on other sites
NTAuthority

 

Well, as you can see above, dutchy already tested my code, and it works as it should, it seems the problem is that my CLEO isn't installed properly.

Do you see the 'CLEO 3' message in the bottom left of the main menu? If yes, do you have the script actually compiled as a .cs file in the cleo\ folder? If yes, do you see '1 script loaded' during the pause menu in the bottom left?

 

 

@Dutchy: oops, overlooked it smile.gif

Share this post


Link to post
Share on other sites
Ricky12

by "Main Menu" i assume you mean the one that opens when i start the game, before i load my saved games. If so, then no. No CLEO 3 message in the bottom left.

 

I did notice an V2.0 in the right corner though, im guessing that means the game is version 2 tounge2.gif

 

Guess i need a downgrade first then, well, no matter, I'll look into it soon

 

Strange though, all previous moding i have attempted have worked perfectly, and i kinda had the impression that only version 1.0 was modable.

Share this post


Link to post
Share on other sites
NTAuthority
Strange though, all previous moding i have attempted have worked perfectly, and i kinda had the impression that only version 1.0 was modable.

The only mods not working in V2 are mods that modify gta3.img and mods that hook the game, like CLEO sadly.

Share this post


Link to post
Share on other sites
Ricky12

Well that answers most of my questions, just some left:

 

1. Can somebody give me the link for a downgrade, would spare me some websearching?

 

2. Will downgrading my game affect my saved games?

 

3. What is the difference between 2.0 and 1.0 in general?

Share this post


Link to post
Share on other sites
Dutchy3010

1. Downgrader.

2. No, you can still play your own saved games.

3. Generally, version 1 is modable, version 2 not (or at least it is more difficult to mod). Version 2 has some bugfixes. But you won't get version 1 when you use the downgrader, you will only get a modable version 2.

Share this post


Link to post
Share on other sites
Ricky12

sounds good tounge.gif

 

Ill get it right away! wink.gif

Share this post


Link to post
Share on other sites
Ricky12

Still isn't working....

 

The downgrade removed the text saying "V2.0" in the bottom right corner, so im guessing the downgrade i performed was a success, however there is no equa text saying "CLEO" in the bottom left corner, and i start the game and SURPRISE! none of the cars are spawned... monocle.gif

 

I'm guessing CLEO is not installed, and that i have to do that first.

 

Sanny builder tells me CLEO is installed, and the CLEO folder in the

Rockstar Games\GTA San Andreas is still there.

 

How shall i install CLEO if it's already installed?? mercie_blink.gif

If i can't, how can i uninstall? confused.gif

 

I'll try installing it again first though.

Share this post


Link to post
Share on other sites
OrionSR

Just a bit of warning: You need to be careful when using opcodes 014B: and 0A93: in a cleo script; they add the generators to the game save. If the script runs more than once (reloading the save after the cars were added and saved) you can end up with multiple copies of the same car in the same location. If you add too many cars then there won't be room in memory for the generators streamed in from IPL, which is most of the parked cars in the game. You can safely add about 60 or 70 vehicles before the car spawns start to lag a little.

Edited by OrionSR

Share this post


Link to post
Share on other sites
Ricky12

any way to prevent the script from repeating itself?

 

EDIT:

 

uninstalled GTA, Sanny builder, tried to remove all CLEO folders.

Trying to start over and do everything correct this time... confused.gif

 

EDIT 2:

 

reinstalled the game and sanny builder, got the option to install CLEO along with sanny builder, installed it, compiled and copied my script into the GTA San Andreas\cleo folder, tried to run the game, and it crashes right before the main menu...

 

also tried removing my script, but the game still crashes!

 

HEEEEEEEEEEEEEEELP!!!!!!!!!!!!! suicidal.gifsad.gifsuicidal.gif

Edited by Ricky12

Share this post


Link to post
Share on other sites
OrionSR

 

any way to prevent the script from repeating itself?

For something like this I would use a keypress check to run the car spawning codes so the new cars are only added when you want to make the change. Once you are happy with the new cars then move the script into a disabled folder so it can't run again. A more elegant solution would be to use an unused global to flag the modification, but I don't recommend it. Messing with globals tends to cause problems eventually.

 

 

{$CLEO .cs}0000:while true wait 250 if   0AB0:   key_pressed 0x76    // F7 then                                                                              0A94: start_custom_mission "Testing" endend

 

 

 

{$CLEO .cm}:CG_Testing thread "Testing"//Put your test codes here.wait 25000BB: show_text_lowpriority GXT 'FESZ_LS' time 2000 flag 1  // Load Successful.004E: end_thread

 

 

The advantage to this method is you don't need to restart the game after each modification since the custom mission isn't loaded until the trigger key is pressed.

 

Consider adding a text message to the code segment as a warning that something has happen, or a clue that the script is working.

 

00BB: show_text_lowpriority GXT 'FELD_WR' time 3000 flag 1  // Loading data, please wait...

 

Edited by OrionSR

Share this post


Link to post
Share on other sites
james227uk

DId you delete the game folder? I found that selecting Uninstall GTA San Andreas doesn't delete the games folder. So it's says in uninstalling, but it's only really deleting Registry Entries

Share this post


Link to post
Share on other sites
[SM]CJZera

This aint about fixing your problem, but I recomend you not using Parked Generators, because the max number of parked cars may max out and the game will start deleting some, you'll notice what I mean if you ever go to LV airport to get a plane after fixing your problems, some planes may have disapeared, I recomend using a check to know if the player is around the sphere and then spawning the car

Share this post


Link to post
Share on other sites
ZAZ

 

Just a bit of warning: You need to be careful when using opcodes 014B: and 0A93: in a cleo script; they add the generators to the game save. If the script runs more than once (reloading the save after the cars were added and saved) you can end up with multiple copies of the same car in the same location. If you add too many cars then there won't be room in memory for the generators streamed in from IPL, which is most of the parked cars in the game. You can safely add about 60 or 70 vehicles before the car spawns start to lag a little.

You must add

0A95: enable_thread_saving

to save the scriptstate

read Cleo Tutorial

 

{$CLEO .cs}:PaCar_103A4: name_thread "PACR"0001: wait  1000 ms0A95: enable_thread_saving014B: [email protected] = init_parked_car_generator #BANSHEE -1 -1  1 alarm  0 door_lock  0  0  10000 at  920.1994  2020.546  11.79 angle  100.0014C: set_parked_car_generator [email protected] cars_to_generate_to  101032B: [email protected] = create_weapon_pickup #MINIGUN  15 ammo  5000 at  2113.373 1520.674  10.820A93: end_custom_thread

 

 

but without that opcode insnt a reason for crashs

Share this post


Link to post
Share on other sites
Seemann

Hey guys, the topic starter clearly said:

 

it crashes right before the main menu...

and you keep giving advices to him to use a keypress check or add a save_flag ... He can't load his game at all! biggrin.gif

 

Well, the problem is that, Ricky was adviced to use the downgrader patch that SEEMS to be unsupported by the current CLEO version. I'm not sure what that patch does, but from my experience anyone who used it had a problem with launching the game with CLEO installed.

 

Ricky, the solution seems to be given in the SCM Coding FAQ under the CLEO section. Dl the compact exe and make use of it, that should help you to run the game. Then follow other advices from this topic if needed.

Share this post


Link to post
Share on other sites
Ricky12

If CLEO doesn't work with the downgrade i installed, then it all makes sense sigh.gif

 

But rather than giving me tons of pages to read through, can't you guys just give me the download link?

 

Also, about the script repeating itself and so on, im planning to make a few missions, where these cars are awarded for completing the mission, so i guess that won't be a problem in the future tounge.gif

Share this post


Link to post
Share on other sites
OrionSR

 

Hey guys, the topic starter clearly said:

 

it crashes right before the main menu...

and you keep giving advices to him to use a keypress check or add a save_flag ... He can't load his game at all! biggrin.gif

 

 

Yeah, I know. Point taken. Still, I felt compelled to post a warning about the dangers of adding car generators using CLEO scripts, and the TC did ask how to stop scripts from repeating so I don't think I'm too far off topic, even if my methods are a bit crude.

 

ZAZ, enabling thread saving is not a requirement for using car generators in CLEO scripts. We have been adding cars to the chain game saves without this code for quite a while now and have not had any problems. From what I gathered from the tutorial, the author (oh, hey - that's you) was using thread saving to prevent the car generators from being created more than once, and demonstrating how to store thread data (thread has ended). I am sure there are many methods to solve any problem and the author's is probably very effective. The method we used to prevent duplication of the car generators was to add a check so the custom mission would only run on new game starts (then we unallocated all the cars and replaced them). We avoided thread saving because the saves were intended to be used with v1 and v2, and always without CLEO running.

 

The GTA:SA Save Game Editor v1.0 by Ryosuke is a very effective tool for viewing the status of the car generators in the save. I don't trust this Japanese application for making edits, but it is definitely a great save file viewer. It was certainly useful when someone else used a poorly written CLEO script that added a couple hundred cars to the shared save.

http://gtasamod.web.fc2.com/tool/sase/index.html

 

Update: Sorry, Ricky. I didn't notice your message until after I posted. The link is right there in the first post. Scroll down to CLEO, look down a few lines, and there it is; you need the password too. You might want to follow up on [sM]CJZera's suggestion of spawning the vehicle only when CJ is near. You can add custom parts (nitrous), paintjobs, and proofings to mission spawned vehicles. Car generators have fairly limited properties. Also, you will be limited to only 4 new custom plates if you stick with car generators.

Edited by OrionSR

Share this post


Link to post
Share on other sites
Andrew

Duplicate topic, locked.

Share this post


Link to post
Share on other sites
Guest
This topic is now closed to further replies.
Sign in to follow this  

  • 2 Users Currently Viewing
    0 members, 0 Anonymous, 2 Guests

×
×
  • Create New...

Important Information

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