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