public MyAnimalBotLogic(MyAnimalBot bot) : base(bot) { MyBotNavigation navigation = this.AnimalBot.Navigation; navigation.AddSteering(new MyTreeAvoidance(navigation, 0.1f)); this.m_characterAvoidance = new MyCharacterAvoidance(navigation, 1f); navigation.AddSteering(this.m_characterAvoidance); navigation.MaximumRotationAngle = new float?(MathHelper.ToRadians((float)23f)); }
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 void EnableCharacterAvoidance(bool isTrue) { MyBotNavigation navigation = this.AnimalBot.Navigation; bool flag = navigation.HasSteeringOfType(this.m_characterAvoidance.GetType()); if (isTrue && !flag) { navigation.AddSteering(this.m_characterAvoidance); } else if (!isTrue & flag) { navigation.RemoveSteering(this.m_characterAvoidance); } }
public MyTreeAvoidance(MyBotNavigation navigation, float weight) : base(navigation, weight) { }
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 MyBotAiming(MyBotNavigation parent) { m_parent = parent; m_mode = AimingMode.FOLLOW_MOVEMENT; m_rotationHint = Vector3.Zero; }
public MyCharacterAvoidance(MyBotNavigation botNavigation, float weight) : base(botNavigation, weight) { }