Ejemplo n.º 1
0
        private int SpawnNewBotInternal(MyAgentDefinition agentDefinition, Vector3D?spawnPosition = null, bool createdByPlayer = false)
        {
            var currentHighestBotID = MyAIComponent.GenerateBotId(m_lastSpawnedBot);
            var newBotId            = currentHighestBotID;

            EnsureIdentityUniqueness(newBotId);
            m_agentsToSpawn[newBotId] = new AgentSpawnData(agentDefinition, spawnPosition, createdByPlayer);
            m_lastSpawnedBot          = newBotId;

            Sync.Players.RequestNewPlayer(newBotId, MyDefinitionManager.Static.GetRandomCharacterName(), agentDefinition.BotModel);
            return(newBotId);
        }
Ejemplo n.º 2
0
        private int SpawnNewBotInternal(MyAgentDefinition agentDefinition, Vector3D?spawnPosition = null, bool createAlways = false)
        {
            var currentHighestBotID = MyAIComponent.GenerateBotId(m_lastSpawnedBot);
            var newBotId            = currentHighestBotID;

            EnsureIdentityUniqueness(newBotId);
            m_agentsToSpawn[newBotId] = new AgentSpawnData(agentDefinition, spawnPosition, createAlways);
            m_lastSpawnedBot          = newBotId;

            Sync.Players.RequestNewPlayer(newBotId, agentDefinition.DisplayNameText, agentDefinition.BotModel);
            return(newBotId);
        }