Skip to content

Commit

Permalink
0.7.4 release
Browse files Browse the repository at this point in the history
  • Loading branch information
x87 committed Nov 11, 2021
1 parent 075a04c commit 1f8777c
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 29 deletions.
24 changes: 18 additions & 6 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,20 +1,29 @@
### 0.7.4 - Nov 11, 2021

- ignore mobile and console command definitions (fixes https://github.com/cleolibrary/CLEO-Redux/issues/6)

#### BREAKING CHANGE

- minimum required version of `vc.json` is `0.144`
- minimum required version of `sa.json` is `0.168`

### 0.7.3 - Nov 8, 2021

- ensure custom scripts have unique [in-game names](https://library.sannybuilder.com/#/vc/default/03A4) when the first 7 characters of their file names are the same (e.g. scripts in files `spawner_a.cs`, `spawner_b.cs`, `spawner_c.cs` would now have names `spawner`, `spawn01`, `spawn02` respectively)
- fix: internal address error could make a JS script execute a wrong instruction

#### BREAKING CHANGE

- minimum required version of `sa.json` is `0.167`
- minimum required version of `sa.json` is `0.167`

### 0.7.2 - Nov 4, 2021

- add `ONMISSION` variable that can be used to manipulate the global player's on a mission status

```js
if (!ONMISSION) {
showTextBox("Not on a mission. Setting ONMISSION to true");
ONMISSION = true;
showTextBox("Not on a mission. Setting ONMISSION to true");
ONMISSION = true;
}
```

Expand All @@ -23,10 +32,10 @@ if (!ONMISSION) {
- using `new` operator on a static object (for which Sanny Builder Library does not define a constructor, e.g. `Audio` or `Hud`) now throws an error:

```js
var hud = new Hud(); // error: Hud is not constructable
var hud = new Hud(); // error: Hud is not constructable
```

- minimum required version of `sa.json` is `0.166`
- minimum required version of `sa.json` is `0.166`

### 0.7.1 - Nov 02, 2021

Expand All @@ -37,18 +46,20 @@ if (!ONMISSION) {

- CLEO Redux can now work as an extension to CLEO Library (see [Relation to CLEO Library](README.md#relation-to-cleo-library))
- CLEO Redux is now able to execute JavaScript in GTA San Andreas with CLEO 4.4 installed
- new config parameter `AllowCs` to control `*.cs` scripts
- new config parameter `AllowCs` to control `*.cs` scripts
- fix: ini config was ignored if there were missing parameters in the `cleo.ini`

#### BREAKING CHANGE

CLEO Redux' primary distribution file has been renamed to `cleo_redux.asi`. To avoid conflicts with previously installed versions of CLEO Redux manually delete old `cleo.asi` file from the game directory.

### 0.6.2 - Oct 11, 2021

- add [CALL_FUNCTION](https://library.sannybuilder.com/#/gta3/CLEO/0AA5), [CALL_FUNCTION_RETURN](https://library.sannybuilder.com/#/gta3/CLEO/0AA7), [CALL_METHOD](https://library.sannybuilder.com/#/gta3/CLEO/0AA6), [CALL_METHOD_RETURN](https://library.sannybuilder.com/#/gta3/CLEO/0AA8). See [Using Memory](using-memory.md#calling-foreign-functions) for more information.
- update typings to include links to relevant documentation

### 0.6.1 - Oct 08, 2021

- fix crash in `Memory` class methods

### 0.6.0 - Oct 08, 2021
Expand All @@ -58,6 +69,7 @@ CLEO Redux' primary distribution file has been renamed to `cleo_redux.asi`. To a
- new static methods in `Memory` class. See [documentation](using-memory.md) for more info

#### BREAKING CHANGES

- `asFloat` has been removed in favor of `Memory.ToFloat`
- class `Object` has been renamed to `ScriptObject` to avoid conflicts with native JavaScript Object.
- deprecated command `isKeyPressed` has been deleted. Use `Pad.isKeyPressed` instead
Expand Down
43 changes: 22 additions & 21 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,18 +21,18 @@ JavaScript is enabled by default. To disable it open up `CLEO\.config\cleo.ini`
- GTA III v1.0 (PC version)
- GTA Vice City v1.0 (PC version)
- GTA San Andreas v1.0 (PC version, only with [CLEO 4.4](https://github.com/cleolibrary/CLEO4))
- re3 (see [Compatibility details](README.md#compatibility-with-re3-and-revc))
- re3 (see [Compatibility details](README.md#compatibility-with-re3-and-revc))
- reVC (see [Compatibility details](README.md#compatibility-with-re3-and-revc))

NOTE: CLEO Redux doesn't work on [Windows 7 and below](https://github.com/cleolibrary/CLEO-Redux/issues/5).

### Relation to CLEO Library

CLEO is a common name for the custom libraries designed and created for GTA III, Vice City or San Andreas. Each version can be found and downloaded [here](https://cleo.li/download.html). CLEO Redux is *another* CLEO implementation made from scratch with a few distinctive features, such as single code base for all games, or support for JavaScript code.
CLEO is a common name for the custom libraries designed and created for GTA III, Vice City or San Andreas. Each version can be found and downloaded [here](https://cleo.li/download.html). CLEO Redux is _another_ CLEO implementation made from scratch with a few distinctive features, such as single code base for all games, or support for JavaScript code.

At the moment CLEO Redux can not be considered as a replacement for CLEO Library due to the lack of support for many widely used CLEO commands. To solve this issue and get the best out of the two libraries, CLEO Redux supports two different usage strategies.

CLEO Redux can run as a standalone software, or as an addon to CLEO Library. In the first case your game directory would only contain `cleo_redux.asi` file. In the second case, your game directory would have both `cleo.asi` (or `III.CLEO.asi` or `VC.CLEO.asi`) and `cleo_redux.asi`.
CLEO Redux can run as a standalone software, or as an addon to CLEO Library. In the first case your game directory would only contain `cleo_redux.asi` file. In the second case, your game directory would have both `cleo.asi` (or `III.CLEO.asi` or `VC.CLEO.asi`) and `cleo_redux.asi`.

#### Running CLEO Redux as a standalone software

Expand Down Expand Up @@ -192,10 +192,11 @@ This line instructs VS Code where to look for the commands definitions for the a

When JavaScript is enabled CLEO Redux needs commands definitions from https://library.sannybuilder.com/. On the first run CLEO would try to download the necessary files and put them into your local `CLEO/.config` directory. If that did not happen, or you don't want to let CLEO make network calls, manually download [gta3.json](https://github.com/sannybuilder/library/blob/master/gta3/gta3.json), [vc.json](https://github.com/sannybuilder/library/blob/master/vc/vc.json), or [sa.json](https://github.com/sannybuilder/library/blob/master/sa/sa.json) and place them in the `CLEO/.config` directory.

Minimum required version of the commands definitions:
* `gta3.json`: `0.99`
* `vc.json`: `0.143`
* `sa.json`: `0.167`
Minimum required version of the commands definitions:

- `gta3.json`: `0.99`
- `vc.json`: `0.144`
- `sa.json`: `0.168`

### Script Lifecycle

Expand Down Expand Up @@ -230,14 +231,14 @@ Sanny Builder Library defines a static class `Object` to group commands allowing
To avoid mixing the two, CLEO Redux uses `ScriptObject` class instead of the Library's `Object` with [the same interface](https://library.sannybuilder.com/#/gta3/classes/Object).

```js
var x = ScriptObject.Create(modelId, x, y, z) // opcode 0107, creates a new object in the game
var x = Object.create(null) // native JavaScript code, creates a new object in JS memory
var x = ScriptObject.Create(modelId, x, y, z); // opcode 0107, creates a new object in the game

var x = Object.create(null); // native JavaScript code, creates a new object in JS memory
```

#### Class Math

Similarly to the `Object` class (see above), both the Library and native JavaScript runtime use the same name for mathematical utilities: class `Math`. In this case however, the decision was made to keep both native and script methods under the same class name.
Similarly to the `Object` class (see above), both the Library and native JavaScript runtime use the same name for mathematical utilities: class `Math`. In this case however, the decision was made to keep both native and script methods under the same class name.

The priority was given to the native code in those cases where it provides the same functionality as script opcodes. For example, to calculate the absolute value of a number, use native [Math.abs](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/abs), not [Math.Abs](https://library.sannybuilder.com/#/gta3?q=%22abs%22). See [Using Math](using-math.md) for more detailed information.

Expand Down Expand Up @@ -312,21 +313,21 @@ if (GAME === "sa") {

```js
if (!ONMISSION) {
showTextBox("Not on a mission. Setting ONMISSION to true");
ONMISSION = true;
showTextBox("Not on a mission. Setting ONMISSION to true");
ONMISSION = true;
}
```

- `TIMERA` and `TIMERB` - two auto-incrementing timers useful for measuring time intervals.

```js
while(true) {
TIMERA = 0;
// wait 1000 ms
while(TIMERA < 1000) {
wait(0)
}
showTextBox("1 second passed")
while (true) {
TIMERA = 0;
// wait 1000 ms
while (TIMERA < 1000) {
wait(0);
}
showTextBox("1 second passed");
}
```

Expand Down Expand Up @@ -355,7 +356,7 @@ showTextBox("Hello, world!");
- `exit(reason?)` - terminates the script immediately. `exit` function accepts an optional string argument that will be added to the `cleo_redux.log`.

```js
exit("Script ended");
exit("Script ended");
```

- family of static methods in the `Memory` class for manipulating different data types. See the [Memory guide](using-memory.md) for more information.
Expand Down
5 changes: 3 additions & 2 deletions website/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,8 @@ <h1 class="font-weight-bold d-flex justify-content-center">
<hr class="divider" />
<div class="mb-5 text-white-75">
<p>
CLEO Redux is an experimental JavaScript runtime for classic GTA 3D games.
CLEO Redux is an experimental JavaScript runtime for classic GTA
3D games.
</p>
<p>
It brings a joy of enhancing the gameplay with countless
Expand All @@ -97,7 +98,7 @@ <h1 class="font-weight-bold d-flex justify-content-center">
href="https://github.com/cleolibrary/CLEO-Redux/releases/latest"
>Download</a
>
<small class="pt-1 text-muted">v0.7.3 | Nov 08, 2021</small>
<small class="pt-1 text-muted">v0.7.4 | Nov 11, 2021</small>
</div>
</div>
</div>
Expand Down

0 comments on commit 1f8777c

Please sign in to comment.