IMG

 
IMG
IMG   IMG
  Welcome to GTAForums! Be sure to check out the Grand Theft Auto V Forum.

You are not registered! (If you are, click here to login) Registering is fast, free and easy and allows you to instantly reply to any topic on GTAForums.
Why wait? Click here to register your own unique username and become part of the ever-growing community!


( Log In | Register | Revalidate Validation E-mail )
Quick Log-In:
  IMG
       
>
Forum Rules GTA Modification Forums

Please post mod releases in the Mod Showroom

GTAGarage.com
free mod hosting from GTANet, simply login with your GTAForums account details

GTAModding.com
GTANet's modding wiki

GTA Modding Chatroom
provided by irc.gtanet.com (Don't have an IRC client? Click here)


Pages: (2) 1 [2]   ( Go to first unread post ) Reply to this topicStart new topicStart Poll

 CLEO Coding for GTA3

 Parked car generator
 
JACK JONES  
Posted: Thursday, Jul 5 2012, 14:11
Quote Post


Booom!!!
Group Icon
Group: Members
Joined: Dec 6, 2011

sr.gif

XXXXX



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

 
SomeGuy86  
Posted: Thursday, Jul 5 2012, 14:52
Quote Post


Dodo Pilot
Group Icon
Group: Members
Joined: Dec 14, 2010

XXXXX



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 smile.gif
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
PM
  Top
 

 
fireguy109  
Posted: Thursday, Jul 5 2012, 16:29
Quote Post


Chronic post editor.
Group Icon
Group: Leone Family Mafia
Joined: Aug 30, 2010

us.gif

XXXXX



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

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

This post has been edited by fireguy109 on Thursday, Jul 5 2012, 16:31
Users WebsitePMPlayStation Network
  Top
 

 
SomeGuy86  
Posted: Thursday, Jul 5 2012, 16:37
Quote Post


Dodo Pilot
Group Icon
Group: Members
Joined: Dec 14, 2010

XXXXX



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

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

Very nice! Even though I finally got it working, I'll definitely go check it out icon14.gif

EDIT
That coach almost dropped right onto my head lol, but yes it does work smile.gif 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
PM
  Top
 

 
JACK JONES  
Posted: Thursday, Jul 5 2012, 17:00
Quote Post


Booom!!!
Group Icon
Group: Members
Joined: Dec 6, 2011

sr.gif

XXXXX



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

 
SomeGuy86  
Posted: Thursday, Jul 5 2012, 17:10
Quote Post


Dodo Pilot
Group Icon
Group: Members
Joined: Dec 14, 2010

XXXXX



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

 
fireguy109  
Posted: Thursday, Jul 5 2012, 19:02
Quote Post


Chronic post editor.
Group Icon
Group: Leone Family Mafia
Joined: Aug 30, 2010

us.gif

XXXXX



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

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
Users WebsitePMPlayStation Network
  Top
 

 
SomeGuy86  
Posted: Thursday, Jul 5 2012, 22:49
Quote Post


Dodo Pilot
Group Icon
Group: Members
Joined: Dec 14, 2010

XXXXX



Thanks! icon14.gif

I'll have to give it some time & check out the possible uses for this script, will let you know if I make any more progress smile.gif
PM
  Top
 

 
SomeGuy86  
Posted: Sunday, Jul 8 2012, 16:54
Quote Post


Dodo Pilot
Group Icon
Group: Members
Joined: Dec 14, 2010

XXXXX



I tried to make 2 separate loops for this script, just to see does it work or not. For some reason, 1st car (114) Always spawns, while the other one, (122) doesn't. I'm sure there's an explanation for this issue, as I'm probably doing something wrong, again whatsthat.gif
CODE
{$CLEO .cs}
03A4: name_thread 'ILL1'
0247: request_model 114

:ILL1_1
0001: wait 0 ms
00D6: if and
00E3:   player $PLAYER_CHAR 0 921.8088 -1463.761 radius 100.0 100.0
0248:   model 114 available
004D: jump_if_false @ILL1_1
00A5: 0@ = create_car 114 at 921.8088 -1463.761 13.0504
0175: set_car 0@ z_angle_to 82.0
0249: release_model 114

:ILL1_2
0001: wait 0 ms
00D6: if
80E3:   not player $PLAYER_CHAR 0 921.8088 -1463.761 radius 100.0 100.0
004D: jump_if_false @ILL1_2
01C3: remove_references_to_car 0@
0247: request_model 114
0002: jump @ILL1_1

03A4: name_thread 'ILL2'
0247: request_model 122

:ILL2_1
0001: wait 0 ms
00D6: if and
00E3:   player $PLAYER_CHAR 0 874.4673 -1388.943 radius 100.0 100.0
0248:   model 122 available
004D: jump_if_false @ILL2_1
00A5: 0@ = create_car 122 at 874.4673 -1388.943 13.9162
0175: set_car 0@ z_angle_to 0.0
0249: release_model 122

:ILL2_2
0001: wait 0 ms
00D6: if
80E3:   not player $PLAYER_CHAR 0 874.4673 -1388.943 radius 100.0 100.0
004D: jump_if_false @ILL2_2
01C3: remove_references_to_car 0@
0247: request_model 122
0002: jump @ILL2_1

I even tried using
CODE
05DC: end_custom_thread
between the 2 fragments, 2 vehicles and it didn't work either.
PM
  Top
 

 
SilentPL  
Posted: Sunday, Jul 8 2012, 17:22
Quote Post


Senior File Manager
Group Icon
Group: Members
Joined: Feb 1, 2010

pl.gif

Member Award




2nd loop is never launched. It's the best to have it like that (high-level code again, sorry, I'm too used to it):

CODE
{$CLEO}
0000: SPAWNER

while true
   0001: wait 125 ms   // No need to check these THAT often, I think
   if
       00E3:   player $PLAYER_CHAR 0 921.8088 -1463.761 radius 100.0 100.0
   then
       if
           0039:   2@ == 0
       then
           0247: request_model 114
           
           while 8248:   not model 114 available
               0001: wait 0 ms
           end
           
           00A5: 0@ = create_car 114 at 921.8088 -1463.761 13.0504
           0175: set_car 0@ z_angle_to 82.0
           01C3: remove_references_to_car 0@
           0249: release_model 114
           0006: 2@ = 1        // Car 1 created flag
       end
   else
       if
           0039:   2@ == 1
       then
//            00A6: destroy_car 0@        // YES, this IS valid
           0006: 2@ = 0
       end
   end

   if
       00E3:   player $PLAYER_CHAR 0 874.4673 -1388.943 radius 100.0 100.0
   then
       if
           0039:   3@ == 0
       then
           0247: request_model 122
           
           while 8248:   not model 122 available
               0001: wait 0 ms
           end
           
           00A5: 1@ = create_car 122 at 874.4673 -1388.943 13.9162
           0175: set_car 1@ z_angle_to 82.0
           01C3: remove_references_to_car 1@
           0249: release_model 122
           0006: 3@ = 1        // Car 1 created flag
       end
   else
       if
           0039:   3@ == 1
       then
//            00A6: destroy_car 1@
           0006: 3@ = 0
       end
   end
end


If multiple vehicles will appear when you'll get to the areas many times, uncomment 00A6 lines.
Users WebsitePMMSNXbox Live
  Top
 

 
SomeGuy86  
Posted: Sunday, Jul 8 2012, 17:36
Quote Post


Dodo Pilot
Group Icon
Group: Members
Joined: Dec 14, 2010

XXXXX



Wow! Too "high level" for my coding skills I'm afraid lol, but thank you either way icon14.gif
PM
  Top
 

 
SilentPL  
Posted: Sunday, Jul 8 2012, 17:37
Quote Post


Senior File Manager
Group Icon
Group: Members
Joined: Feb 1, 2010

pl.gif

Member Award




If you have problems with understanding this type of code, just compile it and then decompile again.
Users WebsitePMMSNXbox Live
  Top
 

 
SomeGuy86  
Posted: Sunday, Jul 8 2012, 17:40
Quote Post


Dodo Pilot
Group Icon
Group: Members
Joined: Dec 14, 2010

XXXXX



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

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
PM
  Top
 

 

1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)

0 Members:

Pages: (2) 1 [2] 

Topic Options Reply to this topicStart new topicStart Poll
Search topic for posted by (exact match)



 
IMG IMG