Jump to content


Photo

AI troubleshooting


10 replies to this topic

#1 Moreartillery

Moreartillery
  • Members
  • 246 posts
  • Projects:Cinematic Battles

Posted 28 July 2019 - 09:06 AM

I'm trying to add sisters of battle to dark crusade. I copied the spacemarine files, renamed them and changed the function names etc. I can't figure out why it won't work because its almost the same as the spacemarine ai. Corsix didn't find any lua errors.

-- Log file for all error messages related to the AI --

Loading Insane AI...
RaceLoader: Init global race info...
RaceLoader: Init guard_race...
RaceLoader: Create build base strategy of race AI guard_race...
player 1001 has chosen strategy: 2
player 1001 has chosen squadlimits: standard
gametime: 0
Loading Insane AI...
RaceLoader: Init global race info...
RaceLoader: Init sisters_race...
 *ALERT: MilitaryManager:Update() threw exception (lua runtime error)
  Lua             Core/cpu_manager.ai            Ln 1223 (?)
  Lua             Core/cpu_manager.ai            Ln  362 (Initialize)
  Lua             DATA:AI/default.ai             Ln  115 (InitializeAI)
  main            DATA:AI/default.ai             Ln  133 ((null))
Error loading script file 'DATA:AI/default.ai' for race 'sisters_race'!

----------------------------------------
-- File: 'sistersloader.ai'
-- Edited by Arkhan		@ 23.10.2006
-- Renamed by Corsix    @ 13.02.2006
-- Edited by Thudmeizer @ 14.10.2006
-- Edited by Moar Artillery  @ 21.07.2019

class 'sisters_race'

-- Constructor
function sisters_race:__init()

end

-- Returns the name of the race
function sisters_race:GetRaceName()
	return "sisters_race"
end

-- This function is called if the race is being played
function sisters_race:LoadRace( eDifficulty )

	-- Import strategies
	import( 'Races/sisters_race/Strategies/SistersBuildBaseStrategy.ai' )
	
	-- Import strategy info
	import( "Races/sisters_race/Strategies/SistersStrategyInfo.ai" )
	
	-- Import tactics
	import( 'Races/sisters_race/Tactics/SistersInfantryTactic.ai' )
	return true
end

-- This function is called even if space marines are not the race being played
function sisters_race:LoadGlobalInfo()

	-- Import info files
	import( 'Races/sisters_race/Info/sistersunitstats.ai' )
	
	-- Add race unit stats
	table.insert(UnitStats, SistersUnitStats)
	return true
end

-- Creates build base strategy
function sisters_race:CreateBuildBaseStrategy()
	return SistersBuildBaseStrategy(BuildBaseStrategyInfo)
end

-- Creates a special tactic for a unit
function sisters_race:CreateTactic(oSquadAI)

	-- Get unit name and class
	local sUnitName = oSquadAI:GetSquadName()
	local eClass = oSquadAI:GetStats():GetClass()
	
	-- Check if there is a special tactic for the unit available
	--local bVehicle = (eClass == UnitStatsAI.UC_VehicleLow or eClass == UnitStatsAI.UC_VehicleMed or eClass == UnitStatsAI.UC_VehicleHigh)
	--local bAirPlane = (eClass == UnitStatsAI.UC_AirLow or eClass == UnitStatsAI.UC_AirMed or eClass == UnitStatsAI.UC_AirHigh)
	if (sUnitName == "sisters_squad_servitor") then
		return SistersServitorTactic(oSquadAI)
	--elseif (sUnitName == "sisters_squad_repentia") then
	--	return SistersRepentiaTactic(oSquadAI)
	--elseif (sUnitName == "sisters_squad_missionary") then
	--	return SistersMissionaryTactic(oSquadAI)
	--elseif (sUnitName == "sisters_squad_seraphim") then
	--	return SistersSeraphimTactic(oSquadAI)
	--elseif (sUnitName == "sisters_squad_celestian") then
	--	return SistersCelestianTactic(oSquadAI)
	--elseif (sUnitName == "sisters_squad_canoness") then
	--	return SistersCanonessTactic(oSquadAI)
	--elseif (sUnitName == "sisters_squad_confessor") then
	--	return SistersConfessorTactic(oSquadAI)
	--elseif (sUnitName == "sisters_squad_rhino") then
	--	return SistersRhinoTactic(oSquadAI)
	--elseif (sUnitName == "sisters_squad_immolator_tank") then
	--	return SistersImmolatorTactic(oSquadAI)
	--elseif (sUnitName == "sisters_squad_exorcist_tank") then
	--	return SistersExorcistTactic(oSquadAI)
	--elseif (sUnitName == "sisters_squad_living_saint") then
	--	return SistersLivingSaintTactic(oSquadAI)
	--elseif (bVehicle or bAirPlane) then
	--	return SistersVehicleTactic(oSquadAI)
	end
	return SistersInfantryTactic(oSquadAI)
end

-- Creates a base tactic
function sisters_race:CreateBaseTactic(oBuilding)

	-- Get building name
	local sBuildingName = oBuilding:GetBaseName()
	
	-- Check if their is a special tactic for the building available
	if (sBuildingName == "sisters_infantry") then
		return MarineBarracksTactic(oBuilding)
	end
	return nil
end

-- Returns a specific information
function sisters_race:GetInfo(sType)

	-- Check info type
	if (sType == "TurretPower") then
		return 500
	elseif (sType == "SupportAllyFactor") then
		return 9 / 4
	elseif (sType == "AttackModifier") then
		return 10
	elseif (sType == "CriticalRangeIncreasePerTier") then
		return 10
	elseif (sType == "MinArmyStrengthPerTier") then
		return 750
	elseif (sType == "AttackRatio") then
		return 4 / 5
	elseif (sType == "RetreatRatio") then
		return 3 / 5
	elseif (sType == "InvisibleBuildings") then
		return false
	end
	return nil
end

-- Returns the building type and threat
function sisters_race:GetBuildingType(sBuildingName)

	-- Return race specific object string
	if (sBuildingName == "sisters_hq") then
		return "HQ", 0
	end
	return nil, 0
end
----------------------------------------
-- File: 'sistersbuildbasestrategy.ai'
-- Edited by Thudmeizer @ 20.03.2007
-- Edited by Corsix     @ 15.01.2005
-- Edited by LarkinVB   @ 29.09.2005
-- Edited by Arkhan     @ 09.03.2006
-- Edited by Moar Artillery  @ 17.07.2019

class 'SistersBuildBaseStrategy' (BuildBaseStrategy)

function SistersBuildBaseStrategy:__init( baseinfo ) super( baseinfo )

	-- Add detector units (Best first, worst last)

end

function SistersBuildBaseStrategy:ChooseBuildProgram()

	-- Check build program count
	if (table.getn(self.info.BuildPrograms) ~= 4) then
		return BuildBaseStrategy.ChooseBuildProgram(self)
	end

	-- Get map size and closest enemy distance
	local sMapSize, iClosestEnemyDistance = self:GetMapSize()
		
	-- Set probabilities of the strategies according to the map size
	local iBuildProgram1	-- Basic strategy
	local iBuildProgram2	-- Infantry strategy
	local iBuildProgram3	-- Fast Attack strategy
	local iBuildProgram4	-- Tank	strategy
	
	-- Now choose a program
	local oEnemy = cpu_manager:FindClosestEnemyPlayer(false)
	local sEnemy = oEnemy:GetPlayerRaceName()	
	if (sEnemy == "sisters_race" or sEnemy == "space_marine_race" or sEnemy == "chaos_marine_race" or sEnemy == "necron_race") and (iClosestEnemyDistance <= 300) then
		return 3
		
	elseif (sEnemy == "guard_race" or sEnemy == "ork_race" or sEnemy == "eldar_race" or sEnemy == "tau_race") and (iClosestEnemyDistance <= 300) then
		return 2
		
	elseif (iClosestEnemyDistance > 300) then
		return math.random(3, 4)
	end
end	
-- < less then

function SistersBuildBaseStrategy:SetSquadLimitsBasedOnStrategy(iStrategy)
	if iStrategy == 1 then
        -- Basic strategy
		BuildBaseStrategyInfo.sisters_race.SquadLimits.standard.sisters_squad_servitor = 4
		BuildBaseStrategyInfo.sisters_race.SquadLimits.standard.sisters_squad_battle_sister = 4
	
	elseif iStrategy == 2 then
        -- Infantry strategy
		BuildBaseStrategyInfo.sisters_race.SquadLimits.standard.sisters_squad_servitor = 4
		BuildBaseStrategyInfo.sisters_race.SquadLimits.standard.sisters_squad_battle_sister = 4

	elseif iStrategy == 3 then
        -- Fast Attack strategy
		BuildBaseStrategyInfo.sisters_race.SquadLimits.standard.sisters_squad_servitor = 4
		BuildBaseStrategyInfo.sisters_race.SquadLimits.standard.sisters_squad_battle_sister = 4

	elseif iStrategy == 4 then
        -- Tank	strategy
		BuildBaseStrategyInfo.sisters_race.SquadLimits.standard.sisters_squad_servitor = 4
		BuildBaseStrategyInfo.sisters_race.SquadLimits.standard.sisters_squad_battle_sister = 4
	end
end

function SistersBuildBaseStrategy:GetBuildingName( sType )

	-- Return race specific object string
	if (sType == "HQ") then
		return "sisters_hq"
		
	elseif (sType == "Generator") then
		return "sisters_plasma_generator"
		
	elseif (sType == "BiggerGenerator") then
		return "sisters_thermo_plasma"
		
	elseif (sType == "VehicleBuilding") then
		return "sisters_vehicle_building"
		
	elseif (sType == "ListeningPost") then
		return "sisters_listening_post"
		
	elseif (sType == "Turret") then
		return "sisters_turret_flamer"
		
	elseif (sType == "Mine") then
		return "sisters_mines"
	end
	
	return nil
end

function SistersBuildBaseStrategy:GetAddonBuilding( sType )

	if (sType == "addon_sisters_turret") then
		return "sisters_turret_flamer"
		
	elseif (sType == "addon_sisters_list_post_1") then
		return "sisters_listening_post"
		
	elseif (sType == "addon_sisters_list_post_2") then
		return "sisters_listening_post"

	elseif (sType == "addon_sisters_holy_icon") then
		return "sisters_listening_post"
		
	elseif (sType == "addon_sisters_hq_1") then
		return "sisters_hq"
		
	elseif (sType == "addon_sisters_hq_2") then
		return "sisters_hq"
	end
	return nil
end

-- Inherited method to check if an addon is a tier addon
function SistersBuildBaseStrategy:IsTierAddon( sName, iTargetTier )

	-- Check addon name and target tier
	if (sName == "addon_sisters_hq_1" and iTargetTier == 2) then
		return true
	elseif (sName == "addon_sisters_hq_2" and iTargetTier == 3) then
		return true
	end
	return false
end

-- Returns the squad cap and support cap of the given squad
function SistersBuildBaseStrategy:GetUnitStats(sSquadName)

	if (sSquadName == "sisters_squad_missionary") then
		return 0, 0
	elseif (sSquadName == "sisters_squad_battle_sister") then
		return 0, 0
	elseif (sSquadName == "sisters_squad_seraphim") then
		return 0, 0
	elseif (sSquadName == "sisters_squad_celestian") then
		return 0, 0
	elseif (sSquadName == "sisters_squad_assassin") then
		return 0, 0
	elseif (sSquadName == "sisters_squad_repentia") then
		return 0, 0
	elseif (sSquadName == "sisters_squad_rhino") then
		return 0, 0
	elseif (sSquadName == "sisters_squad_immolator_tank") then
		return 0, 0
	elseif (sSquadName == "sisters_squad_lightning") then
		return 0, 0
	elseif (sSquadName == "sisters_squad_exorcist_tank") then
		return 0, 3
	elseif (sSquadName == "sisters_squad_penitent_engine") then
		return 0, 0
	end
	return 0, 0
end


function SistersBuildBaseStrategy:UpdateTierLevel()

	-- Reset tier level
	self.tierLevel = 1
	
	-- Prepare
	local iHQAddon1ID = cpu_manager.stats:GetAddOnID("addon_sisters_hq_1")
	local iHQAddon2ID = cpu_manager.stats:GetAddOnID("addon_sisters_hq_2")
	local oStats = cpu_manager.stats:GetPlayerStatsFromID( cpu_manager.player_id )
	
	-- Check HQ's for addons
	for oBase in oStats:GetBases() do
	
		-- Check for valid building
		if (oBase:IsValid() and not oBase:IsListeningPost()) then

			-- Check for HQ addon 2
			if (oBase:HasAddOn(iHQAddon2ID)) then
			
				-- We still have the proper building
				if (self:GetBuildingCountByName("sisters_shrine") > 0) then
					self.tierLevel = 4
					return
				else
					self.tierLevel = 3
					return
				end
			
				-- Check for HQ addon 1
				elseif (oBase:HasAddOn(iHQAddon1ID)) then
				self.tierLevel = 2
			end
		end
	end
end

function SistersBuildBaseStrategy:BuildFlexible()

	-- Dynamic research
	-- Item-Syntax: ResearchName, MinTier, RequisitionCost, PowerCost, MinSquadCap, MinSupportCap, SquadName, SquadMinCount

	
	-- Restrict dynamic builds to hard difficulty or higher
	if (CpuManager.AISettings.bMultiBuildings) then
	
		-- Dynamic buildings
		-- Item-Syntax: BuildingName, BuildingCount, MinTier, MinRequisition, MinPower, MinSquadCap, MinSupportCap
		self:DynamicBuild("sisters_infantry", 2, 1, 800, 0, 0, 0)
	end
end

-- Arkhan 01.2006: Method to check if force tech should be computed
function SistersBuildBaseStrategy:ForceTech()

	-- Check time
	if (g_iGMT < 60 * DefendChokePointPlan.HarassingTime) then
		return false
	end
	
	-- Check ressources
	local iRequisition = resource_manager:GetResourceAmount():Get( ResourceAmount.RT_Requisition )
	local iPower = resource_manager:GetResourceAmount():Get( ResourceAmount.RT_Power )

	-- Check tier
	local iTierLevel = self:GetTierLevel()
	if (iTierLevel == 1) then
	
		-- Check resources
		if (iRequisition > 600 and iPower > 200) then
			return false
		end
		return not self.m_bHQAddon1
		
	elseif (iTierLevel == 2) then

		-- Check build channel for machine cult
		iID = cpu_manager.stats:GetBuildingID("sisters_vehicle_building")
		local bHasVehicleBuilding = false
		for oBuildChannel in build_manager:GetBuildChannelAIs() do
		
			-- Check building ID
			if (oBuildChannel:GetBlueprintID() == iID) then
				bHasVehicleBuilding = true
				break
			end
		end
		if (not bHasVehicleBuilding) then
			return true
		end
		
		-- Check time
		if (g_iGMT > 60 * 12 and (iRequisition < 600 or iPower < 600)) then
			return true
		end
		
	elseif (iTierLevel == 3) then	

		-- Check time
		if (g_iGMT > 60 * 19 and (iRequisition < 600 or iPower < 600)) then
			return true
		end
	end
	return false
end

-- Return placement type for buildings
function SistersBuildBaseStrategy:GetPlacementType(iBuildingID)
	
	-- Check building
	if (cpu_manager:IsHQ(iBuildingID)) then
		return "HQ"
	elseif (iBuildingID == cpu_manager.stats:GetBuildingID("sisters_infantry") or
		iBuildingID == cpu_manager.stats:GetBuildingID("sisters_vehicle_building") or
		iBuildingID == cpu_manager.stats:GetBuildingID("sisters_shrine")) then
		return "Military"
	elseif (cpu_manager:IsTurret(iBuildingID)) then
		return "Front2"		
	elseif (cpu_manager:IsMine(iBuildingID)) then
		return "Mine"
	elseif (cpu_manager:IsGenerator(iBuildingID) or
		iBuildingID == cpu_manager.stats:GetBuildingID("sisters_sanctuary") or
		iBuildingID == cpu_manager.stats:GetBuildingID("sisters_holy_reliquary")) then
		return "BaseBack"
	end
	return "Basic"
end

-- Inherited method to modify squad demand
function SistersBuildBaseStrategy:ModifySquadDemand(iUnitID)

	-- No more missionaries then squads 
	if (iUnitID == cpu_manager.stats:GetSquadID("sisters_squad_missionary")) then
		
		-- Check number of attachable squads 
		local miss_attach = function ( squad_ai )
			return (squad_ai:GetTactic():GetUnitStrength() >= 250 and squad_ai:CanReceiveAttachment())
		end
		local num_attach = self:CountSquads("sisters_squad_battle_sister", miss_attach) +
				   self:CountSquads("sisters_squad_celestian", miss_attach) +
				   self:CountSquads("sisters_squad_repentia", miss_attach) 
 
 		-- Check miss count
		local num_miss = self:CountSquads("sisters_squad_missionary")
		if (num_miss >= num_attach) then
			return 0
		end	
	end

	-- Only build rhinos if we've full support cap
	if (iUnitID == cpu_manager.stats:GetSquadID("sisters_squad_rhino")) then
		
		-- Check army strength
		if (cpu_manager:GetArmyStrength() < 4000) then
			return 0
		end
	end
	
	return BuildBaseStrategy.ModifySquadDemand(self, iUnitID)
end

-- Arkhan 11.2006: Virtual method for checking out relic units
function SistersBuildBaseStrategy:RelicRequired(sName)

	-- Check name
	if (sName == "sisters_squad_living_saint") then
		return true
	end
	return false
end

----------------------------------------
-- File: 'sistersstrategyinfo.ai'
-- Created by Arkhan     @ 12.10.2006
-- Edited by Thudmeizer  @ 20.03.2007
-- Edited by Moar Artillery   @ 17.07.2019

BuildBaseStrategyInfo = 
{
	sisters_race =
	{
		post_builder = 1,
		flag_capture = 2,

		--reserve this amount for building units/buildings (not for use in upgrading/ reinforcing)
		req_reserve = 150,
		
		--need at least this at all times
		squad_cap_threshold = 2,

		--need at least this at all times
		support_cap_threshold = 3,
		
		--used to calculate wants for engineers
		Engineers =
		{
			--number of engineers we're aiming for
			want = 5,
		},
		
		-- Is used to modify the army strength in the build programs (Allows faster balancing adjustments)
		ArmyStrengthModifier = 1.0,
		
		-- Item-Syntax: Min. Tier, Min. Requisition, Min. Power, Min. ArmyStrength, Object-Count, Object-Type, Object-Name
		BuildPrograms =
		{
			-- Allround strategy
			{
				{ 1, 200, 40, 0, 1,	"Unit",		"sisters_squad_canoness" },
				{ 1, 75, 0, 0, 1,	"Unit",		"sisters_squad_missionary" }, -- Force a capturing squad
				{ 1, 140, 0, 0, 2,	"Unit",		"sisters_squad_battle_sister" },
				{ 1, 200, 20, 0, 1,	"Unit",		"sisters_squad_seraphim" },
				{ 1, 450, 0, 0, 1,	"Building",	"sisters_hq" },
				{ 1, 250, 0, 0, 1,	"Building",	"sisters_infantry" },
				{ 1, 135, 0, 0, 1,	"Building",	"sisters_plasma_generator" },
				{ 1, 175, 50, 500, 1,	"Building",	"sisters_sanctuary" },
				{ 1, 100, 75, 750, 60,	"TurretAddon",	"addon_sisters_list_post_1" },
				{ 1, 135, 0, 0, 2,	"Building",	"sisters_plasma_generator" },
				{ 1, 90, 45, 0, 1,	"Building",	"sisters_turret_flamer" },
				{ 1, 135, 0, 1000, 3,	"Building",	"sisters_plasma_generator" },
				{ 1, 300, 125, 1000, 1,	"Addon",	"addon_sisters_hq_1" },
				{ 1, 100, 75, 250, 100,	"TurretAddon",	"addon_sisters_list_post_1" },
				{ 1, 105, 50, 500, 1,	"TurretAddon",	"addon_sisters_holy_icon" },
				{ 1, 75, 50, 500, 1,	"Research",	"sisters_laud_hailer_research" },
				{ 1, 135, 0, 500, 4,	"Building",	"sisters_plasma_generator" },

				{ 2, 200, 125, 250, 1,	"Building",	"sisters_vehicle_building" },
				{ 2, 165, 250, 0, 1,	"Unit",		"sisters_squad_immolator_tank" },
				{ 2, 180, 40, 0, 2,	"Unit",		"sisters_squad_celestian" },
				{ 2, 135, 0, 1000, 6,	"Building",	"sisters_plasma_generator" },
				{ 2, 105, 50, 1500, 60,	"TurretAddon",	"addon_sisters_holy_icon" },
				{ 2, 50, 0, 1500, 50,	"TurretAddon",	"addon_sisters_turret" },
				{ 2, 90, 45, 2000, 2,	"Building",	"sisters_turret_flamer" },
				{ 2, 25, 25, 2000, 2,	"Building",	"sisters_mines" },
				{ 2, 260, 150, 2000, 1,	"TurretAddon",	"addon_sisters_list_post_2" },
				{ 2, 340, 340, 2000, 1,	"Addon",	"addon_sisters_hq_2" },
				{ 2, 125, 50, 2000, 1,	"Building",	"sisters_holy_reliquary" },

				{ 3, 220, 80, 0, 2,	"Unit",		"sisters_squad_repentia" },
				{ 3, 90, 45, 2000, 4,	"Building",	"sisters_turret_flamer" },
				{ 3, 25, 25, 2000, 4,	"Building",	"sisters_mines" },
				{ 3, 260, 150, 2000, 50,"TurretAddon",	"addon_sisters_list_post_2" },
				{ 3, 450, 450, 2000, 1,	"Building",	"sisters_shrine" },

				{ 4, 400, 400, 0, 1,	"Unit",		"sisters_squad_living_saint" },
				{ 4, 90, 45, 2000, 6,	"Building",	"sisters_turret_flamer" },
				{ 4, 25, 25, 2000, 6,	"Building",	"sisters_mines" },
				{ 4, 260, 150, 3000, 100,"TurretAddon",	"addon_sisters_list_post_2" },
				{ 4, 450, 0, 3000, 2,	"Building",	"sisters_hq" }
			},
			
			-- Mass Battle Sisters strategy
			{
				{ 1, 0, 0, 0, 0,	"Rush", 	"Prepare" },
				{ 1, 200, 40, 0, 1,	"Unit",		"sisters_squad_canoness" },
				{ 1, 75, 0, 0, 1,	"Unit",		"sisters_squad_missionary" }, -- Force a capturing squad
				{ 1, 140, 0, 0, 3,	"Unit",		"sisters_squad_battle_sister" },
				{ 1, 450, 0, 0, 1,	"Building",	"sisters_hq" },
				{ 1, 250, 0, 0, 1,	"Building",	"sisters_infantry" },
				{ 1, 135, 0, 0, 1,	"Building",	"sisters_plasma_generator" },
				{ 1, 175, 50, 500, 1,	"Building",	"sisters_sanctuary" },
				{ 1, 100, 75, 750, 60,	"TurretAddon",	"addon_sisters_list_post_1" },
				{ 1, 135, 0, 0, 2,	"Building",	"sisters_plasma_generator" },
				{ 1, 90, 45, 0, 1,	"Building",	"sisters_turret_flamer" },
				{ 1, 135, 0, 1000, 3,	"Building",	"sisters_plasma_generator" },
				{ 1, 300, 125, 1000, 1,	"Addon",	"addon_sisters_hq_1" },
				{ 1, 100, 75, 250, 100,	"TurretAddon",	"addon_sisters_list_post_1" },
				{ 1, 105, 50, 500, 1,	"TurretAddon",	"addon_sisters_holy_icon" },
				{ 1, 135, 0, 500, 4,	"Building",	"sisters_plasma_generator" },

				{ 2, 200, 125, 250, 1,	"Building",	"sisters_vehicle_building" },
				{ 2, 165, 250, 0, 1,	"Unit",		"sisters_squad_immolator_tank" },
				{ 2, 180, 40, 0, 2,	"Unit",		"sisters_squad_celestian" },
				{ 2, 135, 0, 1000, 6,	"Building",	"sisters_plasma_generator" },
				{ 2, 105, 50, 1500, 60,	"TurretAddon",	"addon_sisters_holy_icon" },
				{ 2, 50, 0, 1500, 50,	"TurretAddon",	"addon_sisters_turret" },
				{ 2, 90, 45, 2000, 2,	"Building",	"sisters_turret_flamer" },
				{ 2, 25, 25, 2000, 2,	"Building",	"sisters_mines" },
				{ 2, 260, 150, 2000, 1,	"TurretAddon",	"addon_sisters_list_post_2" },
				{ 2, 340, 340, 2000, 1,	"Addon",	"addon_sisters_hq_2" },
				{ 2, 125, 50, 2000, 1,	"Building",	"sisters_holy_reliquary" },

				{ 3, 220, 80, 0, 2,	"Unit",		"sisters_squad_repentia" },
				{ 3, 90, 45, 2000, 4,	"Building",	"sisters_turret_flamer" },
				{ 3, 25, 25, 2000, 4,	"Building",	"sisters_mines" },
				{ 3, 260, 150, 2000, 50,"TurretAddon",	"addon_sisters_list_post_2" },
				{ 3, 450, 450, 2000, 1,	"Building",	"sisters_shrine" },

				{ 4, 400, 400, 0, 1,	"Unit",		"sisters_squad_living_saint" },
				{ 4, 90, 45, 2000, 6,	"Building",	"sisters_turret_flamer" },
				{ 4, 25, 25, 2000, 6,	"Building",	"sisters_mines" },
				{ 4, 260, 150, 3000, 100,"TurretAddon",	"addon_sisters_list_post_2" },
				{ 4, 450, 0, 3000, 2,	"Building",	"sisters_hq" }
			},
			
			-- Immolator strategy
			{
				{ 1, 0, 0, 0, 1,	"Rush", 	"Prepare" },
				{ 1, 75, 0, 0, 3,	"Unit",		"sisters_squad_servitor" },
				{ 1, 75, 0, 0, 1,	"Unit",		"sisters_squad_missionary" }, -- Force a capturing squad
				{ 1, 450, 0, 0, 1,	"Building",	"sisters_hq" },
				{ 1, 250, 0, 0, 1,	"Building",	"sisters_infantry" },
				{ 1, 135, 0, 0, 1,	"Building",	"sisters_plasma_generator" },
				{ 1, 100, 75, 0, 100,	"TurretAddon",	"addon_sisters_list_post_1" },
				{ 1, 175, 50, 0, 1,	"Building",	"sisters_sanctuary" },
				{ 1, 135, 0, 0, 3,	"Building",	"sisters_plasma_generator" },
				{ 1, 300, 125, 0, 1,	"Addon",	"addon_sisters_hq_1" },
				{ 1, 135, 0, 0, 6,	"Building",	"sisters_plasma_generator" },

				{ 2, 0, 0, 0, 1,	"Rush", 	"Prepare" },
				{ 2, 200, 125, 0, 1,	"Building",	"sisters_vehicle_building" },
				{ 2, 200, 40, 0, 1,	"Unit",		"sisters_squad_canoness" },
				{ 2, 165, 250, 0, 3,	"Unit",		"sisters_squad_immolator_tank" },
				{ 2, 140, 0, 0, 2,	"Unit",		"sisters_squad_battle_sister" },
				{ 2, 180, 40, 0, 1,	"Unit",		"sisters_squad_celestian" },
				{ 2, 0, 0, 1500, 0,	"Rush", 	"Unleash" },
				{ 2, 90, 45, 1500, 1,	"Building",	"sisters_turret_flamer" },
				{ 2, 105, 50, 1500, 60,	"TurretAddon",	"addon_sisters_holy_icon" },
				{ 2, 50, 0, 1500, 50,	"TurretAddon",	"addon_sisters_turret" },
				{ 2, 90, 45, 2000, 2,	"Building",	"sisters_turret_flamer" },
				{ 2, 25, 25, 2000, 2,	"Building",	"sisters_mines" },
				{ 2, 260, 150, 2000, 1,	"TurretAddon",	"addon_sisters_list_post_2" },
				{ 2, 340, 340, 2000, 1,	"Addon",	"addon_sisters_hq_2" },
				{ 2, 125, 50, 2000, 1,	"Building",	"sisters_holy_reliquary" },

				{ 3, 220, 80, 0, 2,	"Unit",		"sisters_squad_repentia" },
				{ 3, 90, 45, 2000, 4,	"Building",	"sisters_turret_flamer" },
				{ 3, 25, 25, 2000, 4,	"Building",	"sisters_mines" },
				{ 3, 260, 150, 2000, 50,"TurretAddon",	"addon_sisters_list_post_2" },
				{ 3, 450, 450, 2000, 1,	"Building",	"sisters_shrine" },

				{ 4, 400, 400, 0, 1,	"Unit",		"sisters_squad_living_saint" },
				{ 4, 90, 45, 2000, 6,	"Building",	"sisters_turret_flamer" },
				{ 4, 25, 25, 2000, 6,	"Building",	"sisters_mines" },
				{ 4, 260, 150, 3000, 100,"TurretAddon",	"addon_sisters_list_post_2" },
				{ 4, 450, 0, 3000, 2,	"Building",	"sisters_hq" }
			},
		
			-- Tank	strategy
			{
				{ 1, 0, 0, 0, 1,	"Rush", 	"Prepare" },
				{ 1, 75, 0, 0, 3,	"Unit",		"sisters_squad_servitor" },
				{ 1, 75, 0, 0, 1,	"Unit",		"sisters_squad_missionary" }, -- Force a capturing squad
				{ 1, 450, 0, 0, 1,	"Building",	"sisters_hq" },
				{ 1, 250, 0, 0, 1,	"Building",	"sisters_infantry" },
				{ 1, 135, 0, 0, 1,	"Building",	"sisters_plasma_generator" },
				{ 1, 100, 75, 0, 100,	"TurretAddon",	"addon_sisters_list_post_1" },
				{ 1, 175, 50, 0, 1,	"Building",	"sisters_sanctuary" },
				{ 1, 135, 0, 0, 3,	"Building",	"sisters_plasma_generator" },
				{ 1, 300, 125, 0, 1,	"Addon",	"addon_sisters_hq_1" },
				{ 1, 135, 0, 0, 6,	"Building",	"sisters_plasma_generator" },

				{ 2, 0, 0, 0, 1,	"Rush", 	"Prepare" },
				{ 2, 200, 125, 0, 1,	"Building",	"sisters_vehicle_building" },
				{ 2, 200, 40, 0, 1,	"Unit",		"sisters_squad_canoness" },
				{ 2, 100, 200, 0, 3,	"Unit",		"sisters_squad_lightning" },
				{ 2, 200, 20, 0, 2,	"Unit",		"sisters_squad_seraphim" },
				{ 2, 180, 40, 0, 1,	"Unit",		"sisters_squad_celestian" },
				{ 2, 0, 0, 1500, 0,	"Rush", 	"Unleash" },
				{ 2, 90, 45, 1500, 1,	"Building",	"sisters_turret_flamer" },
				{ 2, 105, 50, 1500, 60,	"TurretAddon",	"addon_sisters_holy_icon" },
				{ 2, 50, 0, 1500, 50,	"TurretAddon",	"addon_sisters_turret" },
				{ 2, 90, 45, 2000, 2,	"Building",	"sisters_turret_flamer" },
				{ 2, 25, 25, 2000, 2,	"Building",	"sisters_mines" },
				{ 2, 260, 150, 2000, 1,	"TurretAddon",	"addon_sisters_list_post_2" },
				{ 2, 340, 340, 2000, 1,	"Addon",	"addon_sisters_hq_2" },
				{ 2, 125, 50, 2000, 1,	"Building",	"sisters_holy_reliquary" },

				{ 3, 220, 80, 0, 2,	"Unit",		"sisters_squad_repentia" },
				{ 3, 90, 45, 2000, 4,	"Building",	"sisters_turret_flamer" },
				{ 3, 25, 25, 2000, 4,	"Building",	"sisters_mines" },
				{ 3, 260, 150, 2000, 50,"TurretAddon",	"addon_sisters_list_post_2" },
				{ 3, 450, 450, 2000, 1,	"Building",	"sisters_shrine" },

				{ 4, 165, 75, 0, 1,	"Research",	"sisters_faithful_morale_2" },
				{ 4, 400, 400, 0, 1,	"Unit",		"sisters_squad_living_saint" },
				{ 4, 90, 45, 2000, 6,	"Building",	"sisters_turret_flamer" },
				{ 4, 25, 25, 2000, 6,	"Building",	"sisters_mines" },
				{ 4, 260, 150, 3000, 100,"TurretAddon",	"addon_sisters_list_post_2" },
				{ 4, 450, 0, 3000, 2,	"Building",	"sisters_hq" }
			}
		},
				
		SquadLimits = 
		{
			standard = 
			{
				sisters_squad_living_saint = 1,
			}
		}
	},
}

BuildOrderStrategyInfo = 
{
	sisters_race =
	{
		Basic =
		{
			{ "squad", "sisters_squad_missionary" },
			{ "flag_capture" }, { "flag_capture" },
			{ "flag_capture" },
			{ "squad", "sisters_squad_missionary" },
			{ "squad", "sisters_squad_servitor" },
			{ "squad", "sisters_squad_missionary" },
			{ "squad", "sisters_squad_missionary" },
			{ "building", "sisters_infantry", true },
			{ "flag_capture" }, 
			{ "post_builder" },
			{ "flag_capture" }, 
			{ "post_builder" },
			{ "flag_capture" }, 
			{ "post_builder" },
			{ "flag_capture" }, 
			{ "post_builder" },
			{ "building", "sisters_plasma_generator" }
		},
		
		QuickStart =
		{
			{ "flag_capture" }, { "flag_capture" }, 
			{ "flag_capture" },
			{ "squad", "sisters_squad_missionary" },
			{ "squad", "sisters_squad_servitor" },
			{ "squad", "sisters_squad_missionary" },
			{ "squad", "sisters_squad_missionary" },
			{ "squad", "sisters_squad_servitor" },
			{ "post_builder" }, { "post_builder" },
			{ "building", "sisters_infantry", true },
			{ "building", "sisters_infantry", true },
			{ "building", "sisters_plasma_generator" }
		},
		
		LargeMap =
		{
			{ "flag_capture" }, { "flag_capture" }, 
			{ "flag_capture" }, { "flag_capture" },
			{ "squad", "sisters_squad_missionary" },
			{ "squad", "sisters_squad_servitor" },
			{ "squad", "sisters_squad_missionary" },
			{ "squad", "sisters_squad_missionary" },
			{ "squad", "sisters_squad_missionary" },
			{ "post_builder" }, { "post_builder" },
			{ "building", "sisters_infantry", true },
			{ "building", "sisters_plasma_generator" }
		}
	}
}

AttackStrategyInfo = 
{
	sisters_race =
	{
		MinArmyStrength = 750,
	},
}

Developer of the Cinematic Battles mod.

https://www.moddb.co...nematic-battles


#2 Gambit

Gambit

    title available

  • Members
  • 6,718 posts
  • Location:Athens, Greece

Posted 28 July 2019 - 11:40 AM

There is only one way to find the culprit, brother .

The good-old way of commenting (--[[]]) parts of the code.

 

The error above (MilitaryManager:Update() threw exception) is not indicative, so there is a lot that you must check.

Start from TOTALLY disabling the tactics, so that only the 4 basic AI files are loaded.

 

 

Note last, that in some rare cases similar issues CAN be the result of AE inconsistencies...


-In search of Papasmurf...

#3 thudo

thudo

    Wacko AI Guy!

  • Division Leaders
  • 12,164 posts
  • Location:Lemonville North, Canada
  • Projects:DoW AI Scripting Project
  • Division:DoW
  • Job:Division Leader

Posted 28 July 2019 - 02:45 PM

You really don't need us anymore because of THIS. :party:

 

I am creating a massive DoW1 Tut to ensure "best practices" are followed so you do not run into these issues.


Advanced Skirmish AI Team Lead for the coolest Warhammer40k PC RTS out there:

Dawn of War Advanced AI Headquarters

Latest DoW Advanced AI Download!

#4 Moreartillery

Moreartillery
  • Members
  • 246 posts
  • Projects:Cinematic Battles

Posted 28 July 2019 - 03:24 PM

You really don't need us anymore because of THIS. :party:

 

I am creating a massive DoW1 Tut to ensure "best practices" are followed so you do not run into these issues.

I read that but the log file doesn't tell me anything useful in this case.


Developer of the Cinematic Battles mod.

https://www.moddb.co...nematic-battles


#5 thudo

thudo

    Wacko AI Guy!

  • Division Leaders
  • 12,164 posts
  • Location:Lemonville North, Canada
  • Projects:DoW AI Scripting Project
  • Division:DoW
  • Job:Division Leader

Posted 28 July 2019 - 03:49 PM

You do not need the log file.. the error you got is explained in the tut how to then explore and solve.

 

ie.MilitaryManager:Update() errors can be generated in specific circumstances: those are now outlined for you in that part of the AI tut.


Advanced Skirmish AI Team Lead for the coolest Warhammer40k PC RTS out there:

Dawn of War Advanced AI Headquarters

Latest DoW Advanced AI Download!

#6 Moreartillery

Moreartillery
  • Members
  • 246 posts
  • Projects:Cinematic Battles

Posted 28 July 2019 - 06:26 PM

You do not need the log file.. the error you got is explained in the tut how to then explore and solve.

 

ie.MilitaryManager:Update() errors can be generated in specific circumstances: those are now outlined for you in that part of the AI tut.

All its says is theres a syntax error which I've not been able to find. And I can't go commenting out sections in the ai without creating new errors.


Developer of the Cinematic Battles mod.

https://www.moddb.co...nematic-battles


#7 thudo

thudo

    Wacko AI Guy!

  • Division Leaders
  • 12,164 posts
  • Location:Lemonville North, Canada
  • Projects:DoW AI Scripting Project
  • Division:DoW
  • Job:Division Leader

Posted 28 July 2019 - 08:59 PM

Yer commenting wrong... use --[[ ]] to omit large sections of code. Start inside the CreateTactic() section in your loader.ai..

 

You likely have a bad tactic file loading.. this is covered in the Tut.


Advanced Skirmish AI Team Lead for the coolest Warhammer40k PC RTS out there:

Dawn of War Advanced AI Headquarters

Latest DoW Advanced AI Download!

#8 Moreartillery

Moreartillery
  • Members
  • 246 posts
  • Projects:Cinematic Battles

Posted 29 July 2019 - 05:04 PM

Yer commenting wrong... use --[[ ]] to omit large sections of code. Start inside the CreateTactic() section in your loader.ai..

 

You likely have a bad tactic file loading.. this is covered in the Tut.

I tried it without the tactics, thats not the cause.


Developer of the Cinematic Battles mod.

https://www.moddb.co...nematic-battles


#9 thudo

thudo

    Wacko AI Guy!

  • Division Leaders
  • 12,164 posts
  • Location:Lemonville North, Canada
  • Projects:DoW AI Scripting Project
  • Division:DoW
  • Job:Division Leader

Posted 29 July 2019 - 05:14 PM

Check then the syntax in both your Sisters' Infantry and Vehicle tactics.

 

Also, you have to ask yourself: what is different to your custom Sisters' mod compared to the Adv. Sisters AI made for vanilla?


Advanced Skirmish AI Team Lead for the coolest Warhammer40k PC RTS out there:

Dawn of War Advanced AI Headquarters

Latest DoW Advanced AI Download!

#10 Gambit

Gambit

    title available

  • Members
  • 6,718 posts
  • Location:Athens, Greece

Posted 29 July 2019 - 05:30 PM

I also suggest you should look VERY CAREFULLY into the loader.ai...

And then into chaosbuildbasestrategy.ai, commenting HUGE function parts... I would only keep that ChooseBuildProgram.


-In search of Papasmurf...

#11 thudo

thudo

    Wacko AI Guy!

  • Division Leaders
  • 12,164 posts
  • Location:Lemonville North, Canada
  • Projects:DoW AI Scripting Project
  • Division:DoW
  • Job:Division Leader

Posted 29 July 2019 - 05:37 PM

I think you meant "sistersbuildbasestrategy.ai"  as this should be impacting only ONE faction... Sisters... don't want to over-complicate things of course.

 

Btw, if its a loader issue you'll likely start not loading the Unitstats.ai and get something more close to:

CpuManager: No unit stats available for: ultra_marine_squad_builder!!! Using default tactic...
Warning: ultra_marine_squad_builder has no unit strength!
 *ALERT: MilitaryManager:Update() threw exception (lua runtime error)
  Lua             Core/cpu_manager.ai            Ln 1564 (?)
  Lua             Core/cpu_manager.ai            Ln  419 (Initialize)
  Lua             DATA:AI/default.ai             Ln  115 (InitializeAI)
  main            DATA:AI/default.ai             Ln  133 ((null))
Error loading script file 'DATA:AI/default.ai' for race 'ultra_marine_race'!

Advanced Skirmish AI Team Lead for the coolest Warhammer40k PC RTS out there:

Dawn of War Advanced AI Headquarters

Latest DoW Advanced AI Download!



Reply to this topic



  


0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users