Mister X Posted January 6, 2008 Share Posted January 6, 2008 I was asking this question concerning Sanny Builder: Through file. Cs, you can write spawn weapons and cars and Unique Jumps? Teleport (colored red or green)? Spawn people ? But above all, it is possible to insert "mini-missions" scripted (check-point race ecc)? Or these things in the files. Cs can not be put in force to be placed on Main? Thanks for the possible help !!!! Link to comment Share on other sites More sharing options...
Seemann Posted January 6, 2008 Share Posted January 6, 2008 You can do *almost* any things via CLEO-scripts (.cs), except: 1. using *new* global variables 2. using status_text opcodes (03C4, 04F7, etc), as they require global variables (see #1). Sanny Builder 3 • SA Memory Handling • OpenIV • gtamodding.com CLEO.li - The CLEO Library - Official site Link to comment Share on other sites More sharing options...
ZAZ Posted January 6, 2008 Share Posted January 6, 2008 At the opportunity, Seeman Would you explain how to start and stop Cleo scripts commanded in other Cleo scripts in the case of running thread to creat_threat @2ndMod end_named_thread "MD" start mission ?? end_thread 0926: $SCRIPT_STATUS = external_script_status 0 (PLAYER_PARACHUTE) 00D6: if 0 0038: $SCRIPT_STATUS == 0 // integer values 08A9: load_external_script 0 (PLAYER_PARACHUTE) 08AB: external_script 0 (PLAYER_PARACHUTE) loaded 0913: run_external_script 0 (PLAYER_PARACHUTE) in the case of running misson to creat_threat @2ndMod end_named_thread "MD" end_thread Can I send a gosub from main to cs and reverse? May we add your Cleo pack into our mods for release of course with a link to your website in the readme? Is it possible that you add as option the asi files from Alexanders ASILoader? CLEO MODS CLEO Script Tutorial Link to comment Share on other sites More sharing options...
Seemann Posted January 6, 2008 Share Posted January 6, 2008 (edited) Would you explain how to start and stop Cleo scripts commanded in other Cleo scripts To start custom script use opcode 0A92 (in CLEO, in externals, in main.scm). You only can stop it internally, using 0A93. Or by adding some "event processor" (the code that checks some CLEO-variable and stop the thread if this variable's value mathes needing value: //in script (main, CLEO)0AB3: var 55 = 1//in CLEO-script0AB4: [email protected] = var [email protected] == 1then0A93: end_custom_threadend Looks like I should make smth like "end_custom_thread_named". Can I send a gosub from main to cs and reverse? By 'main' you mean the main.scm? If so, then look what the help says: An important thing concerns with data communication between a CLEO script and the main.scm. To use the SCM code, its variables, threads you have to compile the CLEO script as an external one (first way). But this method is not recommended, as such a script becomes very sensible to the any main.scm change. Implicitly, a CLEO script should be sufficient for itself and use minimum of the SCM data. However, you can freely use global variables names from the CustomVaribles.ini (for example, $PLAYER_CHAR, $PLAYER_ACTOR, $ONMISSION, etc). Also, for the data communicate between the main.scm and CLEO, or between the CLEO scripts you may use the CLEO variables (see opcodes 0AB3, 0AB4). So, basically, the answer is no. You can use the scm code (gosubs) if you're compiling the CLEO-script as external script along with main.scm, and you should distribute this scm with this script as well. May we add your Cleo pack into our mods for release of course with a link to your website in the readme? What pack? If you mean the CLEO files (cleo.asi and vorbis), the site gives you an answer: CLEO 3 redistribution If you wrote a script using the CLEO library and (or) its plugins, you may distribute needed files along with that script. You also may direct the script users on cleo.sannybuilder.com to inform them how to use CLEO. If you mean a CLEO scripts pack, like Alexander's one, you should ask the proper authors. Is it possible that you add as option the asi files from Alexanders ASILoader? It's not *his* loader. It's made by JernejL (Delfi) and only hosted by Alex because of some problems with Delfi's website. The version of the loader included in the CLEO package works perfectly for almost all users (from my memory you're the only one having troubles with it ). I will consider your suggestion. Edited January 6, 2008 by Seemann Sanny Builder 3 • SA Memory Handling • OpenIV • gtamodding.com CLEO.li - The CLEO Library - Official site Link to comment Share on other sites More sharing options...
ZAZ Posted January 7, 2008 Share Posted January 7, 2008 (edited) Did I understand right ? To start custom script use opcode 0A92 (in CLEO, in externals, in main.scm). I can use 0A92 in main.scm to start a cs ? I thought it would contradicts the CLEO3 opcode description: The using of the following opcodes is only possible at the CLEO 3 library installed. Or does this only means: They require a installed CLEO 3 library. CLEO 3 Opcodes description: 0A92: create_custom_thread "ShowTextBox.s"0A92 creates a new thread from the file. If the file has an extension .cs the thread from it is created automatically at game startup. At creating a custom thread, you can pass up to 34 parameters to it, like in opcode 004F. Parameter: file name. The name must be specified with an extension if it has one. The file is retrieved relatively of the directory ‘game\CLEO’ which is default path for any CLEO files. Does it means the CLEO script file extension ? Why only a s ? my exemble: 0A92: create_custom_thread "Mod.cs" ..."if it has one", could it have nothing ? 0A94: start_custom_mission "missions\CustomMission1"0A94 begins a CLEO mission from the specified file as the 0147 does. Look that the file extension is not needed to specify. In fact the opcode will search for the file with the extension .cm (Custom Mission). The mission starts from the file CLEO\missions\CustomMission1.cm in this example. Parameter: file name without an extension. The file is retrieved relatively of the directory ‘game\CLEO’. Does it require to create a mission folder ? And can I even start a mission with longer paths? Paths to other directories or drives? 0A94: start_custom_mission "CustomMission1"0A94: start_custom_mission "missions\Test1\Version1\CustomMission1"0A94: start_custom_mission "D:\GTA\CustomMission1" Can I start a original thread in main.scm from a CLEO mission ? For exemble "CASHWIN" Edited January 7, 2008 by ZAZ CLEO MODS CLEO Script Tutorial Link to comment Share on other sites More sharing options...
Seemann Posted January 8, 2008 Share Posted January 8, 2008 I can use 0A92 in main.scm to start a cs ? Yes. But be aware that every CLEO-script within the .cs file automatically starts at game loading (the CLEO main core provides that). You need to use another extenstion (.s, .myscr, .any, etc) to avoid this script being loaded from startup. Then you use 0A92 with the full path to this file and this script starts. Or, you can place the .cs file to directory different than "game\cleo" and this script still does not be loaded, and you starts it on yourself. And yes, every CLEO opcode needs the CLEO library being installed. my exemble: 0A92: create_custom_thread "Mod.cs" I think I've already answered above. If you will use the .cs, the script starts with the game, you don't need 0A92. IF you don't need the script started in such a way, change the file extension and load it with 0A92. 0A92 requires the file extenstion. 0A94 don't (it uses a .cm extension always). Does it require to create a mission folder ? And can I even start a mission with longer paths?Paths to other directories or drives? No matter. Use any path you wish. Can I start a original thread in main.scm from a CLEO mission ?For exemble "CASHWIN" You can, but what happened if I play with modded scm (stripped) without this thread present? I think the game will crash when execute 004F: @CASHWIN. You probably need to copy the whole CASHWIN's stuff into your CLEO script and use it, to make this one works with any scms. Or you just need to say to people who will play this script that they should use the unmodded scm. Sanny Builder 3 • SA Memory Handling • OpenIV • gtamodding.com CLEO.li - The CLEO Library - Official site Link to comment Share on other sites More sharing options...
ZAZ Posted January 8, 2008 Share Posted January 8, 2008 (edited) Thanks for this. I have just downloaded CLEO3 from your site and add to SA It works now. Maybe because I installed meanwhile MS SP2 ?! Edited January 18, 2008 by ZAZ CLEO MODS CLEO Script Tutorial Link to comment Share on other sites More sharing options...
ZAZ Posted January 18, 2008 Share Posted January 18, 2008 Ok, still one question. I wonna get the value of a normal variable into the cleo var for communication between CLEO thread and CLEO mission Misionstarterthread 03C0: @0 = actor $PLAYER_ACTOR car var 0 = @0 Mission 0AB4: [email protected]= var 0 008B: [email protected]([email protected],16i) = @0 // integer values and handles 036A: put_actor $PLAYER_ACTOR in_car [email protected]([email protected],16i) is it possible? I found only 0AB3: var 0 = 10 and 0AB4: [email protected]= var 0 CLEO MODS CLEO Script Tutorial Link to comment Share on other sites More sharing options...
Seemann Posted January 19, 2008 Share Posted January 19, 2008 yes, you can use var 0 = [email protected] [email protected]([email protected],16i) = var 0 any variable. You also could pass an actor's handle to a mission using opcode 0A94: start_custom_mission "missions\CustomMission1" $actorhandle and [email protected] in the mission will be equal to the value of $actorhandle Sanny Builder 3 • SA Memory Handling • OpenIV • gtamodding.com CLEO.li - The CLEO Library - Official site Link to comment Share on other sites More sharing options...
ZAZ Posted January 19, 2008 Share Posted January 19, 2008 You also could pass an actor's handle to a mission using opcode 0A94: start_custom_mission "missions\CustomMission1" $actorhandle and [email protected] in the mission will be equal to the value of $actorhandle Oh yes, thats fine, it works Misionstarterthread 0209: $ctyp1 = random_int 533 5360A94: start_custom_mission "TestMission1" $ctyp1 // Originally: Mission 0247: request_model [email protected]:TestMiss_120001: wait 0 ms00D6: if 00248: model [email protected] available004D: jump_if_false @TestMiss_1204C4: create_coordinate [email protected] [email protected] [email protected] from_actor $PLAYER_ACTOR offset 0.0 5.0 0.50 00A5: $10431 = create_car [email protected] at [email protected] [email protected] [email protected] Misionstarterthread 0209: [email protected] = random_int 533 5360AB3: var 13 = [email protected]: start_custom_mission "TestMission1" // Originally: Mission 0AB4: [email protected] = var 130247: request_model [email protected]:TestMiss_120001: wait 0 ms00D6: if 00248: model [email protected] available004D: jump_if_false @TestMiss_1204C4: create_coordinate [email protected] [email protected] [email protected] from_actor $PLAYER_ACTOR offset 0.0 5.0 0.50 00A5: $10431 = create_car [email protected] at [email protected] [email protected] [email protected] BTW. I realized a limit for the CLEO missions A mission with 6656 lines crashes A mission with 6193 lines works Is there a way to fix it ? My CarSaloon mission script have 8810 lines and works in the main.scm CLEO MODS CLEO Script Tutorial Link to comment Share on other sites More sharing options...
Seemann Posted January 19, 2008 Share Posted January 19, 2008 There's no limit for a single mission size in terms of lines, there's a limit in BYTES. One single mission could NOT exceed the limit of 69,000 bytes of size, be it a scm mission or a cleo one. Sanny Builder 3 • SA Memory Handling • OpenIV • gtamodding.com CLEO.li - The CLEO Library - Official site Link to comment Share on other sites More sharing options...
Sacky Posted January 19, 2008 Share Posted January 19, 2008 Note that SA Limit Adjuster can adjust the max mission byte size Link to comment Share on other sites More sharing options...
P.I.M.P_PL Posted January 19, 2008 Share Posted January 19, 2008 Note that SA Limit Adjuster can adjust the max mission byte size its be good when can scm block too;] Link to comment Share on other sites More sharing options...
ZAZ Posted January 19, 2008 Share Posted January 19, 2008 (edited) Note that SA Limit Adjuster can adjust the max mission byte size Ok, I try. But basicly there exist a different between limt for CLEO mission script and main.scm mission script Also its not nice to recommend the user to use Limit Adjuster if he wonna play my mission mod There's no limit for a single mission size in terms of lines, there's a limit in BYTES. One single mission could NOT exceed the limit of 69,000 bytes of size, be it a scm mission or a cleo one. THX for clarification. Its easy to count the lines of a script and see, this will crash or this will work. To count the bytes it needs to add the mission script into a stripped main and look for the compiler message. Well, I did it. The CarSaloon mission script have 63409 bytes Mybe its possible to make this script as CLEO Extern script. In that case I have to convert hundreds of locals into globals. A made a lot experience in creating missions for CLEO3 Im shure now the limit for CLEO mission scripts is ca. 49 000 bytes ------------------------------------------------ edit I testet with limit adjuster but no success the errordump: GTA:SA Crashed, Debug Info Follows: GTA Info: Version: EU 1.0 Last File Loaded: cleo\CARSALOONEX.cm Last Library Loaded: user32.dll Error: Unknown Assembly Info: Exception At Address: 0x0156A247 Exception Code: 0xc0000005 (EXCEPTION_ACCESS_VIOLATION) Registers: EAX: 0x00000000 EBX: 0x00A7A6A0 ECX: 0x00000000 EDX: 0x7C91EB94 ESI: 0x4952545F EDI: 0x00000000 EBP: 0x0022FCE0 ESP: 0x0022FB70 Edited February 5, 2008 by ZAZ CLEO MODS CLEO Script Tutorial 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