public int TickCounter { get; private set; } // Can be used by actions to check, whether something happened in the same frame public MyBotMemory Clone() { // creates copy of current memory state MyBotMemory copy = new MyBotMemory(m_memoryUser); copy.m_behaviorTree = m_behaviorTree; MyObjectBuilder_BotMemory memoryBuilder = new MyObjectBuilder_BotMemory(); memoryBuilder = GetObjectBuilder(); copy.Init(memoryBuilder); return copy; }
public MyAgentBot(MyPlayer player, MyBotDefinition botDefinition) { m_player = player; m_navigation = new MyBotNavigation(); m_actionCollection = null; m_botMemory = new MyBotMemory(this); m_botDefinition = botDefinition as MyAgentDefinition; m_player.Controller.ControlledEntityChanged += Controller_ControlledEntityChanged; m_navigation.ChangeEntity(m_player.Controller.ControlledEntity); }
} // Can be used by actions to check, whether something happened in the same frame public MyBotMemory Clone() { // creates copy of current memory state MyBotMemory copy = new MyBotMemory(m_memoryUser); copy.m_behaviorTree = m_behaviorTree; MyObjectBuilder_BotMemory memoryBuilder = new MyObjectBuilder_BotMemory(); memoryBuilder = GetObjectBuilder(); copy.Init(memoryBuilder); return(copy); }
public MySandboxBot(MyPlayer botPlayer, MyBotDefinition botDefinition) { m_definition = botDefinition as MyAgentDefinition; m_player = botPlayer; m_navigation = new MyBotNavigation(); m_respawnRequestSent = false; m_actionCollection = null; m_botMemory = new MyBotMemory(this); m_player.Controller.ControlledEntityChanged += Controller_ControlledEntityChanged; m_navigation.ChangeEntity(m_player.Controller.ControlledEntity); }
public MyAgentBot(MyPlayer player, MyBotDefinition botDefinition) { this.m_player = player; this.m_navigation = new MyBotNavigation(); this.m_actionCollection = null; this.m_botMemory = new MyBotMemory(this); this.m_botDefinition = botDefinition as MyAgentDefinition; this.m_removeAfterDeath = this.m_botDefinition.RemoveAfterDeath; this.m_respawnRequestSent = false; this.m_botRemoved = false; this.m_player.Controller.ControlledEntityChanged += new Action <IMyControllableEntity, IMyControllableEntity>(this.Controller_ControlledEntityChanged); this.m_navigation.ChangeEntity(this.m_player.Controller.ControlledEntity); MyCestmirDebugInputComponent.PlacedAction += new Action <Vector3D, MyEntity>(this.DebugGoto); }
public MyAgentBot(MyPlayer player, MyBotDefinition botDefinition) { m_player = player; m_navigation = new MyBotNavigation(); m_actionCollection = null; m_botMemory = new MyBotMemory(this); m_botDefinition = botDefinition as MyAgentDefinition; m_removeAfterDeath = m_botDefinition.RemoveAfterDeath; m_respawnRequestSent = false; m_botRemoved = false; m_player.Controller.ControlledEntityChanged += Controller_ControlledEntityChanged; m_navigation.ChangeEntity(m_player.Controller.ControlledEntity); Sandbox.Game.Gui.MyCestmirDebugInputComponent.PlacedAction += DebugGoto; }
public void ReturnToLastMemory() { if ( m_LastBotMemory != null ) m_botMemory = m_LastBotMemory; }