Releases: lostinmind-dev/lost-c3
3.3.4
CLI Changes
Now you can use npm modules in your projects by using built-in bundler in Lost. Lost's using ESBuild for bundling packages.
lost bundle --package "{package_name}"
- Creates {package_name}.bundle.js
for module and put it to ./Addon/Modules
folder. If there is any types were found in package.json
, .d.ts
file will be also created in the same directory.
Example
lost bundle --package "axios" --format "esm" --minify
--format
AND --minify
flags are optional. By default module bundles without minification and esm
format for ESBuild.
Bug fixes
- Fixed issue with using
.js
modules.Modules
folder name in import path wasn't converting to lower case.
3.3.3
CLI Changes
To serve addon you can use one of the next examples:
lost serve
- Runs web server with default port "65432".
lost serve --port "{your_port}"
- Runs web serve with specifix port.
To create new Lost project by using bare bones you can use one of the next examples:
lost create --type "plugin"
OR
lost create --type "drawing-plugin"
OR
lost create --type "behavior"
Framework changes
setRuntimeScripts
method was reworked for both forplugin
ANDbehavior
addon types. Now you can use this method for changing script dependency from 'external-dom-script' to 'external-runtime-script' for files and directories inside./Scripts
folder. When you are settingtype
field to
type: 'directory'
All of your .js
AND .ts
scripts dependency type will be set to 'external-runtime-scripts'
Example
import { defineAddon, Plugin, Property } from '../../mod.ts';
import type { EditorInstance } from '@Editor/Instance.ts';
import type { EditorType } from '@Editor/Type.ts';
import config from './lost.config.ts';
export default defineAddon(
new Plugin<EditorInstance, EditorType>(config)
/** @Settings */
.setRuntimeScripts(
{ type: 'directory', path: 'runtimeScripts' },
{ type: 'file', path: 'test.js' }
)
/** @Properties */
)
setRemoteScripts
method was reworked for both forplugin
ANDbehavior
addon types. You can use this method as previously but now you have an ability to setscriptType
to 'module' for your remote script
Example
import { defineAddon, Plugin, Property } from '../../mod.ts';
import type { EditorInstance } from '@Editor/Instance.ts';
import type { EditorType } from '@Editor/Type.ts';
import config from './lost.config.ts';
export default defineAddon(
new Plugin<EditorInstance, EditorType>(config)
/** @Settings */
.addRemoteScripts(
{ url: 'https://myremoteurl.com/script.js'},
{ url: 'https://myremoteurl.com/script2.js', type: 'module' },
)
/** @Properties */
)
3.3.0
-
Fixed issue with 'File not found' when using '.js' files in
Modules
andScripts
folders. -
Added support for 'combo-grouped' ACEs parameter (available only for Construct R419 and above)
-
Added minifier (UglifyJS). It works both on all addon files (except user scripts and modules) and JSONfiles (aces.json, addon.json, en-US.json)
lost build --minify
3.2.3
π§ Changes
[!IMPORTANT] You don't need to assign classes to
SDK
orC3
variables in global scope, Lost automatically adds assignment at build >time, making the addon files much cleaner. But note that you must use for exampleexport type { <className> }
for the file to be >detected as used and compiled into Javascript.
New Plugin bare bones
New Drawing Plugin bare bones
New Behavior bare bones
- Added new
Editor
folder for editing editorInstance.ts
andType.ts
classes. - The
lost.config.ts
config file must usedefineConfig
method from library. - Added new field for 'plugin' addon type
pluginType: 'object' | 'world' /** 'world' for drawing plugins */
For drawing plugin you should set pluginType
to world
lost.config.ts
import { defineConfig } from 'jsr:@lost-c3/[email protected]';
export default defineConfig<'plugin'>({
type: 'plugin',
pluginType: 'object',
// deprecated?: boolean;
// minConstructVersion?: string;
// canBeBundled?: boolean;
isSingleGlobal: true,
objectName: 'LostPlugin',
addonId: 'LostPluginId',
category: 'general',
addonName: 'Lost plugin for Construct 3',
addonDescription: 'My awesome addon was made with Lost',
version: '1.0.0.0',
author: 'lostinmind.',
docsUrl: 'https://myaddon.com/docs',
helpUrl: {
EN: 'https://myaddon.com/help/en'
},
websiteUrl: 'https://myaddon.com'
})
- The
addon.ts
config file must usedefineAddon
method from library.
addon.ts
import { defineAddon, Plugin } from 'jsr:@lost-c3/[email protected]';
import config from './lost.config.ts';
export default defineAddon(
new Plugin<EditorInstance, EditorType>(config)
)
π New features
- Added drawing plugin support (also added new fields in config for drawing plugins)
- Added behavior addon support
- Now you can use types of your
EditorInstance
andEditorType
innew Plugin<EditorInstance, EditorType>
andnew Behavior<EditorInstance>
. It will automatically detect your editor instance class type for using it inProperty.Link
orProperty.Info
plugin property type for example
π Improvements
- Increased addon build time
3.0.1
π§ Changes
- Icon default path was changed, now shouldn't put your
icon.svg
in./Addon
folder, now you must put your icon in main folder./
π Improvements
Lost error detector was improved. Now it detects next issues:
- Empty plugin property Id
- Duplicated plugin property id's
- Empty group Id
- Duplicated group id's
- Empty Category Id
- Duplicated Category id's
- Empty Action/Condition/Expression Id
- Duplicated Action/Condition/Expression id's
- Empty Parameter Id
- Duplicated Parameter id's
- Duplicated methods names
π New features
- Added new command to CLI
lost build --watch
for faster addon development
That command will automatically reload build command after you changed any addon file - Now when you are using
lost build
command, it'll create .d.ts file with plugin properties types at path:./Addon/Types/properties.d.ts
Usage example
class LostInstance extends globalThis.ISDKInstanceBase {
constructor() {
super();
const properties = this._getInitProperties() as PluginProperties;
}
}
It'll help you to detect type of your plugin property in main Instance.ts
file.
3.0.0
π New features
- Added support for 'application/wasm' file types.
- Added 'lost types' command for installing all
ts-defs
construct types that was merged in one file - New
addon.ts
file (for configurating remote scripts, files and other) - Added fully support for compiling all Typescript files from folder Modules folder
- Added support for using import .ts files in main Instance.ts file (after build it will be replaced with real module path from ready addon folder)
- Added MD5 encryption for autocompleteId property in parameter options
π Bug Fixes
- Fixed issue with autocompleteId, in final build, the type of property was boolean
π§ Changes
- Switched BBCode functions names to lowerCase
- Moved all BBCode functions to
jsr:@lost-c3/lib/misc
- Removed 'behavior', 'theme', 'effect' addon support (will be in next releases)
Action decorator
- Removed one
Options
property - Added
id, name, displayText, description?, opts?
properties
Condition decorator
- Removed one
Options
property - Added
id, name, displayText, description?, opts?
properties
Expression decorator
- Removed one
Options
property - Added
id, name, description?, opts?
properties
Parameters declarations
For creating parameters for Action/Condition/Expression you should use opts.params property. To create parameter you should use addParam(id, name, opts)
function from jsr:@lost-c3/lib
2.0.0
π§ New Features
- New README.md instructions for creating any addon type!
- Support for Typescript in
./Scripts
folder (it'll automatically compiled to Javascript) - Support for
'behavior'
addon type! - Support for
'theme'
addon type! - Support for
'effect'
addon type!
ποΈ Creating 'behavior'
addon type
Create 'behavior'
addon bare-bones by using lost create --behavior
OR lost create -b
π¨ Creating 'theme'
addon type
Create 'theme'
addon bare-bones by using lost create --theme
OR lost create -t
β¨ Creating 'effect'
addon type
Create 'effect'
addon bare-bones by using lost create --effect
OR lost create -e
1.2.4
π Bug Fixes
- Fixed issue with building final .c3addon file, there was an error with missing en-US.json file after installing addon.
π§ Common Changes
- Removed 'behavior' addon type (for developing)
- Moved to full online addon build system
ποΈ New File System
π Instance.ts
Now you don't need to import your Config const from ../lost.config.ts
in your Instance.ts
file. When you are creating new addon by using lost create -p
OR lost create --plugin
, there was added lost.d.ts file in path ./Addon/Types/ts-defs
for supporting global 'Config' variable that allows to not do import.
If you have already developed the plugin before, you need to copy the lost.d.ts
file from the bare-bones repository, or create it by yourself.
lost.d.ts
import type { LostConfig, AddonType } from "jsr:@lost-c3/[email protected]";
declare global {
const Config: LostConfig<AddonType>;
}
export {}
π Type.ts (NEW!)
There was added support for customization your type.js
runtime script file. File includes in bare-bones repository so if you creating new one, you don't need to create it by yourself. If you have already developed the plugin before, you need to create new Type.ts
file in main addon folder ./Addon
.
Type.ts
import type { Instance } from "./Instance.ts";
const C3 = globalThis.C3;
C3.Plugins[Config.AddonId].Type = class LostType extends globalThis.ISDKObjectTypeBase<Instance> {
constructor() {
super();
}
_onCreate() {}
};
π Plugin.ts (NEW!)
There was added support for customization your plugin.js
runtime script file. File includes in bare-bones repository so if you creating new one, you don't need to create it by yourself. If you have already developed the plugin before, you need to create new Plugin.ts
file in main addon folder ./Addon
.
Plugin.ts
const C3 = globalThis.C3;
C3.Plugins[Config.AddonId] = class LostPlugin extends globalThis.ISDKPluginBase {
constructor() {
super();
}
};
π¦ Support for SDK v2 modules
There was added support for importing your any module.
- New folder
Modules
at main addon folder./Addon
.
That folder uses your any mymodule.js files.
Example of using mymodule.js
import * as MyModule from './Modules/mymodule.js';
const C3 = globalThis.C3;
class LostInstance extends globalThis.ISDKInstanceBase {
readonly PluginConditions = C3.Plugins[Config.AddonId].Cnds;
constructor() {
super();
const properties = this._getInitProperties();
console.log(MyModule.VAR);
if (properties) {
}
}
_release() {
super._release();
}
};
C3.Plugins[Config.AddonId].Instance = LostInstance;
export type { LostInstance as Instance };
[!WARNING] Note this is only supported from r401+.
[!INFO] π For more info checkout official docs:
https://www.construct.net/en/make-games/manuals/addon-sdk/guide/runtime-scripts/sdk-v2