Skip to content

Commit

Permalink
optimization
Browse files Browse the repository at this point in the history
  • Loading branch information
MatiDragon-YT committed Jan 21, 2022
1 parent 15c6299 commit 8f8696a
Show file tree
Hide file tree
Showing 29 changed files with 651 additions and 440 deletions.
38 changes: 25 additions & 13 deletions en/articles/mpack.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,38 +15,50 @@
---

We just need to create a folder called `MPACK` in the directory "My Documents\GTA San Andreas User Files". Now the game will understand that the player needs to choose a `main`.
.
To do this, we must first create another folder as follows, with which we configure the order of the list::
| MPACK + Sequence number

To do this, we must first create another folder as follows, with which we configure the order of the list:

> MPACK + Sequence number

The sequence number is integer from 1 to 24.

<div class="info">
:::info
Note that there should not be identical numbers.
</div>
:::

For example, we are going to create a folder called `MPACK1`.
.

Now inside the folder do the following:

_ Create a `mpack.dat` file with a normal notepad.\nOpen it and add the following entry: `1#Testeo MD v1.0#`. <blockquote>`1` - the sequence number of the mission set.\n`Testeo MD v1.0` - the name of the set, will be displayed when selected. It must be written in Latin letters, as the game does not always recognize the encoding.</blockquote>
_ Add files: `american.gxt` from the `GTASA\text` folder and `main.scm` from the `GTASA\data\script` folder.
_ Rename `main.scm` to `scr.scm` and `american.gxt` to `text.gxt`
1. Create a `mpack.dat` file with a normal notepad.\nOpen it and add the following entry: `1#Testeo MD v1.0#`. <blockquote>`1` - the sequence number of the mission set.\n`Testeo MD v1.0` - the name of the set, will be displayed when selected. It must be written in Latin letters, as the game does not always recognize the encoding.</blockquote>
2. Add files: `american.gxt` from the `GTASA\text` folder and `main.scm` from the `GTASA\data\script` folder.
3. Rename `main.scm` to `scr.scm` and `american.gxt` to `text.gxt`

Now our package is ready. When we launch a new game, this we will see:

:::l
![](mpack/preview.jpg)
:::

The standard game is the main one found in the `GTASA\data\script` folder.\
The other will launch our `main` customed.

<div class="warning">
:::warning
* All CLEO scripts will work when running any MPACK, so if they do interact with the `main` in any way, you should take this into account.
* You can only add up to a maximum of 24 packages.
* In mission packs, external scripts cannot be downloaded (plugins required)
* If you installed the mission pack incorrectly, you will see the following:

![](mpack/fail.jpg)
</div>
:::c bg-black-2 white p-5 h6 d-inline-block
Load failed!

The current Mission Pack is not available.\
Please recheck that the current Mission Pack\
is installed correctly.

Press RETURN to start a new standard game.
:::

:::

<script src="../../js/markdown.js"></script>
<script src="../../js/main.min.js"></script>
Binary file removed en/articles/mpack/fail.jpg
Binary file not shown.
Binary file modified en/articles/mpack/preview.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions en/cleo-3/code-library.html
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
Sanny Builder 3 has the files SASCM.INI and OPCODES.TXT already up to date. Future updates of the CLEO library may require some changes of these files. You will get all instructions along with the updates on [cleo.sannybuilder.com](http://cleo.sannybuilder.com/).

:::right light gray p-2
What about plugins? ------- <a id="plugins"></a>
What about plugins? ------- [plugins][]
:::

The plugins are the DLL files having an extension .CLEO. At startup, the CLEO library scans the folder GTASA\CLEO for the files with that extension and tries to load them. If successful, the plugin begins to work and complete the functions it was made for.
Expand All @@ -69,6 +69,6 @@

If you want to help in developing of the library or its plugins, contact me by forum or e-mail.

Also thanks to [Stanislav Golovin (aka listener)](http://www.gtaforums.com/index.php?showuser=236130) for his support and useful information.
Also thanks to [Stanislav Golovin](http://www.gtaforums.com/index.php?showuser=236130 "(aka listener)") for his support and useful information.

<script src="../../js/main.min.js"></script>
241 changes: 121 additions & 120 deletions en/cleo-3/opcodes.html

Large diffs are not rendered by default.

10 changes: 5 additions & 5 deletions en/cleo-3/scripts.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,23 +17,23 @@

There are several ways of making of a CLEO-script being able to work correctly in the game. First: you add a new external script in the source file, compile it, and then extract that script from the file script.img. The extracted file will have the extension .scm, so you only need to change it on the .cs and copy to the folder ‘game\CLEO’.

The second way is easier. Create a new file in Sanny Builder, write the [directive $E](..coding/directives.md#external) at the beginning of it, and compile. The compiled file will be the same as that one extracted from the script.img. You only need to change its extension on the .cs and copy to the ‘game\CLEO’.
The second way is easier. Create a new file in Sanny Builder, write the [directive $E](../coding/directives.md#external) at the beginning of it, and compile. The compiled file will be the same as that one extracted from the script.img. You only need to change its extension on the .cs and copy to the ‘game\CLEO’.

Finally, the easiest one. Create a new file in Sanny Builder, write the [directive $CLEO](..coding/directives.md#cleo) at the beginning of the file, and compile. The compiled file will be copied into the ‘game\CLEO’ directory and will have a file extension specified by the directive (.cs by default).
Finally, the easiest one. Create a new file in Sanny Builder, write the [directive $CLEO](../coding/directives.md#cleo) at the beginning of the file, and compile. The compiled file will be copied into the ‘game\CLEO’ directory and will have a file extension specified by the directive (.cs by default).

The CLEO-scripts could be used as missions. The compiling process is the same, but the output file must have the extension .cm (Custom Mission). To start this mission, use the [opcode 0A94](opcode.md#0A94).
The CLEO-scripts could be used as missions. The compiling process is the same, but the output file must have the extension .cm (Custom Mission). To start this mission, use the [opcode 0A94](opcodes.md#0A94).

The rules you must follow using CLEO 3:

1. **One file - one thread**. Each CLEO-script must be made as a single thread compiled in a single file. If you need more threads for your script, use the opcodes 004F or [0A92](opcodes.md#0A92), depending of where is that additional thread located - in the main.scm or in a separate cs-file.
2. **Never use the opcode 004E in the CLEO-threads**. They work separately from the common threads, so the using of this opcode will cause an error. Use the opcode 0A93, if you need to stop a CLEO-thread. Conversely, never use [the opcode 0A93](opcode.md#0A93) in the CLEO-missions, but instead use the 004E to cancel a mission.
2. **Never use the opcode 004E in the CLEO-threads**. They work separately from the common threads, so the using of this opcode will cause an error. Use the opcode 0A93, if you need to stop a CLEO-thread. Conversely, never use [the opcode 0A93](opcodes.md#0A93) in the CLEO-missions, but instead use the 004E to cancel a mission.
3. **Never use custom global variables in your CLEO-scripts ($car, $foo, $blahblah, etc)**, or your script will work incorrectly. You may use only a few global variables (read below).

To install the CLEO script it’s only necessary to copy the file with an extension .cs to the folder ‘game\CLEO’. The file name does not matter, but it uses at the thread initialization to name it. For example, the CLEO thread located in the file showsavescreen.cs has the name SHOWSAV.

To remove the script, just delete the proper file from the CLEO directory.

The CLEO thread status may be saved and loaded along with the common threads. It does not saved by default. The saves themselves are located in the folder CLEO\cleo_saves. The is an own save for each save slot. The save file stores only the CLEO threads having the saving flag enabled ([0A95 opcode](opcode.md#0A95)). The save file stores not only the active threads, but also the ones being forced to end ([0A93 opcode](opcode.md#0A93)), to prevent their rerun at loading. If at the loading one of saved thread is not found, there is no error. If you add a new script that is not present in the current save file, it will be loaded along with the others and to work from the very beginning.
The CLEO thread status may be saved and loaded along with the common threads. It does not saved by default. The saves themselves are located in the folder CLEO\cleo_saves. The is an own save for each save slot. The save file stores only the CLEO threads having the saving flag enabled ([0A95 opcode](opcodes.md#0A95)). The save file stores not only the active threads, but also the ones being forced to end ([0A93 opcode](opcodes.md#0A93)), to prevent their rerun at loading. If at the loading one of saved thread is not found, there is no error. If you add a new script that is not present in the current save file, it will be loaded along with the others and to work from the very beginning.

The CLEO thread is the ordinary thread on the whole. It has 32 local variables and 2 timers incrementing constantly. You can pass up to 34 parameters at creation of that thread or a CLEO mission (by analogy with the opcode 004F).

Expand Down
4 changes: 4 additions & 0 deletions en/scm-documentation/ascii-character-codes.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@
<link rel="stylesheet" type="text/css" href="../../style/style.css">
</head>
<body>
```sb3
0AD3: 0@v = string_format "Example %c" &lt;id&gt;
```

<table>
<thead>
<tr>
Expand Down
7 changes: 5 additions & 2 deletions en/scm-documentation/sa/particles.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,14 @@
<link rel="stylesheet" type="text/css" href="../../../style/style.css">
</head>
<body>
```sb3
064B: 0@ = create_particle &lt;id&gt; at X Y Z type 1
```
<table>
<thead>
<tr>
<th>Description</th>
<th>Particle</th>
<th>ID</th>
</tr>
</thead>
<tbody>
Expand Down Expand Up @@ -106,7 +109,7 @@
t+=
"<tr>\
<td>"+key[0]+"</td>\
<td>\""+key[1]+"\"</td>\
<td>"+key[1]+"</td>\
</tr>"
})
$('tbody').innerHTML+=t
Expand Down
Loading

0 comments on commit 8f8696a

Please sign in to comment.