|
 |
|
|
|
|
|
GTA Modification Forums
CLEO | Creating a car park Crash at startup
 |
|
 |
| |
JACK JONES  |
Posted: Tuesday, Jul 24 2012, 10:55
|
firearms and adrenaline

Group: Members
Joined: Dec 6, 2011


|
First error: Avoid using global variables ($1266, $1267, $87 or some other such as $1, $2...) inside a CLEO scrypt, use local variables (there are 15 of them in Vice City and 2 more for time checking). Local variables are: 0@, 1@, 2@...15@ Second error: You're using the same variable ($1267) for diferent things Third error: You need to end the CLEO scrypt with this: | CODE | | 05DC: end_custom_thread |
Oh wait you saw that. And don't double post, use EDIT! EDIT: Put 101 in the opcode 014C because with 0 a car will not spawn: 0 - Car will never spawn. 1-100 - Car will spawn xx number of times. 101 - Car will always spawn. This post has been edited by JACK JONES on Tuesday, Jul 24 2012, 11:00
|
|
|
|
|
 |
|
 |
 |
|
 |
| |
Mister X  |
Posted: Tuesday, Jul 24 2012, 11:01
|
Square Civilian

Group: Members
Joined: Dec 25, 2007

|
| QUOTE (JACK JONES @ Tuesday, Jul 24 2012, 10:55) | First error: Avoid using global variables ($1266, $1267, $87 or some other such as $1, $2...) inside a CLEO scrypt, use local variables (there are 15 of them in Vice City and 2 more for time checking). Local variables are: 0@, 1@, 2@...15@ Second error: You're using the same variable ($1267) for diferent things Third error: You need to end the CLEO scrypt with this:
| CODE | | 05DC: end_custom_thread |
Oh wait you saw that. And don't double post, use EDIT! | Thanks a lot. I've been good with scripting...but after years I forgot almost everything... Thanks for the advice... Another thing: can I modify an existing car spawn? For example: | CODE | 014B: $1839 = init_parked_car_generator #SECURICA -1 -1 0 alarm 0 door_lock 70 0 10000 at -870.2545 -353.9059 10.0475 angle 357.8359 014C: set_parked_car_generator $1839 cars_to_generate_to 101 |
This is into original main.scm. Can I do something inside script that modify the car and,obliviously,the coordinates?
|
|
|
|
|
 |
|
 |
 |
|
 |
| |
Mister X  |
Posted: Tuesday, Jul 24 2012, 11:51
|
Square Civilian

Group: Members
Joined: Dec 25, 2007

|
| QUOTE (Deji @ Tuesday, Jul 24 2012, 11:45) | | You'd be better off just creating your own generator, by testing how close the player is and spawning the vehicles manually. |
This require a extra coding. And now I don't remember the exactly opcode to use... If I go near the spawn,the car will spawn...But if the car spawn and I ignore that,and after I go,again,near the car.....the car spawner will do a double-spawn? I'm no good like old times... I know that it's simple,so please can you post a sample script? Also,I've to spawn ever some weapon pickup,some bribe with aspirine and life...so: even this kind of spawn makes problem? EDIT: Other problem: how I get Angle rotation of a vehicle? (To spawn it into right direction,now facing the damned streetlight). I remember that,previously,I used a good tool,but I can't remember it's name... EDIT2:: now I've understand the problem....I can't want to spawn bribe or weapon pickup,neither usual car spawn ; because if I insert it into a .cs files | CODE | | 0213: 6@ = create_pickup 375 type 15 at -326.918 -522.806 12.781 |
Then EVERY time I load game the script run,so after 3 time I load the game in the same place I can find 3 bribes....and this is shìt...I can use enable_thread_saving....but for Vice and GTA III this opcode doesn't exist....so HOW I can do that? Damw,this is very annoying.... This post has been edited by Mister X on Wednesday, Jul 25 2012, 08:12
|
|
|
|
|
 |
|
 |
 |
|
 |
| |
Link2012  |
|
Wut?

Group: Members
Joined: Jan 30, 2011


|
| QUOTE (MW_29 @ Sunday, Jul 29 2012, 12:22) | | QUOTE (SilentPL @ Tuesday, Jul 24 2012, 11:39) | | Car generators inside a CLEO script are evil though. One of the best ways to f*ck up your save. |
Confirmed. Everytime you save with such CLEO script which has cargens inside, to your savefile there are added the same cargens entries as a result of using CLEO file with them inside, you save 5x times, you got 5x THE SAME cargen entries added , so .sf file is really f*cked up then I use emulated cargens instead, and yes as Deji said this can be done via some extra lines with checks if player around some coords It's not difficult to do |
This can be solved with a enable_thread_saving. But if you remove the script the generator will still there, will need some save hacking to remove them, a manual generator still better.
|
|
|
|
|
 |
|
 |
 |
|
 |
| |
Mister X  |
|
Square Civilian

Group: Members
Joined: Dec 25, 2007

|
| QUOTE (Link2012 @ Sunday, Jul 29 2012, 15:36) | | QUOTE (MW_29 @ Sunday, Jul 29 2012, 12:22) | | QUOTE (SilentPL @ Tuesday, Jul 24 2012, 11:39) | | Car generators inside a CLEO script are evil though. One of the best ways to f*ck up your save. |
Confirmed. Everytime you save with such CLEO script which has cargens inside, to your savefile there are added the same cargens entries as a result of using CLEO file with them inside, you save 5x times, you got 5x THE SAME cargen entries added , so .sf file is really f*cked up then I use emulated cargens instead, and yes as Deji said this can be done via some extra lines with checks if player around some coords It's not difficult to do |
This can be solved with a enable_thread_saving. But if you remove the script the generator will still there, will need some save hacking to remove them, a manual generator still better. | Yup. But enable_thread_saving isn't included in the Vice's/III opcode list...exist only on SA,strange...ok then,I've also understand that generator is SH*T But I'm a little "rusty" with coding. Can someone write the code for me? I know is easy (sort of kind: if player is in radius load model and spawn it). Someone can do this BIG pleasure to me? At least the part of code that check "if player is near that coordinates then...". You would do a VERY BIG favor to me,because now I'm working on mapping and I want to release SOON my mods. If someone help me,I will be happy to quote it onto credits
|
|
|
|
|
 |
|
 |
 |
|
 |
| |
Mister X  |
|
Square Civilian

Group: Members
Joined: Dec 25, 2007

|
Thanks for the answer Very useful,but I've a silly problem,now: Double spawn : obliviously,if I spawn the car,I go far and I return to spawn I found 2 car. OK,there's 01C3: remove_references_to_car @0 (I know how to use it) but there's a problem: if I use it while I'm in the car (like should be use: if I goes far from spawn point,remove references to the car,ready to be spawned again) the spawned car that I'm using is deleted from "interesting vehicles list". I mean: THEN,If i exit the car and I go (on foot) little far from my car it disappear,like stupid traffic vehicle. That doesn't happen when I do the same story on stolen vehicle and garage vehicle,because they are...."important" for the game engine ; It's a REALLLLLLLLY stupid thing,and ever if I can't resolve it well: who cares. But exist a way to prevent double spawn and doesn't use 01C3 opcode? I tried to use clear_vehicle_from_cube (It should work,because if I goes far,when I return the engine would clean the spawn point and then spawn vehicle) but it doesn't work,ever if i code a big area. @Bad.boy!: Useful,but I can't use your code. I'm using Vice City,and most opcode you used doesn't work on CLEO 4 VC. EDIT: Really satisfied Little big genious moment: | CODE | :LABELBLOOD1 0001: wait 100 ms 00D6: if 00E3: player $PLAYER_CHAR 0 -958.488 -855.367 radius 100.0 100.0 004D: jump_if_false @LABELBLOODFIN 00D6: if 0039: 2@ == 0 // Se NON spawnato 004D: jump_if_false @LABELBLOOD1 0247: request_model #BLOODRA
:LABELBLOOD2 8248: not model #BLOODRA available 004D: jump_if_false @LABELBLOOD3 0001: wait 0 ms 0002: jump @LABELBLOOD2
:LABELBLOOD3 00A5: 0@ = create_car #BLOODRA at -958.488 -855.367 12.183 0175: set_car 0@ z_angle_to 180.0 0249: release_model #BLOODRA 0006: 2@ = 1 // SPAWNATO! 0002: jump @LABELBLOOD1
:LABELBLOODFIN 00D6: if 0039: 2@ == 1 // Se Spawnato 004D: jump_if_false @LABELBLOOD1
00D6: if 01FC: player $PLAYER_CHAR near_car 0@ radius 70.0 70.0 0 then 0002: jump @LABELBLOOD1
else 01C3: remove_references_to_car 0@ 0006: 2@ = 0 // integer values end 0002: jump @LABELBLOOD1 |
NOW work like a charm: if the car spawn and I go far from and return near it,the car is deleted and replaced by a new car. If I TAKE the car,I goes far and then I return to spawn point,no new car spawn happen. Also the car remain "in memory" if I go on foot (Obliviously within certain limit ; 70,to be precise  ). Visually old style coding and high level coding together look very poor,but hey: it work  . NOW,THE PROBLEM: how I can do the same with weapon pickup? thanks god for vehicle exist the 01FC opcode,but for other kind of things? Because I looked that IF i SAVE with a creating_pickup item (bribe or weapon) then I screwed: every time I load the game another one born...so I must find a way to spawn a weapon pickup "only-for-once". Anyone has an idea? EDIT2: THIS suffer a big problem: if I save near a destroyed (spawned) vehicle it CORRUPT the savegame. Yep: the fuc*ing wreck REMAIN onto the map even on game exit and reloading and doesn't wanna leave. I've already tried every "clean" opcode,but the wreck remain here. What can also I try? This post has been edited by Mister X on Monday, Jul 30 2012, 18:32
|
|
|
|
|
 |
|
 |
 |
|
 |
| |
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.
| |
 |
|
 |
|
|
|
|