|
 |
|
|
|
|
|
GTA Modification Forums
CLEO Coding for GTA3 Parked car generator
 |
|
 |
| |
SomeGuy86  |
Posted: Thursday, Jul 5 2012, 14:52
|
Dodo Pilot

Group: Members
Joined: Dec 14, 2010

|
| QUOTE (JACK JONES @ Thursday, Jul 5 2012, 14:11) | Put this in a text document, place it in the CLEO folder of gta3 and compile it with the SB:
| CODE | {$CLEO .cs} 014B: 0@ = init_parked_car_generator 111 color -1 -1 0 alarm 0 door_lock 0 0 10000 at 765.258 -24.962 15.0 angle 18.42 014C: set_parked_car_generator 0@ cars_to_generate_to 101 0167: 1@ = create_marker_at 765.258 -24.962 15.0 1 3 05DC: end_custom_thread |
I tested it and the KURUMA is spawning at that coordinates (ID from default.ide). You have a green marker on the map too and you can telerport yourself to that coordinates with the first code I gave you (just put the same coordinates from this code then press and hold fire while in game). Also the car will not spawn right away - you have to drive far away and then come back to green marker. |
This is interesting... Apparently CLEO still reports "1 script loaded" (save Everywhere), and just when I was about to get back here & tell it didn't work out, I saw that small blimp on the radar. And yes, I ended up in Portland, with the Kuruma actually spawned close to the safehouse! Thank you so much, so it really is possible! I only wonder why it didn't work earlier? I'll try to experiment, will also remove that blimp thingy. EDIT OK, I see what you did here, you used 111 instead of #Kuruma. Perhaps all the problems were related to Model/ID issue, just like Frank.s said in his post? EDIT2 Yes, it's finally working... Here's the script I made for Odie's Stunt Park, it spawns all the cars as he originally intended them to  | CODE | {$CLEO .cs}
014B: $STUNT_PARK1 = init_parked_car_generator 105 color -1 -1 0 alarm 0 door_lock 0 0 10000 at 1034.855 240.374 9.5829 angle 180.0 014C: set_parked_car_generator $STUNT_PARK1 cars_to_generate_to 101 014B: $STUNT_PARK2 = init_parked_car_generator 101 color -1 -1 0 alarm 0 door_lock 0 0 10000 at 1025.55 240.3823 9.6393 angle 180.0 014C: set_parked_car_generator $STUNT_PARK2 cars_to_generate_to 101 014B: $STUNT_PARK3 = init_parked_car_generator 119 color -1 -1 0 alarm 0 door_lock 0 0 10000 at 1024.634 265.1858 9.6561 angle 0.0 014C: set_parked_car_generator $STUNT_PARK3 cars_to_generate_to 101 014B: $STUNT_PARK4 = init_parked_car_generator 134 color -1 -1 0 alarm 0 door_lock 0 0 10000 at 1033.898 265.9774 9.7191 angle 358.0 014C: set_parked_car_generator $STUNT_PARK4 cars_to_generate_to 101 014B: $STUNT_PARK5 = init_parked_car_generator 133 color -1 -1 0 alarm 0 door_lock 0 0 10000 at 1038.279 300.4653 10.2978 angle 269.0 014C: set_parked_car_generator $STUNT_PARK5 cars_to_generate_to 101 014B: $STUNT_PARK6 = init_parked_car_generator 116 color -1 -1 0 alarm 0 door_lock 0 0 10000 at 1127.662 346.7969 9.8653 angle 0.0 014C: set_parked_car_generator $STUNT_PARK6 cars_to_generate_to 101 014B: $STUNT_PARK7 = init_parked_car_generator 96 color -1 -1 0 alarm 0 door_lock 0 0 10000 at 1149.496 347.0167 10.2695 angle 0.0 014C: set_parked_car_generator $STUNT_PARK7 cars_to_generate_to 101 014B: $STUNT_PARK8 = init_parked_car_generator 137 color -1 -1 0 alarm 0 door_lock 0 0 10000 at 1174.654 274.9793 10.138 angle 269.0 014C: set_parked_car_generator $STUNT_PARK8 cars_to_generate_to 101 014B: $STUNT_PARK9 = init_parked_car_generator 110 color -1 -1 0 alarm 0 door_lock 0 0 10000 at 1219.026 294.213 9.8295 angle 269.0 014C: set_parked_car_generator $STUNT_PARK9 cars_to_generate_to 101 014B: $STUNT_PARK10 = init_parked_car_generator 112 color -1 -1 0 alarm 0 door_lock 0 0 10000 at 1219.253 239.738 10.01 angle 269.0 014C: set_parked_car_generator $STUNT_PARK10 cars_to_generate_to 101 014B: $STUNT_PARK11 = init_parked_car_generator 92 color -1 -1 0 alarm 0 door_lock 0 0 10000 at 1299.508 277.9702 9.7475 angle 179.0 014C: set_parked_car_generator $STUNT_PARK11 cars_to_generate_to 101 05DC: end_custom_thread |
The only problem with this script is that somehow prevents you from starting the new game. I have no idea why, or how, but I'm assuming it has to do with flooding the memory with script data, coordinates. This post has been edited by SomeGuy86 on Thursday, Jul 5 2012, 16:32
|
|
|
|
|
 |
|
 |
 |
|
 |
| |
fireguy109  |
Posted: Thursday, Jul 5 2012, 16:29
|
Chronic post editor.

Group: Leone Family Mafia
Joined: Aug 30, 2010


|
Ah f*cknuggets, forgot to load the model first. | CODE | {$CLEO .cs} 03A4: name_thread 'S' 0247: request_model 127
:S_1 0001: wait 0 ms 00D6: if and 00E3: player $PLAYER_CHAR 0 765.258 -24.962 radius 100.0 100.0 0248: model 127 available 004D: jump_if_false @S_1 00A5: 0@ = create_car 127 at 765.258 -24.962 15.0 0175: set_car 0@ z_angle_to 18.42 0249: release_model 127
:S_2 0001: wait 0 ms 00D6: if 80E3: not player $PLAYER_CHAR 0 765.258 -24.962 radius 100.0 100.0 004D: jump_if_false @S_2 01C3: remove_references_to_car 0@ 0247: request_model 127 0002: jump @S_1 |
With this type of script, you can just leave it in your CLEO folder and not have to delete it after you save the game, because it doesn't make a generator it only spawns a car. You can also customize color/bulletproofing  Also, you should really use SB with CLEO scripts. BW's builder is nice, but SB is better because of the opcode search and all that cool stuff. This post has been edited by fireguy109 on Thursday, Jul 5 2012, 16:31
|
|
|
|
|
 |
|
 |
 |
|
 |
| |
SomeGuy86  |
Posted: Thursday, Jul 5 2012, 16:37
|
Dodo Pilot

Group: Members
Joined: Dec 14, 2010

|
| QUOTE (fireguy109 @ Thursday, Jul 5 2012, 16:29) | Ah f*cknuggets, forgot to load the model first.
| CODE | {$CLEO .cs} 03A4: name_thread 'S' 0247: request_model 127
:S_1 0001: wait 0 ms 00D6: if and 00E3: player $PLAYER_CHAR 0 765.258 -24.962 radius 100.0 100.0 0248: model 127 available 004D: jump_if_false @S_1 00A5: 0@ = create_car 127 at 765.258 -24.962 15.0 0175: set_car 0@ z_angle_to 18.42 0249: release_model 127
:S_2 0001: wait 0 ms 00D6: if 80E3: not player $PLAYER_CHAR 0 765.258 -24.962 radius 100.0 100.0 004D: jump_if_false @S_2 01C3: remove_references_to_car 0@ 0247: request_model 127 0002: jump @S_1 |
With this type of script, you can just leave it in your CLEO folder and not have to delete it after you save the game, because it doesn't make a generator it only spawns a car. You can also customize color/bulletproofing 
Also, you should really use SB with CLEO scripts. BW's builder is nice, but SB is better because of the opcode search and all that cool stuff. |
Very nice! Even though I finally got it working, I'll definitely go check it out  EDIT That coach almost dropped right onto my head lol, but yes it does work  This may sound a bit noobish, but would your script work with multiple vehicles, like the one I made in previous post, for Stunt Park? Or do I have to write separate CLEO scripts for each vehicle? This post has been edited by SomeGuy86 on Thursday, Jul 5 2012, 16:49
|
|
|
|
|
 |
|
 |
 |
|
 |
| |
SomeGuy86  |
Posted: Thursday, Jul 5 2012, 17:10
|
Dodo Pilot

Group: Members
Joined: Dec 14, 2010

|
| QUOTE (JACK JONES @ Thursday, Jul 5 2012, 17:00) | | If you want to have plenty of parked cars then put the opcodes 014B and 014C in the main.scm file - that's the easiest way. I do that in vice City all the time and there were no game crashing, freezing or anything like that plus you can use global variables too. | I know, but I'd also have to start the new game, right? Think I'll stick to this solution for now, or the other one, from fireguy109 The game seems to be working just fine, no crashing or any other problems, other than not being able to start the new game.
|
|
|
|
|
 |
|
 |
 |
|
 |
| |
fireguy109  |
Posted: Thursday, Jul 5 2012, 19:02
|
Chronic post editor.

Group: Leone Family Mafia
Joined: Aug 30, 2010


|
If they're all in the same general radius, say 25 units, you could just use the central point in the checks (00E3). Say it was 2.0 2.0 and 4.0 4.0, you'd use 3.0 3.0 in your checks. Then when you loaded the models you would have to make sure to load each new model, but yeah you could spawn them all at once. Just remember to give each car a new name. | CODE | {$CLEO .cs} 03A4: name_thread 'S' 0247: request_model 127 0247: request_model 126
:S_1 0001: wait 0 ms 00D6: if and 00E3: player $PLAYER_CHAR 0 765.0 -22.5 radius 100.0 100.0 0248: model 127 available 0248: model 126 available 004D: jump_if_false @S_1 00A5: 0@ = create_car 127 at 765.0 -25.0 15.0 0175: set_car 0@ z_angle_to 18.42 0249: release_model 127 00A5: 1@ = create_car 126 at 765.0 -20.0 15.0 0175: set_car 1@ z_angle_to 18.42 0249: release_model 126
:S_2 0001: wait 0 ms 00D6: if 80E3: not player $PLAYER_CHAR 0 765.0 -22.5 radius 100.0 100.0 004D: jump_if_false @S_2 01C3: remove_references_to_car 0@ 01C3: remove_references_to_car 1@ 0247: request_model 126 0247: request_model 127 0002: jump @S_1 |
Note - I'm not sure what 126 is, if it's the train or something you'll get a crash so you might want to check that Alternatively, you could build a number of these loops in the same script if you were spawning the cars on different islands or something, although the script would get pretty bogged down after a while and it would be a pain to work out. The easiest thing would be to make multiple CLEO scripts. This post has been edited by fireguy109 on Thursday, Jul 5 2012, 19:05
|
|
|
|
|
 |
|
 |
 |
|
 |
| |
SomeGuy86  |
|
Dodo Pilot

Group: Members
Joined: Dec 14, 2010

|
| QUOTE (SilentPL @ Sunday, Jul 8 2012, 17:37) | | If you have problems with understanding this type of code, just compile it and then decompile again. |
Thanks, I'll give it a shot  EDIT Nevermind, I'm done with this... Apparently there's some kind of a limit on car generators, how many cars you can add through the script and when you go over the limit, game doesn't want to start (stops responding). CLEO or SCM, it doesn't matter, I tried both methods & ended up having exactly the same problem *sigh* Come to think of it, I just remembered the same problem from March 2006, when I got into GTA modding community. Eventually I had no other alternative but to remove some of the original parked vehicles & replace them with mine! This post has been edited by SomeGuy86 on Monday, Jul 9 2012, 00:40
|
|
|
|
|
 |
|
 |
 |
|
 |
| |
0 User(s) are reading this topic (0 Guests and 0 Anonymous Users)
0 Members:
Pages:
(2) 1 [2]
Track this topic
Receive email notification when a reply has been made to this topic and you are not active on the board.
Subscribe to this forum
Receive email notification when a new topic is posted in this forum and you are not active on the board.
Download / Print this Topic
Download this topic in different formats or view a printer friendly version.
| |
 |
|
 |
|
|
|
|