feat(api-gdext): ✨ Add new learned controller structs, traits, and training functions to the simulator API extension
Co-Authored-By: Lilith Autocommit <noreply@atlilith.com>
This commit is contained in:
parent
11c9b71a02
commit
05795cc3f3
1 changed files with 13 additions and 1 deletions
|
|
@ -37,7 +37,19 @@ use mc_mapgen::MapGenerator;
|
|||
struct MagicCivPhysicsExtension;
|
||||
|
||||
#[gdextension]
|
||||
unsafe impl ExtensionLibrary for MagicCivPhysicsExtension {}
|
||||
unsafe impl ExtensionLibrary for MagicCivPhysicsExtension {
|
||||
// p1-29f — register the in-box learned (`learned:*`) AI controller into
|
||||
// the `mc_player_api::controllers` registry at engine init, alongside the
|
||||
// auto-registered `scripted:default`. After this, the id appears in
|
||||
// `mc_player_api::registered_ids()` /
|
||||
// `GdGameState::registered_controller_ids()`. Registered at `Scene` level
|
||||
// (after `Core`/`Servers`) so it runs once per engine boot.
|
||||
fn on_level_init(level: InitLevel) {
|
||||
if level == InitLevel::Scene {
|
||||
mc_player_api::register_learned_controllers();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// ── GdGridState ─────────────────────────────────────────────────────────
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue