Beispiel #1
0
 public void Update()
 {
     if (m_player.Controller.ControlledEntity != null)
     {
         var controlledEntity = m_player.Controller.ControlledEntity.Entity;
         if (controlledEntity != null)
         {
             m_navigation.Update();
             m_navigation.DebugDraw();
             if (MyDebugDrawSettings.ENABLE_DEBUG_DRAW)
             {
                 VRageRender.MyRenderProxy.DebugDrawSphere(m_navigation.PositionAndOrientation.Translation, 0.15f, Color.White.ToVector3(), 1.0f, false);
             }
             if (BehaviorTree != null)
             {
                 BehaviorTree.Tick(this);
             }
         }
     }
 }
        protected virtual void UpdateInternal()
        {
            m_navigation.Update(m_botMemory.TickCounter);
            m_botLogic.Update();

            if (m_joinRequestSent == false && m_botDefinition.FactionTag != null && m_botDefinition.FactionTag.Length > 0)
            {
                var upper          = m_botDefinition.FactionTag.ToUpperInvariant();
                var desiredFaction = MySession.Static.Factions.TryGetFactionByTag(upper);
                if (desiredFaction == null)
                {
                    return;
                }

                var identityId = AgentEntity.ControllerInfo.ControllingIdentityId;
                var faction    = MySession.Static.Factions.TryGetPlayerFaction(identityId);
                if (faction == null && !m_joinRequestSent)
                {
                    MyFactionCollection.SendJoinRequest(desiredFaction.FactionId, identityId);
                    m_joinRequestSent = true;
                }
            }
        }
Beispiel #3
0
 protected virtual void UpdateInternal()
 {
     m_navigation.Update();
     AgentActions.AiTargetBase.Update();
     m_botLogic.Update();
 }