diff --git a/CHANGELOG.md b/CHANGELOG.md index 5b1ec4b..0d1a6e3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,12 @@ +### 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) @@ -5,7 +14,7 @@ #### 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 @@ -13,8 +22,8 @@ ```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; } ``` @@ -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 @@ -37,7 +46,7 @@ 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 @@ -45,10 +54,12 @@ if (!ONMISSION) { 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 @@ -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 diff --git a/README.md b/README.md index 104ddac..46cc80c 100644 --- a/README.md +++ b/README.md @@ -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 @@ -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 @@ -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. @@ -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"); } ``` @@ -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. diff --git a/website/index.html b/website/index.html index 3517044..00763e3 100644 --- a/website/index.html +++ b/website/index.html @@ -72,7 +72,8 @@
- CLEO Redux is an experimental JavaScript runtime for classic GTA 3D games. + CLEO Redux is an experimental JavaScript runtime for classic GTA + 3D games.
It brings a joy of enhancing the gameplay with countless @@ -97,7 +98,7 @@