Jump to content
    1. Welcome to GTAForums!

    1. GTANet.com

    1. GTA Online

      1. The Criminal Enterprises
      2. Updates
      3. Find Lobbies & Players
      4. Guides & Strategies
      5. Vehicles
      6. Content Creator
      7. Help & Support
    2. Red Dead Online

      1. Blood Money
      2. Frontier Pursuits
      3. Find Lobbies & Outlaws
      4. Help & Support
    3. Crews

    1. Grand Theft Auto Series

      1. Bugs*
      2. St. Andrews Cathedral
    2. GTA VI

    3. GTA V

      1. Guides & Strategies
      2. Help & Support
    4. GTA IV

      1. The Lost and Damned
      2. The Ballad of Gay Tony
      3. Guides & Strategies
      4. Help & Support
    5. GTA San Andreas

      1. Classic GTA SA
      2. Guides & Strategies
      3. Help & Support
    6. GTA Vice City

      1. Classic GTA VC
      2. Guides & Strategies
      3. Help & Support
    7. GTA III

      1. Classic GTA III
      2. Guides & Strategies
      3. Help & Support
    8. Portable Games

      1. GTA Chinatown Wars
      2. GTA Vice City Stories
      3. GTA Liberty City Stories
    9. Top-Down Games

      1. GTA Advance
      2. GTA 2
      3. GTA
    1. Red Dead Redemption 2

      1. PC
      2. Help & Support
    2. Red Dead Redemption

    1. GTA Mods

      1. GTA V
      2. GTA IV
      3. GTA III, VC & SA
      4. Tutorials
    2. Red Dead Mods

      1. Documentation
    3. Mod Showroom

      1. Scripts & Plugins
      2. Maps
      3. Total Conversions
      4. Vehicles
      5. Textures
      6. Characters
      7. Tools
      8. Other
      9. Workshop
    4. Featured Mods

      1. Design Your Own Mission
      2. OpenIV
      3. GTA: Underground
      4. GTA: Liberty City
      5. GTA: State of Liberty
    1. Rockstar Games

    2. Rockstar Collectors

    1. Off-Topic

      1. General Chat
      2. Gaming
      3. Technology
      4. Movies & TV
      5. Music
      6. Sports
      7. Vehicles
    2. Expression

      1. Graphics / Visual Arts
      2. GFX Requests & Tutorials
      3. Writers' Discussion
      4. Debates & Discussion
    1. Announcements

    2. Support

    3. Suggestions

*DO NOT* SHARE MEDIA OR LINKS TO LEAKED COPYRIGHTED MATERIAL. Discussion is allowed.

Features in .CS


Mister X
 Share

Recommended Posts

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? confused.gif

 

 

 

Thanks for the possible help Shifty41s_beerhatsmilie2.gif !!!!

 

 

Link to comment
Share on other sites

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).

 

Link to comment
Share on other sites

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?

Link to comment
Share on other sites

 

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

 

 

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 wink.gif). I will consider your suggestion.

Edited by Seemann
Link to comment
Share on other sites

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 by ZAZ
Link to comment
Share on other sites

 

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.

 

 

 

 

Link to comment
Share on other sites

  • 2 weeks later...

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

Link to comment
Share on other sites

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

 

 

 

Link to comment
Share on other sites

 

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

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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

 

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 by ZAZ
Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • 1 User Currently Viewing
    0 members, 0 Anonymous, 1 Guest

×
×
  • Create New...

Important Information

By using GTAForums.com, you agree to our Terms of Use and Privacy Policy.