Compare commits
No commits in common. "7656b663489bd8240b33c0a97db98f5cca7dd337" and "482f5a9d7df7836c6ddc1a3d06d3e47f7d5ae99e" have entirely different histories.
7656b66348
...
482f5a9d7d
3 changed files with 86 additions and 55 deletions
|
|
@ -2,6 +2,7 @@
|
||||||
* API index: https://github.com/malware-dev/MDK-SE/wiki/Api-Index
|
* API index: https://github.com/malware-dev/MDK-SE/wiki/Api-Index
|
||||||
* Vector transformation: https://github.com/malware-dev/MDK-SE/wiki/Vector-Transformations-with-World-Matrices
|
* Vector transformation: https://github.com/malware-dev/MDK-SE/wiki/Vector-Transformations-with-World-Matrices
|
||||||
* How to get rotation/position: https://forum.keenswh.com/threads/how-do-i-get-the-world-position-and-rotation-of-a-ship.7363867/
|
* How to get rotation/position: https://forum.keenswh.com/threads/how-do-i-get-the-world-position-and-rotation-of-a-ship.7363867/
|
||||||
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
using Sandbox.Game.EntityComponents;
|
using Sandbox.Game.EntityComponents;
|
||||||
|
|
@ -48,11 +49,11 @@ namespace IngameScript
|
||||||
|
|
||||||
readonly Output output;
|
readonly Output output;
|
||||||
|
|
||||||
readonly IMyRemoteControl remoteController;
|
IMyRemoteControl remoteController;
|
||||||
readonly IMyCubeGrid grid;
|
IMyCubeGrid grid;
|
||||||
readonly List<IMyGyro> gyros = new List<IMyGyro>();
|
readonly List<IMyGyro> gyros = new List<IMyGyro>();
|
||||||
|
|
||||||
readonly IMyBroadcastListener connnectorMinerPositionListener;
|
IMyBroadcastListener connnectorMinerPositionListener;
|
||||||
MatrixD connectorMinerPosition;
|
MatrixD connectorMinerPosition;
|
||||||
|
|
||||||
public Program()
|
public Program()
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,4 @@
|
||||||
using Sandbox.Game.Entities;
|
using Sandbox.Game.Entities.Cube;
|
||||||
using Sandbox.Game.Entities.Cube;
|
|
||||||
using Sandbox.Game.EntityComponents;
|
using Sandbox.Game.EntityComponents;
|
||||||
//using Sandbox.ModAPI;
|
//using Sandbox.ModAPI;
|
||||||
using Sandbox.ModAPI.Ingame;
|
using Sandbox.ModAPI.Ingame;
|
||||||
|
|
@ -31,12 +30,13 @@ namespace IngameScript
|
||||||
{
|
{
|
||||||
partial class Program : MyGridProgram
|
partial class Program : MyGridProgram
|
||||||
{
|
{
|
||||||
//const string MISSILE_GRID_PREFIX = "[PM]";
|
const string MISSILE_GRID_PREFIX = "[PM]";
|
||||||
|
|
||||||
const float EPSILON = 0.05f;
|
const float EPSILON = 0.05f;
|
||||||
const double DELAY_BEFORE_TRAVELLING_MODE = 3000; // [ms].
|
const double DELAY_BEFORE_TRAVELLING_MODE = 3000; // [ms].
|
||||||
const double AUTO_DESTRUCTION_AFTER = 60000; // [ms] (1 min). Or if the hydrogen tank is empty.
|
const double AUTO_DESTRUCTION_AFTER = 60000; // [ms] (1 min). Or if the hydrogen tank is empty.
|
||||||
|
|
||||||
|
|
||||||
enum State
|
enum State
|
||||||
{
|
{
|
||||||
NORMAL,
|
NORMAL,
|
||||||
|
|
@ -47,14 +47,13 @@ namespace IngameScript
|
||||||
State currentState = State.NORMAL;
|
State currentState = State.NORMAL;
|
||||||
|
|
||||||
readonly Output output;
|
readonly Output output;
|
||||||
readonly IMyCubeGrid grid;
|
|
||||||
|
|
||||||
int tickFromStart;
|
int tickFromStart;
|
||||||
IMyThrust forwardThruster;
|
IMyThrust forwardThruster;
|
||||||
IMyFlightMovementBlock aiMove;
|
IMyFlightMovementBlock aiMove;
|
||||||
IMyOffensiveCombatBlock aiCombat;
|
IMyOffensiveCombatBlock aiCombat;
|
||||||
IMySensorBlock sensor;
|
IMySensorBlock sensor;
|
||||||
IEnumerable<IMyWarhead> warheads;
|
List<IMyWarhead> warheads = new List<IMyWarhead>();
|
||||||
IMyGasTank gasTank;
|
IMyGasTank gasTank;
|
||||||
IMyLightingBlock light;
|
IMyLightingBlock light;
|
||||||
|
|
||||||
|
|
@ -65,7 +64,6 @@ namespace IngameScript
|
||||||
|
|
||||||
this.output.Print("Missile controller system starting...");
|
this.output.Print("Missile controller system starting...");
|
||||||
|
|
||||||
this.grid = this.Me.CubeGrid;
|
|
||||||
this.Runtime.UpdateFrequency = UpdateFrequency.Update10;
|
this.Runtime.UpdateFrequency = UpdateFrequency.Update10;
|
||||||
|
|
||||||
this.output.Print("Missile controller system started");
|
this.output.Print("Missile controller system started");
|
||||||
|
|
@ -74,7 +72,7 @@ namespace IngameScript
|
||||||
void UpdateState10()
|
void UpdateState10()
|
||||||
{
|
{
|
||||||
if (this.forwardThruster == null)
|
if (this.forwardThruster == null)
|
||||||
this.forwardThruster = this.GridTerminalSystem.GetBlock<IMyThrust>("[PM] Hydrogen Thruster 01", this.grid);
|
this.forwardThruster = this.GridTerminalSystem.GetBlockWithName("[PM] Hydrogen Thruster 01") as IMyThrust;
|
||||||
if (this.forwardThruster == null)
|
if (this.forwardThruster == null)
|
||||||
{
|
{
|
||||||
this.output.Print("Error: Cannot find forward thruster");
|
this.output.Print("Error: Cannot find forward thruster");
|
||||||
|
|
@ -82,7 +80,7 @@ namespace IngameScript
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.aiMove == null)
|
if (this.aiMove == null)
|
||||||
this.aiMove = this.GridTerminalSystem.GetBlock<IMyFlightMovementBlock>("[PM] AI Flight (Move)", this.grid);
|
this.aiMove = this.GridTerminalSystem.GetBlockWithName("[PM] AI Flight (Move)") as IMyFlightMovementBlock;
|
||||||
if (this.aiMove == null)
|
if (this.aiMove == null)
|
||||||
{
|
{
|
||||||
this.output.Print("Error: Cannot find AI move");
|
this.output.Print("Error: Cannot find AI move");
|
||||||
|
|
@ -90,7 +88,7 @@ namespace IngameScript
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.aiCombat == null)
|
if (this.aiCombat == null)
|
||||||
this.aiCombat = this.GridTerminalSystem.GetBlock<IMyOffensiveCombatBlock>("[PM] AI Offensive (Combat)", this.grid);
|
this.aiCombat = this.GridTerminalSystem.GetBlockWithName("[PM] AI Offensive (Combat)") as IMyOffensiveCombatBlock;
|
||||||
if (this.aiCombat == null)
|
if (this.aiCombat == null)
|
||||||
{
|
{
|
||||||
this.output.Print("Error: Cannot find AI combat");
|
this.output.Print("Error: Cannot find AI combat");
|
||||||
|
|
@ -98,23 +96,23 @@ namespace IngameScript
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.sensor == null)
|
if (this.sensor == null)
|
||||||
this.sensor = this.GridTerminalSystem.GetBlock<IMySensorBlock>("[PM] Sensor", this.grid);
|
this.sensor = this.GridTerminalSystem.GetBlockWithName("[PM] Sensor") as IMySensorBlock;
|
||||||
if (this.sensor == null)
|
if (this.sensor == null)
|
||||||
{
|
{
|
||||||
this.output.Print("Error: Cannot find sensor");
|
this.output.Print("Error: Cannot find sensor");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.warheads == null)
|
if (this.warheads.Count == 0)
|
||||||
this.warheads = this.GridTerminalSystem.GetBlocksFromGroup<IMyWarhead>("[PM] Warheads", this.grid);
|
this.GridTerminalSystem.GetBlockGroupWithName("[PM] Warheads").GetBlocksOfType(this.warheads);
|
||||||
if (this.warheads.Count() == 0)
|
if (this.warheads.Count == 0)
|
||||||
{
|
{
|
||||||
this.output.Print("Error: Cannot find any warhead");
|
this.output.Print("Error: Cannot find any warhead");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.gasTank == null)
|
if (this.gasTank == null)
|
||||||
this.gasTank = this.GridTerminalSystem.GetBlock<IMyGasTank>("[PM] Hydrogen Tank", this.grid);
|
this.gasTank = this.GridTerminalSystem.GetBlockWithName("[PM] Hydrogen Tank") as IMyGasTank;
|
||||||
if (this.gasTank == null)
|
if (this.gasTank == null)
|
||||||
{
|
{
|
||||||
this.output.Print("Error: Cannot find gas tank");
|
this.output.Print("Error: Cannot find gas tank");
|
||||||
|
|
@ -122,18 +120,18 @@ namespace IngameScript
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.light == null)
|
if (this.light == null)
|
||||||
this.light = this.GridTerminalSystem.GetBlock<IMyLightingBlock>("[PM] Light", this.grid);
|
this.light = this.GridTerminalSystem.GetBlockWithName("[PM] Light") as IMyLightingBlock;
|
||||||
if (this.light == null)
|
if (this.light == null)
|
||||||
{
|
{
|
||||||
this.output.Print("Error: Cannot find light");
|
this.output.Print("Error: Cannot find light");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
this.tickFromStart += 10;
|
|
||||||
|
|
||||||
switch (this.currentState)
|
switch (this.currentState)
|
||||||
{
|
{
|
||||||
case State.LAUNCHING:
|
case State.LAUNCHING:
|
||||||
|
// this.output.Print($"Tick: {this.tickFromStart}");
|
||||||
|
//this.forwardThruster.ove
|
||||||
this.forwardThruster.ThrustOverridePercentage = 1;
|
this.forwardThruster.ThrustOverridePercentage = 1;
|
||||||
if (this.MsSinceLaunch > DELAY_BEFORE_TRAVELLING_MODE)
|
if (this.MsSinceLaunch > DELAY_BEFORE_TRAVELLING_MODE)
|
||||||
{
|
{
|
||||||
|
|
@ -185,6 +183,7 @@ namespace IngameScript
|
||||||
{
|
{
|
||||||
if ((updateSource & UpdateType.Update10) != 0)
|
if ((updateSource & UpdateType.Update10) != 0)
|
||||||
{
|
{
|
||||||
|
this.tickFromStart += 10;
|
||||||
this.UpdateState10();
|
this.UpdateState10();
|
||||||
}
|
}
|
||||||
else if ((updateSource & (UpdateType.Script | UpdateType.Terminal | UpdateType.Trigger)) != 0)
|
else if ((updateSource & (UpdateType.Script | UpdateType.Terminal | UpdateType.Trigger)) != 0)
|
||||||
|
|
@ -197,11 +196,6 @@ namespace IngameScript
|
||||||
this.currentState = State.LAUNCHING;
|
this.currentState = State.LAUNCHING;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case "STOP":
|
|
||||||
this.output.Print("Stop mode");
|
|
||||||
this.currentState = State.NORMAL;
|
|
||||||
break;
|
|
||||||
|
|
||||||
default:
|
default:
|
||||||
this.output.Print($"Uknown command: {argument}");
|
this.output.Print($"Uknown command: {argument}");
|
||||||
break;
|
break;
|
||||||
|
|
|
||||||
|
|
@ -26,10 +26,22 @@ using VRage.GameServices;
|
||||||
|
|
||||||
using VRageMath;
|
using VRageMath;
|
||||||
|
|
||||||
|
// using static VRageRender.Utils.MyWingedEdgeMesh;
|
||||||
|
|
||||||
namespace IngameScript
|
namespace IngameScript
|
||||||
{
|
{
|
||||||
class Missile
|
class Missile
|
||||||
{
|
{
|
||||||
|
//string prefix;
|
||||||
|
//readonly string tankName = "Hydrogen Tank";
|
||||||
|
//readonly string connectorName = "Connector";
|
||||||
|
//readonly string mergeBlockName = "Merge Block";
|
||||||
|
//readonly string programmableBlockName = "Programmable Block";
|
||||||
|
|
||||||
|
//State currentState = State.NOMINAL;
|
||||||
|
|
||||||
|
//IMyGridTerminalSystem gridTerminalSystem;
|
||||||
|
|
||||||
public IMyGasTank Tank { get; }
|
public IMyGasTank Tank { get; }
|
||||||
public IMyShipConnector Connector { get; }
|
public IMyShipConnector Connector { get; }
|
||||||
public IMyShipMergeBlock MergeBlock { get; }
|
public IMyShipMergeBlock MergeBlock { get; }
|
||||||
|
|
@ -54,15 +66,19 @@ namespace IngameScript
|
||||||
LAUNCHING,
|
LAUNCHING,
|
||||||
}
|
}
|
||||||
|
|
||||||
readonly int number;
|
int number;
|
||||||
readonly Output output;
|
IMyCubeGrid grid;
|
||||||
|
Output output;
|
||||||
readonly IMyGridTerminalSystem gridTerminal;
|
|
||||||
readonly IMyShipConnector connector;
|
|
||||||
|
|
||||||
Missile missile;
|
Missile missile;
|
||||||
|
|
||||||
State currentState = State.NOMINAL;
|
State currentState = State.NOMINAL;
|
||||||
|
|
||||||
|
IMyGridTerminalSystem gridTerminal;
|
||||||
|
IMyShipConnector connector;
|
||||||
|
|
||||||
|
//IReadOnlyList<IMyShipWelder> welders;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
///
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
@ -71,12 +87,16 @@ namespace IngameScript
|
||||||
/// <param name="grid"></param>
|
/// <param name="grid"></param>
|
||||||
/// <param name="output">To output some text</param>
|
/// <param name="output">To output some text</param>
|
||||||
/// <param name="connector">Connector of the launcher (not the missile)</param>
|
/// <param name="connector">Connector of the launcher (not the missile)</param>
|
||||||
public Launcher(int number, IMyGridTerminalSystem gridTerminal, Output output, IMyShipConnector connector)
|
public Launcher(int number, IMyGridTerminalSystem gridTerminal, IMyCubeGrid grid, Output output, IMyShipConnector connector)
|
||||||
{
|
{
|
||||||
this.number = number;
|
this.number = number;
|
||||||
|
this.grid = grid;
|
||||||
this.gridTerminal = gridTerminal;
|
this.gridTerminal = gridTerminal;
|
||||||
this.output = output;
|
this.output = output;
|
||||||
this.connector = connector;
|
this.connector = connector;
|
||||||
|
|
||||||
|
//this.connector = this.gridTerminal.GetBlockWithName(String.Format("{0} {1}", Program.GRID_PREFIX, String.Format(LAUNCHER_SMALL_CONNECTOR_NAME, number))) as IMyShipConnector;
|
||||||
|
//output.Print($"{this.connector}");
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Launch()
|
public void Launch()
|
||||||
|
|
@ -87,7 +107,7 @@ namespace IngameScript
|
||||||
|
|
||||||
void Print(string message)
|
void Print(string message)
|
||||||
{
|
{
|
||||||
this.output.Print(String.Format("{0:00}: {1}", this.number, message));
|
this.output.Print(String.Format("{0:00} {1}", this.number, message));
|
||||||
}
|
}
|
||||||
|
|
||||||
public void UpdateState()
|
public void UpdateState()
|
||||||
|
|
@ -103,13 +123,9 @@ namespace IngameScript
|
||||||
}
|
}
|
||||||
|
|
||||||
var missileGrid = missileConnector.CubeGrid;
|
var missileGrid = missileConnector.CubeGrid;
|
||||||
if (missileGrid == null)
|
|
||||||
{
|
|
||||||
this.Print("Cannot find the missile grid");
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
IMyGasTank tank = this.gridTerminal.GetBlock<IMyGasTank>("[PM] Hydrogen Tank", missileGrid);
|
IMyGasTank tank = this.gridTerminal.GetBlock<IMyGasTank>("[PM] Hydrogen Tank", missileGrid); //Utils.GetBlock( this.gridTerminal.GetBlockWithName("[PM] Hydrogen Tank") as IMyGasTank;
|
||||||
|
this.output.Print($"tank: {tank}");
|
||||||
if (tank == null)
|
if (tank == null)
|
||||||
{
|
{
|
||||||
this.Print("Cannot find the missile hydrogen tank");
|
this.Print("Cannot find the missile hydrogen tank");
|
||||||
|
|
@ -132,7 +148,6 @@ namespace IngameScript
|
||||||
}
|
}
|
||||||
|
|
||||||
tank.Stockpile = true;
|
tank.Stockpile = true;
|
||||||
connector.Connect();
|
|
||||||
|
|
||||||
this.missile = new Missile(tank, connector, mergeBlock, programmableBlock);
|
this.missile = new Missile(tank, connector, mergeBlock, programmableBlock);
|
||||||
|
|
||||||
|
|
@ -140,7 +155,7 @@ namespace IngameScript
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case State.FILLING_TANK:
|
case State.FILLING_TANK:
|
||||||
this.Print($"Waiting missile tank filled... ({this.missile.Tank.FilledRatio * 100:.0}%)");
|
this.Print("Waiting missile tank filled...");
|
||||||
|
|
||||||
if (this.missile.Tank.FilledRatio >= Program.HYDRO_TANK_FILLED_PERCENT / 100)
|
if (this.missile.Tank.FilledRatio >= Program.HYDRO_TANK_FILLED_PERCENT / 100)
|
||||||
{
|
{
|
||||||
|
|
@ -160,7 +175,6 @@ namespace IngameScript
|
||||||
this.missile.MergeBlock.Enabled = false;
|
this.missile.MergeBlock.Enabled = false;
|
||||||
this.connector.Disconnect();
|
this.connector.Disconnect();
|
||||||
this.currentState = State.NOMINAL;
|
this.currentState = State.NOMINAL;
|
||||||
this.missile = null;
|
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|
@ -184,25 +198,32 @@ namespace IngameScript
|
||||||
public const string MISSILE_GRID_PREFIX = "[PM]";
|
public const string MISSILE_GRID_PREFIX = "[PM]";
|
||||||
public const double HYDRO_TANK_FILLED_PERCENT = 20;
|
public const double HYDRO_TANK_FILLED_PERCENT = 20;
|
||||||
|
|
||||||
|
const string LAUNCHER_GRID_NAME = "Launcher"; // Following by a number: "01", "02", etc.
|
||||||
const string LAUNCHER_SMALL_CONNECTOR_NAME = "Connector Launcher"; // Following by a number: "01", "02", etc.
|
const string LAUNCHER_SMALL_CONNECTOR_NAME = "Connector Launcher"; // Following by a number: "01", "02", etc.
|
||||||
|
//const string WELDER_NAME_GROUP = "Welder {0:00}"; // Example for group 1: ["Welder 01A", "Welder 01B", "Welder 01C"].
|
||||||
|
|
||||||
const float EPSILON = 0.05f;
|
const float EPSILON = 0.05f;
|
||||||
|
|
||||||
readonly Output output;
|
readonly Output output;
|
||||||
|
|
||||||
readonly List<Launcher> launchers = new List<Launcher>();
|
IMyCubeGrid grid;
|
||||||
|
|
||||||
|
List<Launcher> launchers = new List<Launcher>();
|
||||||
int nbLaunched = 0;
|
int nbLaunched = 0;
|
||||||
int nextToLaunch = 0;
|
int nextToLaunch = 0;
|
||||||
|
|
||||||
State currentState = State.NOMINAL;
|
State currentState = State.NOMINAL;
|
||||||
|
|
||||||
|
//bool continuous_launching = false;
|
||||||
|
|
||||||
public Program()
|
public Program()
|
||||||
{
|
{
|
||||||
var output = this.Me.GetSurface(0);
|
var output = this.Me.GetSurface(0);
|
||||||
this.output = new Output(output);
|
this.output = new Output(output);
|
||||||
this.output.Print("Missile launcher system starting...");
|
this.output.Print("Missile launcher system starting...");
|
||||||
|
|
||||||
|
this.grid = this.Me.CubeGrid;
|
||||||
|
|
||||||
var connectorNamePrefix = String.Format("{0} {1} ", GRID_PREFIX, LAUNCHER_SMALL_CONNECTOR_NAME);
|
var connectorNamePrefix = String.Format("{0} {1} ", GRID_PREFIX, LAUNCHER_SMALL_CONNECTOR_NAME);
|
||||||
|
|
||||||
// Find all launcher sub-grid and create the associated launcher.
|
// Find all launcher sub-grid and create the associated launcher.
|
||||||
|
|
@ -212,15 +233,30 @@ namespace IngameScript
|
||||||
(IMyShipConnector connector) => connector.CustomName.StartsWith(connectorNamePrefix)
|
(IMyShipConnector connector) => connector.CustomName.StartsWith(connectorNamePrefix)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
this.output.Print($"launcherConnectors.Count = {launcherConnectors.Count}");
|
||||||
|
|
||||||
foreach (var connector in launcherConnectors)
|
foreach (var connector in launcherConnectors)
|
||||||
|
//for (int i = 0; i < launcherConnectors.Count; i++)
|
||||||
{
|
{
|
||||||
var n = int.Parse(connector.CustomName.Substring(connectorNamePrefix.Length));
|
var n = int.Parse(connector.CustomName.Substring(connectorNamePrefix.Length));
|
||||||
this.launchers.Add(new Launcher(n, this.GridTerminalSystem, this.output, connector));
|
this.output.Print($"n = {n}");
|
||||||
|
|
||||||
|
//var n = i + 1;
|
||||||
|
//var connector = launcherConnectors[i];
|
||||||
|
|
||||||
|
// Find associated welders.
|
||||||
|
//var welders = new List<IMyShipWelder>();
|
||||||
|
//this.GridTerminalSystem.GetBlocksOfType(
|
||||||
|
// welders,
|
||||||
|
// (IMyShipWelder welder) => welder.CustomName.StartsWith(String.Format("{0} {1}", GRID_PREFIX, String.Format(WELDER_NAME_GROUP, n)))
|
||||||
|
//);
|
||||||
|
|
||||||
|
this.launchers.Add(new Launcher(n, this.GridTerminalSystem, connector.CubeGrid, this.output, connector));
|
||||||
}
|
}
|
||||||
|
|
||||||
this.Runtime.UpdateFrequency = UpdateFrequency.Update100;
|
this.Runtime.UpdateFrequency = UpdateFrequency.Update100;
|
||||||
|
|
||||||
this.output.Print($"Missile launcher system started ({this.launchers.Count} launcher(s))");
|
this.output.Print("Missile launcher system started");
|
||||||
}
|
}
|
||||||
|
|
||||||
void LaunchNext()
|
void LaunchNext()
|
||||||
|
|
@ -229,11 +265,10 @@ namespace IngameScript
|
||||||
{
|
{
|
||||||
this.launchers[this.nextToLaunch].Launch();
|
this.launchers[this.nextToLaunch].Launch();
|
||||||
this.nextToLaunch = (this.nextToLaunch + 1) % this.launchers.Count;
|
this.nextToLaunch = (this.nextToLaunch + 1) % this.launchers.Count;
|
||||||
this.nbLaunched += 1;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void ResetToNominal()
|
void Reset()
|
||||||
{
|
{
|
||||||
this.nbLaunched = 0;
|
this.nbLaunched = 0;
|
||||||
this.currentState = State.NOMINAL;
|
this.currentState = State.NOMINAL;
|
||||||
|
|
@ -245,13 +280,13 @@ namespace IngameScript
|
||||||
{
|
{
|
||||||
case State.LAUNCHING_ONE:
|
case State.LAUNCHING_ONE:
|
||||||
this.LaunchNext();
|
this.LaunchNext();
|
||||||
this.ResetToNominal();
|
this.Reset();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case State.LAUNCHING_ALL:
|
case State.LAUNCHING_ALL:
|
||||||
if (this.nbLaunched >= launchers.Count)
|
if (this.nbLaunched >= launchers.Count)
|
||||||
{
|
{
|
||||||
this.ResetToNominal();
|
this.Reset();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
@ -270,6 +305,7 @@ namespace IngameScript
|
||||||
|
|
||||||
public void Save()
|
public void Save()
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Main(string argument, UpdateType updateSource)
|
public void Main(string argument, UpdateType updateSource)
|
||||||
|
|
@ -299,7 +335,7 @@ namespace IngameScript
|
||||||
|
|
||||||
case "STOP":
|
case "STOP":
|
||||||
this.output.Print("Stopping lauching...");
|
this.output.Print("Stopping lauching...");
|
||||||
this.ResetToNominal();
|
this.currentState = State.NOMINAL;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue