public virtual void Init(MyObjectBuilder_Bot botBuilder) { MyObjectBuilder_AgentBot bot = botBuilder as MyObjectBuilder_AgentBot; if (bot != null) { this.m_deathCountdownMs = bot.RespawnCounter; if (this.AgentDefinition.FactionTag != null) { MyFaction faction = MySession.Static.Factions.TryGetOrCreateFactionByTag(this.AgentDefinition.FactionTag); if (faction != null) { MyFactionCollection.SendJoinRequest(faction.FactionId, this.Player.Identity.IdentityId); this.m_joinRequestSent = true; } } if (bot.AiTarget != null) { this.AgentActions.AiTargetBase.Init(bot.AiTarget); } if (botBuilder.BotMemory != null) { this.m_botMemory.Init(botBuilder.BotMemory); } MyAIComponent.Static.BehaviorTrees.SetBehaviorName(this, bot.LastBehaviorTree); } }
public virtual MyObjectBuilder_Bot GetBotData() { MyObjectBuilder_AgentBot botData = new MyObjectBuilder_AgentBot(); // MW:TODO replace with proper object builders botData.BotDefId = BotDefinition.Id; botData.AiTarget = AgentActions.AiTarget.GetObjectBuilder(); botData.BotMemory = m_botMemory.GetObjectBuilder(); botData.LastBehaviorTree = BehaviorSubtypeName; return(botData); }
public virtual MyObjectBuilder_Bot GetObjectBuilder() { MyObjectBuilder_AgentBot botData = MyAIComponent.BotFactory.GetBotObjectBuilder(this) as MyObjectBuilder_AgentBot; botData.BotDefId = BotDefinition.Id; botData.AiTarget = AgentActions.AiTargetBase.GetObjectBuilder(); botData.BotMemory = m_botMemory.GetObjectBuilder(); botData.LastBehaviorTree = BehaviorSubtypeName; botData.RemoveAfterDeath = m_removeAfterDeath; botData.RespawnCounter = m_deathCountdownMs; return(botData); }
public virtual MyObjectBuilder_Bot GetBotData() { MyObjectBuilder_AgentBot botData = new MyObjectBuilder_AgentBot(); // MW:TODO replace with proper object builders botData.BotDefId = BotDefinition.Id; botData.AiTarget = AgentActions.AiTargetBase.GetObjectBuilder(); botData.BotMemory = m_botMemory.GetObjectBuilder(); botData.LastBehaviorTree = BehaviorSubtypeName; botData.RemoveAfterDeath = m_removeAfterDeath; botData.RespawnCounter = m_deathCountdownMs; return(botData); }
public virtual MyObjectBuilder_Bot GetObjectBuilder() { MyObjectBuilder_AgentBot botObjectBuilder = MyAIComponent.BotFactory.GetBotObjectBuilder(this) as MyObjectBuilder_AgentBot; botObjectBuilder.BotDefId = (SerializableDefinitionId)this.BotDefinition.Id; botObjectBuilder.AiTarget = this.AgentActions.AiTargetBase.GetObjectBuilder(); botObjectBuilder.BotMemory = this.m_botMemory.GetObjectBuilder(); botObjectBuilder.LastBehaviorTree = this.BehaviorSubtypeName; botObjectBuilder.RemoveAfterDeath = this.m_removeAfterDeath; botObjectBuilder.RespawnCounter = this.m_deathCountdownMs; return(botObjectBuilder); }