How can I modify a Machine Start Variable of Battle starting schematic with code? For example if I want to set the scene that is loaded at battle start. I can do this with a global variable because I know how to set this. But it's not clear how to set the Local Machine Start Variable. Thanks, -Mike

List<Combatant> combatants = new List<Combatant> { selectCardController.connectedGameObject.GetComponent<CombatantComponent>().Combatant };
newBattle = BattleComponent.CreateBattle(combatants);
newBattle.settings.ownStartSchematic = true;
AssetSource < MakinomSchematicAsset > tempAsset = new AssetSource<MakinomSchematicAsset>();
tempAsset.SetAsset(battleStartAsset);
newBattle.settings.startSchematicAsset = tempAsset;
//Maki.Game.Variables.Set("Map_LoadSceneName", selectCardController.loadScene);
newBattle.settings.variableChanges.variable.SetValue(selectCardController.loadScene, 0); //Doesn't work

newBattle.settings.ownEndSchematic = true;
AssetSource<MakinomSchematicAsset> tempAsset2 = new AssetSource<MakinomSchematicAsset>();
tempAsset2.SetAsset(battleEndVictoryAsset);
newBattle.settings.victorySchematicAsset = tempAsset2;
  • They're only used by machine components, the Battle component doesn't have them, i.e. battle start/end schematic don't have them.
    Please consider rating/reviewing my products on the Asset Store (hopefully positively), as that helps tremendously with getting found.
    If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
Sign In or Register to comment.