protected virtual void Controller_ControlledEntityChanged(IMyControllableEntity oldEntity, IMyControllableEntity newEntity) { if (oldEntity == null && newEntity is MyCharacter) { EraseRespawn(); } m_navigation.ChangeEntity(newEntity); m_navigation.AimWithMovement(); var newCharacter = newEntity as MyCharacter; if (newCharacter != null) { var character = m_player.Controller.ControlledEntity as MyCharacter; var jetpack = newCharacter.JetpackComp; if (jetpack != null) { jetpack.TurnOnJetpack(false); } } if (HasLogic) { m_botLogic.OnControlledEntityChanged(newEntity); } }
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); }
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 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); }
protected virtual void Controller_ControlledEntityChanged(IMyControllableEntity oldEntity, IMyControllableEntity newEntity) { if (oldEntity == null && newEntity is MyCharacter) { m_deathTimestamp = 0; m_respawnRequestSent = false; } m_navigation.ChangeEntity(newEntity); m_navigation.ResetAiming(true); if (HasLogic) { m_botLogic.OnControlledEntityChanged(newEntity); } }
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; }
void Controller_ControlledEntityChanged(Entities.IMyControllableEntity oldEntity, Entities.IMyControllableEntity newEntity) { m_navigation.ChangeEntity(newEntity); }
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); }