eaztbay Posted September 22, 2015 Share Posted September 22, 2015 hopefully this is in the right forum section.... i downloaded Car Parked Script Creator V2 from EdUaRdO>>Brasil, an he didnt include a tut on how to use it or where to copy and paste the line of code the tool generates. any help would be appreciated. the mod was from http://www.gtainside.com/en/sanandreas/tools/74473-car-parked-script-creator-v2 please dont lock this post i seriously hope this is in the right section of the forums..... Link to comment Share on other sites More sharing options...
TiTAN_AI Posted September 22, 2015 Share Posted September 22, 2015 did you read the comments on that site ? do you have the programm sanny builder ? Link to comment Share on other sites More sharing options...
SilverRST Posted October 1, 2015 Share Posted October 1, 2015 (edited) I tried it and it's working. But the angle somehow doesn't. It aims right to the north when its spawned. Edited October 1, 2015 by SilverRST Link to comment Share on other sites More sharing options...
OrionSR Posted October 1, 2015 Share Posted October 1, 2015 Post the line of code generated by the tool. Beware of car generators. They will be saved with your game. It's really easy to create multiple cars in the same location if your include them in a script that always runs when loading a save. Extra car generators are really difficult to remove. Link to comment Share on other sites More sharing options...
SilverRST Posted October 1, 2015 Share Posted October 1, 2015 (edited) Post the line of code generated by the tool. Beware of car generators. They will be saved with your game. It's really easy to create multiple cars in the same location if your include them in a script that always runs when loading a save. Extra car generators are really difficult to remove. The tool generates the cleo scripts, which is damn easy and no savegame will be harmed unlike the other park you car scripts. If you want to remove the parked cars, easily remove the .cs script. I found out why the car is aimed to different angles. It seems the player and car have different ZXY axis or how you call it. I want to park a car and with help of teleports like from trainer easily gets you the coordinates and copy them in notepad and then in the tool. But as for the angles, you have to put an - to the coordinates for the angle. Here are the coordinates: 2493,3046875 -1685,24853515625 12,6761646270752 268,768 (this is the angle and you have to add a - at the beginning) Edited October 1, 2015 by SilverRST Link to comment Share on other sites More sharing options...
gtafan2u Posted October 2, 2015 Share Posted October 2, 2015 I thinks you have the code only problem are angles right! Get inside a car, position it like you want your car to park. Copy the car park code and put in sanny. Delete the coordinates right click there then click insert then insert coordinate. For angle also do like that but after insert click insert angle. Link to comment Share on other sites More sharing options...
SilverRST Posted October 2, 2015 Share Posted October 2, 2015 (edited) I thinks you have the code only problem are angles right! Get inside a car, position it like you want your car to park. Copy the car park code and put in sanny. Delete the coordinates right click there then click insert then insert coordinate. For angle also do like that but after insert click insert angle. I did that way but the car do not spawn. Odd. The script is exactly the same and I did exactly what you said and still not working. Only the first method of getting the coordinates from Crazy Trainer and putting a - works. EDIT Crap, scratch that what I said above. It seems the game accepts only one carspawn script. I removed the first and the newest works. How can I save more spawns? I assume copying the scripts but other coordinates but it won't work like that, I think. This is the script for an example: {$CLEO .cs}thread 'Car_Generator':Car_Toolwait 1000if0256: $PLAYER_CHAR jf @Car_Toolif0256: $PLAYER_ACTOR jf @Car_Toolwait 250014B: [email protected] 586 {Wayfarer} 3 0 -1 0 {Desativado} 0 {Desativado} 0 10000 2442.54223632813 -1683.91772460938 12.8575067520142 -352.269014C: $EdUaRdO_Car_Placer 101jump @Car_Tool//Script Criado com Car Parked Script Generator by EdUaRdO EDIT 2 Never mind, after searching through google I found another car spawn script and this one makes it possible to have more spawn cleo scripts. Man, scripting is awesome! The tool doesn't work properly and allows only one cleo spawn script. In anyone anyone is interested to have more spawns: // This file was decompiled using SASCM.ini published by GTAG (http://gtag.gtagaming.com/opcode-database) on 14.6.2013{$CLEO .CS}//-------------MAIN---------------0000: NOP014B: $PARKED_1 = init_car_generator #CARNAME color 3 3 force_spawn 1 alarm 0 door_lock 0 min_delay 0 max_delay 10000 at 2498.26220703125 -1684.39428710938 13.1125564575195 angle -257.357014C: set_parked_car_generator $PARKED_1 cars_to_generate_to 101:NONAME_52wait 0jump @NONAME_52 Edited October 2, 2015 by SilverRST Link to comment Share on other sites More sharing options...
gtafan2u Posted October 2, 2015 Share Posted October 2, 2015 Are you changing those global variables. Seems your are not so only one spawn is working. From the global variable I meant the $PARKED_1 in your code. Link to comment Share on other sites More sharing options...
SilverRST Posted October 2, 2015 Share Posted October 2, 2015 (edited) Are you changing those global variables. Seems your are not so only one spawn is working. From the global variable I meant the $PARKED_1 in your code. What do you mean? You mean the first code or the second? Can I have more spawns in one cleo script? EDIT I think it is fine to have for each spawn their own script. If I want to remove a spawn, simply remove the .cs file and that's it. Edited October 2, 2015 by SilverRST Link to comment Share on other sites More sharing options...
gtafan2u Posted October 2, 2015 Share Posted October 2, 2015 You mean you had not changed those. That's what your problem is. You can add multiple cars using one script. I am telling about the second one. The text I told should be different for each car. In this format $something. I think your problem would now be solved. Link to comment Share on other sites More sharing options...
SilverRST Posted October 2, 2015 Share Posted October 2, 2015 You mean you had not changed those. That's what your problem is. You can add multiple cars using one script. I am telling about the second one. The text I told should be different for each car. In this format $something. I think your problem would now be solved. Well, having each spawns their own one script is easier in case I want to remove a spawn. My problem is indeed solved but, I do like to know more about. Can you please explain in it detail and which/what would I change? Link to comment Share on other sites More sharing options...
gtafan2u Posted October 2, 2015 Share Posted October 2, 2015 (edited) The $ stands for global variable and @ for local variable. Here we use the global variable. All the global variables used for different functions should be unique. And using the same global variable and multiple scripts you said will not work either. You needs to either replace $ with @ or use a unique variable. You can use like this $x here x is a unique and random word or number or mix. Edited October 2, 2015 by gtafan2u Link to comment Share on other sites More sharing options...
SilverRST Posted October 2, 2015 Share Posted October 2, 2015 (edited) And there is a NONAME52. I can't use multiple spawns in one script with multiple NONAME52 because of 'label redeclared' EDIT Well f*ck me, why the f*ck am I asking I tried this and it works, now all three spawns works in a single .cs script. This is the working code: // This file was decompiled using SASCM.ini published by GTAG (http://gtag.gtagaming.com/opcode-database) on 14.6.2013{$CLEO .CS}//-------------MAIN---------------0000: NOP014B: $PARKED_1 = init_car_generator #WAYFARER color 3 0 force_spawn 1 alarm 0 door_lock 0 min_delay 0 max_delay 10000 at 2462.0596 -1665.0013 13.3452 angle 89.6171014C: set_parked_car_generator $PARKED_1 cars_to_generate_to 101014B: $PARKED_2 = init_car_generator #EUROS color 3 3 force_spawn 1 alarm 0 door_lock 0 min_delay 0 max_delay 10000 at 2498.26220703125 -1684.39428710938 13.1125564575195 angle -257.357014C: set_parked_car_generator $PARKED_2 cars_to_generate_to 101014B: $PARKED_3 = init_car_generator #WAYFARER color 3 0 force_spawn 1 alarm 0 door_lock 0 min_delay 0 max_delay 10000 at 2442.54223632813 -1683.91772460938 12.8575067520142 angle -352.269014C: set_parked_car_generator $PARKED_3 cars_to_generate_to 101:NONAME_52wait 0jump @NONAME_52 Edited October 2, 2015 by SilverRST Link to comment Share on other sites More sharing options...
gtafan2u Posted October 2, 2015 Share Posted October 2, 2015 Well this script is OK. But it will be better if you will end the script instead looping. Don't remember up codes but search sanny for these. first line- custom_thread 'x' Code last line- end_custom_thread Link to comment Share on other sites More sharing options...
SilverRST Posted October 2, 2015 Share Posted October 2, 2015 Alright, another try and it also works: {$CLEO .cs}:Carspawns03A4: name_thread "Parked Cars"0001: wait 1000 ms0A95: enable_thread_saving014B: $PARKED_1 = init_car_generator #WAYFARER color 3 0 force_spawn 1 alarm 0 door_lock 0 min_delay 0 max_delay 10000 at 2462.0596 -1665.0013 13.3452 angle 89.6171014C: set_parked_car_generator $PARKED_1 cars_to_generate_to 101014B: $PARKED_2 = init_car_generator #EUROS color 3 3 force_spawn 1 alarm 0 door_lock 0 min_delay 0 max_delay 10000 at 2498.26220703125 -1684.39428710938 13.1125564575195 angle -257.357014C: set_parked_car_generator $PARKED_2 cars_to_generate_to 101014B: $PARKED_3 = init_car_generator #WAYFARER color 3 0 force_spawn 1 alarm 0 door_lock 0 min_delay 0 max_delay 10000 at 2442.54223632813 -1683.91772460938 12.8575067520142 angle -352.269014C: set_parked_car_generator $PARKED_3 cars_to_generate_to 1010A93: end_custom_thread Link to comment Share on other sites More sharing options...
OrionSR Posted October 2, 2015 Share Posted October 2, 2015 (edited) Yeah, scripting is awesome and really easy with cleo, but it's also really easy to screw up your saves if you don't understand how things work. Please review some of the Cleo Scripting tutorials to learn the dangers of 1) using global variables in a cleo script, 2) using custom variable names in a cleo script, and 3) adding car generators, objects, pickup and radar icons using cleo. Thread saving will prevent multiple copies of the car generator but each script you test might add more cargens. If you save the game those cargens become part of the save and are very hard to remove. Removing the script will not remove the cargen using the coding strategy you are using. There's a fancy trick for adding cargens that aren't saved but I don't see the point to doing that over simply scripting a vehicle to appear when CJ is near. Custom variable names will take over the next unnamed global not defined in customvariable.ini. Your custom names are overwriting data used by the standard scripts. Most global variables are used by the game, those that are not have been used again and again by coders over the years. When people port those codes to other games the variables used tend to overwrite critical information in the save and break the mission flow, among other problems. An easy solution: Use [email protected] for each vehicle and forget about the remembering handle or thread saving since there's nothing much you can do after the cargen is created and displayed. Maybe add the player owned property after displaying the car. If you like the car where it is then save the game and remove the script. If you really get into this and completely ruin your cargen pool I've got strategies in development for completely dumping the entire cargen pool and rebuilding it from scratch and displaying them again according to mission progress. It's not an easy fix at this point but the technical parts have been worked out, and it could be an easy fix for others in the future. Edited October 2, 2015 by OrionSR Link to comment Share on other sites More sharing options...
SilverRST Posted October 2, 2015 Share Posted October 2, 2015 (edited) F*ck. All I want are parked cars that do not have anything to do with the savegames. Which script would be the best? Can you write a simple example? That doesn't interfere with the savegames? And I don't understand where to place the [email protected] exactly. Edited October 2, 2015 by SilverRST Link to comment Share on other sites More sharing options...
OrionSR Posted October 2, 2015 Share Posted October 2, 2015 (edited) In this example I simply copied your codes from above and changed the global variables to local variables. The values in the local variables are lost anyway so I just recycle the same one. I added a line for player owned, the only other setting you might want to apply. CJ won't get a wanted level if a cop sees him entering the Euros for the first time. {$CLEO .cs}:Carspawns03A4: name_thread "Parked Cars"0001: wait 1000 ms0A95: enable_thread_saving014B: [email protected] = init_car_generator #WAYFARER color 3 0 force_spawn 1 alarm 0 door_lock 0 min_delay 0 max_delay 10000 at 2462.0596 -1665.0013 13.3452 angle 89.6171014C: set_parked_car_generator [email protected] cars_to_generate_to 101014B: [email protected] = init_car_generator #EUROS color 3 3 force_spawn 1 alarm 0 door_lock 0 min_delay 0 max_delay 10000 at 2498.26220703125 -1684.39428710938 13.1125564575195 angle -257.357014C: set_parked_car_generator [email protected] cars_to_generate_to 1010A17: set_parked_car_generator [email protected] to_player_owned 1014B: [email protected] = init_car_generator #WAYFARER color 3 0 force_spawn 1 alarm 0 door_lock 0 min_delay 0 max_delay 10000 at 2442.54223632813 -1683.91772460938 12.8575067520142 angle -352.269014C: set_parked_car_generator [email protected] cars_to_generate_to 1010A93: end_custom_thread There's nothing wrong with adding lots of car generators to your save as long as you limit it to... 100 or so. It is possible to remove them, but it's tricky. You can view your cargen pool with SASE 1.00. It's a handy way to check on what your scripts are doing to your save. The index it provides can be used with a cleo procedure to remove a car with that index. It's not an automated process but it can be done. I still think working out a script to rebuild the cargen pool would be a handy fail safe. Edited October 2, 2015 by OrionSR Link to comment Share on other sites More sharing options...
SilverRST Posted October 2, 2015 Share Posted October 2, 2015 (edited) Thanks a lot for the explanations This will help me further. The new script won't break the savegames? Of course I won't be placing 100 cars. And what if I want to be wanted after getting in the car? Which symbol or opcode should I use and where? I am planning to park somewhere around the map and do like to some not owned by CJ. Damn, this is fun to do Back in the days of 2006 I wanted to some scripting but cleo was not around. So I did 3D and never looking back at scripting. Main.scm requires new game. Forgot to ask. I see you have enable thread saving. Will that break the saves? So the [email protected] is better than $PARKED_number? EDIT 2 I see the new opcodes for owned by the player. I assume removing that makes CJ no longer the owner? Edited October 2, 2015 by SilverRST Link to comment Share on other sites More sharing options...
OrionSR Posted October 2, 2015 Share Posted October 2, 2015 Now that you've got your feet wet please, PLEASE, go read an intro topic to scripting and cleo. There are a lot of basics, like how local and global variables are handled, that are covered in the beginning tutorials. I don't mind answering questions but many answers have already been posted. My example will add cargens if saved, but the global variables the game depends on won't be harmed. I have placed over 100 cars in custom saves without issue, but I had to study the scripts like crazy to make sure I didn't break anything. Player owned only effects when CJ is entering a car for the first time - he's not jacking it, this one is his. It acts just like a car he's already driven. Wanted levels still apply. Modifying main.scm doesn't always require a new save. It depends on what you change. However, you've got cleo so there isn't much point in messing with main.scm. Leave that to full map mods and iOS users. Link to comment Share on other sites More sharing options...
SilverRST Posted October 2, 2015 Share Posted October 2, 2015 (edited) Yeah, in the meanwhile I've been searching and reading the basics like crazy Back in the days this all has been really different and it has gotten better over the years it seems. Thanks a lot for your help and explaination I'll be learning more about this. Edited October 2, 2015 by SilverRST Link to comment Share on other sites More sharing options...
OrionSR Posted October 2, 2015 Share Posted October 2, 2015 GTA SA: How to properly add car generators with CLEO script? - by fastman92 Unallocate a car generator using cleo - requires SASE to retrieve the index. These strategies do basically the same thing. fastman's method sets the streaming flag so the car won't be saved. My unallocate strategy just removes the allocation byte and lets the cargen disappear and frees up the slot for reuse right away. The rebulding strategy unallocates all cars in the pool, then the cars are replaced using the original lines from the script (or slightly nudged so they spawn properly). Cars can be displayed and hidden based on mission checklist variables. Both strategies employ memory management strategies; not really a good place to start learning to code. Link to comment Share on other sites More sharing options...
SilverRST Posted October 2, 2015 Share Posted October 2, 2015 (edited) Alright, so there are more different ways to generate parked cars. Never knew that. Your example seems to be the best and simple without harming the saves? I am reading the fastman's tut and it became clear. Edit I am getting 'Label 0AB1: call_scm_func @DisableCarGeneratorFromBeingSaved 1 car_generator 0@ not found' Edited October 2, 2015 by SilverRST Link to comment Share on other sites More sharing options...
OrionSR Posted October 2, 2015 Share Posted October 2, 2015 (edited) The example I posted about should be "safe" enough if you are careful with how you add the cargens. I think you have a basic understanding on how they work and can make the appropriate choices. I don't see any point in including the thread saving command. I never used thread saving. I plan my changes and if the tests look good then I reload my save, apply the changes again, save the game and disable the script. I usually enclose my codes in a trigger script that activates only when a key is pressed and then released. An example is provide below using your test cargen codes. {$CLEO .cs}//F5Test.txt0000:wait 10while true wait 0 if 0AB0: key_pressed 0x74 // F5 then :Wait wait 0 if 0AB0: key_pressed 0x74 // F5 then jump @Wait end//-------------- Test Codes Start Here -------------------------- 014B: [email protected] = init_car_generator #WAYFARER color 3 0 force_spawn 1 alarm 0 door_lock 0 min_delay 0 max_delay 10000 at 2462.0596 -1665.0013 13.3452 angle 89.6171014C: set_parked_car_generator [email protected] cars_to_generate_to 101014B: [email protected] = init_car_generator #EUROS color 3 3 force_spawn 1 alarm 0 door_lock 0 min_delay 0 max_delay 10000 at 2498.26220703125 -1684.39428710938 13.1125564575195 angle -257.357014C: set_parked_car_generator [email protected] cars_to_generate_to 101//0A17: set_parked_car_generator [email protected] to_player_owned 1014B: [email protected] = init_car_generator #WAYFARER color 3 0 force_spawn 1 alarm 0 door_lock 0 min_delay 0 max_delay 10000 at 2442.54223632813 -1683.91772460938 12.8575067520142 angle -352.269014C: set_parked_car_generator [email protected] cars_to_generate_to 101 //---------------- Test Codes End Here -------------------------- endend In this example the player owned command was "commented out" with the double-slash tag. Edited October 2, 2015 by OrionSR SilverRST 1 Link to comment Share on other sites More sharing options...
SilverRST Posted October 2, 2015 Share Posted October 2, 2015 (edited) Yeah, that's what I was thinking. Although it's nice to learn more about it I know the basics know. Next is to know to generate wrecked carparks with minimal health. I am working on a carmod and plan to make a rusty trashed version of it. Edited October 2, 2015 by SilverRST Link to comment Share on other sites More sharing options...
OrionSR Posted October 2, 2015 Share Posted October 2, 2015 Ooh, if you are going that route then you probably want to bail on car generators. The cargens will spawn with standard properties and there isn't much you can do about it. But if you spawn cars when CJ is near you can have a great deal of control over the properties of the vehicles. Take a look at the car park scripts that spawn the vehicles at the Emerald Isle car park in north LV. The cars spawn as he enters each level, and are cleared when he leaves the level. You'll have the handles of the cars and can change their health, pop parts open, off, or damaged, set immunities and other special properties. It's more work to get started but offers a lot more flexibility. The car generators are not cars. The cars they spawn are random traffic and it's difficult to grab their handles to make changes. SilverRST 1 Link to comment Share on other sites More sharing options...
SilverRST Posted October 2, 2015 Share Posted October 2, 2015 (edited) Alright, no problem with that. Thanks for the explanation I just see your new script with a hotkey. That's even more handy. Edited October 2, 2015 by SilverRST Link to comment Share on other sites More sharing options...
gtafan2u Posted October 3, 2015 Share Posted October 3, 2015 If you thinks hotkeys are handy then you should use car spawning code not parking. You can do a lot of things if you use spawning. If you use parked car code then the things you could do are limited. Link to comment Share on other sites More sharing options...
SilverRST Posted October 4, 2015 Share Posted October 4, 2015 I'm not a noob and definitely not new to these things. I know exactly what I want and that is placing some cars and bikes over the map, as hidden vehicles or placing vehicles at favorite places. For car spawning I simply use Crazy Trainer 2011 but that's getting very boring and not fun. They hotkey may be not handy but it's no use for me. i just want to extend the gameplay without using simple and fast solutions. Link to comment Share on other sites More sharing options...
OrionSR Posted October 4, 2015 Share Posted October 4, 2015 (edited) Sorry, I didn't see this before. I am getting 'Label 0AB1: call_scm_func @DisableCarGeneratorFromBeingSaved 1 car_generator 0@ not found' I'm just now starting to work with scm functions. Let me try making an example using your test Euros from the codes above. Another trigger script example: This one executes another script that doesn't auto-load, so you can recompile and run the test script again without reloading a save to refresh the trigger. The trigger scripts are intended for testing purposes. I prefer to keep save altering scripts on a tight leash. So compile this then leave it alone, recompile the next script to make changes. {$CLEO .cs}//F12Test.txt0000:wait 10while true wait 0 if 0AB0: key_pressed 0x7B // F12 then :Wait wait 0 if 0AB0: key_pressed 0x7B // F12 then jump @Wait end//-------------- Test Codes Start Here --------------------------0A92: create_custom_thread "Testing12.s"//00BB: show_text_lowpriority GXT 'FELD_WR' time 1000 flag 1 // Loading data, please wait...//---------------- Test Codes End Here -------------------------- endend The cleo directive in the script below was changed to apply an .s extension to the compiled script. Otherwise it's a pretty normal cleo script, it just doesn't load and execute when a save is loaded. This script includes an example of a call function, fastman's fancy safe cargen strategy. This is pretty tricky stuff for a beginner but you seem to be catching on fast, enjoy the challenge, and don't have much trouble finding more examples on your own. And... this script is getting pretty long now with the added function and all, so I'll hide it within spoiler tags. The spoilers tend to hide information from searches, but makes the post more manageable for long code segments. Quote the message to see how the spoiler tags look. {$CLEO .s} // .s extention will be applied when compiled. //Testing12.txt//Call example: //0A92: create_custom_thread "Testing12.s"//Functions used:// :DisableCarGeneratorFromBeingSaved0000: NOP // No OPeration, something about not starting a script with a label.:Testing // a label address for optional jump loop//03A4: name_thread "Testing12" // Don't need a name if the script terminates immediately.0001: wait 0 ms // In case this script gets looped in a later iteration //-------------- Test Codes Start Here -------------------------- 014B: [email protected] = init_car_generator #EUROS color 3 3 force_spawn 1 alarm 0 door_lock 0 min_delay 0 max_delay 10000 at 2498.25 -1684.5 13.125 angle -257.357014C: set_parked_car_generator [email protected] cars_to_generate_to 1010A17: set_parked_car_generator [email protected] to_player_owned 10AB1: call_scm_func @DisableCarGeneratorFromBeingSaved 1 car_generator [email protected]// the "1" in this opcode is specifying how many parameters to pass, just [email protected] // don't change the 1 unless you can rework the function//0002: jump @Testing // uncomment for a looping script //---------------- Old Test Codes Here --------------------------{}//---------------- Test Codes End Here --------------------------00BB: show_text_lowpriority GXT 'FESZ_LS' time 2000 flag 1 // Load Successful.0001: wait 0 ms //004E: end_thread // use for custom missions0A93: end_custom_thread // use for custom scripts//Script has ended. These codes can't execute unless called.//-------------- SCM Functions Start Here -----------------------//////////////////////////////////////////////////////////////:DisableCarGeneratorFromBeingSaved{Description:Disables car generator from being written into savefile.Fixes a corruption of savefile because of car generators used in CLEO.Parameters:Passed:[email protected] - car generator indexExample:0AB1: call_scm_func @DisableCarGeneratorFromBeingSaved 1 car_generator [email protected]}// Is invalid generator ID?if [email protected] == -1then 0AB2: ret 0end0A8D: [email protected] = read_memory 0x6F32AA size 1 virtual_protect false // CCarGenerator_size0AA7: call_function 0x479D60 num_params 1 pop 1 [email protected] store_result_to [email protected] // CCarGenerator* ptrif [email protected] >= 0x30 // is CCarGenerator_extended ?then [email protected] += 0x22 0A8C: write_memory [email protected] size 2 value 0xFFFF virtual_protect false // exIplFileelse [email protected] += 0x1C 0A8C: write_memory [email protected] size 1 value 0xFF virtual_protect false // iplFileend0AB2: ret 0//--------------- SCM Functions End Here ------------------------ Edited October 4, 2015 by OrionSR Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now