Initial commit

This commit is contained in:
2026-02-28 14:00:45 -06:00
commit 16d3170787
1134 changed files with 589134 additions and 0 deletions

View File

@@ -0,0 +1,65 @@
-- $Id: //depot/Projects/StarWars_Steam/FOC/Run/Data/Scripts/AI/AI_Plan_ExpansionGeneric_GenerateMagicCashDrop.lua#1 $
--/////////////////////////////////////////////////////////////////////////////////////////////////
--
-- (C) Petroglyph Games, Inc.
--
--
-- ***** ** * *
-- * ** * * *
-- * * * * *
-- * * * * * * * *
-- * * *** ****** * ** **** *** * * * ***** * ***
-- * ** * * * ** * ** ** * * * * ** ** ** *
-- *** ***** * * * * * * * * ** * * * *
-- * * * * * * * * * * * * * * *
-- * * * * * * * * * * ** * * * *
-- * ** * * ** * ** * * ** * * * *
-- ** **** ** * **** ***** * ** *** * *
-- * * *
-- * * *
-- * * *
-- * * * *
-- **** * *
--
--/////////////////////////////////////////////////////////////////////////////////////////////////
-- C O N F I D E N T I A L S O U R C E C O D E -- D O N O T D I S T R I B U T E
--/////////////////////////////////////////////////////////////////////////////////////////////////
--
-- $File: //depot/Projects/StarWars_Steam/FOC/Run/Data/Scripts/AI/AI_Plan_ExpansionGeneric_GenerateMagicCashDrop.lua $
--
-- Original Author: James Yarrow
--
-- $Author: Brian_Hayes $
--
-- $Change: 637819 $
--
-- $DateTime: 2017/03/22 10:16:16 $
--
-- $Revision: #1 $
--
--/////////////////////////////////////////////////////////////////////////////////////////////////
require("pgevents")
function Definitions()
Category = "Generate_Magic_Cash_Drop | Skirmish_Generate_Magic_Cash_Drop_Space | Skirmish_Generate_Magic_Cash_Drop_Land"
IgnoreTarget = true
TaskForce = {
{
"ReserveForce"
,"DenyHeroAttach"
,"TaskForceRequired"
}
}
AllowFreeStoreUnits = false
MagicPlan = true
MagicPlanStealing = false
end
function ReserveForce_Thread()
PlayerObject.Give_Money(6000)
Sleep(120)
ScriptExit()
end

View File

@@ -0,0 +1,61 @@
--/////////////////////////////////////////////////////////////////////////////////////////////////
-- (c) Galyana's Ultimate Empire at War Modifications
--
-- ****** *** *** ************ *** ***
-- * * * * * * * *
-- * * * * * * *
-- * * * * * * *
-- * * * * * **** * * *
-- * * * ****** * * * *
-- * **** * * * * * * * *** *
-- * * * * * * * * * *
-- * * * * * * * * * *
-- * * * * * * * ** * * *
-- ****** ****** ************ **** ** *******
--/////////////////////////////////////////////////////////////////////////////////////////////////
-- C O N F I D E N T I A L S O U R C E C O D E -- D O N O T D I S T R I B U T E
--/////////////////////////////////////////////////////////////////////////////////////////////////
--
-- File: GUEaW/Data/Scripts/AI/AI_Plan_ExpansionGeneric_RemoveCorruption.LUA
--
-- Original Editor: Giovanni Galyana
--
-- Final Edit By: Giovanni Galyana
--
-- Date: 25 October, 2020
--
-- Revisions: 1
--
--/////////////////////////////////////////////////////////////////////////////////////////////////
require("pgevents")
function Definitions()
Category = "Remove_Corruption"
IgnoreTarget = true
TaskForce = {
{
"MainForce",
"DenyHeroAttach",
"Mon_Mothma_Team | Obi_Wan_Team | Yoda_Team | Luke_Skywalker_Jedi_Team | Emperor_Palpatine_Team | UEAW_Sate_Pestage_Team | Darth_Team | Admonitor_Star_Destroyer | Cuarson_Team | Pestelous_Team | Galyana_SSD_GC = 1"
}
}
end
function MainForce_Thread()
AssembleForce(MainForce)
LaunchUnits(MainForce)
MainForce.Set_As_Goal_System_Removable(false)
MainForce.Activate_Ability()
MainForce.Set_Plan_Result(true)
Sleep(300)
end
function MainForce_No_Units_Remaining(tf)
--No action
end
function MainForce_Production_Failed(tf, failed_object_type)
ScriptExit()
end

View File

@@ -0,0 +1,66 @@
-- $Id: //depot/Projects/StarWars_Steam/FOC/Run/Data/Scripts/AI/AI_Plan_Underworld_BlackMarket.lua#1 $
--/////////////////////////////////////////////////////////////////////////////////////////////////
--
-- (C) Petroglyph Games, Inc.
--
--
-- ***** ** * *
-- * ** * * *
-- * * * * *
-- * * * * * * * *
-- * * *** ****** * ** **** *** * * * ***** * ***
-- * ** * * * ** * ** ** * * * * ** ** ** *
-- *** ***** * * * * * * * * ** * * * *
-- * * * * * * * * * * * * * * *
-- * * * * * * * * * * ** * * * *
-- * ** * * ** * ** * * ** * * * *
-- ** **** ** * **** ***** * ** *** * *
-- * * *
-- * * *
-- * * *
-- * * * *
-- **** * *
--
--/////////////////////////////////////////////////////////////////////////////////////////////////
-- C O N F I D E N T I A L S O U R C E C O D E -- D O N O T D I S T R I B U T E
--/////////////////////////////////////////////////////////////////////////////////////////////////
--
-- $File: //depot/Projects/StarWars_Steam/FOC/Run/Data/Scripts/AI/AI_Plan_Underworld_BlackMarket.lua $
--
-- Original Author: James Yarrow
--
-- $Author: Brian_Hayes $
--
-- $Change: 637819 $
--
-- $DateTime: 2017/03/22 10:16:16 $
--
-- $Revision: #1 $
--
--/////////////////////////////////////////////////////////////////////////////////////////////////
require("pgevents")
function Definitions()
Category = "Black_Market_Purchase"
IgnoreTarget = true
TaskForce = {
{
"MainForce",
"DenyHeroAttach",
"Silri_Team | Tyber_Zann_Team | Urai_Fen_Team = 1"
}
}
end
function MainForce_Thread()
BlockOnCommand(MainForce.Produce_Force(Target))
BlockOnCommand(MainForce.Move_To(Target))
MainForce.Activate_Ability()
MainForce.Set_Plan_Result(true)
end
function MainForce_Production_Failed(tf, failed_object_type)
ScriptExit()
end

View File

@@ -0,0 +1,67 @@
-- $Id: //depot/Projects/StarWars_Steam/FOC/Run/Data/Scripts/AI/AI_Plan_Underworld_BuildUnderworldBarracks.lua#1 $
--/////////////////////////////////////////////////////////////////////////////////////////////////
--
-- (C) Petroglyph Games, Inc.
--
--
-- ***** ** * *
-- * ** * * *
-- * * * * *
-- * * * * * * * *
-- * * *** ****** * ** **** *** * * * ***** * ***
-- * ** * * * ** * ** ** * * * * ** ** ** *
-- *** ***** * * * * * * * * ** * * * *
-- * * * * * * * * * * * * * * *
-- * * * * * * * * * * ** * * * *
-- * ** * * ** * ** * * ** * * * *
-- ** **** ** * **** ***** * ** *** * *
-- * * *
-- * * *
-- * * *
-- * * * *
-- **** * *
--
--/////////////////////////////////////////////////////////////////////////////////////////////////
-- C O N F I D E N T I A L S O U R C E C O D E -- D O N O T D I S T R I B U T E
--/////////////////////////////////////////////////////////////////////////////////////////////////
--
-- $File: //depot/Projects/StarWars_Steam/FOC/Run/Data/Scripts/AI/AI_Plan_Underworld_BuildUnderworldBarracks.lua $
--
-- Original Author: James Yarrow
--
-- $Author: Brian_Hayes $
--
-- $Change: 637819 $
--
-- $DateTime: 2017/03/22 10:16:16 $
--
-- $Revision: #1 $
--
--/////////////////////////////////////////////////////////////////////////////////////////////////
require("pgevents")
-- Tell the script pooling system to pre-cache this number of scripts.
ScriptPoolCount = 4
function Definitions()
Category = "Build_Initial_Groundbase_Only | Build_Underworld_Barracks"
IgnoreTarget = true
TaskForce = {
{
"BaseForce",
"U_Ground_Barracks = 1"
}
}
end
function BaseForce_Thread()
AssembleForce(BaseForce)
BaseForce.Set_Plan_Result(true)
end
function BaseForce_Production_Failed(tf, failed_object_type)
ScriptExit()
end

View File

@@ -0,0 +1,67 @@
-- $Id: //depot/Projects/StarWars_Steam/FOC/Run/Data/Scripts/AI/AI_Plan_Underworld_BuildUnderworldDroidWorks.lua#1 $
--/////////////////////////////////////////////////////////////////////////////////////////////////
--
-- (C) Petroglyph Games, Inc.
--
--
-- ***** ** * *
-- * ** * * *
-- * * * * *
-- * * * * * * * *
-- * * *** ****** * ** **** *** * * * ***** * ***
-- * ** * * * ** * ** ** * * * * ** ** ** *
-- *** ***** * * * * * * * * ** * * * *
-- * * * * * * * * * * * * * * *
-- * * * * * * * * * * ** * * * *
-- * ** * * ** * ** * * ** * * * *
-- ** **** ** * **** ***** * ** *** * *
-- * * *
-- * * *
-- * * *
-- * * * *
-- **** * *
--
--/////////////////////////////////////////////////////////////////////////////////////////////////
-- C O N F I D E N T I A L S O U R C E C O D E -- D O N O T D I S T R I B U T E
--/////////////////////////////////////////////////////////////////////////////////////////////////
--
-- $File: //depot/Projects/StarWars_Steam/FOC/Run/Data/Scripts/AI/AI_Plan_Underworld_BuildUnderworldDroidWorks.lua $
--
-- Original Author: James Yarrow
--
-- $Author: Brian_Hayes $
--
-- $Change: 637819 $
--
-- $DateTime: 2017/03/22 10:16:16 $
--
-- $Revision: #1 $
--
--/////////////////////////////////////////////////////////////////////////////////////////////////
require("pgevents")
-- Tell the script pooling system to pre-cache this number of scripts.
ScriptPoolCount = 4
function Definitions()
Category = "Build_Initial_Groundbase_Only | Build_Underworld_Droid_Works"
IgnoreTarget = true
TaskForce = {
{
"BaseForce",
"U_Ground_Droid_Works = 1"
}
}
end
function BaseForce_Thread()
AssembleForce(BaseForce)
BaseForce.Set_Plan_Result(true)
end
function BaseForce_Production_Failed(tf, failed_object_type)
ScriptExit()
end

View File

@@ -0,0 +1,67 @@
-- $Id: //depot/Projects/StarWars_Steam/FOC/Run/Data/Scripts/AI/AI_Plan_Underworld_BuildUnderworldPalace.lua#1 $
--/////////////////////////////////////////////////////////////////////////////////////////////////
--
-- (C) Petroglyph Games, Inc.
--
--
-- ***** ** * *
-- * ** * * *
-- * * * * *
-- * * * * * * * *
-- * * *** ****** * ** **** *** * * * ***** * ***
-- * ** * * * ** * ** ** * * * * ** ** ** *
-- *** ***** * * * * * * * * ** * * * *
-- * * * * * * * * * * * * * * *
-- * * * * * * * * * * ** * * * *
-- * ** * * ** * ** * * ** * * * *
-- ** **** ** * **** ***** * ** *** * *
-- * * *
-- * * *
-- * * *
-- * * * *
-- **** * *
--
--/////////////////////////////////////////////////////////////////////////////////////////////////
-- C O N F I D E N T I A L S O U R C E C O D E -- D O N O T D I S T R I B U T E
--/////////////////////////////////////////////////////////////////////////////////////////////////
--
-- $File: //depot/Projects/StarWars_Steam/FOC/Run/Data/Scripts/AI/AI_Plan_Underworld_BuildUnderworldPalace.lua $
--
-- Original Author: James Yarrow
--
-- $Author: Brian_Hayes $
--
-- $Change: 637819 $
--
-- $DateTime: 2017/03/22 10:16:16 $
--
-- $Revision: #1 $
--
--/////////////////////////////////////////////////////////////////////////////////////////////////
require("pgevents")
-- Tell the script pooling system to pre-cache this number of scripts.
ScriptPoolCount = 4
function Definitions()
Category = "Build_Initial_Groundbase_Only | Build_Underworld_Palace"
IgnoreTarget = true
TaskForce = {
{
"BaseForce",
"U_Ground_Palace = 1"
}
}
end
function BaseForce_Thread()
AssembleForce(BaseForce)
BaseForce.Set_Plan_Result(true)
end
function BaseForce_Production_Failed(tf, failed_object_type)
ScriptExit()
end

View File

@@ -0,0 +1,67 @@
-- $Id: //depot/Projects/StarWars_Steam/FOC/Run/Data/Scripts/AI/AI_Plan_Underworld_BuildUnderworldVehicleFactory.lua#1 $
--/////////////////////////////////////////////////////////////////////////////////////////////////
--
-- (C) Petroglyph Games, Inc.
--
--
-- ***** ** * *
-- * ** * * *
-- * * * * *
-- * * * * * * * *
-- * * *** ****** * ** **** *** * * * ***** * ***
-- * ** * * * ** * ** ** * * * * ** ** ** *
-- *** ***** * * * * * * * * ** * * * *
-- * * * * * * * * * * * * * * *
-- * * * * * * * * * * ** * * * *
-- * ** * * ** * ** * * ** * * * *
-- ** **** ** * **** ***** * ** *** * *
-- * * *
-- * * *
-- * * *
-- * * * *
-- **** * *
--
--/////////////////////////////////////////////////////////////////////////////////////////////////
-- C O N F I D E N T I A L S O U R C E C O D E -- D O N O T D I S T R I B U T E
--/////////////////////////////////////////////////////////////////////////////////////////////////
--
-- $File: //depot/Projects/StarWars_Steam/FOC/Run/Data/Scripts/AI/AI_Plan_Underworld_BuildUnderworldVehicleFactory.lua $
--
-- Original Author: James Yarrow
--
-- $Author: Brian_Hayes $
--
-- $Change: 637819 $
--
-- $DateTime: 2017/03/22 10:16:16 $
--
-- $Revision: #1 $
--
--/////////////////////////////////////////////////////////////////////////////////////////////////
require("pgevents")
-- Tell the script pooling system to pre-cache this number of scripts.
ScriptPoolCount = 4
function Definitions()
Category = "Build_Initial_Groundbase_Only | Build_Underworld_Vehicle_Factory"
IgnoreTarget = true
TaskForce = {
{
"BaseForce",
"U_Ground_Vehicle_Factory = 1"
}
}
end
function BaseForce_Thread()
AssembleForce(BaseForce)
BaseForce.Set_Plan_Result(true)
end
function BaseForce_Production_Failed(tf, failed_object_type)
ScriptExit()
end

View File

@@ -0,0 +1,78 @@
-- $Id: //depot/Projects/StarWars_Steam/FOC/Run/Data/Scripts/AI/AI_Plan_Underworld_DeploySaboteur.lua#1 $
--/////////////////////////////////////////////////////////////////////////////////////////////////
--
-- (C) Petroglyph Games, Inc.
--
--
-- ***** ** * *
-- * ** * * *
-- * * * * *
-- * * * * * * * *
-- * * *** ****** * ** **** *** * * * ***** * ***
-- * ** * * * ** * ** ** * * * * ** ** ** *
-- *** ***** * * * * * * * * ** * * * *
-- * * * * * * * * * * * * * * *
-- * * * * * * * * * * ** * * * *
-- * ** * * ** * ** * * ** * * * *
-- ** **** ** * **** ***** * ** *** * *
-- * * *
-- * * *
-- * * *
-- * * * *
-- **** * *
--
--/////////////////////////////////////////////////////////////////////////////////////////////////
-- C O N F I D E N T I A L S O U R C E C O D E -- D O N O T D I S T R I B U T E
--/////////////////////////////////////////////////////////////////////////////////////////////////
--
-- $File: //depot/Projects/StarWars_Steam/FOC/Run/Data/Scripts/AI/AI_Plan_Underworld_DeploySaboteur.lua $
--
-- Original Author: James Yarrow
--
-- $Author: Brian_Hayes $
--
-- $Change: 637819 $
--
-- $DateTime: 2017/03/22 10:16:16 $
--
-- $Revision: #1 $
--
--/////////////////////////////////////////////////////////////////////////////////////////////////
require("pgevents")
function Definitions()
--The mechanisms for corrupting a planet and for sabotaging it are identical - which we perform depends on
--the current corruption state of the target. This is assessed at the perception level and by the time
--we execute the plan it makes no difference to our behavior
Category = "Corrupt_Planet | Sabotage_Planet"
IgnoreTarget = true
TaskForce = {
{
"MainForce",
"DenyHeroAttach",
"Underworld_Saboteur_Team = 1"
}
}
end
function MainForce_Thread()
AssembleForce(MainForce)
BlockOnCommand(MainForce.Move_To(Target))
MainForce.Activate_Ability()
Sleep(10)
if MainForce.Get_Goal_Type_Name() == "Corrupt_Planet" then
if Target.Is_Corrupted() then
MainForce.Set_Plan_Result(true)
end
end
--Always treat sabotage as failing so that we won't repeatedly perform it on the same planet (cost goes up)
end
function MainForce_Production_Failed(tf, failed_object_type)
ScriptExit()
end

View File

@@ -0,0 +1,66 @@
-- $Id: //depot/Projects/StarWars_Steam/FOC/Run/Data/Scripts/AI/AI_Plan_Underworld_HackSuperWeapon.lua#1 $
--/////////////////////////////////////////////////////////////////////////////////////////////////
--
-- (C) Petroglyph Games, Inc.
--
--
-- ***** ** * *
-- * ** * * *
-- * * * * *
-- * * * * * * * *
-- * * *** ****** * ** **** *** * * * ***** * ***
-- * ** * * * ** * ** ** * * * * ** ** ** *
-- *** ***** * * * * * * * * ** * * * *
-- * * * * * * * * * * * * * * *
-- * * * * * * * * * * ** * * * *
-- * ** * * ** * ** * * ** * * * *
-- ** **** ** * **** ***** * ** *** * *
-- * * *
-- * * *
-- * * *
-- * * * *
-- **** * *
--
--/////////////////////////////////////////////////////////////////////////////////////////////////
-- C O N F I D E N T I A L S O U R C E C O D E -- D O N O T D I S T R I B U T E
--/////////////////////////////////////////////////////////////////////////////////////////////////
--
-- $File: //depot/Projects/StarWars_Steam/FOC/Run/Data/Scripts/AI/AI_Plan_Underworld_HackSuperWeapon.lua $
--
-- Original Author: James Yarrow
--
-- $Author: Brian_Hayes $
--
-- $Change: 637819 $
--
-- $DateTime: 2017/03/22 10:16:16 $
--
-- $Revision: #1 $
--
--/////////////////////////////////////////////////////////////////////////////////////////////////
require("pgevents")
function Definitions()
Category = "Hack_Super_Weapon"
IgnoreTarget = true
TaskForce = {
{
"MainForce",
"DenyHeroAttach",
"IG88_Team = 1"
}
}
end
function MainForce_Thread()
BlockOnCommand(MainForce.Produce_Force(Target))
BlockOnCommand(MainForce.Move_To(Target))
BlockOnCommand(LandUnits(MainForce))
MainForce.Set_Plan_Result(true)
end
function MainForce_Production_Failed(tf, failed_object_type)
ScriptExit()
end

View File

@@ -0,0 +1,80 @@
-- $Id: //depot/Projects/StarWars_Steam/FOC/Run/Data/Scripts/AI/BuildBaseComponentAdvancedVehicleFactory.lua#1 $
--/////////////////////////////////////////////////////////////////////////////////////////////////
--
-- (C) Petroglyph Games, Inc.
--
--
-- ***** ** * *
-- * ** * * *
-- * * * * *
-- * * * * * * * *
-- * * *** ****** * ** **** *** * * * ***** * ***
-- * ** * * * ** * ** ** * * * * ** ** ** *
-- *** ***** * * * * * * * * ** * * * *
-- * * * * * * * * * * * * * * *
-- * * * * * * * * * * ** * * * *
-- * ** * * ** * ** * * ** * * * *
-- ** **** ** * **** ***** * ** *** * *
-- * * *
-- * * *
-- * * *
-- * * * *
-- **** * *
--
--/////////////////////////////////////////////////////////////////////////////////////////////////
-- C O N F I D E N T I A L S O U R C E C O D E -- D O N O T D I S T R I B U T E
--/////////////////////////////////////////////////////////////////////////////////////////////////
--
-- $File: //depot/Projects/StarWars_Steam/FOC/Run/Data/Scripts/AI/BuildBaseComponentAdvancedVehicleFactory.lua $
--
-- Original Author: James Yarrow
--
-- $Author: Brian_Hayes $
--
-- $Change: 637819 $
--
-- $DateTime: 2017/03/22 10:16:16 $
--
-- $Revision: #1 $
--
--/////////////////////////////////////////////////////////////////////////////////////////////////
require("pgevents")
function Definitions()
DebugMessage("%s -- In Definitions", tostring(Script))
Category = "Build_Base_Component_Advanced_Vehicle_Factory"
IgnoreTarget = true
TaskForce = {
{
"BaseForce",
"E_Ground_Advanced_Vehicle_Factory = 1"
}
}
DebugMessage("%s -- Done Definitions", tostring(Script))
end
function BaseForce_Thread()
DebugMessage("%s -- In BaseForce_Thread.", tostring(Script))
Sleep(1)
-- BaseForce.Set_As_Goal_System_Removable(false)
AssembleForce(BaseForce)
BaseForce.Set_Plan_Result(true)
DebugMessage("%s -- BaseForce done!", tostring(Script));
ScriptExit()
end
function BaseForce_Production_Failed(tf, failed_object_type)
DebugMessage("%s -- Abandonning plan owing to production failure.", tostring(Script))
ScriptExit()
end

View File

@@ -0,0 +1,68 @@
--/////////////////////////////////////////////////////////////////////////////////////////////////
-- (c) Galyana's Ultimate Empire at War Modifications
--
-- ****** *** *** ************ *** ***
-- * * * * * * * *
-- * * * * * * *
-- * * * * * * *
-- * * * * * **** * * *
-- * * * ****** * * * *
-- * **** * * * * * * * *** *
-- * * * * * * * * * *
-- * * * * * * * * * *
-- * * * * * * * ** * * *
-- ****** ****** ************ **** ** *******
--/////////////////////////////////////////////////////////////////////////////////////////////////
-- C O N F I D E N T I A L S O U R C E C O D E -- D O N O T D I S T R I B U T E
--/////////////////////////////////////////////////////////////////////////////////////////////////
--
-- File: GUEaW/Data/Scripts/AI/BuildBaseComponentBarracks.LUA
--
-- Original Editor: Giovanni Galyana
--
-- Final Edit By: Giovanni Galyana
--
-- Date: 28 Septembter, 2012
--
-- Revisions: 0
--
--/////////////////////////////////////////////////////////////////////////////////////////////////
require("pgevents")
-- Tell the script pooling system to pre-cache this number of scripts.
ScriptPoolCount = 4
function Definitions()
DebugMessage("%s -- In Definitions", tostring(Script))
Category = "Build_Initial_Groundbase_Only | Build_Base_Component_Barracks"
IgnoreTarget = true
TaskForce = {
{
"BaseForce",
"E_Ground_Barracks | R_Ground_Barracks | H_Ground_Barracks = 1"
}
}
DebugMessage("%s -- Done Definitions", tostring(Script))
end
function BaseForce_Thread()
DebugMessage("%s -- In BaseForce_Thread.", tostring(Script))
Sleep(1)
-- BaseForce.Set_As_Goal_System_Removable(false)
AssembleForce(BaseForce)
BaseForce.Set_Plan_Result(true)
DebugMessage("%s -- BaseForce done!", tostring(Script));
ScriptExit()
end
function BaseForce_Production_Failed(tf, failed_object_type)
DebugMessage("%s -- Abandonning plan owing to production failure.", tostring(Script))
ScriptExit()
end

View File

@@ -0,0 +1,67 @@
--/////////////////////////////////////////////////////////////////////////////////////////////////
-- (c) Galyana's Ultimate Empire at War Modifications
--
-- ****** *** *** ************ *** ***
-- * * * * * * * *
-- * * * * * * *
-- * * * * * * *
-- * * * * * **** * * *
-- * * * ****** * * * *
-- * **** * * * * * * * *** *
-- * * * * * * * * * *
-- * * * * * * * * * *
-- * * * * * * * ** * * *
-- ****** ****** ************ **** ** *******
--/////////////////////////////////////////////////////////////////////////////////////////////////
-- C O N F I D E N T I A L S O U R C E C O D E -- D O N O T D I S T R I B U T E
--/////////////////////////////////////////////////////////////////////////////////////////////////
--
-- File: GUEaW/Data/Scripts/AI/BuildBaseComponentCommArray.LUA
--
-- Original Editor: Giovanni Galyana
--
-- Final Edit By: Giovanni Galyana
--
-- Date: 10 May, 2014
--
-- Revisions: 1
--
--/////////////////////////////////////////////////////////////////////////////////////////////////
require("pgevents")
function Definitions()
DebugMessage("%s -- In Definitions", tostring(Script))
Category = "Build_Base_Component_Comm_Array"
IgnoreTarget = true
TaskForce = {
{
"BaseForce",
"E_Ground_Communications_Array | R_Ground_Communications_Array | H_Ground_Communications_Array = 1"
}
}
DebugMessage("%s -- Done Definitions", tostring(Script))
end
function BaseForce_Thread()
DebugMessage("%s -- In BaseForce_Thread.", tostring(Script))
Sleep(1)
-- BaseForce.Set_As_Goal_System_Removable(false)
AssembleForce(BaseForce)
BaseForce.Set_Plan_Result(true)
DebugMessage("%s -- BaseForce done!", tostring(Script));
ScriptExit()
end
function BaseForce_Production_Failed(tf, failed_object_type)
DebugMessage("%s -- Abandonning plan owing to production failure.", tostring(Script))
ScriptExit()
end

View File

@@ -0,0 +1,68 @@
--/////////////////////////////////////////////////////////////////////////////////////////////////
-- (c) Galyana's Ultimate Empire at War Modifications
--
-- ****** *** *** ************ *** ***
-- * * * * * * * *
-- * * * * * * *
-- * * * * * * *
-- * * * * * **** * * *
-- * * * ****** * * * *
-- * **** * * * * * * * *** *
-- * * * * * * * * * *
-- * * * * * * * * * *
-- * * * * * * * ** * * *
-- ****** ****** ************ **** ** *******
--/////////////////////////////////////////////////////////////////////////////////////////////////
-- C O N F I D E N T I A L S O U R C E C O D E -- D O N O T D I S T R I B U T E
--/////////////////////////////////////////////////////////////////////////////////////////////////
--
-- File: GUEaW/Data/Scripts/AI/BuildBaseComponentHeavyVehicleFactory.LUA
--
-- Original Editor: Giovanni Galyana
--
-- Final Edit By: Giovanni Galyana
--
-- Date: 10 May, 2014
--
-- Revisions: 1
--
--/////////////////////////////////////////////////////////////////////////////////////////////////
require("pgevents")
function Definitions()
DebugMessage("%s -- In Definitions", tostring(Script))
Category = "Build_Base_Component_Heavy_Vehicle_Factory"
IgnoreTarget = true
TaskForce = {
{
"BaseForce",
"E_Ground_Heavy_Vehicle_Factory | R_Ground_Heavy_Vehicle_Factory = 1"
}
}
DebugMessage("%s -- Done Definitions", tostring(Script))
end
function BaseForce_Thread()
DebugMessage("%s -- In BaseForce_Thread.", tostring(Script))
Sleep(1)
-- BaseForce.Set_As_Goal_System_Removable(false)
AssembleForce(BaseForce)
BaseForce.Set_Plan_Result(true)
DebugMessage("%s -- BaseForce done!", tostring(Script));
ScriptExit()
end
function BaseForce_Production_Failed(tf, failed_object_type)
DebugMessage("%s -- Abandonning plan owing to production failure.", tostring(Script))
ScriptExit()
end

View File

@@ -0,0 +1,69 @@
--/////////////////////////////////////////////////////////////////////////////////////////////////
-- (c) Galyana's Ultimate Empire at War Modifications
--
-- ****** *** *** ************ *** ***
-- * * * * * * * *
-- * * * * * * *
-- * * * * * * *
-- * * * * * **** * * *
-- * * * ****** * * * *
-- * **** * * * * * * * *** *
-- * * * * * * * * * *
-- * * * * * * * * * *
-- * * * * * * * ** * * *
-- ****** ****** ************ **** ** *******
--/////////////////////////////////////////////////////////////////////////////////////////////////
-- C O N F I D E N T I A L S O U R C E C O D E -- D O N O T D I S T R I B U T E
--/////////////////////////////////////////////////////////////////////////////////////////////////
--
-- File: GUEaW/Data/Scripts/AI/BuildBaseComponentLightVehicleFactory.LUA
--
-- Original Editor: Giovanni Galyana
--
-- Final Edit By: Giovanni Galyana
--
-- Date: 28 Septembter, 2012
--
-- Revisions: 0
--
--/////////////////////////////////////////////////////////////////////////////////////////////////
require("pgevents")
-- Tell the script pooling system to pre-cache this number of scripts.
ScriptPoolCount = 4
function Definitions()
DebugMessage("%s -- In Definitions", tostring(Script))
Category = "Build_Base_Component_Light_Vehicle_Factory | Build_Initial_Groundbase_Only"
IgnoreTarget = true
TaskForce = {
{
"BaseForce",
"E_Ground_Light_Vehicle_Factory | R_Ground_Light_Vehicle_Factory | H_Ground_Factory = 1"
}
}
DebugMessage("%s -- Done Definitions", tostring(Script))
end
function BaseForce_Thread()
DebugMessage("%s -- In BaseForce_Thread.", tostring(Script))
Sleep(1)
-- BaseForce.Set_As_Goal_System_Removable(false)
AssembleForce(BaseForce)
BaseForce.Set_Plan_Result(true)
DebugMessage("%s -- BaseForce done!", tostring(Script));
ScriptExit()
end
function BaseForce_Production_Failed(tf, failed_object_type)
DebugMessage("%s -- Abandonning plan owing to production failure.", tostring(Script))
ScriptExit()
end

View File

@@ -0,0 +1,68 @@
--/////////////////////////////////////////////////////////////////////////////////////////////////
-- (c) Galyana's Ultimate Empire at War Modifications
--
-- ****** *** *** ************ *** ***
-- * * * * * * * *
-- * * * * * * *
-- * * * * * * *
-- * * * * * **** * * *
-- * * * ****** * * * *
-- * **** * * * * * * * *** *
-- * * * * * * * * * *
-- * * * * * * * * * *
-- * * * * * * * ** * * *
-- ****** ****** ************ **** ** *******
--/////////////////////////////////////////////////////////////////////////////////////////////////
-- C O N F I D E N T I A L S O U R C E C O D E -- D O N O T D I S T R I B U T E
--/////////////////////////////////////////////////////////////////////////////////////////////////
--
-- File: GUEaW/Data/Scripts/AI/BuildBaseComponentOfficerAcademy.LUA
--
-- Original Editor: Giovanni Galyana
--
-- Final Edit By: Giovanni Galyana
--
-- Date: 10 May, 2014
--
-- Revisions: 1
--
--/////////////////////////////////////////////////////////////////////////////////////////////////
require("pgevents")
function Definitions()
DebugMessage("%s -- In Definitions", tostring(Script))
Category = "Build_Base_Component_Officer_Academy"
IgnoreTarget = true
TaskForce = {
{
"BaseForce",
"E_Ground_Officer_Academy | R_Ground_Officer_Academy | H_Ground_Command_Center = 1"
}
}
DebugMessage("%s -- Done Definitions", tostring(Script))
end
function BaseForce_Thread()
DebugMessage("%s -- In BaseForce_Thread.", tostring(Script))
Sleep(1)
-- BaseForce.Set_As_Goal_System_Removable(false)
AssembleForce(BaseForce)
BaseForce.Set_Plan_Result(true)
DebugMessage("%s -- BaseForce done!", tostring(Script));
ScriptExit()
end
function BaseForce_Production_Failed(tf, failed_object_type)
DebugMessage("%s -- Abandonning plan owing to production failure.", tostring(Script))
ScriptExit()
end

View File

@@ -0,0 +1,69 @@
--/////////////////////////////////////////////////////////////////////////////////////////////////
-- (c) Galyana's Ultimate Empire at War Modifications
--
-- ****** *** *** ************ *** ***
-- * * * * * * * *
-- * * * * * * *
-- * * * * * * *
-- * * * * * **** * * *
-- * * * ****** * * * *
-- * **** * * * * * * * *** *
-- * * * * * * * * * *
-- * * * * * * * * * *
-- * * * * * * * ** * * *
-- ****** ****** ************ **** ** *******
--/////////////////////////////////////////////////////////////////////////////////////////////////
-- C O N F I D E N T I A L S O U R C E C O D E -- D O N O T D I S T R I B U T E
--/////////////////////////////////////////////////////////////////////////////////////////////////
--
-- File: GUEaW/Data/Scripts/AI/BuildBaseComponentResearchFacility.LUA
--
-- Original Editor: Giovanni Galyana
--
-- Final Edit By: Giovanni Galyana
--
-- Date: 28 Septembter, 2012
--
-- Revisions: 0
--
--/////////////////////////////////////////////////////////////////////////////////////////////////
require("pgevents")
-- This plan handles both the first research facility, built under the MajorItem purchase template scheme
-- and subsequent research facilities, built under Infrastructure, by other perceptions.
function Definitions()
DebugMessage("%s -- In Definitions", tostring(Script))
Category = "Build_Base_Component_Research_Facility | Build_Base_Component_Research_Facility_2"
IgnoreTarget = true
TaskForce = {
{
"BaseForce",
"E_Ground_Research_Facility | H_Ground_Advanced_Technologies_Facility = 1"
}
}
DebugMessage("%s -- Done Definitions", tostring(Script))
end
function BaseForce_Thread()
DebugMessage("%s -- In BaseForce_Thread.", tostring(Script))
Sleep(1)
BaseForce.Set_As_Goal_System_Removable(false)
AssembleForce(BaseForce)
BaseForce.Set_Plan_Result(true)
DebugMessage("%s -- BaseForce done!", tostring(Script));
ScriptExit()
end
function BaseForce_Production_Failed(tf, failed_object_type)
DebugMessage("%s -- Abandonning plan owing to production failure.", tostring(Script))
ScriptExit()
end

View File

@@ -0,0 +1,70 @@
--/////////////////////////////////////////////////////////////////////////////////////////////////
-- (c) Galyana's Ultimate Empire at War Modifications
--
-- ****** *** *** ************ *** ***
-- * * * * * * * *
-- * * * * * * *
-- * * * * * * *
-- * * * * * **** * * *
-- * * * ****** * * * *
-- * **** * * * * * * * *** *
-- * * * * * * * * * *
-- * * * * * * * * * *
-- * * * * * * * ** * * *
-- ****** ****** ************ **** ** *******
--/////////////////////////////////////////////////////////////////////////////////////////////////
-- C O N F I D E N T I A L S O U R C E C O D E -- D O N O T D I S T R I B U T E
--/////////////////////////////////////////////////////////////////////////////////////////////////
--
-- File: GUEaW/Data/Scripts/AI/BuildBaseShieldPlan.lua
--
-- Original Editor: Giovanni Galyana
--
-- Final Edit By: Giovanni Galyana
--
-- Date: 7 March, 2015
--
-- Revisions: 0
--
--/////////////////////////////////////////////////////////////////////////////////////////////////
require("pgevents")
function Definitions()
DebugMessage("%s -- In Definitions", tostring(Script))
Category = "Build_Base_Shield"
IgnoreTarget = true
TaskForce = {
{
"StructureForce",
"E_Ground_Base_Shield_740 | R_Ground_Base_Shield_740 | H_Ground_Base_Shield_740 = 1"
}
}
DebugMessage("%s -- Done Definitions", tostring(Script))
end
function StructureForce_Thread()
DebugMessage("%s -- In StructureForce_Thread.", tostring(Script))
Sleep(1)
StructureForce.Set_As_Goal_System_Removable(false)
AssembleForce(StructureForce)
StructureForce.Set_Plan_Result(true)
DebugMessage("%s -- StructureForce done!", tostring(Script));
ScriptExit()
end
function StructureForce_Production_Failed(tf, failed_object_type)
DebugMessage("%s -- Abandonning plan owing to production failure.", tostring(Script))
ScriptExit()
end

View File

@@ -0,0 +1,78 @@
-- $Id: //depot/Projects/StarWars_Steam/FOC/Run/Data/Scripts/AI/BuildCantinaPlan.lua#1 $
--/////////////////////////////////////////////////////////////////////////////////////////////////
--
-- (C) Petroglyph Games, Inc.
--
--
-- ***** ** * *
-- * ** * * *
-- * * * * *
-- * * * * * * * *
-- * * *** ****** * ** **** *** * * * ***** * ***
-- * ** * * * ** * ** ** * * * * ** ** ** *
-- *** ***** * * * * * * * * ** * * * *
-- * * * * * * * * * * * * * * *
-- * * * * * * * * * * ** * * * *
-- * ** * * ** * ** * * ** * * * *
-- ** **** ** * **** ***** * ** *** * *
-- * * *
-- * * *
-- * * *
-- * * * *
-- **** * *
--
--/////////////////////////////////////////////////////////////////////////////////////////////////
-- C O N F I D E N T I A L S O U R C E C O D E -- D O N O T D I S T R I B U T E
--/////////////////////////////////////////////////////////////////////////////////////////////////
--
-- $File: //depot/Projects/StarWars_Steam/FOC/Run/Data/Scripts/AI/BuildCantinaPlan.lua $
--
-- Original Author: James Yarrow
--
-- $Author: Brian_Hayes $
--
-- $Change: 637819 $
--
-- $DateTime: 2017/03/22 10:16:16 $
--
-- $Revision: #1 $
--
--/////////////////////////////////////////////////////////////////////////////////////////////////
require("pgevents")
-- Tell the script pooling system to pre-cache this number of scripts.
ScriptPoolCount = 4
function Definitions()
DebugMessage("%s -- In Definitions", tostring(Script))
Category = "Build_Cantina"
IgnoreTarget = true
TaskForce = {
{
"StructureForce",
"Ground_Cantina_E | Ground_Cantina_R = 1"
}
}
DebugMessage("%s -- Done Definitions", tostring(Script))
end
function StructureForce_Thread()
DebugMessage("%s -- In StructureForce_Thread.", tostring(Script))
Sleep(1)
-- StructureForce.Set_As_Goal_System_Removable(false)
AssembleForce(StructureForce)
StructureForce.Set_Plan_Result(true)
DebugMessage("%s -- StructureForce done!", tostring(Script));
ScriptExit()
end
function StructureForce_Production_Failed(tf, failed_object_type)
DebugMessage("%s -- Abandonning plan owing to production failure.", tostring(Script))
ScriptExit()
end

View File

@@ -0,0 +1,65 @@
--/////////////////////////////////////////////////////////////////////////////////////////////////
-- (c) Galyana's Ultimate Empire at War Modifications
--
-- ****** *** *** ************ *** ***
-- * * * * * * * *
-- * * * * * * *
-- * * * * * * *
-- * * * * * **** * * *
-- * * * ****** * * * *
-- * **** * * * * * * * *** *
-- * * * * * * * * * *
-- * * * * * * * * * *
-- * * * * * * * ** * * *
-- ****** ****** ************ **** ** *******
--/////////////////////////////////////////////////////////////////////////////////////////////////
-- C O N F I D E N T I A L S O U R C E C O D E -- D O N O T D I S T R I B U T E
--/////////////////////////////////////////////////////////////////////////////////////////////////
--
-- File: GUEaW/Data/Scripts/AI/BuildEconomicStructurePlan.lua
--
-- Original Editor: Giovanni Galyana
--
-- Final Edit By: Giovanni Galyana
--
-- Date: 3 March, 2018
--
-- Revisions: 3
--
--/////////////////////////////////////////////////////////////////////////////////////////////////
require("pgevents")
function Definitions()
DebugMessage("%s -- In Definitions", tostring(Script))
Category = "Build_Economic_Structure"
IgnoreTarget = true
TaskForce = {
{
"StructureForce",
"Rebel_Ground_Mining_Facility_GC | Rebel_Ground_Mining_Facility_GC_Unlim | Rebel_Mineral_Extractor_GC | Empire_Ground_Mining_Facility_GC | Empire_Ground_Mining_Facility_GC_Unlim | Empire_Mineral_Extractor_GC | Hutts_Ground_Mining_Facility_GC | Hutts_Ground_Mining_Facility_GC_Unlim | Hutt_Mineral_Extractor_GC = 1"
}
}
DebugMessage("%s -- Done Definitions", tostring(Script))
end
function StructureForce_Thread()
DebugMessage("%s -- In StructureForce_Thread.", tostring(Script))
Sleep(1)
-- StructureForce.Set_As_Goal_System_Removable(false)
AssembleForce(StructureForce)
StructureForce.Set_Plan_Result(true)
DebugMessage("%s -- StructureForce done!", tostring(Script));
ScriptExit()
end
function StructureForce_Production_Failed(tf, failed_object_type)
DebugMessage("%s -- Abandonning plan owing to production failure.", tostring(Script))
ScriptExit()
end

View File

@@ -0,0 +1,66 @@
--/////////////////////////////////////////////////////////////////////////////////////////////////
-- (c) Galyana's Ultimate Empire at War Modifications
--
-- ****** *** *** ************ *** ***
-- * * * * * * * *
-- * * * * * * *
-- * * * * * * *
-- * * * * * **** * * *
-- * * * ****** * * * *
-- * **** * * * * * * * *** *
-- * * * * * * * * * *
-- * * * * * * * * * *
-- * * * * * * * ** * * *
-- ****** ****** ************ **** ** *******
--/////////////////////////////////////////////////////////////////////////////////////////////////
-- C O N F I D E N T I A L S O U R C E C O D E -- D O N O T D I S T R I B U T E
--/////////////////////////////////////////////////////////////////////////////////////////////////
--
-- File: GUEaW/Data/Scripts/AI/BuildGroundDefensiveStructurePlan.LUA
--
-- Original Editor: Giovanni Galyana
--
-- Final Edit By: Giovanni Galyana
--
-- Date: 10 January, 2019
--
-- Revisions: 2
--
--/////////////////////////////////////////////////////////////////////////////////////////////////
require("pgevents")
function Definitions()
DebugMessage("%s -- In Definitions", tostring(Script))
-- Category = "Build_Ground_Defensive_Structure"
Category = "AlwaysOff"
IgnoreTarget = true
TaskForce = {
{
"StructureForce",
"E_Ground_Base_Shield_740 | R_Ground_Base_Shield_740 | H_Ground_Base_Shield_740 | E_Galactic_Turbolaser_Tower_Defenses | R_Galactic_Turbolaser_Tower_Defenses | H_Galactic_Turbolaser_Tower_Defenses | E_Ground_Magnepulse_Cannon_GC = 1"
}
}
DebugMessage("%s -- Done Definitions", tostring(Script))
end
function StructureForce_Thread()
DebugMessage("%s -- In StructureForce_Thread.", tostring(Script))
Sleep(1)
StructureForce.Set_As_Goal_System_Removable(false)
AssembleForce(StructureForce)
StructureForce.Set_Plan_Result(true)
DebugMessage("%s -- StructureForce done!", tostring(Script));
ScriptExit()
end
function StructureForce_Production_Failed(tf, failed_object_type)
DebugMessage("%s -- Abandonning plan owing to production failure.", tostring(Script))
ScriptExit()
end

View File

@@ -0,0 +1,61 @@
--/////////////////////////////////////////////////////////////////////////////////////////////////
-- (c) Galyana's Ultimate Empire at War Modifications
--
-- ****** *** *** ************ *** ***
-- * * * * * * * *
-- * * * * * * *
-- * * * * * * *
-- * * * * * **** * * *
-- * * * ****** * * * *
-- * **** * * * * * * * *** *
-- * * * * * * * * * *
-- * * * * * * * * * *
-- * * * * * * * ** * * *
-- ****** ****** ************ **** ** *******
--/////////////////////////////////////////////////////////////////////////////////////////////////
-- C O N F I D E N T I A L S O U R C E C O D E -- D O N O T D I S T R I B U T E
--/////////////////////////////////////////////////////////////////////////////////////////////////
--
-- File: GUEaW/Data/Scripts/AI/BuildGroundForcesPlan.lua
--
-- Original Editor: Giovanni Galyana
--
-- Final Edit By: Giovanni Galyana
--
-- Date: 25 October, 2017
--
-- Revisions: 0
--
--/////////////////////////////////////////////////////////////////////////////////////////////////
require("pgevents")
function Definitions()
Category = "Build_Ground_Forces"
IgnoreTarget = true
TaskForce = {
{
"ReserveForce"
,"Infantry = 0,2"
,"Vehicle = 0,2"
,"Air = 0,1"
,"-F9TZ_Cloaking_Transport_Company"
,"-HAV_Juggernaut_Company"
,"-Gallofree_HTT_Company"
,"-Hutt_SailBarge"
,"-Field_Com_Hutts_Team"
,"-Field_Com_Rebel_Team"
,"-Field_Com_Empire_Team"
}
}
RequiredCategories = { "Vehicle" }
AllowFreeStoreUnits = false
end
function ReserveForce_Thread()
ReserveForce.Set_As_Goal_System_Removable(false)
BlockOnCommand(ReserveForce.Produce_Force())
ReserveForce.Set_Plan_Result(true)
end

View File

@@ -0,0 +1,79 @@
-- $Id: //depot/Projects/StarWars_Steam/FOC/Run/Data/Scripts/AI/BuildHuttPalacePlan.lua#1 $
--/////////////////////////////////////////////////////////////////////////////////////////////////
--
-- (C) Petroglyph Games, Inc.
--
--
-- ***** ** * *
-- * ** * * *
-- * * * * *
-- * * * * * * * *
-- * * *** ****** * ** **** *** * * * ***** * ***
-- * ** * * * ** * ** ** * * * * ** ** ** *
-- *** ***** * * * * * * * * ** * * * *
-- * * * * * * * * * * * * * * *
-- * * * * * * * * * * ** * * * *
-- * ** * * ** * ** * * ** * * * *
-- ** **** ** * **** ***** * ** *** * *
-- * * *
-- * * *
-- * * *
-- * * * *
-- **** * *
--
--/////////////////////////////////////////////////////////////////////////////////////////////////
-- C O N F I D E N T I A L S O U R C E C O D E -- D O N O T D I S T R I B U T E
--/////////////////////////////////////////////////////////////////////////////////////////////////
--
-- $File: //depot/Projects/StarWars_Steam/FOC/Run/Data/Scripts/AI/BuildHuttPalacePlan.lua $
--
-- Original Author: Steve_Copeland
--
-- $Author: Brian_Hayes $
--
-- $Change: 637819 $
--
-- $DateTime: 2017/03/22 10:16:16 $
--
-- $Revision: #1 $
--
--/////////////////////////////////////////////////////////////////////////////////////////////////
require("pgevents")
function Definitions()
DebugMessage("%s -- In Definitions", tostring(Script))
Category = "AlwaysOff"
-- Category = "Build_Hutt_Palace"
IgnoreTarget = true
TaskForce = {
{
"StructureForce",
-- "Ground_Hutt_Palace_E | Ground_Hutt_Palace_R = 1"
}
}
DebugMessage("%s -- Done Definitions", tostring(Script))
end
function StructureForce_Thread()
DebugMessage("%s -- In StructureForce_Thread.", tostring(Script))
Sleep(1)
-- StructureForce.Set_As_Goal_System_Removable(false)
AssembleForce(StructureForce)
StructureForce.Set_Plan_Result(true)
DebugMessage("%s -- StructureForce done!", tostring(Script));
ScriptExit()
end
function StructureForce_Production_Failed(tf, failed_object_type)
DebugMessage("%s -- Abandonning plan owing to production failure.", tostring(Script))
ScriptExit()
end

View File

@@ -0,0 +1,79 @@
-- $Id: //depot/Projects/StarWars_Steam/FOC/Run/Data/Scripts/AI/BuildInfiltratorFacility.lua#1 $
--/////////////////////////////////////////////////////////////////////////////////////////////////
--
-- (C) Petroglyph Games, Inc.
--
--
-- ***** ** * *
-- * ** * * *
-- * * * * *
-- * * * * * * * *
-- * * *** ****** * ** **** *** * * * ***** * ***
-- * ** * * * ** * ** ** * * * * ** ** ** *
-- *** ***** * * * * * * * * ** * * * *
-- * * * * * * * * * * * * * * *
-- * * * * * * * * * * ** * * * *
-- * ** * * ** * ** * * ** * * * *
-- ** **** ** * **** ***** * ** *** * *
-- * * *
-- * * *
-- * * *
-- * * * *
-- **** * *
--
--/////////////////////////////////////////////////////////////////////////////////////////////////
-- C O N F I D E N T I A L S O U R C E C O D E -- D O N O T D I S T R I B U T E
--/////////////////////////////////////////////////////////////////////////////////////////////////
--
-- $File: //depot/Projects/StarWars_Steam/FOC/Run/Data/Scripts/AI/BuildInfiltratorFacility.lua $
--
-- Original Author: Steve_Copeland
--
-- $Author: Brian_Hayes $
--
-- $Change: 637819 $
--
-- $DateTime: 2017/03/22 10:16:16 $
--
-- $Revision: #1 $
--
--/////////////////////////////////////////////////////////////////////////////////////////////////
require("pgevents")
function Definitions()
DebugMessage("%s -- In Definitions", tostring(Script))
Category = "Build_Infiltrator_Facility"
IgnoreTarget = true
TaskForce = {
{
"StructureForce",
"Ground_Infiltrator_Facility = 1"
}
}
DebugMessage("%s -- Done Definitions", tostring(Script))
end
function StructureForce_Thread()
DebugMessage("%s -- In StructureForce_Thread.", tostring(Script))
Sleep(1)
StructureForce.Set_As_Goal_System_Removable(false)
AssembleForce(StructureForce)
StructureForce.Set_Plan_Result(true)
DebugMessage("%s -- StructureForce done!", tostring(Script));
ScriptExit()
end
function StructureForce_Production_Failed(tf, failed_object_type)
DebugMessage("%s -- Abandonning plan owing to production failure.", tostring(Script))
ScriptExit()
end

View File

@@ -0,0 +1,69 @@
--/////////////////////////////////////////////////////////////////////////////////////////////////
-- (c) Galyana's Ultimate Empire at War Modifications
--
-- ****** *** *** ************ *** ***
-- * * * * * * * *
-- * * * * * * *
-- * * * * * * *
-- * * * * * **** * * *
-- * * * ****** * * * *
-- * **** * * * * * * * *** *
-- * * * * * * * * * *
-- * * * * * * * * * *
-- * * * * * * * ** * * *
-- ****** ****** ************ **** ** *******
--/////////////////////////////////////////////////////////////////////////////////////////////////
-- C O N F I D E N T I A L S O U R C E C O D E -- D O N O T D I S T R I B U T E
--/////////////////////////////////////////////////////////////////////////////////////////////////
--
-- File: GUEaW/Data/Scripts/AI/BuildJammingStationPlan.LUA
--
-- Original Editor: Giovanni Galyana
--
-- Final Edit By: Giovanni Galyana
--
-- Date: 6 May, 2018
--
-- Revisions: 2
--
--/////////////////////////////////////////////////////////////////////////////////////////////////
require("pgevents")
function Definitions()
DebugMessage("%s -- In Definitions", tostring(Script))
Category = "Build_Jamming_Station"
IgnoreTarget = true
TaskForce = {
{
"StructureForce",
"R_Orbital_Jamming_Station | E_Orbital_Jamming_Station = 1"
}
}
DebugMessage("%s -- Done Definitions", tostring(Script))
end
function StructureForce_Thread()
DebugMessage("%s -- In StructureForce_Thread.", tostring(Script))
Sleep(1)
StructureForce.Set_As_Goal_System_Removable(false)
AssembleForce(StructureForce)
StructureForce.Set_Plan_Result(true)
DebugMessage("%s -- StructureForce done!", tostring(Script));
ScriptExit()
end
function StructureForce_Production_Failed(tf, failed_object_type)
DebugMessage("%s -- Abandonning plan owing to production failure.", tostring(Script))
ScriptExit()
end

View File

@@ -0,0 +1,67 @@
--/////////////////////////////////////////////////////////////////////////////////////////////////
-- (c) Galyana's Ultimate Empire at War Modifications
--
-- ****** *** *** ************ *** ***
-- * * * * * * * *
-- * * * * * * *
-- * * * * * * *
-- * * * * * **** * * *
-- * * * ****** * * * *
-- * **** * * * * * * * *** *
-- * * * * * * * * * *
-- * * * * * * * * * *
-- * * * * * * * ** * * *
-- ****** ****** ************ **** ** *******
--/////////////////////////////////////////////////////////////////////////////////////////////////
-- C O N F I D E N T I A L S O U R C E C O D E -- D O N O T D I S T R I B U T E
--/////////////////////////////////////////////////////////////////////////////////////////////////
--
-- File: GUEaW/Data/Scripts/AI/BuildScannerPlan.LUA
--
-- Original Editor: Giovanni Galyana
--
-- Final Edit By: Giovanni Galyana
--
-- Date: 6 May, 2018
--
-- Revisions: 1
--
--/////////////////////////////////////////////////////////////////////////////////////////////////
require("pgevents")
function Definitions()
DebugMessage("%s -- In Definitions", tostring(Script))
Category = "Build_Scanner"
IgnoreTarget = true
TaskForce = {
{
"StructureForce",
"Empire_Orbital_Long_Range_Scanner | Rebel_Orbital_Long_Range_Scanner = 1"
}
}
DebugMessage("%s -- Done Definitions", tostring(Script))
end
function StructureForce_Thread()
DebugMessage("%s -- In StructureForce_Thread.", tostring(Script))
Sleep(1)
StructureForce.Set_As_Goal_System_Removable(false)
AssembleForce(StructureForce)
StructureForce.Set_Plan_Result(true)
DebugMessage("%s -- StructureForce done!", tostring(Script));
ScriptExit()
end
function StructureForce_Production_Failed(tf, failed_object_type)
DebugMessage("%s -- Abandonning plan owing to production failure.", tostring(Script))
ScriptExit()
end

View File

@@ -0,0 +1,66 @@
--/////////////////////////////////////////////////////////////////////////////////////////////////
-- (c) Galyana's Ultimate Empire at War Modifications
--
-- ****** *** *** ************ *** ***
-- * * * * * * * *
-- * * * * * * *
-- * * * * * * *
-- * * * * * **** * * *
-- * * * ****** * * * *
-- * **** * * * * * * * *** *
-- * * * * * * * * * *
-- * * * * * * * * * *
-- * * * * * * * ** * * *
-- ****** ****** ************ **** ** *******
--/////////////////////////////////////////////////////////////////////////////////////////////////
-- C O N F I D E N T I A L S O U R C E C O D E -- D O N O T D I S T R I B U T E
--/////////////////////////////////////////////////////////////////////////////////////////////////
--
-- File: GUEaW/Data/Scripts/AI/BuildSpaceDefensiveStructurePlan.LUA
--
-- Original Editor: Giovanni Galyana
--
-- Final Edit By: Giovanni Galyana
--
-- Date: 6 May, 2018
--
-- Revisions: 2
--
--/////////////////////////////////////////////////////////////////////////////////////////////////
require("pgevents")
function Definitions()
DebugMessage("%s -- In Definitions", tostring(Script))
-- Category = "Build_Space_Defensive_Structure"
Category = "AlwaysOff"
IgnoreTarget = true
TaskForce = {
{
"StructureForce",
"E_Orbital_Jamming_Station | R_Orbital_Jamming_Station | Ground_Ion_Cannon | Ground_Empire_Hypervelocity_Gun | Ground_Hutts_Hypervelocity_Gun | Empire_Defense_Station_GC | Rebel_Defense_Station_GC | Hutt_Defense_Station_GC = 1"
}
}
DebugMessage("%s -- Done Definitions", tostring(Script))
end
function StructureForce_Thread()
DebugMessage("%s -- In StructureForce_Thread.", tostring(Script))
Sleep(1)
StructureForce.Set_As_Goal_System_Removable(false)
AssembleForce(StructureForce)
StructureForce.Set_Plan_Result(true)
DebugMessage("%s -- StructureForce done!", tostring(Script));
ScriptExit()
end
function StructureForce_Production_Failed(tf, failed_object_type)
DebugMessage("%s -- Abandonning plan owing to production failure.", tostring(Script))
ScriptExit()
end

View File

@@ -0,0 +1,60 @@
--/////////////////////////////////////////////////////////////////////////////////////////////////
-- (c) Galyana's Ultimate Empire at War Modifications
--
-- ****** *** *** ************ *** ***
-- * * * * * * * *
-- * * * * * * *
-- * * * * * * *
-- * * * * * **** * * *
-- * * * ****** * * * *
-- * **** * * * * * * * *** *
-- * * * * * * * * * *
-- * * * * * * * * * *
-- * * * * * * * ** * * *
-- ****** ****** ************ **** ** *******
--/////////////////////////////////////////////////////////////////////////////////////////////////
-- C O N F I D E N T I A L S O U R C E C O D E -- D O N O T D I S T R I B U T E
--/////////////////////////////////////////////////////////////////////////////////////////////////
--
-- File: GUEaW/Data/Scripts/AI/BuildSpaceForcesPlan.lua
--
-- Original Editor: Giovanni Galyana
--
-- Final Edit By: Giovanni Galyana
--
-- Date: 10 January, 2019
--
-- Revisions: 1
--
--/////////////////////////////////////////////////////////////////////////////////////////////////
require("pgevents")
-- Tell the script pooling system to pre-cache this number of scripts.
ScriptPoolCount = 6
function Definitions()
Category = "Build_Space_Forces"
IgnoreTarget = true
--Fighters are omitted deliberately. Since they're cheap, build fast and are quickly killed it's typically better
--to build them as we need them to attack. For defensive purposes we'll rely on space station garrisons for our fighter
--needs
TaskForce = {
{
"ReserveForce"
,"DenyHeroAttach"
,"Corvette = 0,5" --SoaFE: was 0,4
,"Frigate = 0,6" --SoaFE: was 0,4
,"Capital = 0,4"
}
}
RequiredCategories = { "Corvette | Frigate | Capital" }
AllowFreeStoreUnits = false
end
function ReserveForce_Thread()
ReserveForce.Set_As_Goal_System_Removable(false)
BlockOnCommand(ReserveForce.Produce_Force())
ReserveForce.Set_Plan_Result(true)
end

View File

@@ -0,0 +1,59 @@
--/////////////////////////////////////////////////////////////////////////////////////////////////
-- (c) Galyana's Ultimate Empire at War Modifications
--
-- ****** *** *** ************ *** ***
-- * * * * * * * *
-- * * * * * * *
-- * * * * * * *
-- * * * * * **** * * *
-- * * * ****** * * * *
-- * **** * * * * * * * *** *
-- * * * * * * * * * *
-- * * * * * * * * * *
-- * * * * * * * ** * * *
-- ****** ****** ************ **** ** *******
--/////////////////////////////////////////////////////////////////////////////////////////////////
-- C O N F I D E N T I A L S O U R C E C O D E -- D O N O T D I S T R I B U T E
--/////////////////////////////////////////////////////////////////////////////////////////////////
--
-- File: GUEaW/Data/Scripts/AI/BuildTurbolasers.LUA
--
-- Original Editor: Giovanni Galyana
--
-- Final Edit By: Giovanni Galyana
--
-- Date: 28 Septembter, 2012
--
-- Revisions: 0
--
--/////////////////////////////////////////////////////////////////////////////////////////////////
require("pgevents")
function Definitions()
Category = "Build_Turbolasers"
IgnoreTarget = true
TaskForce = {
{
"StructureForce",
"E_Galactic_Turbolaser_Tower_Defenses | R_Galactic_Turbolaser_Tower_Defenses | H_Galactic_Turbolaser_Tower_Defenses = 1"
}
}
end
function StructureForce_Thread()
Sleep(1)
StructureForce.Set_As_Goal_System_Removable(false)
AssembleForce(StructureForce)
StructureForce.Set_Plan_Result(true)
ScriptExit()
end
function StructureForce_Production_Failed(tf, failed_object_type)
DebugMessage("%s -- Abandonning plan owing to production failure.", tostring(Script))
ScriptExit()
end

View File

@@ -0,0 +1,65 @@
--/////////////////////////////////////////////////////////////////////////////////////////////////
-- (c) Galyana's Ultimate Empire at War Modifications
--
-- ****** *** *** ************ *** ***
-- * * * * * * * *
-- * * * * * * *
-- * * * * * * *
-- * * * * * **** * * *
-- * * * ****** * * * *
-- * **** * * * * * * * *** *
-- * * * * * * * * * *
-- * * * * * * * * * *
-- * * * * * * * ** * * *
-- ****** ****** ************ **** ** *******
--/////////////////////////////////////////////////////////////////////////////////////////////////
-- C O N F I D E N T I A L S O U R C E C O D E -- D O N O T D I S T R I B U T E
--/////////////////////////////////////////////////////////////////////////////////////////////////
--
-- File: GUEaW/Data/Scripts/AI/BuildWeaponStructurePlan.LUA
--
-- Original Editor: Giovanni Galyana
--
-- Final Edit By: Giovanni Galyana
--
-- Date: 10 January, 2019
--
-- Revisions: 2
--
--/////////////////////////////////////////////////////////////////////////////////////////////////
require("pgevents")
function Definitions()
DebugMessage("%s -- In Definitions", tostring(Script))
Category = "Build_Weapon"
IgnoreTarget = true
TaskForce = {
{
"StructureForce",
"Ground_Ion_Cannon | Ground_Empire_Hypervelocity_Gun | E_Ground_Magnepulse_Cannon | E_Ground_Magnepulse_Cannon_GC | Ground_Hutts_Hypervelocity_Gun = 1"
}
}
DebugMessage("%s -- Done Definitions", tostring(Script))
end
function StructureForce_Thread()
DebugMessage("%s -- In StructureForce_Thread.", tostring(Script))
Sleep(1)
StructureForce.Set_As_Goal_System_Removable(false)
AssembleForce(StructureForce)
StructureForce.Set_Plan_Result(true)
DebugMessage("%s -- StructureForce done!", tostring(Script));
ScriptExit()
end
function StructureForce_Production_Failed(tf, failed_object_type)
DebugMessage("%s -- Abandonning plan owing to production failure.", tostring(Script))
ScriptExit()
end

View File

@@ -0,0 +1,231 @@
-- $Id: //depot/Projects/StarWars_Expansion/Run/Data/Scripts/AI/ConquerOpponentPlan.lua#1 $
--/////////////////////////////////////////////////////////////////////////////////////////////////
--
-- (C) Petroglyph Games, Inc.
--
--
-- ***** ** * *
-- * ** * * *
-- * * * * *
-- * * * * * * * *
-- * * *** ****** * ** **** *** * * * ***** * ***
-- * ** * * * ** * ** ** * * * * ** ** ** *
-- *** ***** * * * * * * * * ** * * * *
-- * * * * * * * * * * * * * * *
-- * * * * * * * * * * ** * * * *
-- * ** * * ** * ** * * ** * * * *
-- ** **** ** * **** ***** * ** *** * *
-- * * *
-- * * *
-- * * *
-- * * * *
-- **** * *
--
--/////////////////////////////////////////////////////////////////////////////////////////////////
-- C O N F I D E N T I A L S O U R C E C O D E -- D O N O T D I S T R I B U T E
--/////////////////////////////////////////////////////////////////////////////////////////////////
--
-- $File: //depot/Projects/StarWars_Expansion/Run/Data/Scripts/AI/ConquerOpponentPlan.lua $
--
-- Original Author: Brian Hayes
--
-- $Author: Andre_Arsenault $
--
-- $Change: 37816 $
--
-- $DateTime: 2006/02/15 15:33:33 $
--
-- $Revision: #1 $
--
--/////////////////////////////////////////////////////////////////////////////////////////////////
require("pgevents")
-- Tell the script pooling system to pre-cache this number of scripts.
ScriptPoolCount = 2
--
-- Galactic Mode Contrast Script
--
function Definitions()
MinContrastScale = 1.25
MaxContrastScale = 1.75
Category = "Conquer_Opponent"
TaskForce = {
-- First Task Force
{
"SpaceForce"
,"MinimumTotalSize = 8" -- SoaFE was 4
,"MinimumTotalForce = 5000" -- SoaFE was 2500
,"Frigate | Capital | Corvette | Bomber | Fighter = 100%"
},
{
"GroundForce"
,"MinimumTotalSize = 5" -- SoaFE was 4
,"MinimumTotalForce = 800" -- SoaFE was 750
,"Vehicle | Infantry | Air = 100%"
}
}
RequiredCategories = { "Infantry", "Corvette | Frigate | Capital | Super" } --Must have at least one ground unit, also make sure space force is reasonable
PerFailureContrastAdjust = 0.5
SpaceSecured = true
LandSecured = false
MovingGroundForceToTarget = false
WasConflict = false
end
function SpaceForce_Thread()
-- Since we're using plan failure to adjust contrast, we're
-- only concerned with failures in battle. Default the
-- plan to successful and then
-- only on the event of our task force being killed is the
-- plan set to a failed state.
SpaceForce.Set_Plan_Result(true)
SpaceSecured = false
if SpaceForce.Are_All_Units_On_Free_Store() == true then
AssembleForce(SpaceForce)
else
BlockOnCommand(SpaceForce.Produce_Force());
return
end
if SpaceForce.Get_Force_Count() == 0 then
if EvaluatePerception("Is_Good_Ground_Grab_Target", PlayerObject, Target) == 0 then
ScriptExit()
else
SpaceSecured = true
end
else
BlockOnCommand(SpaceForce.Move_To(Target))
WasConflict = true
if SpaceForce.Get_Force_Count() == 0 then
SpaceForce.Set_Plan_Result(false)
Exit_Plan_With_Possible_Sleep()
end
SpaceSecured = true
while not LandSecured do
Sleep(5)
end
SpaceForce.Release_Forces(1.0)
end
end
function GroundForce_Thread()
--Needs to be done by both taskforces - sometimes we may only create a ground force, and if we
--declare it a failure we'll just end up with crazy contrast escalation.
GroundForce.Set_Plan_Result(true)
if GroundForce.Are_All_Units_On_Free_Store() == true then
AssembleForce(GroundForce)
else
BlockOnCommand(GroundForce.Produce_Force());
return
end
LandUnits(GroundForce)
while not SpaceSecured do
if WasConflict then
Exit_Plan_With_Possible_Sleep()
end
Sleep(5)
end
if not LaunchUnits(GroundForce) then
Exit_Plan_With_Possible_Sleep()
end
if EvaluatePerception("Is_Good_Ground_Grab_Target", PlayerObject, Target) == 0 then
Exit_Plan_With_Possible_Sleep()
end
MovingGroundForceToTarget = true
BlockOnCommand(GroundForce.Move_To(Target))
MovingGroundForceToTarget = false
WasConflict = true
if Invade(GroundForce) == false then
GroundForce.Set_Plan_Result(false)
Exit_Plan_With_Possible_Sleep()
end
-- This plan has all but succeeded; make sure AI systems don't remove it
GroundForce.Set_As_Goal_System_Removable(false)
GroundForce.Test_Target_Contrast(false)
LandSecured = true
GroundForce.Release_Forces(1.0)
FundBases(PlayerObject, Target)
Exit_Plan_With_Possible_Sleep()
end
function Exit_Plan_With_Possible_Sleep()
difficulty = "Easy"
if PlayerObject then
difficulty = PlayerObject.Get_Difficulty()
end
sleep_duration = DifficultyBasedMinPause(difficulty)
if SpaceForce then
SpaceForce.Release_Forces(1.0)
end
GroundForce.Release_Forces(1.0)
if WasConflict and (not GalacticAttackAllowed(difficulty, 2)) then
Sleep(sleep_duration)
end
ScriptExit()
end
function SpaceForce_Production_Failed(tf, failed_object_type)
ScriptExit()
end
function GroundForce_Production_Failed(tf, failed_object_type)
ScriptExit()
end
function SpaceForce_Original_Target_Owner_Changed(tf, old_owner, new_owner)
--Ignore changes to neutral - it might just be temporary on the way to
--passing into my control.
if new_owner ~= PlayerObject and new_owner.Is_Neutral() == false then
if (not LandSecured) or (PlayerObject.Get_Difficulty() == "Hard") then
ScriptExit()
end
end
end
function GroundForce_Original_Target_Owner_Changed(tf, old_owner, new_owner)
--Ignore changes to neutral - it might just be temporary on the way to
--passing into my control.
if new_owner ~= PlayerObject and new_owner.Is_Neutral() == false then
if (not LandSecured) or (PlayerObject.Get_Difficulty() == "Hard") then
ScriptExit()
end
end
end
function SpaceForce_No_Units_Remaining()
if not LandSecured then
SpaceForce.Set_Plan_Result(false)
--Don't exit since we need to sleep to enforce delays between AI attacks (can't be done inside an event handler)
end
end
function GroundForce_No_Units_Remaining()
if not LandSecured then
GroundForce.Set_Plan_Result(false)
--Don't exit since we need to sleep to enforce delays between AI attacks (can't be done inside an event handler)
end
end

View File

@@ -0,0 +1,113 @@
-- $Id: //depot/Projects/StarWars_Steam/FOC/Run/Data/Scripts/AI/ConquerPiratePlan.lua#1 $
--/////////////////////////////////////////////////////////////////////////////////////////////////
--
-- (C) Petroglyph Games, Inc.
--
--
-- ***** ** * *
-- * ** * * *
-- * * * * *
-- * * * * * * * *
-- * * *** ****** * ** **** *** * * * ***** * ***
-- * ** * * * ** * ** ** * * * * ** ** ** *
-- *** ***** * * * * * * * * ** * * * *
-- * * * * * * * * * * * * * * *
-- * * * * * * * * * * ** * * * *
-- * ** * * ** * ** * * ** * * * *
-- ** **** ** * **** ***** * ** *** * *
-- * * *
-- * * *
-- * * *
-- * * * *
-- **** * *
--
--/////////////////////////////////////////////////////////////////////////////////////////////////
-- C O N F I D E N T I A L S O U R C E C O D E -- D O N O T D I S T R I B U T E
--/////////////////////////////////////////////////////////////////////////////////////////////////
--
-- $File: //depot/Projects/StarWars_Steam/FOC/Run/Data/Scripts/AI/ConquerPiratePlan.lua $
--
-- Original Author: James Yarrow
--
-- $Author: Brian_Hayes $
--
-- $Change: 637819 $
--
-- $DateTime: 2017/03/22 10:16:16 $
--
-- $Revision: #1 $
--
--/////////////////////////////////////////////////////////////////////////////////////////////////
require("pgtaskforce")
-- Tell the script pooling system to pre-cache this number of scripts.
ScriptPoolCount = 4
function Definitions()
MinContrastScale = 1.1
MaxContrastScale = 1.15
Category = "Conquer_Pirate"
TaskForce = {
{
"MainForce"
, "Infantry | Vehicle | Air | Fighter | Bomber | Corvette | Frigate | Super | Capital = 100%"
}
}
RequiredCategories = { "Air | Infantry | Vehicle" }
LandSecured = false
end
function MainForce_Thread()
-- Since we're using plan failure to adjust contrast, we're
-- only concerned with failures in battle. Default the
-- plan to successful and then
-- only on the event of our task force being killed is the
-- plan set to a failed state.
MainForce.Set_Plan_Result(true)
if MainForce.Are_All_Units_On_Free_Store() == true then
AssembleForce(MainForce)
else
BlockOnCommand(MainForce.Produce_Force());
return
end
BlockOnCommand(MainForce.Move_To(Target))
if MainForce.Get_Force_Count() == 0 then
MainForce.Set_Plan_Result(false)
ScriptExit()
end
if Invade(MainForce) == false then
MainForce.Set_Plan_Result(false)
ScriptExit()
end
LandSecured = true
MainForce.Release_Forces(1.0)
FundBases(PlayerObject, Target)
ScriptExit()
end
function MainForce_Production_Failed(failed_object_type)
ScriptExit()
end
function MainForce_Original_Target_Owner_Changed(tf, old_owner, new_owner)
--Ignore changes to neutral - it might just be temporary on the way to
--passing into my control.
if new_owner ~= PlayerObject and new_owner.Is_Neutral() == false then
ScriptExit()
end
end
function MainForce_No_Units_Remaining()
if not LandSecured then
MainForce.Set_Plan_Result(false)
ScriptExit()
end
end

View File

@@ -0,0 +1,205 @@
--/////////////////////////////////////////////////////////////////////////////////////////////////
-- (c) Galyana's Ultimate Empire at War Modifications
--
-- ****** *** *** ************ *** ***
-- * * * * * * * *
-- * * * * * * *
-- * * * * * * *
-- * * * * * **** * * *
-- * * * ****** * * * *
-- * **** * * * * * * * *** *
-- * * * * * * * * * *
-- * * * * * * * * * *
-- * * * * * * * ** * * *
-- ****** ****** ************ **** ** *******
--/////////////////////////////////////////////////////////////////////////////////////////////////
-- C O N F I D E N T I A L S O U R C E C O D E -- D O N O T D I S T R I B U T E
--/////////////////////////////////////////////////////////////////////////////////////////////////
--
-- File: GUEaW/Data/Scripts/AI/ContrastToReconnect.lua
--
-- Original Editor: Giovanni Galyana
--
-- Final Edit By: Giovanni Galyana
--
-- Date: 31 January, 2019
--
-- Revisions: 1
--
--/////////////////////////////////////////////////////////////////////////////////////////////////
require("pgevents")
--
-- Galactic Mode Contrast To Reconnect Islands of Nodes Script
--
function Definitions()
DebugMessage("%s -- In Definitions", tostring(Script))
Category = "Conquer_To_Reconnect"
TaskForce = {
-- First Task Force
{
"SpaceForce"
,"MinimumTotalSize = 6" --SoaFE was 4
,"MinimumTotalForce = 3000" --SoaFE was 2500
,"Frigate | Capital | Corvette | Bomber | Fighter = 100%"
},
{
"GroundForce"
,"MinimumTotalSize = 4"
,"MinimumTotalForce = 600" --SoaFE was 750
,"Vehicle | Infantry | Air = 100%"
}
}
RequiredCategories = { "Infantry", "Corvette | Frigate | Capital | Super" } --Must have at least one ground unit, also make sure space force is reasonable
PerFailureContrastAdjust = 0.5
SpaceSecured = true
LandSecured = false
InSpaceConflict = false
WasConflict = false
sleep_duration = 150
DebugMessage("%s -- Done Definitions", tostring(Script))
end
function SpaceForce_Thread()
DebugMessage("%s -- In SpaceForce_Thread.", tostring(Script))
-- Since we're using plan failure to adjust contrast, we're
-- only concerned with failures in battle. Default the
-- plan to successful and then
-- only on the event of our task force being killed is the
-- plan set to a failed state.
SpaceForce.Set_Plan_Result(true)
SpaceSecured = false
if SpaceForce.Are_All_Units_On_Free_Store() == true then
DebugMessage("SpaceForce converged on target (disconnecting node)")
SynchronizedAssemble(SpaceForce)
WasConflict = true
else
DebugMessage("%s -- Can't freestore allocate all our units, so just allocating build tasks.", tostring(Script))
BlockOnCommand(SpaceForce.Produce_Force());
return
end
if SpaceForce.Get_Force_Count() == 0 then
if EvaluatePerception("Is_Good_Ground_Grab_Target", PlayerObject, Target) == 0 then
DebugMessage("%s -- No SpaceForce at target and enemies still present in space. Abandonning plan.", tostring(Script))
SpaceForce.Set_Plan_Result(false)
--Exit_Plan_With_Possible_Sleep()
else
DebugMessage("%s -- No SpaceForce, but Space at target appears clear anyway.", tostring(Script))
SpaceSecured = true
end
else
SpaceSecured = true
while not LandSecured do
Sleep(5)
end
SpaceForce.Release_Forces(1.0)
DebugMessage("%s -- SpaceForce Done! Exiting Script!", tostring(Script))
end
end
function GroundForce_Thread()
DebugMessage("%s -- In GroundForce_Thread.", tostring(Script))
GroundForce.Set_Plan_Result(true)
if GroundForce.Are_All_Units_On_Free_Store() == true then
DebugMessage("%s -- GroundForce waiting for the space force to succede.", tostring(Script))
while not SpaceSecured do
-- if WasConflict then
-- Exit_Plan_With_Possible_Sleep()
-- end
Sleep(5)
end
DebugMessage("%s -- converging ground units on the target.", tostring(Script))
SynchronizedAssemble(GroundForce)
else
DebugMessage("%s -- Can't freestore allocate all our units, so just allocating build tasks.", tostring(Script))
BlockOnCommand(GroundForce.Produce_Force());
return
end
WasConflict = true
if Invade(GroundForce) == false then
DebugMessage("%s -- Curses...The invasion failed! Exiting Script!", tostring(Script))
-- Exit_Plan_With_Possible_Sleep()
end
DebugMessage("%s -- Political control changed building Ground and Starbase.", tostring(Script))
LandSecured = true
GroundForce.Release_Forces(1.0)
GroundForce.Set_Plan_Result(true)
FundBases(PlayerObject, Target)
-- Exit_Plan_With_Possible_Sleep()
end
function Exit_Plan_With_Possible_Sleep()
if SpaceForce then
SpaceForce.Release_Forces(1.0)
end
GroundForce.Release_Forces(1.0)
if WasConflict then
Sleep(sleep_duration)
end
ScriptExit()
end
function SpaceForce_Production_Failed(tf, failed_object_type)
DebugMessage("%s -- Abandonning plan owing to production failure.", tostring(Script))
ScriptExit()
end
function GroundForce_Production_Failed(tf, failed_object_type)
DebugMessage("%s -- Abandonning plan owing to production failure.", tostring(Script))
ScriptExit()
end
function GroundForce_Original_Target_Owner_Changed(tf, old_owner, new_owner)
--Ignore changes to neutral - it might just be temporary on the way to
--passing into my control.
if new_owner ~= PlayerObject and new_owner.Is_Neutral() == false then
if (not LandSecured) or (PlayerObject.Get_Difficulty() == "Hard") then
ScriptExit()
end
end
end
function SpaceForce_Original_Target_Owner_Changed(tf, old_owner, new_owner)
--Ignore changes to neutral - it might just be temporary on the way to
--passing into my control.
if new_owner ~= PlayerObject and new_owner.Is_Neutral() == false then
if (not LandSecured) or (PlayerObject.Get_Difficulty() == "Hard") then
ScriptExit()
end
end
end
function SpaceForce_No_Units_Remaining()
if not LandSecured then
DebugMessage("%s -- All units dead or non-buildable. Abandonning plan.", tostring(Script))
SpaceForce.Set_Plan_Result(false)
--Don't exit since we need to sleep to enforce delays between AI attacks (can't be done inside an event handler)
end
end
function GroundForce_No_Units_Remaining()
if not LandSecured then
DebugMessage("%s -- All units dead or non-buildable. Abandonning plan.", tostring(Script))
GroundForce.Set_Plan_Result(false)
--Don't exit since we need to sleep to enforce delays between AI attacks (can't be done inside an event handler)
end
end

View File

@@ -0,0 +1,145 @@
-- $Id: //depot/Projects/StarWars_Expansion/Run/Data/Scripts/AI/CrushPlan.lua#1 $
--/////////////////////////////////////////////////////////////////////////////////////////////////
--
-- (C) Petroglyph Games, Inc.
--
--
-- ***** ** * *
-- * ** * * *
-- * * * * *
-- * * * * * * * *
-- * * *** ****** * ** **** *** * * * ***** * ***
-- * ** * * * ** * ** ** * * * * ** ** ** *
-- *** ***** * * * * * * * * ** * * * *
-- * * * * * * * * * * * * * * *
-- * * * * * * * * * * ** * * * *
-- * ** * * ** * ** * * ** * * * *
-- ** **** ** * **** ***** * ** *** * *
-- * * *
-- * * *
-- * * *
-- * * * *
-- **** * *
--
--/////////////////////////////////////////////////////////////////////////////////////////////////
-- C O N F I D E N T I A L S O U R C E C O D E -- D O N O T D I S T R I B U T E
--/////////////////////////////////////////////////////////////////////////////////////////////////
--
-- $File: //depot/Projects/StarWars_Expansion/Run/Data/Scripts/AI/CrushPlan.lua $
--
-- Original Author: James Yarrow
--
-- $Author: Andre_Arsenault $
--
-- $Change: 37816 $
--
-- $DateTime: 2006/02/15 15:33:33 $
--
-- $Revision: #1 $
--
--/////////////////////////////////////////////////////////////////////////////////////////////////
require("PGTaskForce")
-- Tell the script pooling system to pre-cache this number of scripts.
ScriptPoolCount = 2
function Definitions()
DebugMessage("%s -- In Definitions", tostring(Script))
GlobalContrastScale = 3.0
PerFailureContrastAdjust = 0.5
Category = "Conquer_Opponent"
TaskForce = {
{
"MainForce"
,"MinimumTotalSize = 15" --SoaFE was 10
,"MinimumTotalForce = 12000" --SoaFE was 8000
, "Infantry | Vehicle | Air | Fighter | Bomber | Corvette | Frigate | Super | Capital = 100%"
}
}
RequiredCategories = {
"Infantry",
"Corvette | Frigate | Capital | Super"
}
DebugMessage("%s -- Done Definitions", tostring(Script))
LandSecured = false
end
function MainForce_Thread()
difficulty = "Easy"
if PlayerObject then
difficulty = PlayerObject.Get_Difficulty()
end
sleep_duration = DifficultyBasedMinPause(difficulty)
--Let's not even do this on easy: the AI force can just be too overwhelming
if not difficulty == "Hard" then ScriptExit() end
-- Since we're using plan failure to adjust contrast, we're
-- only concerned with failures in battle. Default the
-- plan to successful and then
-- only on the event of our task force being killed is the
-- plan set to a failed state.
MainForce.Set_Plan_Result(true)
if MainForce.Are_All_Units_On_Free_Store() == true then
AssembleForce(MainForce)
else
BlockOnCommand(MainForce.Produce_Force());
return
end
BlockOnCommand(MainForce.Move_To(Target))
if MainForce.Get_Force_Count() == 0 then
MainForce.Set_Plan_Result(false)
Sleep(sleep_duration)
ScriptExit()
end
if Invade(MainForce) == false then
MainForce.Set_Plan_Result(false)
Sleep(sleep_duration)
ScriptExit()
end
-- This plan has all but succeeded; make sure AI systems don't remove it
MainForce.Set_As_Goal_System_Removable(false)
MainForce.Test_Target_Contrast(false)
FundBases(PlayerObject, Target)
LandSecured = true
MainForce.Release_Forces(1.0)
if (not GalacticAttackAllowed(difficulty, 2)) then
Sleep(sleep_duration)
end
ScriptExit()
end
function MainForce_Production_Failed(failed_object_type)
ScriptExit()
end
function MainForce_Original_Target_Owner_Changed(tf, old_owner, new_owner)
--Ignore changes to neutral - it might just be temporary on the way to
--passing into my control.
if new_owner ~= PlayerObject and new_owner.Is_Neutral() == false then
if (not LandSecured) or (PlayerObject.Get_Difficulty() == "Hard") then
ScriptExit()
end
end
end
function MainForce_No_Units_Remaining()
if not LandSecured then
MainForce.Set_Plan_Result(false)
--Don't exit since we need to sleep to enforce delays between AI attacks (can't be done inside an event handler)
end
end

View File

@@ -0,0 +1,99 @@
-- $Id: //depot/Projects/StarWars_Expansion/Run/Data/Scripts/AI/DeathStarUsePlan.lua#1 $
--/////////////////////////////////////////////////////////////////////////////////////////////////
--
-- (C) Petroglyph Games, Inc.
--
--
-- ***** ** * *
-- * ** * * *
-- * * * * *
-- * * * * * * * *
-- * * *** ****** * ** **** *** * * * ***** * ***
-- * ** * * * ** * ** ** * * * * ** ** ** *
-- *** ***** * * * * * * * * ** * * * *
-- * * * * * * * * * * * * * * *
-- * * * * * * * * * * ** * * * *
-- * ** * * ** * ** * * ** * * * *
-- ** **** ** * **** ***** * ** *** * *
-- * * *
-- * * *
-- * * *
-- * * * *
-- **** * *
--
--/////////////////////////////////////////////////////////////////////////////////////////////////
-- C O N F I D E N T I A L S O U R C E C O D E -- D O N O T D I S T R I B U T E
--/////////////////////////////////////////////////////////////////////////////////////////////////
--
-- $File: //depot/Projects/StarWars_Expansion/Run/Data/Scripts/AI/DeathStarUsePlan.lua $
--
-- Original Author: Steve_Copeland
--
-- $Author: Andre_Arsenault $
--
-- $Change: 37816 $
--
-- $DateTime: 2006/02/15 15:33:33 $
--
-- $Revision: #1 $
--
--/////////////////////////////////////////////////////////////////////////////////////////////////
require("pgevents")
-- Death Star Usage
function Definitions()
Category = "Death_Star_Use"
MinContrastScale = 0.75
MaxContrastScale = 1.75
TaskForce = {
{
"DeathStarForce"
,"Frigate | Capital | Corvette | Bomber | Fighter | Super = 100%"
}
}
RequiredCategories = { "Super" }
end
function DeathStarForce_Thread()
AssembleForce(DeathStarForce)
BlockOnCommand(DeathStarForce.Move_To(Target))
difficulty = "Easy"
if PlayerObject then
difficulty = PlayerObject.Get_Difficulty()
end
sleep_duration = DifficultyBasedMinPause(difficulty)
if DeathStarForce.Get_Force_Count() == 0 then
Sleep(sleep_duration)
ScriptExit()
end
-- Landing a hero deploys it, removing it from the game and killing the script. So,
-- we have to indicate success before we land the unit, even though it hasn't deployed.
-- If a hero killer gets her before she deploys, the plan should die before setting itself successful.
DeathStarForce.Set_Plan_Result(true)
BlockOnCommand(LandUnits(DeathStarForce))
-- This plan has all but succeeded; make sure AI systems don't remove it
DeathStarForce.Set_As_Goal_System_Removable(false)
DeathStarForce.Test_Target_Contrast(false)
if (not GalacticAttackAllowed(difficulty, 2)) then
Sleep(sleep_duration)
end
ScriptExit()
end
function DeathStarForce_No_Units_Remaining(tf)
--Do nothing
end
function DeathStarForce_Original_Target_Owner_Changed(tf, old_owner, new_owner)
--Do nothing
end

View File

@@ -0,0 +1,74 @@
-- $Id: //depot/Projects/StarWars_Steam/FOC/Run/Data/Scripts/AI/DeployUnitOnTarget.lua#1 $
--/////////////////////////////////////////////////////////////////////////////////////////////////
--
-- (C) Petroglyph Games, Inc.
--
--
-- ***** ** * *
-- * ** * * *
-- * * * * *
-- * * * * * * * *
-- * * *** ****** * ** **** *** * * * ***** * ***
-- * ** * * * ** * ** ** * * * * ** ** ** *
-- *** ***** * * * * * * * * ** * * * *
-- * * * * * * * * * * * * * * *
-- * * * * * * * * * * ** * * * *
-- * ** * * ** * ** * * ** * * * *
-- ** **** ** * **** ***** * ** *** * *
-- * * *
-- * * *
-- * * *
-- * * * *
-- **** * *
--
--/////////////////////////////////////////////////////////////////////////////////////////////////
-- C O N F I D E N T I A L S O U R C E C O D E -- D O N O T D I S T R I B U T E
--/////////////////////////////////////////////////////////////////////////////////////////////////
--
-- $File: //depot/Projects/StarWars_Steam/FOC/Run/Data/Scripts/AI/DeployUnitOnTarget.lua $
--
-- Original Author: Steve_Copeland
--
-- $Author: Brian_Hayes $
--
-- $Change: 637819 $
--
-- $DateTime: 2017/03/22 10:16:16 $
--
-- $Revision: #1 $
--
--/////////////////////////////////////////////////////////////////////////////////////////////////
require("pgevents")
function Definitions()
DebugMessage("%s -- In Definitions", tostring(Script))
Category = "Remove_Smuggler"
IgnoreTarget = true
TaskForce = {
{
"MainForce",
"DenyHeroAttach",
"Bounty_Hunter_Team_E | Bounty_Hunter_Team_R = 1"
}
}
end
function MainForce_Thread()
DebugMessage("%s -- In MainForce_Thread.", tostring(Script))
BlockOnCommand(MainForce.Produce_Force(AITarget))
-- Landing a hero deploys it, removing it from the game and killing the script. So,
-- we have to indicate success before we land the unit, even though she hasn't deployed.
-- If a hero killer gets her before she deploys, the plan should die before setting itself successful.
MainForce.Set_Plan_Result(true)
BlockOnCommand(LandUnits(MainForce))
DebugMessage("%s -- Finished MainForce_Thread.", tostring(Script))
end

View File

@@ -0,0 +1,70 @@
--/////////////////////////////////////////////////////////////////////////////////////////////////
-- (c) Galyana's Ultimate Empire at War Modifications
--
-- ****** *** *** ************ *** ***
-- * * * * * * * *
-- * * * * * * *
-- * * * * * * *
-- * * * * * **** * * *
-- * * * ****** * * * *
-- * **** * * * * * * * *** *
-- * * * * * * * * * *
-- * * * * * * * * * *
-- * * * * * * * ** * * *
-- ****** ****** ************ **** ** *******
--/////////////////////////////////////////////////////////////////////////////////////////////////
-- C O N F I D E N T I A L S O U R C E C O D E -- D O N O T D I S T R I B U T E
--/////////////////////////////////////////////////////////////////////////////////////////////////
--
-- File: GUEaW/Data/Scripts/AI/EmpireAdvanceTechPlan.LUA
--
-- Original Editor: Giovanni Galyana
--
-- Final Edit By: Giovanni Galyana
--
-- Date: 31 May, 2018
--
-- Revisions: 1
--
--/////////////////////////////////////////////////////////////////////////////////////////////////
require("pgevents")
function Definitions()
DebugMessage("%s -- In Definitions", tostring(Script))
Category = "Advance_Tech_Empire"
IgnoreTarget = true
TaskForce = {
{
"TechForce",
"DS_Primary_Hyperdrive | DS_Shield_Gen | DS_Superlaser_Core | DS_Durasteel | Death_Star_II = 1"
}
}
DebugMessage("%s -- Done Definitions", tostring(Script))
end
function TechForce_Thread()
DebugMessage("%s -- In TechForce_Thread.", tostring(Script))
-- Ensure that all goal feasability will be reevaluated based on the new production budgetting conditions
-- (production underway that is already paid for and remains affordable under new budgets should continue)
Purge_Goals(PlayerObject)
TechForce.Set_As_Goal_System_Removable(false)
Sleep(1)
BlockOnCommand(TechForce.Produce_Force())
TechForce.Set_Plan_Result(true)
DebugMessage("%s -- TechForce done!", tostring(Script));
ScriptExit()
end
function TechForce_Production_Failed(tf, failed_object_type)
DebugMessage("%s -- Abandonning plan owing to production failure.", tostring(Script))
ScriptExit()
end

View File

@@ -0,0 +1,71 @@
-- $Id: //depot/Projects/StarWars_Steam/FOC/Run/Data/Scripts/AI/FlushMajorItemBudget.lua#1 $
--/////////////////////////////////////////////////////////////////////////////////////////////////
--
-- (C) Petroglyph Games, Inc.
--
--
-- ***** ** * *
-- * ** * * *
-- * * * * *
-- * * * * * * * *
-- * * *** ****** * ** **** *** * * * ***** * ***
-- * ** * * * ** * ** ** * * * * ** ** ** *
-- *** ***** * * * * * * * * ** * * * *
-- * * * * * * * * * * * * * * *
-- * * * * * * * * * * ** * * * *
-- * ** * * ** * ** * * ** * * * *
-- ** **** ** * **** ***** * ** *** * *
-- * * *
-- * * *
-- * * *
-- * * * *
-- **** * *
--
--/////////////////////////////////////////////////////////////////////////////////////////////////
-- C O N F I D E N T I A L S O U R C E C O D E -- D O N O T D I S T R I B U T E
--/////////////////////////////////////////////////////////////////////////////////////////////////
--
-- $File: //depot/Projects/StarWars_Steam/FOC/Run/Data/Scripts/AI/FlushMajorItemBudget.lua $
--
-- Original Author: Steve_Copeland
--
-- $Author: Brian_Hayes $
--
-- $Change: 637819 $
--
-- $DateTime: 2017/03/22 10:16:16 $
--
-- $Revision: #1 $
--
--/////////////////////////////////////////////////////////////////////////////////////////////////
require("pgevents")
-- Galactic Flush MajorItem Budget Script
--
function Definitions()
DebugMessage("%s -- In Definitions", tostring(Script))
Category = "Flush_MajorItem_Budget | Reclaim_Excess_MajorItem_Budget"
IgnoreTarget = true
TaskForce = {
-- First Task Force
{
"MainForce" -- Name of the MainForce, Variable and thread function.
, "TaskForceRequired"
}
}
DebugMessage("%s -- Done Definitions", tostring(Script))
end
function MainForce_Thread()
DebugMessage("%s -- In MainForce_Thread.", tostring(Script))
Budget.Flush_Category("MajorItem")
DebugMessage("%s -- MainForce Done! Exiting Script!", tostring(Script))
ScriptExit()
end

View File

@@ -0,0 +1,78 @@
-- $Id: //depot/Projects/StarWars_Steam/FOC/Run/Data/Scripts/AI/GenerateMagicGroundDefense.lua#1 $
--/////////////////////////////////////////////////////////////////////////////////////////////////
--
-- (C) Petroglyph Games, Inc.
--
--
-- ***** ** * *
-- * ** * * *
-- * * * * *
-- * * * * * * * *
-- * * *** ****** * ** **** *** * * * ***** * ***
-- * ** * * * ** * ** ** * * * * ** ** ** *
-- *** ***** * * * * * * * * ** * * * *
-- * * * * * * * * * * * * * * *
-- * * * * * * * * * * ** * * * *
-- * ** * * ** * ** * * ** * * * *
-- ** **** ** * **** ***** * ** *** * *
-- * * *
-- * * *
-- * * *
-- * * * *
-- **** * *
--
--/////////////////////////////////////////////////////////////////////////////////////////////////
-- C O N F I D E N T I A L S O U R C E C O D E -- D O N O T D I S T R I B U T E
--/////////////////////////////////////////////////////////////////////////////////////////////////
--
-- $File: //depot/Projects/StarWars_Steam/FOC/Run/Data/Scripts/AI/GenerateMagicGroundDefense.lua $
--
-- Original Author: James Yarrow
--
-- $Author: Brian_Hayes $
--
-- $Change: 637819 $
--
-- $DateTime: 2017/03/22 10:16:16 $
--
-- $Revision: #1 $
--
--/////////////////////////////////////////////////////////////////////////////////////////////////
require("pgevents")
function Definitions()
Category = "Generate_Magic_Ground_Defense"
IgnoreTarget = true
TaskForce = {
{
"ReserveForce"
,"DenyHeroAttach"
,"Infantry = 3"
,"Vehicle = 1"
,"-F9TZ_Cloaking_Transport_Company"
,"-HAV_Juggernaut_Company"
,"-Gallofree_HTT_Company"
}
}
AllowFreeStoreUnits = false
MagicPlan = true
MagicPlanStealing = false
end
function ReserveForce_Thread()
ReserveForce.Set_As_Goal_System_Removable(false)
BlockOnCommand(ReserveForce.Produce_Force(Target))
LandUnits(ReserveForce)
ReserveForce.Set_Plan_Result(true)
Sleep(20)
wait_start_time = GetCurrentTime()
wait_duration = Determine_Magic_Wait_Duration()
while (GetCurrentTime() - wait_start_time < wait_duration) and
(EvaluatePerception("Needs_Magic_Ground_Defense", PlayerObject, Target) == 0.0) do
Sleep(1)
end
ScriptExit()
end

View File

@@ -0,0 +1,78 @@
-- $Id: //depot/Projects/StarWars_Steam/FOC/Run/Data/Scripts/AI/GenerateMagicGroundDefenseEasy.lua#1 $
--/////////////////////////////////////////////////////////////////////////////////////////////////
--
-- (C) Petroglyph Games, Inc.
--
--
-- ***** ** * *
-- * ** * * *
-- * * * * *
-- * * * * * * * *
-- * * *** ****** * ** **** *** * * * ***** * ***
-- * ** * * * ** * ** ** * * * * ** ** ** *
-- *** ***** * * * * * * * * ** * * * *
-- * * * * * * * * * * * * * * *
-- * * * * * * * * * * ** * * * *
-- * ** * * ** * ** * * ** * * * *
-- ** **** ** * **** ***** * ** *** * *
-- * * *
-- * * *
-- * * *
-- * * * *
-- **** * *
--
--/////////////////////////////////////////////////////////////////////////////////////////////////
-- C O N F I D E N T I A L S O U R C E C O D E -- D O N O T D I S T R I B U T E
--/////////////////////////////////////////////////////////////////////////////////////////////////
--
-- $File: //depot/Projects/StarWars_Steam/FOC/Run/Data/Scripts/AI/GenerateMagicGroundDefenseEasy.lua $
--
-- Original Author: James Yarrow
--
-- $Author: Brian_Hayes $
--
-- $Change: 637819 $
--
-- $DateTime: 2017/03/22 10:16:16 $
--
-- $Revision: #1 $
--
--/////////////////////////////////////////////////////////////////////////////////////////////////
require("pgevents")
function Definitions()
Category = "Generate_Magic_Ground_Defense_Easy"
IgnoreTarget = true
TaskForce = {
{
"ReserveForce"
,"DenyHeroAttach"
,"Infantry = 3"
,"Vehicle = 1"
,"-F9TZ_Cloaking_Transport_Company"
,"-HAV_Juggernaut_Company"
,"-Gallofree_HTT_Company"
}
}
AllowFreeStoreUnits = false
MagicPlan = true
MagicPlanStealing = false
end
function ReserveForce_Thread()
ReserveForce.Set_As_Goal_System_Removable(false)
BlockOnCommand(ReserveForce.Produce_Force(Target))
LandUnits(ReserveForce)
ReserveForce.Set_Plan_Result(true)
Sleep(20)
wait_start_time = GetCurrentTime()
wait_duration = Determine_Magic_Wait_Duration()
while (GetCurrentTime() - wait_start_time < wait_duration) and
(EvaluatePerception("Needs_Magic_Ground_Defense_Easy", PlayerObject, Target) == 0.0) do
Sleep(1)
end
ScriptExit()
end

View File

@@ -0,0 +1,78 @@
-- $Id: //depot/Projects/StarWars_Steam/FOC/Run/Data/Scripts/AI/GenerateMagicGroundDefenseHard.lua#1 $
--/////////////////////////////////////////////////////////////////////////////////////////////////
--
-- (C) Petroglyph Games, Inc.
--
--
-- ***** ** * *
-- * ** * * *
-- * * * * *
-- * * * * * * * *
-- * * *** ****** * ** **** *** * * * ***** * ***
-- * ** * * * ** * ** ** * * * * ** ** ** *
-- *** ***** * * * * * * * * ** * * * *
-- * * * * * * * * * * * * * * *
-- * * * * * * * * * * ** * * * *
-- * ** * * ** * ** * * ** * * * *
-- ** **** ** * **** ***** * ** *** * *
-- * * *
-- * * *
-- * * *
-- * * * *
-- **** * *
--
--/////////////////////////////////////////////////////////////////////////////////////////////////
-- C O N F I D E N T I A L S O U R C E C O D E -- D O N O T D I S T R I B U T E
--/////////////////////////////////////////////////////////////////////////////////////////////////
--
-- $File: //depot/Projects/StarWars_Steam/FOC/Run/Data/Scripts/AI/GenerateMagicGroundDefenseHard.lua $
--
-- Original Author: James Yarrow
--
-- $Author: Brian_Hayes $
--
-- $Change: 637819 $
--
-- $DateTime: 2017/03/22 10:16:16 $
--
-- $Revision: #1 $
--
--/////////////////////////////////////////////////////////////////////////////////////////////////
require("pgevents")
function Definitions()
Category = "Generate_Magic_Ground_Defense_Hard"
IgnoreTarget = true
TaskForce = {
{
"ReserveForce"
,"DenyHeroAttach"
,"Infantry = 2"
,"Vehicle = 4"
,"-F9TZ_Cloaking_Transport_Company"
,"-HAV_Juggernaut_Company"
,"-Gallofree_HTT_Company"
}
}
AllowFreeStoreUnits = false
MagicPlan = true
MagicPlanStealing = false
end
function ReserveForce_Thread()
ReserveForce.Set_As_Goal_System_Removable(false)
BlockOnCommand(ReserveForce.Produce_Force(Target))
LandUnits(ReserveForce)
ReserveForce.Set_Plan_Result(true)
Sleep(20)
wait_start_time = GetCurrentTime()
wait_duration = Determine_Magic_Wait_Duration()
while (GetCurrentTime() - wait_start_time < wait_duration) and
(EvaluatePerception("Needs_Magic_Ground_Defense_Hard", PlayerObject, Target) == 0.0) do
Sleep(1)
end
ScriptExit()
end

View File

@@ -0,0 +1,66 @@
-- $Id: //depot/Projects/StarWars_Steam/FOC/Run/Data/Scripts/AI/GenerateMagicGroundStructure.lua#1 $
--/////////////////////////////////////////////////////////////////////////////////////////////////
--
-- (C) Petroglyph Games, Inc.
--
--
-- ***** ** * *
-- * ** * * *
-- * * * * *
-- * * * * * * * *
-- * * *** ****** * ** **** *** * * * ***** * ***
-- * ** * * * ** * ** ** * * * * ** ** ** *
-- *** ***** * * * * * * * * ** * * * *
-- * * * * * * * * * * * * * * *
-- * * * * * * * * * * ** * * * *
-- * ** * * ** * ** * * ** * * * *
-- ** **** ** * **** ***** * ** *** * *
-- * * *
-- * * *
-- * * *
-- * * * *
-- **** * *
--
--/////////////////////////////////////////////////////////////////////////////////////////////////
-- C O N F I D E N T I A L S O U R C E C O D E -- D O N O T D I S T R I B U T E
--/////////////////////////////////////////////////////////////////////////////////////////////////
--
-- $File: //depot/Projects/StarWars_Steam/FOC/Run/Data/Scripts/AI/GenerateMagicGroundStructure.lua $
--
-- Original Author: James Yarrow
--
-- $Author: Brian_Hayes $
--
-- $Change: 637819 $
--
-- $DateTime: 2017/03/22 10:16:16 $
--
-- $Revision: #1 $
--
--/////////////////////////////////////////////////////////////////////////////////////////////////
require("pgevents")
function Definitions()
Category = "Generate_Magic_Ground_Structure"
IgnoreTarget = true
TaskForce = {
{
"ReserveForce"
,"DenyHeroAttach"
,"E_Galactic_Turbolaser_Tower_Defenses | R_Galactic_Turbolaser_Tower_Defenses | E_Ground_Advanced_Vehicle_Factory | E_Ground_Heavy_Vehicle_Factory | R_Ground_Heavy_Vehicle_Factory | E_Ground_Light_Vehicle_Factory | R_Ground_Light_Vehicle_Factory | U_Ground_Vehicle_Factory | U_Ground_Droid_Works | U_Ground_Barracks | U_Ground_Palace = 1"
}
}
AllowFreeStoreUnits = false
MagicPlan = true
MagicPlanStealing = false
end
function ReserveForce_Thread()
ReserveForce.Set_As_Goal_System_Removable(false)
BlockOnCommand(ReserveForce.Produce_Force(Target))
Sleep(40)
ScriptExit()
end

View File

@@ -0,0 +1,77 @@
-- $Id: //depot/Projects/StarWars_Steam/FOC/Run/Data/Scripts/AI/GenerateMagicSpaceDefense.lua#1 $
--/////////////////////////////////////////////////////////////////////////////////////////////////
--
-- (C) Petroglyph Games, Inc.
--
--
-- ***** ** * *
-- * ** * * *
-- * * * * *
-- * * * * * * * *
-- * * *** ****** * ** **** *** * * * ***** * ***
-- * ** * * * ** * ** ** * * * * ** ** ** *
-- *** ***** * * * * * * * * ** * * * *
-- * * * * * * * * * * * * * * *
-- * * * * * * * * * * ** * * * *
-- * ** * * ** * ** * * ** * * * *
-- ** **** ** * **** ***** * ** *** * *
-- * * *
-- * * *
-- * * *
-- * * * *
-- **** * *
--
--/////////////////////////////////////////////////////////////////////////////////////////////////
-- C O N F I D E N T I A L S O U R C E C O D E -- D O N O T D I S T R I B U T E
--/////////////////////////////////////////////////////////////////////////////////////////////////
--
-- $File: //depot/Projects/StarWars_Steam/FOC/Run/Data/Scripts/AI/GenerateMagicSpaceDefense.lua $
--
-- Original Author: James Yarrow
--
-- $Author: Brian_Hayes $
--
-- $Change: 637819 $
--
-- $DateTime: 2017/03/22 10:16:16 $
--
-- $Revision: #1 $
--
--/////////////////////////////////////////////////////////////////////////////////////////////////
require("pgevents")
function Definitions()
Category = "Generate_Magic_Space_Defense"
IgnoreTarget = true
TaskForce = {
{
"ReserveForce"
,"DenyHeroAttach"
,"Fighter | Bomber = 6"
,"Corvette | Frigate = 4"
}
}
AllowFreeStoreUnits = false
MagicPlan = true
MagicPlanStealing = false
end
function ReserveForce_Thread()
ReserveForce.Set_As_Goal_System_Removable(false)
BlockOnCommand(ReserveForce.Produce_Force(Target))
ReserveForce.Set_Plan_Result(true)
Sleep(20)
--Use the Easy version of Needs_Magic_Space_Defense (just in case the units we spawned don't pull us past the
--Normal threshold)
wait_start_time = GetCurrentTime()
wait_duration = Determine_Magic_Wait_Duration()
while (GetCurrentTime() - wait_start_time < wait_duration) and
(EvaluatePerception("Needs_Magic_Space_Defense_Easy", PlayerObject, Target) == 0.0) do
Sleep(1)
end
ScriptExit()
end

View File

@@ -0,0 +1,75 @@
-- $Id: //depot/Projects/StarWars_Steam/FOC/Run/Data/Scripts/AI/GenerateMagicSpaceDefenseEasy.lua#1 $
--/////////////////////////////////////////////////////////////////////////////////////////////////
--
-- (C) Petroglyph Games, Inc.
--
--
-- ***** ** * *
-- * ** * * *
-- * * * * *
-- * * * * * * * *
-- * * *** ****** * ** **** *** * * * ***** * ***
-- * ** * * * ** * ** ** * * * * ** ** ** *
-- *** ***** * * * * * * * * ** * * * *
-- * * * * * * * * * * * * * * *
-- * * * * * * * * * * ** * * * *
-- * ** * * ** * ** * * ** * * * *
-- ** **** ** * **** ***** * ** *** * *
-- * * *
-- * * *
-- * * *
-- * * * *
-- **** * *
--
--/////////////////////////////////////////////////////////////////////////////////////////////////
-- C O N F I D E N T I A L S O U R C E C O D E -- D O N O T D I S T R I B U T E
--/////////////////////////////////////////////////////////////////////////////////////////////////
--
-- $File: //depot/Projects/StarWars_Steam/FOC/Run/Data/Scripts/AI/GenerateMagicSpaceDefenseEasy.lua $
--
-- Original Author: James Yarrow
--
-- $Author: Brian_Hayes $
--
-- $Change: 637819 $
--
-- $DateTime: 2017/03/22 10:16:16 $
--
-- $Revision: #1 $
--
--/////////////////////////////////////////////////////////////////////////////////////////////////
require("pgevents")
function Definitions()
Category = "Generate_Magic_Space_Defense_Easy"
IgnoreTarget = true
TaskForce = {
{
"ReserveForce"
,"DenyHeroAttach"
,"Fighter | Bomber = 4"
,"Corvette | Frigate = 2"
}
}
AllowFreeStoreUnits = false
MagicPlan = true
MagicPlanStealing = false
end
function ReserveForce_Thread()
ReserveForce.Set_As_Goal_System_Removable(false)
BlockOnCommand(ReserveForce.Produce_Force(Target))
ReserveForce.Set_Plan_Result(true)
--Sleep forever on easy so that we can't repeat the spawn
wait_start_time = GetCurrentTime()
wait_duration = Determine_Magic_Wait_Duration()
while (GetCurrentTime() - wait_start_time < wait_duration) do
Sleep(1)
end
ScriptExit()
end

View File

@@ -0,0 +1,76 @@
-- $Id: //depot/Projects/StarWars_Steam/FOC/Run/Data/Scripts/AI/GenerateMagicSpaceDefenseHard.lua#1 $
--/////////////////////////////////////////////////////////////////////////////////////////////////
--
-- (C) Petroglyph Games, Inc.
--
--
-- ***** ** * *
-- * ** * * *
-- * * * * *
-- * * * * * * * *
-- * * *** ****** * ** **** *** * * * ***** * ***
-- * ** * * * ** * ** ** * * * * ** ** ** *
-- *** ***** * * * * * * * * ** * * * *
-- * * * * * * * * * * * * * * *
-- * * * * * * * * * * ** * * * *
-- * ** * * ** * ** * * ** * * * *
-- ** **** ** * **** ***** * ** *** * *
-- * * *
-- * * *
-- * * *
-- * * * *
-- **** * *
--
--/////////////////////////////////////////////////////////////////////////////////////////////////
-- C O N F I D E N T I A L S O U R C E C O D E -- D O N O T D I S T R I B U T E
--/////////////////////////////////////////////////////////////////////////////////////////////////
--
-- $File: //depot/Projects/StarWars_Steam/FOC/Run/Data/Scripts/AI/GenerateMagicSpaceDefenseHard.lua $
--
-- Original Author: James Yarrow
--
-- $Author: Brian_Hayes $
--
-- $Change: 637819 $
--
-- $DateTime: 2017/03/22 10:16:16 $
--
-- $Revision: #1 $
--
--/////////////////////////////////////////////////////////////////////////////////////////////////
require("pgevents")
function Definitions()
Category = "Generate_Magic_Space_Defense_Hard"
IgnoreTarget = true
TaskForce = {
{
"ReserveForce"
,"DenyHeroAttach"
,"Fighter | Bomber = 10"
,"Corvette | Frigate | Capital = 6"
}
}
AllowFreeStoreUnits = false
MagicPlan = true
MagicPlanStealing = false
end
function ReserveForce_Thread()
ReserveForce.Set_As_Goal_System_Removable(false)
BlockOnCommand(ReserveForce.Produce_Force(Target))
ReserveForce.Set_Plan_Result(true)
Sleep(20)
--Use the Normal version of Needs_Magic_Space_Defense (just in case the units we spawned don't pull us past the
--Hard threshold)
wait_start_time = GetCurrentTime()
wait_duration = Determine_Magic_Wait_Duration()
while (GetCurrentTime() - wait_start_time < wait_duration) and
(EvaluatePerception("Needs_Magic_Space_Defense", PlayerObject, Target) == 0.0) do
Sleep(1)
end
ScriptExit()
end

View File

@@ -0,0 +1,70 @@
--/////////////////////////////////////////////////////////////////////////////////////////////////
-- (c) Galyana's Ultimate Empire at War Modifications
--
-- ****** *** *** ************ *** ***
-- * * * * * * * *
-- * * * * * * *
-- * * * * * * *
-- * * * * * **** * * *
-- * * * ****** * * * *
-- * **** * * * * * * * *** *
-- * * * * * * * * * *
-- * * * * * * * * * *
-- * * * * * * * ** * * *
-- ****** ****** ************ **** ** *******
--/////////////////////////////////////////////////////////////////////////////////////////////////
-- C O N F I D E N T I A L S O U R C E C O D E -- D O N O T D I S T R I B U T E
--/////////////////////////////////////////////////////////////////////////////////////////////////
--
-- File: GUEaW/Data/Scripts/AI/HuttsAdvanceTechPlan.LUA
--
-- Original Editor: Giovanni Galyana
--
-- Final Edit By: Giovanni Galyana
--
-- Date: 31 May, 2018
--
-- Revisions: 0
--
--/////////////////////////////////////////////////////////////////////////////////////////////////
require("pgevents")
function Definitions()
DebugMessage("%s -- In Definitions", tostring(Script))
Category = "Advance_Tech_Hutts"
IgnoreTarget = true
TaskForce = {
{
"TechForce",
"Hutt_Tech_2 | Hutt_Tech_3 | Hutt_Tech_4 | Hutt_Tech_5 = 1"
}
}
DebugMessage("%s -- Done Definitions", tostring(Script))
end
function TechForce_Thread()
DebugMessage("%s -- In TechForce_Thread.", tostring(Script))
-- Ensure that all goal feasability will be reevaluated based on the new production budgetting conditions
-- (production underway that is already paid for and remains affordable under new budgets should continue)
Purge_Goals(PlayerObject)
TechForce.Set_As_Goal_System_Removable(false)
Sleep(1)
BlockOnCommand(TechForce.Produce_Force())
TechForce.Set_Plan_Result(true)
DebugMessage("%s -- TechForce done!", tostring(Script));
ScriptExit()
end
function TechForce_Production_Failed(tf, failed_object_type)
DebugMessage("%s -- Abandonning plan owing to production failure.", tostring(Script))
ScriptExit()
end

View File

@@ -0,0 +1,94 @@
-- $Id: //depot/Projects/StarWars_Expansion/Run/Data/Scripts/AI/LandMode/Airstrike.lua#3 $
--/////////////////////////////////////////////////////////////////////////////////////////////////
--
-- (C) Petroglyph Games, Inc.
--
--
-- ***** ** * *
-- * ** * * *
-- * * * * *
-- * * * * * * * *
-- * * *** ****** * ** **** *** * * * ***** * ***
-- * ** * * * ** * ** ** * * * * ** ** ** *
-- *** ***** * * * * * * * * ** * * * *
-- * * * * * * * * * * * * * * *
-- * * * * * * * * * * ** * * * *
-- * ** * * ** * ** * * ** * * * *
-- ** **** ** * **** ***** * ** *** * *
-- * * *
-- * * *
-- * * *
-- * * * *
-- **** * *
--
--/////////////////////////////////////////////////////////////////////////////////////////////////
-- C O N F I D E N T I A L S O U R C E C O D E -- D O N O T D I S T R I B U T E
--/////////////////////////////////////////////////////////////////////////////////////////////////
--
-- $File: //depot/Projects/StarWars_Expansion/Run/Data/Scripts/AI/LandMode/Airstrike.lua $
--
-- Original Author: James Yarrow
--
-- $Author: James_Yarrow $
--
-- $Change: 54633 $
--
-- $DateTime: 2006/09/14 17:46:53 $
--
-- $Revision: #3 $
--
--/////////////////////////////////////////////////////////////////////////////////////////////////
require("pgevents")
--
-- Space Mode Test Script
--
ScriptPoolCount = 3
function Definitions()
Category = "Airstrike"
TaskForce = {
{
"MainForce"
,"DenyHeroAttach"
,"Air = 1, 5"
,"-Gallofree_HTT_Transport"
,"-Fanblade_Fighter"
}
}
AllowEngagedUnits = false
start_loc = nil
end
function MainForce_Thread()
BlockOnCommand(MainForce.Produce_Force())
-- See if any units have landed
if MainForce.Get_Force_Count() ~= 0 then
-- Land the remainder nearby.
WaitForAllReinforcements(MainForce, MainForce)
else
-- Land near the default starting point.
start_loc = FindTarget(MainForce, "Is_Friendly_Start", "Tactical_Location", 1.0)
if start_loc then
WaitForAllReinforcements(MainForce, start_loc)
else
WaitForAllReinforcements(MainForce, AITarget)
end
end
MainForce.Set_As_Goal_System_Removable(false)
MainForce.Set_Targeting_Priorities("Air_Attack_Move")
BlockOnCommand(MainForce.Attack_Move(AITarget, MainForce.Get_Self_Threat_Max()))
ScriptExit()
end

View File

@@ -0,0 +1,64 @@
--/////////////////////////////////////////////////////////////////////////////////////////////////
-- (c) Galyana's Ultimate Empire at War Modifications
--
-- ****** *** *** ************ *** ***
-- * * * * * * * *
-- * * * * * * *
-- * * * * * * *
-- * * * * * **** * * *
-- * * * ****** * * * *
-- * **** * * * * * * * *** *
-- * * * * * * * * * *
-- * * * * * * * * * *
-- * * * * * * * ** * * *
-- ****** ****** ************ **** ** *******
--/////////////////////////////////////////////////////////////////////////////////////////////////
-- C O N F I D E N T I A L S O U R C E C O D E -- D O N O T D I S T R I B U T E
--/////////////////////////////////////////////////////////////////////////////////////////////////
--
-- File: GUEaW/Data/Scripts/AI/LandMode/AI_Plan_ExpansionGeneric_BuildBunker.LUA
--
-- Original Editor: Giovanni Galyana
--
-- Final Edit By: Giovanni Galyana
--
-- Date: 6 May, 2018
--
-- Revisions: 2
--
--/////////////////////////////////////////////////////////////////////////////////////////////////
require("pgevents")
-- Build a bunker
-- Disabling: | FCU_UC_Empire_Bunker | FCU_UC_Rebel_Bunker | FCU_UC_Underworld_Bunker | FCU_UC_Hutts_Bunker | FCU_UC_Empire_Bunker_Pad | FCU_UC_Rebel_Bunker_Pad | FCU_UC_Underworld_Bunker_Pad | FCU_UC_Hutts_Bunker_Pad
function Definitions()
Category = "Build_Bunker"
TaskForce = {
{
"MainForce"
,"TaskForceRequired"
,"UC_Empire_Bunker_Pad | UC_Rebel_Bunker_Pad | UC_Underworld_Bunker_Pad | UC_Hutts_Bunker_Pad | UC_Pirates_Bunker_Pad = 1"
}
}
end
function MainForce_Thread()
-- Make sure we've ended up with a build location that's reasonably close to our original target
pad_table = MainForce.Get_Reserved_Build_Pads()
for i,pad in pad_table do
if pad.Get_Distance(AITarget) > 120 then
ScriptExit()
end
end
-- Build the task force
-- Blocking shouldn't be necessary, but we'll use it to ease watching the script
MainForce.Set_Plan_Result(true)
BlockOnCommand(MainForce.Build_All())
ScriptExit()
end

View File

@@ -0,0 +1,110 @@
--/////////////////////////////////////////////////////////////////////////////////////////////////
-- (c) Galyana's Ultimate Empire at War Modifications
--
-- ****** *** *** ************ *** ***
-- * * * * * * * *
-- * * * * * * *
-- * * * * * * *
-- * * * * * **** * * *
-- * * * ****** * * * *
-- * **** * * * * * * * *** *
-- * * * * * * * * * *
-- * * * * * * * * * *
-- * * * * * * * ** * * *
-- ****** ****** ************ **** ** *******
--/////////////////////////////////////////////////////////////////////////////////////////////////
-- C O N F I D E N T I A L S O U R C E C O D E -- D O N O T D I S T R I B U T E
--/////////////////////////////////////////////////////////////////////////////////////////////////
--
-- File: GUEaW/Data/Scripts/AI/LandMode/AI_Plan_ExpansionGeneric_BuildMDUItem.LUA
--
-- Original Editor: Giovanni Galyana
--
-- Final Edit By: Giovanni Galyana
--
-- Date: 4 June, 2018
--
-- Revisions: 2
--
--/////////////////////////////////////////////////////////////////////////////////////////////////
require("pgevents")
-- Build a single turret.
function Definitions()
Category = "Build_Ysalamiri_Cage | Build_Sensor_Scrambler | Build_Rocket_Pod | Build_EM_Field_Generator | Build_Grenade_Mortar | Build_Offensive_Sensor_Node | Build_MDU_Repair_Facility | Build_Mobile_Shield_Generator | Build_Rapid_Fire_Laser | Build_Obelisk_Tower | Build_Guard_Tower | Build_Landing_Pad"
IgnoreTarget = true
TaskForce = {
{
"MainForce"
,"DenyHeroAttach"
,"Underworld_Mobile_Defense_Unit | Empire_Mobile_Defense_Unit | Rebel_Mobile_Defense_Unit | Hutt_Mobile_Defense_Unit = 1"
}
}
end
function MainForce_Thread()
goal_name = MainForce.Get_Goal_Type_Name()
if goal_name == "Build_Ysalamiri_Cage" then
build_item_name = "UC_Underworld_Buildable_Ysalamiri_Cage"
elseif goal_name == "Build_Sensor_Scrambler" then
build_item_name = "UC_Underworld_Buildable_Sensor_Scrambler"
elseif goal_name == "Build_Rocket_Pod" then
build_item_name = "UC_Underworld_Buildable_Rocket_Pod"
elseif goal_name == "Build_EM_Field_Generator" then
build_item_name = "UC_Empire_Buildable_EM_Field_Generator"
elseif goal_name == "Build_Grenade_Mortar" then
build_item_name = "UC_Empire_Buildable_Grenade_Mortar"
elseif goal_name == "Build_Offensive_Sensor_Node" then
build_item_name = "UC_Empire_Buildable_Offensive_Sensor_Node"
elseif goal_name == "Build_MDU_Repair_Facility" then
build_item_name = "UC_Rebel_Buildable_Repair_Facility_MDU"
elseif goal_name == "Build_Mobile_Shield_Generator" then
build_item_name = "UC_Rebel_Buildable_Shield_Generator_185"
elseif goal_name == "Build_Rapid_Fire_Laser" then
build_item_name = "UC_Rebel_Buildable_Rapid_Fire_Laser_Turret"
elseif goal_name == "Build_Obelisk_Tower" then
build_item_name = "UC_Hutt_Buildable_Obelisk_Tower"
elseif goal_name == "Build_Guard_Tower" then
build_item_name = "UC_Hutt_Buildable_Guard_Tower"
elseif goal_name == "Build_Landing_Pad" then
build_item_name = "UC_H_Ground_Landing_Pad"
end
if not build_item_name then
ScriptExit()
end
BlockOnCommand(MainForce.Produce_Force())
QuickReinforce(PlayerObject, AITarget, MainForce)
BlockOnCommand(MainForce.Move_To(Target, MainForce.Get_Self_Threat_Max()))
build_started = true
BlockOnCommand(MainForce.Activate_Ability("DEPLOY", true))
MainForce.Set_Plan_Result(true)
Sleep(2)
mdu = MainForce.Get_Unit_Table()[1]
if not TestValid(mdu) then
ScriptExit()
end
mdu.Build(build_item_name)
while TestValid(mdu) and not TestValid(mdu.Get_Build_Pad_Contents()) do
Sleep(1)
end
ScriptExit()
end
function MainForce_Unit_Damaged(tf, unit, attacker, deliberate)
if not build_started then
Default_Unit_Damaged(tf, unit, attacker, deliberate)
end
end

View File

@@ -0,0 +1,67 @@
--/////////////////////////////////////////////////////////////////////////////////////////////////
-- (c) Galyana's Ultimate Empire at War Modifications
--
-- ****** *** *** ************ *** ***
-- * * * * * * * *
-- * * * * * * *
-- * * * * * * *
-- * * * * * **** * * *
-- * * * ****** * * * *
-- * **** * * * * * * * *** *
-- * * * * * * * * * *
-- * * * * * * * * * *
-- * * * * * * * ** * * *
-- ****** ****** ************ **** ** *******
--/////////////////////////////////////////////////////////////////////////////////////////////////
-- C O N F I D E N T I A L S O U R C E C O D E -- D O N O T D I S T R I B U T E
--/////////////////////////////////////////////////////////////////////////////////////////////////
--
-- File: GUEaW/Data/Scripts/AI/LandMode/AI_Plan_ExpansionGeneric_DeployTroopTransports.LUA
--
-- Original Editor: Giovanni Galyana
--
-- Final Edit By: Giovanni Galyana
--
-- Date: 28 Septembter, 2012
--
-- Revisions: 0
--
--/////////////////////////////////////////////////////////////////////////////////////////////////
require("pgevents")
--Get transport units landed and move them towards high concentrations of friendly infantry
function Definitions()
Category = "Deploy_Troop_Transports"
IgnoreTarget = true
TaskForce =
{
{
"MainForce"
,"HAV_Juggernaut | F9TZ_Cloaking_Transport | Gallofree_HTT_Transport | Hutt_SailBarge = 1,5"
}
}
AllowEngagedUnits = false
end
function MainForce_Thread()
BlockOnCommand(MainForce.Produce_Force())
QuickReinforce(PlayerObject, AITarget, MainForce, nil)
unit_table = MainForce.Get_Unit_Table()
for i,unit in pairs(unit_table) do
if unit.Has_Garrison() then
MainForce.Release_Unit(unit)
end
end
MainForce.Set_Plan_Result(true)
BlockOnCommand(MainForce.Move_To(AITarget))
ScriptExit()
end

View File

@@ -0,0 +1,117 @@
-- $Id: //depot/Projects/StarWars_Steam/FOC/Run/Data/Scripts/AI/LandMode/AI_Plan_ExpansionGeneric_GarrisonTarget.lua#1 $
--/////////////////////////////////////////////////////////////////////////////////////////////////
--
-- (C) Petroglyph Games, Inc.
--
--
-- ***** ** * *
-- * ** * * *
-- * * * * *
-- * * * * * * * *
-- * * *** ****** * ** **** *** * * * ***** * ***
-- * ** * * * ** * ** ** * * * * ** ** ** *
-- *** ***** * * * * * * * * ** * * * *
-- * * * * * * * * * * * * * * *
-- * * * * * * * * * * ** * * * *
-- * ** * * ** * ** * * ** * * * *
-- ** **** ** * **** ***** * ** *** * *
-- * * *
-- * * *
-- * * *
-- * * * *
-- **** * *
--
--/////////////////////////////////////////////////////////////////////////////////////////////////
-- C O N F I D E N T I A L S O U R C E C O D E -- D O N O T D I S T R I B U T E
--/////////////////////////////////////////////////////////////////////////////////////////////////
--
-- $File: //depot/Projects/StarWars_Steam/FOC/Run/Data/Scripts/AI/LandMode/AI_Plan_ExpansionGeneric_GarrisonTarget.lua $
--
-- Original Author: James Yarrow
--
-- $Author: Brian_Hayes $
--
-- $Change: 637819 $
--
-- $DateTime: 2017/03/22 10:16:16 $
--
-- $Revision: #1 $
--
--/////////////////////////////////////////////////////////////////////////////////////////////////
require("pgevents")
function Definitions()
Category = "Garrison_Bunker | Garrison_Transport"
IgnoreTarget = true
TaskForce =
{
{
"MainForce"
,"Infantry = 1,5"
,"-Vornskr_Wolf"
}
}
AllowEngagedUnits = false
end
function MainForce_Thread()
BlockOnCommand(MainForce.Produce_Force())
QuickReinforce(PlayerObject, AITarget, MainForce, nil)
if not MainForce.Can_Garrison(AITarget) then
ScriptExit()
end
MainForce.Activate_Ability("SPREAD_OUT", false)
difficulty = PlayerObject.Get_Difficulty()
if difficulty == "Easy" then
BlockOnCommand(MainForce.Attack_Move(Target.Get_Position(), MainForce.Get_Self_Threat_Max()))
else
BlockOnCommand(MainForce.Move_To(Target.Get_Position(), MainForce.Get_Self_Threat_Max()))
end
Sleep(5)
ScriptExit()
end
-- Override default handling, which will kill the plan
function MainForce_Original_Target_Owner_Changed(tf, old_player, new_player)
--If someone else captures the bunker then I need to assault it with anti-structure
--units rather than capture it with infantry
if new_player ~= PlayerObject and new_player.Is_Neutral() == false then
ScriptExit()
end
end
function MainForce_Unit_Move_Finished(tf, unit)
MainForce.Set_Plan_Result(true)
Create_Thread("Finalize_Garrison", unit)
end
function Finalize_Garrison(unit)
unit.Guard_Target(Target)
while TestValid(Target) and (not Target.Has_Garrison()) and (Target.Get_Owner() ~= PlayerObject) do
Sleep(2)
unit.Guard_Target(Target)
end
if TestValid(Target) and unit.Can_Garrison(Target) then
unit.Garrison(Target)
end
MainForce.Release_Unit(unit)
end

View File

@@ -0,0 +1,63 @@
-- $Id: //depot/Projects/StarWars_Steam/FOC/Run/Data/Scripts/AI/LandMode/AI_Plan_ExpansionGeneric_OrbitalBombardment.lua#1 $
--/////////////////////////////////////////////////////////////////////////////////////////////////
--
-- (C) Petroglyph Games, Inc.
--
--
-- ***** ** * *
-- * ** * * *
-- * * * * *
-- * * * * * * * *
-- * * *** ****** * ** **** *** * * * ***** * ***
-- * ** * * * ** * ** ** * * * * ** ** ** *
-- *** ***** * * * * * * * * ** * * * *
-- * * * * * * * * * * * * * * *
-- * * * * * * * * * * ** * * * *
-- * ** * * ** * ** * * ** * * * *
-- ** **** ** * **** ***** * ** *** * *
-- * * *
-- * * *
-- * * *
-- * * * *
-- **** * *
--
--/////////////////////////////////////////////////////////////////////////////////////////////////
-- C O N F I D E N T I A L S O U R C E C O D E -- D O N O T D I S T R I B U T E
--/////////////////////////////////////////////////////////////////////////////////////////////////
--
-- $File: //depot/Projects/StarWars_Steam/FOC/Run/Data/Scripts/AI/LandMode/AI_Plan_ExpansionGeneric_OrbitalBombardment.lua $
--
-- Original Author: James Yarrow
--
-- $Author: Brian_Hayes $
--
-- $Change: 637819 $
--
-- $DateTime: 2017/03/22 10:16:16 $
--
-- $Revision: #1 $
--
--/////////////////////////////////////////////////////////////////////////////////////////////////
require("pgevents")
function Definitions()
Category = "Orbital_Bombardment"
IgnoreTarget = true
TaskForce =
{
{
"MainForce"
,"DenyHeroAttach"
,"TaskForceRequired"
}
}
end
function MainForce_Thread()
MainForce.Set_Plan_Result(true)
MainForce.Fire_Orbital_Bombardment(Target)
ScriptExit()
end

View File

@@ -0,0 +1,91 @@
-- $Id: //depot/Projects/StarWars_Steam/FOC/Run/Data/Scripts/AI/LandMode/AI_Plan_Underworld_MineStructure.lua#1 $
--/////////////////////////////////////////////////////////////////////////////////////////////////
--
-- (C) Petroglyph Games, Inc.
--
--
-- ***** ** * *
-- * ** * * *
-- * * * * *
-- * * * * * * * *
-- * * *** ****** * ** **** *** * * * ***** * ***
-- * ** * * * ** * ** ** * * * * ** ** ** *
-- *** ***** * * * * * * * * ** * * * *
-- * * * * * * * * * * * * * * *
-- * * * * * * * * * * ** * * * *
-- * ** * * ** * ** * * ** * * * *
-- ** **** ** * **** ***** * ** *** * *
-- * * *
-- * * *
-- * * *
-- * * * *
-- **** * *
--
--/////////////////////////////////////////////////////////////////////////////////////////////////
-- C O N F I D E N T I A L S O U R C E C O D E -- D O N O T D I S T R I B U T E
--/////////////////////////////////////////////////////////////////////////////////////////////////
--
-- $File: //depot/Projects/StarWars_Steam/FOC/Run/Data/Scripts/AI/LandMode/AI_Plan_Underworld_MineStructure.lua $
--
-- Original Author: James Yarrow
--
-- $Author: Brian_Hayes $
--
-- $Change: 637819 $
--
-- $DateTime: 2017/03/22 10:16:16 $
--
-- $Revision: #1 $
--
--/////////////////////////////////////////////////////////////////////////////////////////////////
require("pgevents")
ScriptPoolCount = 1
function Definitions()
Category = "Mine_Structure"
AllowEngagedUnits = true
IgnoreTarget = true
TaskForce = {
{
"MainForce"
,"DenyHeroAttach"
,"Underworld_Merc_Team = 1,2"
}
}
end
function MainForce_Thread()
MainForce.Set_Plan_Result(false)
BlockOnCommand(MainForce.Produce_Force())
QuickReinforce(PlayerObject, AITarget, MainForce)
unit_table = MainForce.Get_Unit_Table()
for i,unit in pairs(unit_table) do
if not unit.Is_Ability_Ready("PROXIMITY_MINES") then
MainForce.Release_Unit(unit)
end
end
BlockOnCommand(MainForce.Attack_Move(AITarget))
enemy = FindDeadlyEnemy(AITarget)
if not TestValid(enemy) then
enemy = Find_Nearest(AITarget, PlayerObject, false)
end
if not TestValid(enemy) then
ScriptExit()
end
MainForce.Move_To(enemy)
Sleep(5)
MainForce.Activate_Ability("PROXIMITY_MINES", MainForce)
--We treat all instances as failures so as not to repeatedly attempt to mine the same location
ScriptExit()
end

View File

@@ -0,0 +1,82 @@
-- $Id: //depot/Projects/StarWars_Steam/FOC/Run/Data/Scripts/AI/LandMode/AI_Plan_Underworld_RemoteBombFriendlyUnit.lua#1 $
--/////////////////////////////////////////////////////////////////////////////////////////////////
--
-- (C) Petroglyph Games, Inc.
--
--
-- ***** ** * *
-- * ** * * *
-- * * * * *
-- * * * * * * * *
-- * * *** ****** * ** **** *** * * * ***** * ***
-- * ** * * * ** * ** ** * * * * ** ** ** *
-- *** ***** * * * * * * * * ** * * * *
-- * * * * * * * * * * * * * * *
-- * * * * * * * * * * ** * * * *
-- * ** * * ** * ** * * ** * * * *
-- ** **** ** * **** ***** * ** *** * *
-- * * *
-- * * *
-- * * *
-- * * * *
-- **** * *
--
--/////////////////////////////////////////////////////////////////////////////////////////////////
-- C O N F I D E N T I A L S O U R C E C O D E -- D O N O T D I S T R I B U T E
--/////////////////////////////////////////////////////////////////////////////////////////////////
--
-- $File: //depot/Projects/StarWars_Steam/FOC/Run/Data/Scripts/AI/LandMode/AI_Plan_Underworld_RemoteBombFriendlyUnit.lua $
--
-- Original Author: James Yarrow
--
-- $Author: Brian_Hayes $
--
-- $Change: 637819 $
--
-- $DateTime: 2017/03/22 10:16:16 $
--
-- $Revision: #1 $
--
--/////////////////////////////////////////////////////////////////////////////////////////////////
require("pgevents")
ScriptPoolCount = 3
function Definitions()
Category = "Remote_Bomb_Friendly_Unit"
AllowEngagedUnits = true
IgnoreTarget = true
TaskForce = {
{
"MainForce"
,"DenyHeroAttach"
,"Underworld_Saboteur = 1"
}
}
end
function MainForce_Thread()
BlockOnCommand(MainForce.Produce_Force())
QuickReinforce(PlayerObject, AITarget, MainForce)
unit_table = MainForce.Get_Unit_Table()
for i,unit in pairs(unit_table) do
if not unit.Is_Ability_Ready("PLACE_REMOTE_BOMB") then
MainForce.Release_Unit(unit)
end
end
BlockOnCommand(MainForce.Activate_Ability("PLACE_REMOTE_BOMB", Target))
MainForce.Set_Plan_Result(true)
if TestValid(Target) then
rush_target = Find_Nearest(Target, PlayerObject, false)
if TestValid(rush_target) then
Target.Move_To(rush_target)
end
end
end

View File

@@ -0,0 +1,152 @@
-- $Id: //depot/Projects/StarWars_Steam/FOC/Run/Data/Scripts/AI/LandMode/AI_Plan_Underworld_TyberManagerLand.lua#1 $
--/////////////////////////////////////////////////////////////////////////////////////////////////
--
-- (C) Petroglyph Games, Inc.
--
--
-- ***** ** * *
-- * ** * * *
-- * * * * *
-- * * * * * * * *
-- * * *** ****** * ** **** *** * * * ***** * ***
-- * ** * * * ** * ** ** * * * * ** ** ** *
-- *** ***** * * * * * * * * ** * * * *
-- * * * * * * * * * * * * * * *
-- * * * * * * * * * * ** * * * *
-- * ** * * ** * ** * * ** * * * *
-- ** **** ** * **** ***** * ** *** * *
-- * * *
-- * * *
-- * * *
-- * * * *
-- **** * *
--
--/////////////////////////////////////////////////////////////////////////////////////////////////
-- C O N F I D E N T I A L S O U R C E C O D E -- D O N O T D I S T R I B U T E
--/////////////////////////////////////////////////////////////////////////////////////////////////
--
-- $File: //depot/Projects/StarWars_Steam/FOC/Run/Data/Scripts/AI/LandMode/AI_Plan_Underworld_TyberManagerLand.lua $
--
-- Original Author: James Yarrow
--
-- $Author: Brian_Hayes $
--
-- $Change: 637819 $
--
-- $DateTime: 2017/03/22 10:16:16 $
--
-- $Revision: #1 $
--
--/////////////////////////////////////////////////////////////////////////////////////////////////
require("pgevents")
function Definitions()
Category = "Tyber_Manager_Land"
TaskForce = {
{
"MainForce"
,"DenyHeroAttach"
,"Tyber_Zann = 1"
}
}
IgnoreTarget = true
AllowEngagedUnits = true
attack_attention_span = 30
defend_attention_span = 30
end
function MainForce_Thread()
BlockOnCommand(MainForce.Produce_Force())
QuickReinforce(PlayerObject, AITarget, MainForce)
MainForce.Set_As_Goal_System_Removable(false)
tyber = MainForce.Get_Unit_Table()[1]
if not TestValid(tyber) then
ScriptExit()
end
tyber.Set_Single_Ability_Autofire("TACTICAL_BRIBE", false)
-- Continuously try to attack, assist the most significant nearby unit, and heal up
while true do
threat_threshold = "Any_Threat"
if tyber.Get_Hull() < 0.5 then
threat_threshold = "Low_Threat"
end
if not ConsiderHeal(tyber) then
if not Try_Bribe(tyber, threat_threshold) then
if not Try_Defend(tyber, threat_threshold) then
if not Try_Attack(tyber, threat_threshold) then
Try_Ability(tyber, "STEALTH")
Sleep(5)
end
end
end
end
-- Make sure the loop always yields
Sleep(1)
end
end
function Try_Bribe(tyber, threat_threshold)
if tyber.Is_Ability_Ready("TACTICAL_BRIBE") then
bribe_target = FindTarget.Reachable_Target(PlayerObject, "Bribe_Target_Score", "Enemy_Unit", threat_threshold, 1.0, tyber)
if TestValid(bribe_target) then
bribe_cost = bribe_target.Get_Game_Object().Get_Type().Get_Bribe_Cost(tyber)
if bribe_cost > 0.0 and bribe_cost < PlayerObject.Get_Credits() then
tyber.Activate_Ability("STEALTH", true)
BlockOnCommand(tyber.Activate_Ability("TACTICAL_BRIBE", bribe_target))
return true
end
end
end
return false
end
function Try_Defend(tyber, threat_threshold)
if EvaluatePerception("Allowed_As_Defender_Land", PlayerObject) <= 0.0 then
structure_to_defend = FindTarget.Reachable_Target(PlayerObject, "Need_To_Defend_Structure", "Friendly_Structure", threat_threshold, 1.0, tyber)
if TestValid(structure_to_defend) then
BlockOnCommand(MainForce.Guard_Target(structure_to_defend), defend_attention_span)
return true
end
end
return false
end
function Try_Attack(tyber, threat_threshold)
enemy = FindDeadlyEnemy(tyber)
if not TestValid(enemy) then
enemy = Find_Nearest(tyber, PlayerObject, false)
end
if TestValid(enemy) then
BlockOnCommand(tyber.Attack_Move(enemy), attack_attention_span)
return true
end
return false
end

View File

@@ -0,0 +1,208 @@
-- $Id: //depot/Projects/StarWars_Steam/FOC/Run/Data/Scripts/AI/LandMode/BobaFettFlameInfantry.lua#1 $
--/////////////////////////////////////////////////////////////////////////////////////////////////
--
-- (C) Petroglyph Games, Inc.
--
--
-- ***** ** * *
-- * ** * * *
-- * * * * *
-- * * * * * * * *
-- * * *** ****** * ** **** *** * * * ***** * ***
-- * ** * * * ** * ** ** * * * * ** ** ** *
-- *** ***** * * * * * * * * ** * * * *
-- * * * * * * * * * * * * * * *
-- * * * * * * * * * * ** * * * *
-- * ** * * ** * ** * * ** * * * *
-- ** **** ** * **** ***** * ** *** * *
-- * * *
-- * * *
-- * * *
-- * * * *
-- **** * *
--
--/////////////////////////////////////////////////////////////////////////////////////////////////
-- C O N F I D E N T I A L S O U R C E C O D E -- D O N O T D I S T R I B U T E
--/////////////////////////////////////////////////////////////////////////////////////////////////
--
-- $File: //depot/Projects/StarWars_Steam/FOC/Run/Data/Scripts/AI/LandMode/BobaFettFlameInfantry.lua $
--
-- Original Author: James Yarrow
--
-- $Author: Brian_Hayes $
--
-- $Change: 637819 $
--
-- $DateTime: 2017/03/22 10:16:16 $
--
-- $Revision: #1 $
--
--/////////////////////////////////////////////////////////////////////////////////////////////////
require("pgevents")
function Definitions()
Category = "Flame_Infantry"
TaskForce = {
{
"MainForce"
,"DenyHeroAttach"
,"Boba_Fett = 1"
}
}
IgnoreTarget = true
AllowEngagedUnits = true
time_to_transition_reinforcement_point = 10
end
function MainForce_Thread()
BlockOnCommand(MainForce.Produce_Force())
QuickReinforce(PlayerObject, AITarget, MainForce)
MainForce.Set_As_Goal_System_Removable(false)
fett = MainForce.Get_Unit_Table()[1]
if not TestValid(fett) then
MessageBox("unexpected state; fett unavailable")
end
-- Make sure he doesn't autonomousely use his flamethrower
--fett.Set_Single_Ability_Autofire("FLAME_THROWER", false)
--MessageBox("Start")
-- Don't let Fett waste the landing party on Easy or Normal difficlties
difficulty = PlayerObject.Get_Difficulty()
if (EvaluatePerception("Is_Skirmish_Mode", PlayerObject) == 0)
and (difficulty == "Normal" or difficulty == "Easy") then
friendly_structure = Find_Nearest(MainForce, "Structure", PlayerObject, true)
if TestValid(friendly_structure) then
BlockOnCommand(MainForce.Guard_Target(friendly_structure), 80)
else
Sleep(80)
end
end
while true do
ConsiderFettHeal()
-- Capture a reinforcement point
lz_table = PruneFriendlyObjects(Find_All_Objects_Of_Type("IsRushTarget"))
--DebugPrintTable(lz_table)
if TestValid(lz_table[1]) then
FettMove(lz_table[1])
BlockOnCommand(fett.Guard_Target(lz_table[1]), time_to_transition_reinforcement_point)
end
ConsiderFettHeal()
-- Chase down infantry and flame them
closest_infantry = Find_Nearest(fett, "Infantry", PlayerObject, false)
if TestValid(closest_infantry) then
FettMove(closest_infantry, true)
-- Walk the last bit so we can attack more appropriately
if TestValid(closest_infantry) then
DebugMessage("%s-- finally attack moving on %s", tostring(Script), tostring(closest_infantry))
BlockOnCommand(fett.Attack_Move(closest_infantry))
end
end
MainForce.Set_Plan_Result(true)
-- Make sure the loop always yields
Sleep(1)
end
ScriptExit()
end
function ConsiderFettHeal()
if fett.Get_Hull() < 0.4 then
bacta = Find_Nearest(fett, "HealsInfantry", PlayerObject, true)
if TestValid(bacta) then
FettMove(bacta)
while fett.Get_Hull() < 0.9 do
DebugMessage("%s-- Waiting to heal", tostring(Script))
BlockOnCommand(fett.Guard_Target(bacta), 2)
end
end
end
end
-- Try to use the jet pack to get around, but run if we have to while the ability is recharging.
function FettMove(target, use_attack_move)
DebugMessage("%s-- starting FettMove", tostring(Script))
if use_attack_move then
change_up_duration = 4
else
change_up_duration = 30
end
if TestValid(target) and fett.Get_Distance(target) > 150 then
if JetPackReady() then
BlockOnCommand(fett.Activate_Ability("JET_PACK", target), change_up_duration)
MoveUntilDone(target, change_up_duration)
else
if use_attack_move then
BlockOnCommand(fett.Attack_Move(target, -1, JetPackReady))
else
BlockOnCommand(fett.Move_To(target.Get_Position(), -1, JetPackReady))
end
-- Apparently needed so that the following jet pack usage will detect that the ability is ready
Sleep(1)
if TestValid(target) then
DebugMessage("%s-- activating jet pack because it came on line", tostring(Script))
BlockOnCommand(fett.Activate_Ability("JET_PACK", target), change_up_duration)
MoveUntilDone(target, change_up_duration)
end
end
else
end
DebugMessage("%s-- finished FettMove", tostring(Script))
end
-- This moves fett, periodically reissuing the order, while allowing to finish if we get close
-- enough or the block naturally finishes (because we've collided with the structure or whatever)
-- This is to fix a bug where Fett would get stuck trying to move to the center of a building, and
-- still think he's not close enough. The block should finish when we hit the building.
function MoveUntilDone(target, max_duration)
DebugMessage("%s-- starting MoveUntilDone", tostring(Script))
if not TestValid(target) then
return
end
ThreadValue.Set("BlockStartFettMove", GetCurrentTime())
block = fett.Move_To(target)
while TestValid(target) and fett.Get_Distance(target) > 30 and block and (block.IsFinished() ~= true) do
DebugMessage("%s-- servicing MoveUntilDone", tostring(Script))
PumpEvents()
if (GetCurrentTime() - ThreadValue("BlockStartFettMove") > max_duration) then
DebugMessage("%s-- reissuing move order", tostring(Script))
block = fett.Move_To(target)
end
end
DebugMessage("%s-- finished MoveUntilDone", tostring(Script))
end
function JetPackReady()
return fett.Is_Ability_Ready("JET_PACK")
end

View File

@@ -0,0 +1,56 @@
--/////////////////////////////////////////////////////////////////////////////////////////////////
-- (c) Galyana's Ultimate Empire at War Modifications
--
-- ****** *** *** ************ *** ***
-- * * * * * * * *
-- * * * * * * *
-- * * * * * * *
-- * * * * * **** * * *
-- * * * ****** * * * *
-- * **** * * * * * * * *** *
-- * * * * * * * * * *
-- * * * * * * * * * *
-- * * * * * * * ** * * *
-- ****** ****** ************ **** ** *******
--/////////////////////////////////////////////////////////////////////////////////////////////////
-- C O N F I D E N T I A L S O U R C E C O D E -- D O N O T D I S T R I B U T E
--/////////////////////////////////////////////////////////////////////////////////////////////////
--
-- File: GUEaW/Data/Scripts/AI/LandMode/BuildAntiAirTurret.LUA
--
-- Original Editor: Giovanni Galyana
--
-- Final Edit By: Giovanni Galyana
--
-- Date: 27 January, 2019
--
-- Revisions: 4
--
--/////////////////////////////////////////////////////////////////////////////////////////////////
require("pgevents")
-- Build a single turret.
-- Disabling: | FCU_UC_Empire_Buildable_Anti_Aircraft_Turret | FCU_UC_Rebel_Buildable_Anti_Aircraft_Turret | FCU_UC_Underworld_Buildable_Flak_Turret | FCU_UC_Hutt_Buildable_Anti_Aircraft_Turret
function Definitions()
Category = "Build_AntiAir_Turret"
TaskForce = {
{
"MainForce"
,"TaskForceRequired"
,"UC_Empire_Buildable_Anti_Aircraft_Turret | UC_Rebel_Buildable_Anti_Aircraft_Turret | UC_Pirate_Buildable_Anti_Aircraft_Turret | UC_Underworld_Buildable_Flak_Turret | UC_Hutt_Buildable_Anti_Aircraft_Turret = 1"
}
}
end
function MainForce_Thread()
DebugMessage("%s -- Building a turret.", tostring(Script))
-- Build the task force
-- Blocking shouldn't be necessary, but we'll use it to ease watching the script
BlockOnCommand(MainForce.Build_All())
ScriptExit()
end

View File

@@ -0,0 +1,65 @@
--/////////////////////////////////////////////////////////////////////////////////////////////////
-- (c) Galyana's Ultimate Empire at War Modifications
--
-- ****** *** *** ************ *** ***
-- * * * * * * * *
-- * * * * * * *
-- * * * * * * *
-- * * * * * **** * * *
-- * * * ****** * * * *
-- * **** * * * * * * * *** *
-- * * * * * * * * * *
-- * * * * * * * * * *
-- * * * * * * * ** * * *
-- ****** ****** ************ **** ** *******
--/////////////////////////////////////////////////////////////////////////////////////////////////
-- C O N F I D E N T I A L S O U R C E C O D E -- D O N O T D I S T R I B U T E
--/////////////////////////////////////////////////////////////////////////////////////////////////
--
-- File: GUEaW/Data/Scripts/AI/LandMode/BuildAntiInfantryTurret.LUA
--
-- Original Editor: Giovanni Galyana
--
-- Final Edit By: Giovanni Galyana
--
-- Date: 27 January, 2019
--
-- Revisions: 4
--
--/////////////////////////////////////////////////////////////////////////////////////////////////
require("pgevents")
-- Build a single turret.
-- Disabling: | FCU_UC_Empire_Buildable_Anti_Infantry_Turret | FCU_UC_Rebel_Buildable_Anti_Infantry_Turret | FCU_UC_Underworld_Buildable_Mass_Driver_Turret | FCU_UC_Hutt_Buildable_Rapid_Fire_Laser_Turret
function Definitions()
Category = "Build_AntiInfantry_Turret"
TaskForce = {
{
"MainForce"
,"TaskForceRequired"
,"UC_Empire_Buildable_Anti_Infantry_Turret | UC_Rebel_Buildable_Anti_Infantry_Turret | UC_Pirate_Buildable_Anti_Infantry_Turret | UC_Underworld_Buildable_Mass_Driver_Turret | UC_Hutt_Buildable_Rapid_Fire_Laser_Turret = 1"
}
}
end
function MainForce_Thread()
--MessageBox("%s -- Building a turret.", tostring(Script))
-- Make sure we've ended up with a build location that's reasonably close to our original target
pad_table = MainForce.Get_Reserved_Build_Pads()
for i,pad in pad_table do
if pad.Get_Distance(AITarget) > 120 then
ScriptExit()
end
end
-- Build the task force
-- Blocking shouldn't be necessary, but we'll use it to ease watching the script
MainForce.Set_Plan_Result(true)
BlockOnCommand(MainForce.Build_All())
ScriptExit()
end

View File

@@ -0,0 +1,65 @@
--/////////////////////////////////////////////////////////////////////////////////////////////////
-- (c) Galyana's Ultimate Empire at War Modifications
--
-- ****** *** *** ************ *** ***
-- * * * * * * * *
-- * * * * * * *
-- * * * * * * *
-- * * * * * **** * * *
-- * * * ****** * * * *
-- * **** * * * * * * * *** *
-- * * * * * * * * * *
-- * * * * * * * * * *
-- * * * * * * * ** * * *
-- ****** ****** ************ **** ** *******
--/////////////////////////////////////////////////////////////////////////////////////////////////
-- C O N F I D E N T I A L S O U R C E C O D E -- D O N O T D I S T R I B U T E
--/////////////////////////////////////////////////////////////////////////////////////////////////
--
-- File: GUEaW/Data/Scripts/AI/LandMode/BuildAntiVehicleTurret.LUA
--
-- Original Editor: Giovanni Galyana
--
-- Final Edit By: Giovanni Galyana
--
-- Date: 27 January, 2019
--
-- Revisions: 4
--
--/////////////////////////////////////////////////////////////////////////////////////////////////
require("pgevents")
-- Build a single turret.
-- Disabling: | FCU_UC_Empire_Buildable_Anti_Vehicle_Turret | FCU_UC_Rebel_Buildable_Anti_Vehicle_Turret | FCU_UC_Underworld_Buildable_Torpedo_Turret | FCU_UC_Hutt_Buildable_Rocket_Turret
function Definitions()
Category = "Build_AntiVehicle_Turret"
TaskForce = {
{
"MainForce"
,"TaskForceRequired"
,"UC_Empire_Buildable_Anti_Vehicle_Turret | UC_Rebel_Buildable_Anti_Vehicle_Turret | UC_Pirate_Buildable_Anti_Vehicle_Turret | UC_Underworld_Buildable_Torpedo_Turret | UC_Hutt_Buildable_Rocket_Turret = 1"
}
}
end
function MainForce_Thread()
--MessageBox("%s -- Building a turret.", tostring(Script))
-- Make sure we've ended up with a build location that's reasonably close to our original target
pad_table = MainForce.Get_Reserved_Build_Pads()
for i,pad in pad_table do
if pad.Get_Distance(AITarget) > 120 then
ScriptExit()
end
end
-- Build the task force
-- Blocking shouldn't be necessary, but we'll use it to ease watching the script
MainForce.Set_Plan_Result(true)
BlockOnCommand(MainForce.Build_All())
ScriptExit()
end

View File

@@ -0,0 +1,56 @@
--/////////////////////////////////////////////////////////////////////////////////////////////////
-- (c) Galyana's Ultimate Empire at War Modifications
--
-- ****** *** *** ************ *** ***
-- * * * * * * * *
-- * * * * * * *
-- * * * * * * *
-- * * * * * **** * * *
-- * * * ****** * * * *
-- * **** * * * * * * * *** *
-- * * * * * * * * * *
-- * * * * * * * * * *
-- * * * * * * * ** * * *
-- ****** ****** ************ **** ** *******
--/////////////////////////////////////////////////////////////////////////////////////////////////
-- C O N F I D E N T I A L S O U R C E C O D E -- D O N O T D I S T R I B U T E
--/////////////////////////////////////////////////////////////////////////////////////////////////
--
-- File: GUEaW/Data/Scripts/AI/LandMode/BuildBactaTank.LUA
--
-- Original Editor: Giovanni Galyana
--
-- Final Edit By: Giovanni Galyana
--
-- Date: 27 January, 2019
--
-- Revisions: 2
--
--/////////////////////////////////////////////////////////////////////////////////////////////////
require("pgevents")
-- Build a single structure.
-- Disabling: | FCU_UC_Empire_Buildable_Bacta_Tank | FCU_UC_Rebel_Buildable_Bacta_Tank | FCU_UC_Underworld_Buildable_Bacta_Tank | FCU_UC_Hutt_Buildable_Bacta_Tank
function Definitions()
Category = "Build_Bacta_Tank"
TaskForce = {
{
"MainForce"
,"TaskForceRequired"
,"UC_Empire_Buildable_Bacta_Tank | UC_Rebel_Buildable_Bacta_Tank | UC_Pirate_Buildable_Bacta_Tank | UC_Underworld_Buildable_Bacta_Tank | UC_Hutt_Buildable_Bacta_Tank = 1"
}
}
end
function MainForce_Thread()
DebugMessage("%s -- Building a turret.", tostring(Script))
-- Build the task force
-- Blocking shouldn't be necessary, but we'll use it to ease watching the script
BlockOnCommand(MainForce.Build_All())
ScriptExit()
end

View File

@@ -0,0 +1,53 @@
--/////////////////////////////////////////////////////////////////////////////////////////////////
-- (c) Galyana's Ultimate Empire at War Modifications
--
-- ****** *** *** ************ *** ***
-- * * * * * * * *
-- * * * * * * *
-- * * * * * * *
-- * * * * * **** * * *
-- * * * ****** * * * *
-- * **** * * * * * * * *** *
-- * * * * * * * * * *
-- * * * * * * * * * *
-- * * * * * * * ** * * *
-- ****** ****** ************ **** ** *******
--/////////////////////////////////////////////////////////////////////////////////////////////////
-- C O N F I D E N T I A L S O U R C E C O D E -- D O N O T D I S T R I B U T E
--/////////////////////////////////////////////////////////////////////////////////////////////////
--
-- File: GUEaW/Data/Scripts/AI/LandMode/BuildBarracksLand.LUA
--
-- Original Editor: Giovanni Galyana
--
-- Final Edit By: Giovanni Galyana
--
-- Date: 9 April, 2023
--
-- Revisions: 4
--
--/////////////////////////////////////////////////////////////////////////////////////////////////
require("pgevents")
function Definitions()
Category = "Tactical_Multiplayer_Build_Barracks"
IgnoreTarget = true
TaskForce = {
{
"MainForce"
,"UC_E_Ground_Barracks | UC_R_Ground_Barracks | UC_U_Ground_Barracks | UC_H_Ground_Barracks | UC_P_Ground_Outpost = 1"
}
}
AllowFreeStoreUnits = false
end
function MainForce_Thread()
BlockOnCommand(MainForce.Build_All())
MainForce.Set_Plan_Result(true)
ScriptExit()
end

View File

@@ -0,0 +1,54 @@
--/////////////////////////////////////////////////////////////////////////////////////////////////
-- (c) Galyana's Ultimate Empire at War Modifications
--
-- ****** *** *** ************ *** ***
-- * * * * * * * *
-- * * * * * * *
-- * * * * * * *
-- * * * * * **** * * *
-- * * * ****** * * * *
-- * **** * * * * * * * *** *
-- * * * * * * * * * *
-- * * * * * * * * * *
-- * * * * * * * ** * * *
-- ****** ****** ************ **** ** *******
--/////////////////////////////////////////////////////////////////////////////////////////////////
-- C O N F I D E N T I A L S O U R C E C O D E -- D O N O T D I S T R I B U T E
--/////////////////////////////////////////////////////////////////////////////////////////////////
--
-- File: GUEaW/Data/Scripts/AI/LandMode/BuildCommandCenterLand.LUA
--
-- Original Editor: Giovanni Galyana
--
-- Final Edit By: Giovanni Galyana
--
-- Date: 2 October, 2022
--
-- Revisions: 3
--
--/////////////////////////////////////////////////////////////////////////////////////////////////
-- Disabling: | FCU_UC_E_Ground_Command_Center | FCU_UC_R_Ground_Command_Center | FCU_UC_U_Ground_Palace | FCU_UC_H_Ground_Command_Center
require("pgevents")
function Definitions()
Category = "Tactical_Multiplayer_Build_Command_Center"
IgnoreTarget = true
TaskForce = {
{
"MainForce"
,"UC_E_Ground_Command_Center | UC_R_Ground_Command_Center | UC_U_Ground_Palace | UC_H_Ground_Command_Center | UC_P_Ground_Command_Center = 1"
}
}
AllowFreeStoreUnits = false
end
function MainForce_Thread()
BlockOnCommand(MainForce.Build_All())
MainForce.Set_Plan_Result(true)
ScriptExit()
end

View File

@@ -0,0 +1,63 @@
--/////////////////////////////////////////////////////////////////////////////////////////////////
-- (c) Galyana's Ultimate Empire at War Modifications
--
-- ****** *** *** ************ *** ***
-- * * * * * * * *
-- * * * * * * *
-- * * * * * * *
-- * * * * * **** * * *
-- * * * ****** * * * *
-- * **** * * * * * * * *** *
-- * * * * * * * * * *
-- * * * * * * * * * *
-- * * * * * * * ** * * *
-- ****** ****** ************ **** ** *******
--/////////////////////////////////////////////////////////////////////////////////////////////////
-- C O N F I D E N T I A L S O U R C E C O D E -- D O N O T D I S T R I B U T E
--/////////////////////////////////////////////////////////////////////////////////////////////////
--
-- File: GUEaW/Data/Scripts/AI/LandMode/BuildEconStructure.LUA
--
-- Original Editor: Giovanni Galyana
--
-- Final Edit By: Giovanni Galyana
--
-- Date: 2 October, 2022
--
-- Revisions: 4
--
--/////////////////////////////////////////////////////////////////////////////////////////////////
-- Disabling for now
-- | FCU_UC_Rebel_Farm | FCU_UC_Rebel_Mineral_Processor | FCU_UC_Rebel_Surface_Mine | FCU_UC_Rebel_Refinery | FCU_UC_Rebel_Casino | FCU_UC_Rebel_Ground_Mining_Facility
-- | FCU_UC_Empire_Farm | FCU_UC_Empire_Mineral_Processor | FCU_UC_Empire_Surface_Mine | FCU_UC_Empire_Refinery | FCU_UC_Empire_Casino | FCU_UC_Empire_Ground_Mining_Facility
-- | FCU_UC_Underworld_Farm | FCU_UC_Underworld_Mineral_Processor | FCU_UC_Underworld_Surface_Mine | FCU_UC_Underworld_Refinery | FCU_UC_Underworld_Casino | FCU_UC_Underworld_Ground_Mining_Facility
-- | FCU_UC_Hutts_Farm | FCU_UC_Hutts_Mineral_Processor | FCU_UC_Hutts_Advanced_Mineral_Processor | FCU_UC_Hutts_Surface_Mine | FCU_UC_Hutts_Refinery | FCU_UC_Hutts_Casino | FCU_UC_Hutts_Ground_Mining_Facility
require("pgevents")
function Definitions()
Category = "Build_Econ_Structure"
IgnoreTarget = true
TaskForce = {
{
"MainForce"
,"UC_Rebel_Mineral_Processor | UC_Rebel_Ground_Mining_Facility = 0,1"
,"UC_Empire_Mineral_Processor | UC_Empire_Ground_Mining_Facility = 0,1"
,"UC_Underworld_Mineral_Processor | UC_Underworld_Ground_Mining_Facility = 0,1"
,"UC_Hutts_Mineral_Processor | UC_Hutts_Ground_Mining_Facility = 0,1"
,"UC_Pirate_Mineral_Processor | UC_Pirate_Ground_Mining_Facility = 0,1"
}
}
RequiredCategories = {"Structure"}
AllowFreeStoreUnits = false
end
function MainForce_Thread()
BlockOnCommand(MainForce.Build_All())
MainForce.Set_Plan_Result(true)
ScriptExit()
end

View File

@@ -0,0 +1,71 @@
-- $Id: //depot/Projects/StarWars_Expansion/Run/Data/Scripts/AI/LandMode/BuildInfantryEmergency.lua#3 $
--/////////////////////////////////////////////////////////////////////////////////////////////////
--
-- (C) Petroglyph Games, Inc.
--
--
-- ***** ** * *
-- * ** * * *
-- * * * * *
-- * * * * * * * *
-- * * *** ****** * ** **** *** * * * ***** * ***
-- * ** * * * ** * ** ** * * * * ** ** ** *
-- *** ***** * * * * * * * * ** * * * *
-- * * * * * * * * * * * * * * *
-- * * * * * * * * * * ** * * * *
-- * ** * * ** * ** * * ** * * * *
-- ** **** ** * **** ***** * ** *** * *
-- * * *
-- * * *
-- * * *
-- * * * *
-- **** * *
--
--/////////////////////////////////////////////////////////////////////////////////////////////////
-- C O N F I D E N T I A L S O U R C E C O D E -- D O N O T D I S T R I B U T E
--/////////////////////////////////////////////////////////////////////////////////////////////////
--
-- $File: //depot/Projects/StarWars_Expansion/Run/Data/Scripts/AI/LandMode/BuildInfantryEmergency.lua $
--
-- Original Author: James Yarrow
--
-- $Author: James_Yarrow $
--
-- $Change: 53121 $
--
-- $DateTime: 2006/08/30 16:32:34 $
--
-- $Revision: #3 $
--
--/////////////////////////////////////////////////////////////////////////////////////////////////
require("pgevents")
function Definitions()
Category = "Tactical_Multiplayer_Build_Infantry_Emergency"
IgnoreTarget = true
TaskForce = {
{
"ReserveForce",
"Infantry | LandHero = 1",
"-Vornskr_Wolf",
"-Veers_AT_AT_Walker",
"-Gargantuan_Battle_Platform",
"-Tactical_R2_3PO_Team",
"-Droids_Team"
}
}
AllowFreeStoreUnits = false
end
function ReserveForce_Thread()
BlockOnCommand(ReserveForce.Produce_Force())
ReserveForce.Set_Plan_Result(true)
ReserveForce.Set_As_Goal_System_Removable(false)
Sleep(15)
ScriptExit()
end

View File

@@ -0,0 +1,56 @@
--/////////////////////////////////////////////////////////////////////////////////////////////////
-- (c) Galyana's Ultimate Empire at War Modifications
--
-- ****** *** *** ************ *** ***
-- * * * * * * * *
-- * * * * * * *
-- * * * * * * *
-- * * * * * **** * * *
-- * * * ****** * * * *
-- * **** * * * * * * * *** *
-- * * * * * * * * * *
-- * * * * * * * * * *
-- * * * * * * * ** * * *
-- ****** ****** ************ **** ** *******
--/////////////////////////////////////////////////////////////////////////////////////////////////
-- C O N F I D E N T I A L S O U R C E C O D E -- D O N O T D I S T R I B U T E
--/////////////////////////////////////////////////////////////////////////////////////////////////
--
-- File: GUEaW/Data/Scripts/AI/LandMode/BuildRepairFacility.LUA
--
-- Original Editor: Giovanni Galyana
--
-- Final Edit By: Giovanni Galyana
--
-- Date: 27 January, 2019
--
-- Revisions: 2
--
--/////////////////////////////////////////////////////////////////////////////////////////////////
require("pgevents")
-- Build a single structure.
-- Disabling: | FCU_UC_Empire_Buildable_Repair_Facility | FCU_UC_Rebel_Buildable_Repair_Facility | FCU_UC_Underworld_Buildable_Repair_Facility | FCU_UC_Hutt_Buildable_Repair_Facility
function Definitions()
Category = "Build_Repair_Bay"
TaskForce = {
{
"MainForce"
,"TaskForceRequired"
,"UC_Empire_Buildable_Repair_Facility | UC_Rebel_Buildable_Repair_Facility | UC_Pirate_Buildable_Repair_Facility | UC_Underworld_Buildable_Repair_Facility | UC_Hutt_Buildable_Repair_Facility = 1"
}
}
end
function MainForce_Thread()
DebugMessage("%s -- Building a turret.", tostring(Script))
-- Build the task force
-- Blocking shouldn't be necessary, but we'll use it to ease watching the script
BlockOnCommand(MainForce.Build_All())
ScriptExit()
end

View File

@@ -0,0 +1,60 @@
--/////////////////////////////////////////////////////////////////////////////////////////////////
-- (c) Galyana's Ultimate Empire at War Modifications
--
-- ****** *** *** ************ *** ***
-- * * * * * * * *
-- * * * * * * *
-- * * * * * * *
-- * * * * * **** * * *
-- * * * ****** * * * *
-- * **** * * * * * * * *** *
-- * * * * * * * * * *
-- * * * * * * * * * *
-- * * * * * * * ** * * *
-- ****** ****** ************ **** ** *******
--/////////////////////////////////////////////////////////////////////////////////////////////////
-- C O N F I D E N T I A L S O U R C E C O D E -- D O N O T D I S T R I B U T E
--/////////////////////////////////////////////////////////////////////////////////////////////////
--
-- File: GUEaW/Data/Scripts/AI/LandMode/BuildStructureLand.LUA
--
-- Original Editor: Giovanni Galyana
--
-- Final Edit By: Giovanni Galyana
--
-- Date: 26 April, 2023
--
-- Revisions: 7
--
--/////////////////////////////////////////////////////////////////////////////////////////////////
--BuildEconStructure.lua covers these
--UC_Rebel_Mineral_Processor | UC_Rebel_Ground_Mining_Facility
--UC_Empire_Mineral_Processor | UC_Empire_Ground_Mining_Facility
--UC_Underworld_Mineral_Processor | UC_Underworld_Ground_Mining_Facility
--UC_Hutts_Mineral_Processor | UC_Hutts_Ground_Mining_Facility
--UC_Pirate_Mineral_Processor | UC_Pirate_Ground_Mining_Facility
require("pgevents")
function Definitions()
Category = "Tactical_Multiplayer_Build_Basic_Structure"
IgnoreTarget = true
TaskForce = {
{
"MainForce"
,"UC_R_Ground_Power_Generator | UC_R_Ground_Base_Shield_740 | UC_R_Ground_Base_Shield_370 | UC_R_Ground_Base_Shield_740_Pad | UC_R_Ground_Base_Shield_370_Pad | UC_R_Ground_Turbolaser_Tower | UC_R_Ground_Turbolaser_Tower_N | UC_R_Ground_Light_Vehicle_Factory | UC_R_Ground_Heavy_Vehicle_Factory | UC_R_Ground_Communications_Array | UC_R_Ground_Research_Facility | UC_R_Ground_Hutt_Palace | UC_R_Ground_Uplink_Station | UC_Rebel_Ground_Refinery = 0,1"
,"UC_E_Ground_Power_Generator | UC_E_Ground_Base_Shield_740 | UC_E_Ground_Base_Shield_370 | UC_E_Ground_Base_Shield_740_Pad | UC_E_Ground_Base_Shield_370_Pad | UC_E_Ground_Turbolaser_Tower | UC_E_Ground_Turbolaser_Tower_N | UC_E_Ground_Light_Vehicle_Factory | UC_E_Ground_Heavy_Vehicle_Factory | UC_E_Ground_Communications_Array | UC_E_Ground_Research_Facility | UC_E_Ground_Hutt_Palace | UC_E_Ground_Magnepulse_Cannon | UC_Empire_Ground_Refinery = 0,1"
,"UC_U_Ground_Power_Generator | UC_U_Ground_Shutter_Shield | UC_U_Ground_Shutter_Shield_Small | UC_U_Ground_Base_Shield_740_Pad | UC_U_Ground_Base_Shield_370_Pad | UC_U_Ground_Turbolaser_Tower | UC_U_Ground_Turbolaser_Tower_N | UC_U_Ground_Droid_Works | UC_U_Ground_Vehicle_Factory | UC_U_Ground_Hutt_Palace | UC_U_Ground_Gravity_Generator | UC_Underworld_Ground_Refinery = 0,1"
,"UC_H_Ground_Power_Generator | UC_H_Ground_Base_Shield_740 | UC_H_Ground_Base_Shield_370 | UC_H_Ground_Base_Shield_740_Pad | UC_H_Ground_Base_Shield_370_Pad | UC_H_Ground_Heavy_Beam_Tower | UC_H_Ground_Heavy_Beam_Tower_N | UC_H_Ground_Factory | UC_H_Ground_Communications_Array | UC_H_Ground_Advanced_Technologies_Facility | UC_H_Ground_Hutt_Palace | UC_H_Ground_Shutter_Shield | UC_Hutts_Ground_Refinery = 0,1"
,"UC_P_Ground_Power_Generator | UC_P_Ground_Base_Shield_740 | UC_P_Ground_Base_Shield_400 | UC_P_Ground_Base_Shield_740_Pad | UC_P_Ground_Base_Shield_400_Pad | UC_P_Ground_Turbolaser_Tower_N = 0,1"
}
}
RequiredCategories = {"Structure"}
AllowFreeStoreUnits = false
end
function MainForce_Thread()
BlockOnCommand(MainForce.Build_All())
MainForce.Set_Plan_Result(true)
ScriptExit()
end

View File

@@ -0,0 +1,132 @@
-- $Id: //depot/Projects/StarWars_Steam/FOC/Run/Data/Scripts/AI/LandMode/BurnUnitsLand.lua#1 $
--/////////////////////////////////////////////////////////////////////////////////////////////////
--
-- (C) Petroglyph Games, Inc.
--
--
-- ***** ** * *
-- * ** * * *
-- * * * * *
-- * * * * * * * *
-- * * *** ****** * ** **** *** * * * ***** * ***
-- * ** * * * ** * ** ** * * * * ** ** ** *
-- *** ***** * * * * * * * * ** * * * *
-- * * * * * * * * * * * * * * *
-- * * * * * * * * * * ** * * * *
-- * ** * * ** * ** * * ** * * * *
-- ** **** ** * **** ***** * ** *** * *
-- * * *
-- * * *
-- * * *
-- * * * *
-- **** * *
--
--/////////////////////////////////////////////////////////////////////////////////////////////////
-- C O N F I D E N T I A L S O U R C E C O D E -- D O N O T D I S T R I B U T E
--/////////////////////////////////////////////////////////////////////////////////////////////////
--
-- $File: //depot/Projects/StarWars_Steam/FOC/Run/Data/Scripts/AI/LandMode/BurnUnitsLand.lua $
--
-- Original Author: Steve_Copeland
--
-- $Author: Brian_Hayes $
--
-- $Change: 637819 $
--
-- $DateTime: 2017/03/22 10:16:16 $
--
-- $Revision: #1 $
--
--/////////////////////////////////////////////////////////////////////////////////////////////////
require("pgevents")
function Definitions()
AllowEngagedUnits = true
IgnoreTarget = true
Category = "Burn_Units_Land"
TaskForce = {
{
"MainForce"
, "TaskForceRequired"
, "DenySpecialWeaponAttach"
}
}
end
function MainForce_Thread()
-- Cheat to wrap the game up if this is a firesale
if (EvaluatePerception("Should_Firesale_Land", PlayerObject) > 0) then
reveal_ai = FogOfWar.Reveal_All(PlayerObject)
MainForce.Set_As_Goal_System_Removable(false)
-- We're now also revealing FOW here for the human player (was previously handled by a hard-coded system)
-- Make sure that there isn't a scripted scenario underway that doesn't want automatic FOW reveals
if Is_Multiplayer_Mode() == false and ((EvaluatePerception("Is_Skirmish_Mode", PlayerObject) == 1) or
(GlobalValue.Get("Allow_AI_Controlled_Fog_Reveal") == 1)) then
reveal_human = FogOfWar.Reveal_All(Find_Player("local"))
end
end
-- Do this at least once (it may just be an attempt to burn off extra units, rather than a firesale)
repeat
-- Cancel all goals
Purge_Goals(PlayerObject)
--Eject garrisons from structures so they can be burned along with everything else.
garrison_table = Find_All_Objects_Of_Type("CanContainGarrison", PlayerObject)
if garrison_table then
for i,unit in pairs(garrison_table) do
if not unit.Is_Category("Vehicle") then
unit.Eject_Garrison()
end
end
Sleep(1)
end
Sleep(1)
-- Use all idle units, mapwide
MainForce.Collect_All_Free_Units()
-- form up any spread out infantry
MainForce.Activate_Ability("SPREAD_OUT", false)
Set_Land_AI_Targeting_Priorities(MainForce)
-- Have each unit attack its nearest enemy structure until success or death
nearest_enemy = Find_Nearest(MainForce, "InBase", PlayerObject, false)
if not TestValid(nearest_enemy) then
nearest_enemy = Find_Nearest(MainForce, PlayerObject, false)
end
while TestValid(nearest_enemy) do
MainForce.Collect_All_Free_Units()
BlockOnCommand(MainForce.Attack_Move(nearest_enemy), 20)
end
-- Only let this happen every so often
Sleep(5)
MainForce.Set_Plan_Result(true)
-- If this is a firesale condition, continue to burn off units
-- This must be done within the same plan because we don't want to destroy the
-- reveal objects turning FOW back on (which would result in the FOW being toggled repeatedly).
until (EvaluatePerception("Should_Firesale_Land", PlayerObject) == 0)
MainForce.Release_Forces(1.0)
Sleep(30)
end
-- Override default event to prevent plan from ending under firesale conditions
-- We want the fog of war reveal for the player to persist.
function MainForce_No_Units_Remaining()
end
function MainForce_Unit_Damaged(tf, unit, attacker, deliberate)
--Override self preservation behavior - the whole purpose of this plan is to kill or be killed
end

View File

@@ -0,0 +1,103 @@
-- $Id: //depot/Projects/StarWars_Steam/FOC/Run/Data/Scripts/AI/LandMode/CleanUpDumb.lua#1 $
--/////////////////////////////////////////////////////////////////////////////////////////////////
--
-- (C) Petroglyph Games, Inc.
--
--
-- ***** ** * *
-- * ** * * *
-- * * * * *
-- * * * * * * * *
-- * * *** ****** * ** **** *** * * * ***** * ***
-- * ** * * * ** * ** ** * * * * ** ** ** *
-- *** ***** * * * * * * * * ** * * * *
-- * * * * * * * * * * * * * * *
-- * * * * * * * * * * ** * * * *
-- * ** * * ** * ** * * ** * * * *
-- ** **** ** * **** ***** * ** *** * *
-- * * *
-- * * *
-- * * *
-- * * * *
-- **** * *
--
--/////////////////////////////////////////////////////////////////////////////////////////////////
-- C O N F I D E N T I A L S O U R C E C O D E -- D O N O T D I S T R I B U T E
--/////////////////////////////////////////////////////////////////////////////////////////////////
--
-- $File: //depot/Projects/StarWars_Steam/FOC/Run/Data/Scripts/AI/LandMode/CleanUpDumb.lua $
--
-- Original Author: Steve_Copeland
--
-- $Author: Brian_Hayes $
--
-- $Change: 637819 $
--
-- $DateTime: 2017/03/22 10:16:16 $
--
-- $Revision: #1 $
--
--/////////////////////////////////////////////////////////////////////////////////////////////////
require("pgevents")
--
-- This should be a low desirability plan, to engage otherwise idle units after all enemies are being handled.
-- This plan does not consider much and should only be enacted once the tactical outcome is obvious.
--
function Definitions()
Category = "Clean_Up"
TaskForce = {
{
"MainForce"
,"DenyHeroAttach"
,"Infantry | Vehicle | Air = 1,50"
,"LandHero = 0,10"
}
}
IgnoreTarget = true
AllowEngagedUnits = false
closest_enemy = nil
kill_target = nil
start_loc = nil
end
function MainForce_Thread()
BlockOnCommand(MainForce.Produce_Force())
QuickReinforce(PlayerObject, AITarget, MainForce)
Set_Land_AI_Targeting_Priorities(MainForce)
-- This is a global plan, so we must find our own target
closest_enemy = Find_Nearest(MainForce, PlayerObject, false)
if TestValid(closest_enemy) then
-- Assign appropriate targeting priorities here, once we get the ability to do this per unit type
BlockOnCommand(MainForce.Attack_Move(closest_enemy))
end
ScriptExit()
end
-- Make sure that units don't sit idle at the end of their move order, waiting for others
function MainForce_Unit_Move_Finished(tf, unit)
Default_Unit_Move_Finished(tf, unit)
-- We want this unit to release and attack something, whatever is attacking us or just something close
kill_target = FindDeadlyEnemy(tf)
if not TestValid(kill_target) then
kill_target = Find_Nearest(unit, PlayerObject, false)
end
if TestValid(kill_target) then
unit.Attack_Move(kill_target)
tf.Release_Unit(unit)
DebugMessage("%s-- Unit %s only Attack_Move to %s", tostring(Script), tostring(unit), tostring(kill_target))
end
end

View File

@@ -0,0 +1,111 @@
-- $Id: //depot/Projects/StarWars_Steam/FOC/Run/Data/Scripts/AI/LandMode/ClearInfantry.lua#1 $
--/////////////////////////////////////////////////////////////////////////////////////////////////
--
-- (C) Petroglyph Games, Inc.
--
--
-- ***** ** * *
-- * ** * * *
-- * * * * *
-- * * * * * * * *
-- * * *** ****** * ** **** *** * * * ***** * ***
-- * ** * * * ** * ** ** * * * * ** ** ** *
-- *** ***** * * * * * * * * ** * * * *
-- * * * * * * * * * * * * * * *
-- * * * * * * * * * * ** * * * *
-- * ** * * ** * ** * * ** * * * *
-- ** **** ** * **** ***** * ** *** * *
-- * * *
-- * * *
-- * * *
-- * * * *
-- **** * *
--
--/////////////////////////////////////////////////////////////////////////////////////////////////
-- C O N F I D E N T I A L S O U R C E C O D E -- D O N O T D I S T R I B U T E
--/////////////////////////////////////////////////////////////////////////////////////////////////
--
-- $File: //depot/Projects/StarWars_Steam/FOC/Run/Data/Scripts/AI/LandMode/ClearInfantry.lua $
--
-- Original Author: James Yarrow
--
-- $Author: Brian_Hayes $
--
-- $Change: 637819 $
--
-- $DateTime: 2017/03/22 10:16:16 $
--
-- $Revision: #1 $
--
--/////////////////////////////////////////////////////////////////////////////////////////////////
require("pgevents")
-- Tell the script pooling system to pre-cache this number of scripts.
ScriptPoolCount = 6
function Definitions()
Category = "Clear_Infantry"
MinContrastScale = 0.2
MaxContrastScale = 3.0
TaskForce = {
{
"MainForce"
,"DenyHeroAttach"
,"Infantry | Vehicle | Air = 1,5"
,"LandHero = 0,2"
,"-Gallofree_HTT_Company"
,"-HAV_Juggernaut_Company"
,"-F9TZ_Cloaking_Transport_Company"
}
}
AllowEngagedUnits = false
start_loc = nil
closest_infantry = nil
kill_target = nil
end
function MainForce_Thread()
BlockOnCommand(MainForce.Produce_Force())
QuickReinforce(PlayerObject, AITarget, MainForce)
--BlockOnCommand(MainForce.Move_To(MainForce.Get_Stage(), false)) -- true = wait for entire taskforce at intermediate zone points
MainForce.Set_As_Goal_System_Removable(false)
Set_Land_AI_Targeting_Priorities(MainForce)
BlockOnCommand(MainForce.Attack_Move(AITarget, MainForce.Get_Self_Threat_Max()))
-- If the original goal on this target is still valid, keep hunting
while (EvaluatePerception("Should_Clear_Infantry", PlayerObject, AITarget) > 0) do
closest_infantry = Find_Nearest(MainForce, "Infantry", PlayerObject, false)
if TestValid(closest_infantry) then
BlockOnCommand(MainForce.Attack_Move(closest_infantry))
else
-- Prevent endless loops in case of an unexpected condition
break
end
end
ScriptExit()
end
-- Make sure that units don't sit idle at the end of their move order, waiting for others
function MainForce_Unit_Move_Finished(tf, unit)
Default_Unit_Move_Finished(tf, unit)
-- Assist the tf with whatever is holding it up
kill_target = FindDeadlyEnemy(tf)
if TestValid(kill_target) then
unit.Attack_Move(kill_target)
else
unit.Attack_Move(tf)
end
end

View File

@@ -0,0 +1,113 @@
-- $Id: //depot/Projects/StarWars_Steam/FOC/Run/Data/Scripts/AI/LandMode/ClearVehicles.lua#1 $
--/////////////////////////////////////////////////////////////////////////////////////////////////
--
-- (C) Petroglyph Games, Inc.
--
--
-- ***** ** * *
-- * ** * * *
-- * * * * *
-- * * * * * * * *
-- * * *** ****** * ** **** *** * * * ***** * ***
-- * ** * * * ** * ** ** * * * * ** ** ** *
-- *** ***** * * * * * * * * ** * * * *
-- * * * * * * * * * * * * * * *
-- * * * * * * * * * * ** * * * *
-- * ** * * ** * ** * * ** * * * *
-- ** **** ** * **** ***** * ** *** * *
-- * * *
-- * * *
-- * * *
-- * * * *
-- **** * *
--
--/////////////////////////////////////////////////////////////////////////////////////////////////
-- C O N F I D E N T I A L S O U R C E C O D E -- D O N O T D I S T R I B U T E
--/////////////////////////////////////////////////////////////////////////////////////////////////
--
-- $File: //depot/Projects/StarWars_Steam/FOC/Run/Data/Scripts/AI/LandMode/ClearVehicles.lua $
--
-- Original Author: James Yarrow
--
-- $Author: Brian_Hayes $
--
-- $Change: 637819 $
--
-- $DateTime: 2017/03/22 10:16:16 $
--
-- $Revision: #1 $
--
--/////////////////////////////////////////////////////////////////////////////////////////////////
require("pgevents")
-- Tell the script pooling system to pre-cache this number of scripts.
ScriptPoolCount = 6
function Definitions()
Category = "Clear_Vehicles"
MinContrastScale = 0.2
MaxContrastScale = 3.0
TaskForce = {
{
"MainForce"
,"DenyHeroAttach"
,"Infantry = 0,5"
,"Vehicle | Air = 0,5"
,"LandHero = 0,3"
,"-Gallofree_HTT_Company"
,"-HAV_Juggernaut_Company"
,"-F9TZ_Cloaking_Transport_Company"
,"-AT_AA_Walker"
}
}
AllowEngagedUnits = false
start_loc = nil
closest_vehicle = nil
kill_target = nil
end
function MainForce_Thread()
BlockOnCommand(MainForce.Produce_Force())
QuickReinforce(PlayerObject, AITarget, MainForce)
--BlockOnCommand(MainForce.Move_To(MainForce.Get_Stage(), false)) -- true = wait for entire taskforce at intermediate zone points
MainForce.Set_As_Goal_System_Removable(false)
Set_Land_AI_Targeting_Priorities(MainForce)
BlockOnCommand(MainForce.Attack_Move(AITarget, MainForce.Get_Self_Threat_Max()))
-- If the original goal on this target is still valid, keep hunting
while (EvaluatePerception("Should_Clear_Vehicles", PlayerObject, AITarget) > 0) do
closest_vehicle = Find_Nearest(MainForce, "Vehicle", PlayerObject, false)
if TestValid(closest_vehicle) then
BlockOnCommand(MainForce.Attack_Move(closest_vehicle))
else
-- Prevent endless loops in case of an unexpected condition
break
end
end
ScriptExit()
end
-- Make sure that units don't sit idle at the end of their move order, waiting for others
function MainForce_Unit_Move_Finished(tf, unit)
DebugMessage("%s -- %s reached end of move, giving new order", tostring(Script), tostring(unit))
-- Assist the tf with whatever is holding it up
kill_target = FindDeadlyEnemy(tf)
if TestValid(kill_target) then
unit.Attack_Move(kill_target)
else
unit.Attack_Move(tf)
end
end

View File

@@ -0,0 +1,108 @@
-- $Id: //depot/Projects/StarWars_Expansion/Run/Data/Scripts/AI/LandMode/DefendStructure.lua#5 $
--/////////////////////////////////////////////////////////////////////////////////////////////////
--
-- (C) Petroglyph Games, Inc.
--
--
-- ***** ** * *
-- * ** * * *
-- * * * * *
-- * * * * * * * *
-- * * *** ****** * ** **** *** * * * ***** * ***
-- * ** * * * ** * ** ** * * * * ** ** ** *
-- *** ***** * * * * * * * * ** * * * *
-- * * * * * * * * * * * * * * *
-- * * * * * * * * * * ** * * * *
-- * ** * * ** * ** * * ** * * * *
-- ** **** ** * **** ***** * ** *** * *
-- * * *
-- * * *
-- * * *
-- * * * *
-- **** * *
--
--/////////////////////////////////////////////////////////////////////////////////////////////////
-- C O N F I D E N T I A L S O U R C E C O D E -- D O N O T D I S T R I B U T E
--/////////////////////////////////////////////////////////////////////////////////////////////////
--
-- $File: //depot/Projects/StarWars_Expansion/Run/Data/Scripts/AI/LandMode/DefendStructure.lua $
--
-- Original Author: James Yarrow
--
-- $Author: James_Yarrow $
--
-- $Change: 56734 $
--
-- $DateTime: 2006/10/24 14:15:48 $
--
-- $Revision: #5 $
--
--/////////////////////////////////////////////////////////////////////////////////////////////////
require("pgevents")
ScriptPoolCount = 16
function Definitions()
Category = "Defend_Structure"
AllowEngagedUnits = true
MinContrastScale = 1.2
MaxContrastScale = 1.8
TaskForce = {
{
"MainForce"
,"DenyHeroAttach"
,"EscortForce" -- This should force a good RPS match for the enemies in our target's zone
,"Infantry = 0,20"
,"Vehicle | Air = 0,20"
,"LandHero = 0,3"
,"-Gallofree_HTT_Company"
,"-HAV_Juggernaut_Company"
,"-F9TZ_Cloaking_Transport_Company"
,"-Hutt_SailBarge_Company"
,"-Fanblade_Fighter"
,"-AALL6"
,"-AT_AA_Walker"
}
}
RequiredCategories = {"Infantry | Vehicle | Air"}
structure = nil
kill_target = nil
end
function MainForce_Thread()
BlockOnCommand(MainForce.Produce_Force())
Set_Land_AI_Targeting_Priorities(MainForce)
-- form up any spread out infantry
MainForce.Activate_Ability("SPREAD_OUT", false)
structure = AITarget.Get_Game_Object()
DebugMessage("%s -- Found structure: %s.", tostring(Script), tostring(structure))
if TestValid(structure) then
kill_target = FindDeadlyEnemy(structure)
DebugMessage("%s -- Found deadly enemy: %s.", tostring(Script), tostring(kill_target))
if TestValid(kill_target) and (kill_target.Get_Distance(AITarget) < 500) then
BlockOnCommand(MainForce.Attack_Target(kill_target, MainForce.Get_Self_Threat_Sum()))
end
BlockOnCommand(MainForce.Attack_Move(AITarget))
BlockOnCommand(MainForce.Guard_Target(AITarget))
end
end
-- Make sure that units don't sit idle at the end of their move order, waiting for others
function MainForce_Unit_Move_Finished(tf, unit)
Default_Unit_Move_Finished(tf, unit)
if TestValid(AITarget) then
-- As each unit arrives, guard the structure
unit.Guard_Target(AITarget)
end
end

View File

@@ -0,0 +1,97 @@
-- $Id: //depot/Projects/StarWars_Steam/FOC/Run/Data/Scripts/AI/LandMode/DefensiveRush.lua#1 $
--/////////////////////////////////////////////////////////////////////////////////////////////////
--
-- (C) Petroglyph Games, Inc.
--
--
-- ***** ** * *
-- * ** * * *
-- * * * * *
-- * * * * * * * *
-- * * *** ****** * ** **** *** * * * ***** * ***
-- * ** * * * ** * ** ** * * * * ** ** ** *
-- *** ***** * * * * * * * * ** * * * *
-- * * * * * * * * * * * * * * *
-- * * * * * * * * * * ** * * * *
-- * ** * * ** * ** * * ** * * * *
-- ** **** ** * **** ***** * ** *** * *
-- * * *
-- * * *
-- * * *
-- * * * *
-- **** * *
--
--/////////////////////////////////////////////////////////////////////////////////////////////////
-- C O N F I D E N T I A L S O U R C E C O D E -- D O N O T D I S T R I B U T E
--/////////////////////////////////////////////////////////////////////////////////////////////////
--
-- $File: //depot/Projects/StarWars_Steam/FOC/Run/Data/Scripts/AI/LandMode/DefensiveRush.lua $
--
-- Original Author: James Yarrow
--
-- $Author: Brian_Hayes $
--
-- $Change: 637819 $
--
-- $DateTime: 2017/03/22 10:16:16 $
--
-- $Revision: #1 $
--
--/////////////////////////////////////////////////////////////////////////////////////////////////
-- This plan is to send a limited amount of force to try to initially push the attacker off a planet.
-- It should only be invoked if the defender can spare some units and still have a strong base defense.
-- This is to provide a middle ground between the all out rush (when the AI decides that it has overwhelming
-- force) and the total defensive posture (when AI doesn't clearly have overwhelming force).
require("pgevents")
ScriptPoolCount = 16
function Definitions()
Category = "Defensive_Rush"
AllowEngagedUnits = true
IgnoreTarget = true
TaskForce = {
{
"MainForce"
,"DenyHeroAttach"
,"Infantry | Vehicle | Air = 5,12"
}
}
guard_duration = 20
end
function MainForce_Thread()
BlockOnCommand(MainForce.Produce_Force())
MainForce.Set_As_Goal_System_Removable(false)
Set_Land_AI_Targeting_Priorities(MainForce)
-- Rush the LZ
lz_table = PruneFriendlyObjects(Find_All_Objects_Of_Type("IsRushTarget"))
if TestValid(lz_table[1]) then
--MessageBox("guarding the LZ")
BlockOnCommand(MainForce.Attack_Move(lz_table[1]))
BlockOnCommand(MainForce.Guard_Target(lz_table[1]), guard_duration)
end
-- Rush any attackers that we might be able to see
nearest_enemy = Find_Nearest(MainForce, PlayerObject, false)
while TestValid(nearest_enemy) do
BlockOnCommand(MainForce.Attack_Move(nearest_enemy))
nearest_enemy = Find_Nearest(MainForce, PlayerObject, false)
end
-- This plan should only be allowed to occur once
while true do
Sleep(200)
end
end

View File

@@ -0,0 +1,102 @@
-- $Id: //depot/Projects/StarWars_Expansion/Run/Data/Scripts/AI/LandMode/DestroyLandUnit.lua#5 $
--/////////////////////////////////////////////////////////////////////////////////////////////////
--
-- (C) Petroglyph Games, Inc.
--
--
-- ***** ** * *
-- * ** * * *
-- * * * * *
-- * * * * * * * *
-- * * *** ****** * ** **** *** * * * ***** * ***
-- * ** * * * ** * ** ** * * * * ** ** ** *
-- *** ***** * * * * * * * * ** * * * *
-- * * * * * * * * * * * * * * *
-- * * * * * * * * * * ** * * * *
-- * ** * * ** * ** * * ** * * * *
-- ** **** ** * **** ***** * ** *** * *
-- * * *
-- * * *
-- * * *
-- * * * *
-- **** * *
--
--/////////////////////////////////////////////////////////////////////////////////////////////////
-- C O N F I D E N T I A L S O U R C E C O D E -- D O N O T D I S T R I B U T E
--/////////////////////////////////////////////////////////////////////////////////////////////////
--
-- $File: //depot/Projects/StarWars_Expansion/Run/Data/Scripts/AI/LandMode/DestroyLandUnit.lua $
--
-- Original Author: James Yarrow
--
-- $Author: James_Yarrow $
--
-- $Change: 56734 $
--
-- $DateTime: 2006/10/24 14:15:48 $
--
-- $Revision: #5 $
--
--/////////////////////////////////////////////////////////////////////////////////////////////////
require("pgevents")
ScriptPoolCount = 5
function Definitions()
Category = "Destroy_Land_Unit"
TaskForce = {
{
"MainForce"
,"DenyHeroAttach"
,"Vehicle | Air = 1,8"
,"LandHero = 0,1"
,"-Gallofree_HTT_Company"
,"-HAV_Juggernaut_Company"
,"-F9TZ_Cloaking_Transport_Company"
,"-Hutt_SailBarge_Company"
,"-Fanblade_Fighter"
,"-AALL6"
,"-AT_AA_Walker"
},
{
"GuardForce"
,"EscortForce"
,"Infantry = 0,4"
}
}
start_loc = nil
end
function MainForce_Thread()
BlockOnCommand(MainForce.Produce_Force())
QuickReinforce(PlayerObject, AITarget, MainForce, GuardForce)
--BlockOnCommand(MainForce.Move_To(MainForce.Get_Stage(), false)) -- true = wait for entire taskforce at intermediate zone points
MainForce.Set_As_Goal_System_Removable(false)
Set_Land_AI_Targeting_Priorities(MainForce)
-- Assign appropriate targeting priorities here, once we get the ability to do this per unit type
BlockOnCommand(MainForce.Attack_Move(AITarget, MainForce.Get_Self_Threat_Max()))
ScriptExit()
end
function GuardForce_Thread()
BlockOnCommand(GuardForce.Produce_Force())
QuickReinforce(PlayerObject, AITarget, GuardForce, MainForce)
Set_Land_AI_Targeting_Priorities(GuardForce)
-- Give an initial order to put the escorts in a state that the Escort function expects
GuardForce.Guard_Target(MainForce)
while true do
Escort(GuardForce, MainForce)
end
end

View File

@@ -0,0 +1,101 @@
-- $Id: //depot/Projects/StarWars_Expansion/Run/Data/Scripts/AI/LandMode/DestroyStructure.lua#5 $
--/////////////////////////////////////////////////////////////////////////////////////////////////
--
-- (C) Petroglyph Games, Inc.
--
--
-- ***** ** * *
-- * ** * * *
-- * * * * *
-- * * * * * * * *
-- * * *** ****** * ** **** *** * * * ***** * ***
-- * ** * * * ** * ** ** * * * * ** ** ** *
-- *** ***** * * * * * * * * ** * * * *
-- * * * * * * * * * * * * * * *
-- * * * * * * * * * * ** * * * *
-- * ** * * ** * ** * * ** * * * *
-- ** **** ** * **** ***** * ** *** * *
-- * * *
-- * * *
-- * * *
-- * * * *
-- **** * *
--
--/////////////////////////////////////////////////////////////////////////////////////////////////
-- C O N F I D E N T I A L S O U R C E C O D E -- D O N O T D I S T R I B U T E
--/////////////////////////////////////////////////////////////////////////////////////////////////
--
-- $File: //depot/Projects/StarWars_Expansion/Run/Data/Scripts/AI/LandMode/DestroyStructure.lua $
--
-- Original Author: James Yarrow
--
-- $Author: James_Yarrow $
--
-- $Change: 56734 $
--
-- $DateTime: 2006/10/24 14:15:48 $
--
-- $Revision: #5 $
--
--/////////////////////////////////////////////////////////////////////////////////////////////////
require("pgevents")
ScriptPoolCount = 16
function Definitions()
Category = "Destroy_Structure"
TaskForce = {
{
"MainForce"
,"DenyHeroAttach"
,"Infantry | Vehicle | Air = 1,10"
,"LandHero = 0,2"
,"-Gallofree_HTT_Company"
,"-HAV_Juggernaut_Company"
,"-F9TZ_Cloaking_Transport_Company"
,"-Hutt_SailBarge_Company"
,"-Fanblade_Fighter"
,"-AALL6"
,"-AT_AA_Walker"
},
{
"GuardForce"
,"EscortForce"
,"Squad_Rebel_Trooper | Squad_Stormtrooper = 0,2"
}
}
start_loc = nil
end
function MainForce_Thread()
BlockOnCommand(MainForce.Produce_Force())
QuickReinforce(PlayerObject, AITarget, MainForce, GuardForce)
Set_Land_AI_Targeting_Priorities(MainForce)
-- Assign appropriate targeting priorities here, once we get the ability to do this per unit type
BlockOnCommand(MainForce.Attack_Move(AITarget, MainForce.Get_Self_Threat_Max()))
ScriptExit()
end
function GuardForce_Thread()
BlockOnCommand(GuardForce.Produce_Force())
QuickReinforce(PlayerObject, AITarget, GuardForce, MainForce)
-- Give an initial order to put the escorts in a state that the Escort function expects
GuardForce.Guard_Target(MainForce)
-- Make sure these guys will shoot at structures autonomously
GuardForce.Set_Targeting_Priorities("Infantry_Attack_Move")
while true do
Escort(GuardForce, MainForce)
end
end

View File

@@ -0,0 +1,103 @@
-- $Id: //depot/Projects/StarWars_Expansion/Run/Data/Scripts/AI/LandMode/DestroyTurbolaser.lua#4 $
--/////////////////////////////////////////////////////////////////////////////////////////////////
--
-- (C) Petroglyph Games, Inc.
--
--
-- ***** ** * *
-- * ** * * *
-- * * * * *
-- * * * * * * * *
-- * * *** ****** * ** **** *** * * * ***** * ***
-- * ** * * * ** * ** ** * * * * ** ** ** *
-- *** ***** * * * * * * * * ** * * * *
-- * * * * * * * * * * * * * * *
-- * * * * * * * * * * ** * * * *
-- * ** * * ** * ** * * ** * * * *
-- ** **** ** * **** ***** * ** *** * *
-- * * *
-- * * *
-- * * *
-- * * * *
-- **** * *
--
--/////////////////////////////////////////////////////////////////////////////////////////////////
-- C O N F I D E N T I A L S O U R C E C O D E -- D O N O T D I S T R I B U T E
--/////////////////////////////////////////////////////////////////////////////////////////////////
--
-- $File: //depot/Projects/StarWars_Expansion/Run/Data/Scripts/AI/LandMode/DestroyTurbolaser.lua $
--
-- Original Author: James Yarrow
--
-- $Author: James_Yarrow $
--
-- $Change: 56734 $
--
-- $DateTime: 2006/10/24 14:15:48 $
--
-- $Revision: #4 $
--
--/////////////////////////////////////////////////////////////////////////////////////////////////
require("pgevents")
ScriptPoolCount = 16
function Definitions()
Category = "Destroy_Turbolaser"
TaskForce = {
{
"MainForce"
,"DenyHeroAttach"
,"Infantry | Air | LandHero = 3,10"
,"-Gallofree_HTT_Company"
,"-HAV_Juggernaut_Company"
,"-F9TZ_Cloaking_Transport_Company"
,"-Hutt_SailBarge_Company"
,"-Fanblade_Fighter"
,"-AALL6"
,"-AT_AA_Walker"
},
{
"GuardForce"
,"EscortForce"
,"Squad_Rebel_Trooper | Squad_Stormtrooper = 0,2"
}
}
start_loc = nil
end
function MainForce_Thread()
BlockOnCommand(MainForce.Produce_Force())
QuickReinforce(PlayerObject, AITarget, MainForce, GuardForce)
Try_Ability(MainForce, "FORCE_CLOAK")
Try_Ability(MainForce, "STEALTH")
-- Try to get under the min attack range, then attack
BlockOnCommand(MainForce.Move_To(AITarget, MainForce.Get_Self_Threat_Sum()))
BlockOnCommand(MainForce.Attack_Target(AITarget))
ScriptExit()
end
function GuardForce_Thread()
BlockOnCommand(GuardForce.Produce_Force())
QuickReinforce(PlayerObject, AITarget, GuardForce, MainForce)
-- Give an initial order to put the escorts in a state that the Escort function expects
GuardForce.Guard_Target(MainForce)
-- Make sure these guys will shoot at structures autonomously
GuardForce.Set_Targeting_Priorities("Infantry_Attack_Move")
while true do
Escort(GuardForce, MainForce)
end
end

View File

@@ -0,0 +1,134 @@
-- $Id: //depot/Projects/StarWars_Steam/FOC/Run/Data/Scripts/AI/LandMode/Droids.lua#1 $
--/////////////////////////////////////////////////////////////////////////////////////////////////
--
-- (C) Petroglyph Games, Inc.
--
--
-- ***** ** * *
-- * ** * * *
-- * * * * *
-- * * * * * * * *
-- * * *** ****** * ** **** *** * * * ***** * ***
-- * ** * * * ** * ** ** * * * * ** ** ** *
-- *** ***** * * * * * * * * ** * * * *
-- * * * * * * * * * * * * * * *
-- * * * * * * * * * * ** * * * *
-- * ** * * ** * ** * * ** * * * *
-- ** **** ** * **** ***** * ** *** * *
-- * * *
-- * * *
-- * * *
-- * * * *
-- **** * *
--
--/////////////////////////////////////////////////////////////////////////////////////////////////
-- C O N F I D E N T I A L S O U R C E C O D E -- D O N O T D I S T R I B U T E
--/////////////////////////////////////////////////////////////////////////////////////////////////
--
-- $File: //depot/Projects/StarWars_Steam/FOC/Run/Data/Scripts/AI/LandMode/Droids.lua $
--
-- Original Author: Steve_Copeland
--
-- $Author: Brian_Hayes $
--
-- $Change: 637819 $
--
-- $DateTime: 2017/03/22 10:16:16 $
--
-- $Revision: #1 $
--
--/////////////////////////////////////////////////////////////////////////////////////////////////
require("pgevents")
function Definitions()
Category = "Droids"
TaskForce = {
{
"MainForce"
,"DenyHeroAttach"
,"Tactical_R2_3PO_Team = 1"
}
}
IgnoreTarget = true
AllowEngagedUnits = true
turret_seek_range = 500
repair_seek_range = 500
end
function MainForce_Thread()
BlockOnCommand(MainForce.Produce_Force())
QuickReinforce(PlayerObject, AITarget, MainForce)
MainForce.Set_As_Goal_System_Removable(false)
droids = MainForce.Get_Unit_Table()[1]
if not TestValid(droids) then
MessageBox("unexpected state; droids unavailable")
end
-- Continuously try to use abilities and recharge or heal
while true do
ConsiderRepair(droids)
-- If we're ready and there is a turret nearby, hack it
if droids.Is_Ability_Ready("TARGETED_HACK") then
nearest_turret = Find_Nearest(MainForce, "Turret", PlayerObject, false)
if TestValid(nearest_turret) and MainForce.Get_Distance(nearest_turret) < turret_seek_range then
BlockOnCommand(MainForce.Activate_Ability("TARGETED_HACK", nearest_turret))
end
end
ConsiderRepair(droids)
-- Are we ready to find a vehicle to repair?
if droids.Is_Ability_Ready("TARGETED_REPAIR") then
-- Try a nearby one first
repair_target = FindTarget(MainForce, "Needs_Repair", "Friendly_Unit", 1.0, repair_seek_range)
if TestValid(repair_target) then
BlockOnCommand(MainForce.Activate_Ability("TARGETED_REPAIR", repair_target))
else
-- Find any vehicle to repair
repair_target = FindTarget(MainForce, "Needs_Repair", "Friendly_Unit", 1.0)
if TestValid(repair_target) then
BlockOnCommand(MainForce.Activate_Ability("TARGETED_REPAIR", repair_target))
end
end
end
ConsiderRepair(droids)
-- Generally move toward the most significant friendly vehicle
big_vehicle = FindTarget(MainForce, "Vehicle_Needs_Escort", "Friendly_Unit", 1.0)
if TestValid(big_vehicle) then
-- Time out frequently, so that we can acquire other targets
BlockOnCommand(MainForce.Move_To(big_vehicle), 5)
end
MainForce.Set_Plan_Result(true)
-- Make sure that they have at least some non-offensive orders (because the above may cause no behavior)
flee_loc = FindTarget(MainForce, "Space_Area_Is_Hidden", "Tactical_Location", 1.0, 5000.0)
if flee_loc then
BlockOnCommand(MainForce.Move_To(flee_loc))
end
-- Make sure the loop always yields
Sleep(1)
end
end

View File

@@ -0,0 +1,121 @@
-- $Id: //depot/Projects/StarWars_Steam/FOC/Run/Data/Scripts/AI/LandMode/EwokHuntPlan.lua#1 $
--/////////////////////////////////////////////////////////////////////////////////////////////////
--
-- (C) Petroglyph Games, Inc.
--
--
-- ***** ** * *
-- * ** * * *
-- * * * * *
-- * * * * * * * *
-- * * *** ****** * ** **** *** * * * ***** * ***
-- * ** * * * ** * ** ** * * * * ** ** ** *
-- *** ***** * * * * * * * * ** * * * *
-- * * * * * * * * * * * * * * *
-- * * * * * * * * * * ** * * * *
-- * ** * * ** * ** * * ** * * * *
-- ** **** ** * **** ***** * ** *** * *
-- * * *
-- * * *
-- * * *
-- * * * *
-- **** * *
--
--/////////////////////////////////////////////////////////////////////////////////////////////////
-- C O N F I D E N T I A L S O U R C E C O D E -- D O N O T D I S T R I B U T E
--/////////////////////////////////////////////////////////////////////////////////////////////////
--
-- $File: //depot/Projects/StarWars_Steam/FOC/Run/Data/Scripts/AI/LandMode/EwokHuntPlan.lua $
--
-- Original Author: Steve_Copeland
--
-- $Author: Brian_Hayes $
--
-- $Change: 637819 $
--
-- $DateTime: 2017/03/22 10:16:16 $
--
-- $Revision: #1 $
--
--/////////////////////////////////////////////////////////////////////////////////////////////////
require("pgevents")
--
-- One basic plan, since there are only infantry units and probably not many of them.
-- They will attack with very low contrast ratio, but learn and eventually rally troops to escalate the attack.
function Definitions()
Category = "Ewok_Hunt"
MinContrastScale = 0.0001
TaskForce = {
{
"MainForce"
,"DenyHeroAttach"
,"Infantry= 1,50"
}
}
--IgnoreTarget = false
PerFailureContrastAdjust = 0.2
AllowEngagedUnits = false
closest_enemy = nil
kill_target = nil
start_loc = nil
staging = false
end
function MainForce_Thread()
BlockOnCommand(MainForce.Produce_Force())
MainForce.Set_Plan_Result(true)
-- Don't seem to be getting an effective stage
--DebugMessage("%s -- Got Stage: %s", tostring(Script), tostring(MainForce.Get_Stage()))
--BlockOnCommand(MainForce.Move_To(MainForce.Get_Stage()), 10)
-- Just stage at the spawner nearest the plan's target, if there is one.
spawner = Find_Nearest(AITarget, "Ewok_Spawn_House")
if TestValid(spawner) then
staging = true
BlockOnCommand(MainForce.Attack_Move(spawner), 10)
staging = false
end
BlockOnCommand(MainForce.Attack_Move(AITarget))
-- Give the Unit_Move_Finished a chance to find further targets near the AITarget zone
Sleep(10)
ScriptExit()
end
-- Make sure that units don't sit idle at the end of their move order, waiting for others to let the BlockOn finish
function MainForce_Unit_Move_Finished(tf, unit)
-- Only perform attack move fix-up behavior if we're not trying to stage units.
if staging then
return
end
DebugMessage("%s -- %s reached end of move, giving new order", tostring(Script), tostring(unit))
-- We want this unit to release and attack something, whatever is attacking us or just something close
kill_target = FindDeadlyEnemy(tf)
if not TestValid(kill_target) then
kill_target = Find_Nearest(unit, PlayerObject, false)
end
if TestValid(kill_target) then
unit.Attack_Move(kill_target)
tf.Release_Unit(unit)
DebugMessage("%s-- Unit %s only Attack_Move to %s", tostring(Script), tostring(unit), tostring(kill_target))
end
end
function MainForce_No_Units_Remaining()
--MessageBox("%s -- All units dead or non-buildable. RAISING CONTRAST. Abandonning plan.", tostring(Script))
MainForce.Set_Plan_Result(false)
ScriptExit()
end

View File

@@ -0,0 +1,68 @@
--/////////////////////////////////////////////////////////////////////////////////////////////////
-- (c) Galyana's Ultimate Empire at War Modifications
--
-- ****** *** *** ************ *** ***
-- * * * * * * * *
-- * * * * * * *
-- * * * * * * *
-- * * * * * **** * * *
-- * * * ****** * * * *
-- * **** * * * * * * * *** *
-- * * * * * * * * * *
-- * * * * * * * * * *
-- * * * * * * * ** * * *
-- ****** ****** ************ **** ** *******
--/////////////////////////////////////////////////////////////////////////////////////////////////
-- C O N F I D E N T I A L S O U R C E C O D E -- D O N O T D I S T R I B U T E
--/////////////////////////////////////////////////////////////////////////////////////////////////
--
-- File: GUEaW/Data/Scripts/AI/LandMode/FireMagnepulse.lua
--
-- Original Editor: Giovanni Galyana
--
-- Final Edit By: Giovanni Galyana
--
-- Date: 9 April, 2023
--
-- Revisions: 2
--
--/////////////////////////////////////////////////////////////////////////////////////////////////
-- Self-attachment script for the Magnepulse Cannon, but currently a custom goal is the best tactic
require("pgevents")
function Definitions()
DebugMessage("%s -- In Definitions", tostring(Script))
Category = "Fire_Magnepulse"
IgnoreTarget = true
TaskForce =
{
{
"MainForce"
,"DenySpecialWeaponAttach"
,"DenyHeroAttach"
,"E_Ground_Magnepulse_Cannon | E_Ground_Magnepulse_Cannon_GC = 1"
}
}
DebugMessage("%s -- Done Definitions", tostring(Script))
end
function MainForce_Thread()
BlockOnCommand(MainForce.Produce_Force())
-- Keep firing at the bigger (and probably slowest) enemies
-- Add some variance, so that we can spread the effect around
AITarget = FindTarget(MainForce, "Needs_Magnepulse_Shot", "Enemy_Unit", 0.8)
DebugMessage("%s -- Found Target %s", tostring(Script), tostring(AITarget))
-- Just fire once, because the effect isn't that useful to hit the same target in rapid succession
if TestValid(AITarget) then
MainForce.Fire_Special_Weapon("E_Ground_Magnepulse_Cannon", AITarget)
MainForce.Fire_Special_Weapon("E_Ground_Magnepulse_Cannon_GC", AITarget)
end
ScriptExit()
end

View File

@@ -0,0 +1,91 @@
-- $Id: //depot/Projects/StarWars_Steam/FOC/Run/Data/Scripts/AI/LandMode/FundTacticalStructures.lua#1 $
--/////////////////////////////////////////////////////////////////////////////////////////////////
--
-- (C) Petroglyph Games, Inc.
--
--
-- ***** ** * *
-- * ** * * *
-- * * * * *
-- * * * * * * * *
-- * * *** ****** * ** **** *** * * * ***** * ***
-- * ** * * * ** * ** ** * * * * ** ** ** *
-- *** ***** * * * * * * * * ** * * * *
-- * * * * * * * * * * * * * * *
-- * * * * * * * * * * ** * * * *
-- * ** * * ** * ** * * ** * * * *
-- ** **** ** * **** ***** * ** *** * *
-- * * *
-- * * *
-- * * *
-- * * * *
-- **** * *
--
--/////////////////////////////////////////////////////////////////////////////////////////////////
-- C O N F I D E N T I A L S O U R C E C O D E -- D O N O T D I S T R I B U T E
--/////////////////////////////////////////////////////////////////////////////////////////////////
--
-- $File: //depot/Projects/StarWars_Steam/FOC/Run/Data/Scripts/AI/LandMode/FundTacticalStructures.lua $
--
-- Original Author: Steve_Copeland
--
-- $Author: Brian_Hayes $
--
-- $Change: 637819 $
--
-- $DateTime: 2017/03/22 10:16:16 $
--
-- $Revision: #1 $
--
--/////////////////////////////////////////////////////////////////////////////////////////////////
require("pgevents")
-- Provide nominal funding for tactical structure building from galactic cash. Note that
-- additional cash may still be provided for by unspent cash in various budgets as defined
-- in the player template.
function Definitions()
Category = "Fund_Tactical_Structures"
TaskForce = {
{
"MainForce"
,"TaskForceRequired"
}
}
end
function MainForce_Thread()
-- Never remove this plan
MainForce.Set_As_Goal_System_Removable(false)
if PlayerObject.Get_Credits() == 0 then
-- Pirates work as individual cells and have no galactic coordination of cash.
-- Also, they always have a level one base, so they get a fixed amount of free cash for structures.
-- if EvaluatePerception("Is_Pirate", PlayerObject, Target) then
if PlayerObject.Get_Faction_Name() == "PIRATES" or PlayerObject.Get_Faction_Name() == "HUTTS" then
cash_amount = 15000
PlayerObject.Give_Money(cash_amount)
DebugMessage("%s -- Tactical funding (free for Pirates) %.2f", tostring(Script), cash_amount)
-- Other factions pull a calculated amount of funds from their galactic pool.
else
cash_amount = Evaluate_In_Galactic_Context("Land_Tactical_Budget_Clamped", PlayerObject)
--cash_amount = Evaluate_In_Galactic_Context("Land_Tactical_Budget", PlayerObject)
PlayerObject.Release_Credits_For_Tactical(cash_amount)
DebugMessage("%s -- Tactical funding %.2f", tostring(Script), cash_amount)
end
end
-- Don't let this script exit, so that each instance of land tactical will only be funded once
while true do
Sleep(20)
end
end

View File

@@ -0,0 +1,116 @@
-- $Id: //depot/Projects/StarWars_Steam/FOC/Run/Data/Scripts/AI/LandMode/HanSoloAssists.lua#1 $
--/////////////////////////////////////////////////////////////////////////////////////////////////
--
-- (C) Petroglyph Games, Inc.
--
--
-- ***** ** * *
-- * ** * * *
-- * * * * *
-- * * * * * * * *
-- * * *** ****** * ** **** *** * * * ***** * ***
-- * ** * * * ** * ** ** * * * * ** ** ** *
-- *** ***** * * * * * * * * ** * * * *
-- * * * * * * * * * * * * * * *
-- * * * * * * * * * * ** * * * *
-- * ** * * ** * ** * * ** * * * *
-- ** **** ** * **** ***** * ** *** * *
-- * * *
-- * * *
-- * * *
-- * * * *
-- **** * *
--
--/////////////////////////////////////////////////////////////////////////////////////////////////
-- C O N F I D E N T I A L S O U R C E C O D E -- D O N O T D I S T R I B U T E
--/////////////////////////////////////////////////////////////////////////////////////////////////
--
-- $File: //depot/Projects/StarWars_Steam/FOC/Run/Data/Scripts/AI/LandMode/HanSoloAssists.lua $
--
-- Original Author: Steve_Copeland
--
-- $Author: Brian_Hayes $
--
-- $Change: 637819 $
--
-- $DateTime: 2017/03/22 10:16:16 $
--
-- $Revision: #1 $
--
--/////////////////////////////////////////////////////////////////////////////////////////////////
-- This plan simply puts Han in the right places.
-- It relies on the object script HanSolo.lua to activate abilities.
require("pgevents")
function Definitions()
Category = "HanSoloAssists"
TaskForce = {
{
"MainForce"
,"DenyHeroAttach"
,"Han_Solo = 1"
}
}
IgnoreTarget = true
AllowEngagedUnits = true
duration_to_fight = 60
time_to_transition_reinforcement_point = 5
end
function MainForce_Thread()
BlockOnCommand(MainForce.Produce_Force())
QuickReinforce(PlayerObject, AITarget, MainForce)
MainForce.Set_As_Goal_System_Removable(false)
han = MainForce.Get_Unit_Table()[1]
if not TestValid(han) then
MessageBox("unexpected state; han unavailable")
ScriptExit()
end
-- Continuously try to attack, assist the most significant nearby unit, and heal up
while true do
-- Make sure the loop always yields
Sleep(1)
ConsiderHeal(han)
-- Grab a reinforcement point
lz_table = PruneFriendlyObjects(Find_All_Objects_Of_Type("IsRushTarget"))
if TestValid(lz_table[1]) then
Try_Ability(han, "SPRINT")
BlockOnCommand(han.Move_To(lz_table[1]))
BlockOnCommand(han.Guard_Target(lz_table[1]), time_to_transition_reinforcement_point)
end
ConsiderHeal(han)
-- Try to get near a good EMP stun target
enemy_location = FindTarget.Reachable_Target(PlayerObject, "Area_Needs_Han_Solo_Assist", "Tactical_Location", "Any_Threat", 0.5)
if TestValid(enemy_location) then
DebugMessage("%s-- moving toward enemy concentration", tostring(Script))
BlockOnCommand(MainForce.Attack_Move(enemy_location))
if han.Is_Ability_Ready("AREA_EFFECT_STUN") then
enemy_vehicle = Find_Nearest(han, "Vehicle", PlayerObject, false)
if TestValid(enemy_vehicle) then
BlockOnCommand(MainForce.Move_To(enemy_vehicle))
end
end
end
MainForce.Set_Plan_Result(true)
end
end

View File

@@ -0,0 +1,73 @@
-- $Id: //depot/Projects/StarWars_Steam/FOC/Run/Data/Scripts/AI/LandMode/HoldPosition.lua#1 $
--/////////////////////////////////////////////////////////////////////////////////////////////////
--
-- (C) Petroglyph Games, Inc.
--
--
-- ***** ** * *
-- * ** * * *
-- * * * * *
-- * * * * * * * *
-- * * *** ****** * ** **** *** * * * ***** * ***
-- * ** * * * ** * ** ** * * * * ** ** ** *
-- *** ***** * * * * * * * * ** * * * *
-- * * * * * * * * * * * * * * *
-- * * * * * * * * * * ** * * * *
-- * ** * * ** * ** * * ** * * * *
-- ** **** ** * **** ***** * ** *** * *
-- * * *
-- * * *
-- * * *
-- * * * *
-- **** * *
--
--/////////////////////////////////////////////////////////////////////////////////////////////////
-- C O N F I D E N T I A L S O U R C E C O D E -- D O N O T D I S T R I B U T E
--/////////////////////////////////////////////////////////////////////////////////////////////////
--
-- $File: //depot/Projects/StarWars_Steam/FOC/Run/Data/Scripts/AI/LandMode/HoldPosition.lua $
--
-- Original Author: James Yarrow
--
-- $Author: Brian_Hayes $
--
-- $Change: 637819 $
--
-- $DateTime: 2017/03/22 10:16:16 $
--
-- $Revision: #1 $
--
--/////////////////////////////////////////////////////////////////////////////////////////////////
require("pgevents")
function Definitions()
Category = "Hold_Position"
IgnoreTarget = true
TaskForce = {
{
"MainForce"
,"Vehicle = 0,2"
,"Infantry = 0,2"
},
}
RequiredCategories = { "Infantry | Vehicle " }
end
function MainForce_Thread()
BlockOnCommand(MainForce.Produce_Force())
WaitForAllReinforcements(MainForce, AITarget)
BlockOnCommand(MainForce.Guard_Target(AITarget))
WaitForever()
ScriptExit()
end
function MainForce_No_Units_Remaining()
DebugMessage("%s -- All units dead or non-buildable. Abandonning plan.", tostring(Script))
ScriptExit()
end

View File

@@ -0,0 +1,71 @@
-- $Id: //depot/Projects/StarWars_Steam/FOC/Run/Data/Scripts/AI/LandMode/LandBombing.lua#1 $
--/////////////////////////////////////////////////////////////////////////////////////////////////
--
-- (C) Petroglyph Games, Inc.
--
--
-- ***** ** * *
-- * ** * * *
-- * * * * *
-- * * * * * * * *
-- * * *** ****** * ** **** *** * * * ***** * ***
-- * ** * * * ** * ** ** * * * * ** ** ** *
-- *** ***** * * * * * * * * ** * * * *
-- * * * * * * * * * * * * * * *
-- * * * * * * * * * * ** * * * *
-- * ** * * ** * ** * * ** * * * *
-- ** **** ** * **** ***** * ** *** * *
-- * * *
-- * * *
-- * * *
-- * * * *
-- **** * *
--
--/////////////////////////////////////////////////////////////////////////////////////////////////
-- C O N F I D E N T I A L S O U R C E C O D E -- D O N O T D I S T R I B U T E
--/////////////////////////////////////////////////////////////////////////////////////////////////
--
-- $File: //depot/Projects/StarWars_Steam/FOC/Run/Data/Scripts/AI/LandMode/LandBombing.lua $
--
-- Original Author: James Yarrow
--
-- $Author: Brian_Hayes $
--
-- $Change: 637819 $
--
-- $DateTime: 2017/03/22 10:16:16 $
--
-- $Revision: #1 $
--
--/////////////////////////////////////////////////////////////////////////////////////////////////
require("pgevents")
function Definitions()
Category = "Land_Bombing_Run"
IgnoreTarget = true
TaskForce =
{
{
"MainForce"
,"DenyHeroAttach"
,"TaskForceRequired"
}
}
result = nil
end
function MainForce_Thread()
MainForce.Set_As_Goal_System_Removable(false)
result = BlockOnCommand(MainForce.Bombing_Run(AITarget))
if result and result > 0.65 then
MainForce.Set_Plan_Result(true)
end
ScriptExit()
end

View File

@@ -0,0 +1,75 @@
-- $Id: //depot/Projects/StarWars_Steam/FOC/Run/Data/Scripts/AI/LandMode/LandEscortPlan.lua#1 $
--/////////////////////////////////////////////////////////////////////////////////////////////////
--
-- (C) Petroglyph Games, Inc.
--
--
-- ***** ** * *
-- * ** * * *
-- * * * * *
-- * * * * * * * *
-- * * *** ****** * ** **** *** * * * ***** * ***
-- * ** * * * ** * ** ** * * * * ** ** ** *
-- *** ***** * * * * * * * * ** * * * *
-- * * * * * * * * * * * * * * *
-- * * * * * * * * * * ** * * * *
-- * ** * * ** * ** * * ** * * * *
-- ** **** ** * **** ***** * ** *** * *
-- * * *
-- * * *
-- * * *
-- * * * *
-- **** * *
--
--/////////////////////////////////////////////////////////////////////////////////////////////////
-- C O N F I D E N T I A L S O U R C E C O D E -- D O N O T D I S T R I B U T E
--/////////////////////////////////////////////////////////////////////////////////////////////////
--
-- $File: //depot/Projects/StarWars_Steam/FOC/Run/Data/Scripts/AI/LandMode/LandEscortPlan.lua $
--
-- Original Author: Brian Hayes
--
-- $Author: Brian_Hayes $
--
-- $Change: 637819 $
--
-- $DateTime: 2017/03/22 10:16:16 $
--
-- $Revision: #1 $
--
--/////////////////////////////////////////////////////////////////////////////////////////////////
require("pgevents")
--
-- Land Mode Escort
--
function Definitions()
Category = "Land_Escort"
IgnoreTarget = true
TaskForce = {
{
"MainForce"
,"DenyHeroAttach"
,"Infantry = 1"
,"LandHero = 0,1"
}
}
end
function MainForce_Thread()
BlockOnCommand(MainForce.Produce_Force());
QuickReinforce(PlayerObject, AITarget, MainForce)
DebugMessage("Taskforce %s following object %s.", tostring(MainForce), tostring(Target))
-- Give an initial order to put the escorts in a state that the Escort function expects
MainForce.Guard_Target(AITarget)
while true do
Escort(MainForce, AITarget)
end
ScriptExit()
end

View File

@@ -0,0 +1,85 @@
-- $Id: //depot/Projects/StarWars_Steam/FOC/Run/Data/Scripts/AI/LandMode/LandHeroes.lua#1 $
--/////////////////////////////////////////////////////////////////////////////////////////////////
--
-- (C) Petroglyph Games, Inc.
--
--
-- ***** ** * *
-- * ** * * *
-- * * * * *
-- * * * * * * * *
-- * * *** ****** * ** **** *** * * * ***** * ***
-- * ** * * * ** * ** ** * * * * ** ** ** *
-- *** ***** * * * * * * * * ** * * * *
-- * * * * * * * * * * * * * * *
-- * * * * * * * * * * ** * * * *
-- * ** * * ** * ** * * ** * * * *
-- ** **** ** * **** ***** * ** *** * *
-- * * *
-- * * *
-- * * *
-- * * * *
-- **** * *
--
--/////////////////////////////////////////////////////////////////////////////////////////////////
-- C O N F I D E N T I A L S O U R C E C O D E -- D O N O T D I S T R I B U T E
--/////////////////////////////////////////////////////////////////////////////////////////////////
--
-- $File: //depot/Projects/StarWars_Steam/FOC/Run/Data/Scripts/AI/LandMode/LandHeroes.lua $
--
-- Original Author: Steve_Copeland
--
-- $Author: Brian_Hayes $
--
-- $Change: 637819 $
--
-- $DateTime: 2017/03/22 10:16:16 $
--
-- $Revision: #1 $
--
--/////////////////////////////////////////////////////////////////////////////////////////////////
require("pgevents")
-- This plan just tries to land any purchased heroes for skirmish (they don't count toward unit cap)
function Definitions()
Category = "Land_Heroes"
TaskForce = {
{
"MainForce"
,"DenyHeroAttach"
,"LandHero = 1,5"
}
}
IgnoreTarget = true
AllowEngagedUnits = false
end
function MainForce_Thread()
BlockOnCommand(MainForce.Produce_Force())
--Immediately release anybody that was already landed
MainForce.Release_Forces(1.0)
-- find something to reinforce near
friendly_loc = FindTarget(MainForce, "Space_Area_Is_Hidden", "Tactical_Location", 1.0)
if not TestValid(friendly_loc) then
friendly_loc = FindTarget(MainForce, "Is_Friendly_Start", "Tactical_Location", 1.0)
end
if not TestValid(friendly_loc) then
ScriptExit()
end
WaitForAllReinforcements(MainForce, friendly_loc)
MainForce.Release_Forces(1)
MainForce.Set_Plan_Result(true)
Sleep(15)
end

View File

@@ -0,0 +1,85 @@
-- $Id: //depot/Projects/StarWars_Steam/FOC/Run/Data/Scripts/AI/LandMode/LandScout.lua#1 $
--/////////////////////////////////////////////////////////////////////////////////////////////////
--
-- (C) Petroglyph Games, Inc.
--
--
-- ***** ** * *
-- * ** * * *
-- * * * * *
-- * * * * * * * *
-- * * *** ****** * ** **** *** * * * ***** * ***
-- * ** * * * ** * ** ** * * * * ** ** ** *
-- *** ***** * * * * * * * * ** * * * *
-- * * * * * * * * * * * * * * *
-- * * * * * * * * * * ** * * * *
-- * ** * * ** * ** * * ** * * * *
-- ** **** ** * **** ***** * ** *** * *
-- * * *
-- * * *
-- * * *
-- * * * *
-- **** * *
--
--/////////////////////////////////////////////////////////////////////////////////////////////////
-- C O N F I D E N T I A L S O U R C E C O D E -- D O N O T D I S T R I B U T E
--/////////////////////////////////////////////////////////////////////////////////////////////////
--
-- $File: //depot/Projects/StarWars_Steam/FOC/Run/Data/Scripts/AI/LandMode/LandScout.lua $
--
-- Original Author: James Yarrow
--
-- $Author: Brian_Hayes $
--
-- $Change: 637819 $
--
-- $DateTime: 2017/03/22 10:16:16 $
--
-- $Revision: #1 $
--
--/////////////////////////////////////////////////////////////////////////////////////////////////
require("pgevents")
function Definitions()
Category = "Land_Scout_Area"
IgnoreTarget = true
TaskForce =
{
{
"MainForce",
"Infantry | Air | LandHero = 1"
}
}
end
function MainForce_Thread()
BlockOnCommand(MainForce.Produce_Force())
QuickReinforce(PlayerObject, AITarget, MainForce)
-- Do it once without interruption
MainForce.Set_As_Goal_System_Removable(false)
Try_Ability(MainForce, "FORCE_CLOAK")
BlockOnCommand(MainForce.Attack_Move(AITarget, MainForce.Get_Self_Threat_Max()))
BlockOnCommand(MainForce.Explore_Area(AITarget), 10)
MainForce.Set_Plan_Result(true)
-- MainForce.Set_As_Goal_System_Removable(true)
-- Removing this loop to give other plans a chance. If the AI still wants to scout, the plan will be proposed again.
-- while true do
-- AITarget = FindTarget(MainForce, "Land_Area_Needs_Scouting", "Tactical_Location", 0.8, 1000.0)
-- if not TestValid(AITarget) then
-- DebugMessage("%s -- Unable to find a target for MainForce.", tostring(Script))
-- ScriptExit()
-- end
-- BlockOnCommand(MainForce.Move_To(AITarget, MainForce.Get_Self_Threat_Max()))
-- BlockOnCommand(MainForce.Explore_Area(AITarget), 10)
-- Sleep(1)
-- end
ScriptExit()
end

View File

@@ -0,0 +1,115 @@
-- $Id: //depot/Projects/StarWars_Steam/FOC/Run/Data/Scripts/AI/LandMode/ObiWanAssists.lua#1 $
--/////////////////////////////////////////////////////////////////////////////////////////////////
--
-- (C) Petroglyph Games, Inc.
--
--
-- ***** ** * *
-- * ** * * *
-- * * * * *
-- * * * * * * * *
-- * * *** ****** * ** **** *** * * * ***** * ***
-- * ** * * * ** * ** ** * * * * ** ** ** *
-- *** ***** * * * * * * * * ** * * * *
-- * * * * * * * * * * * * * * *
-- * * * * * * * * * * ** * * * *
-- * ** * * ** * ** * * ** * * * *
-- ** **** ** * **** ***** * ** *** * *
-- * * *
-- * * *
-- * * *
-- * * * *
-- **** * *
--
--/////////////////////////////////////////////////////////////////////////////////////////////////
-- C O N F I D E N T I A L S O U R C E C O D E -- D O N O T D I S T R I B U T E
--/////////////////////////////////////////////////////////////////////////////////////////////////
--
-- $File: //depot/Projects/StarWars_Steam/FOC/Run/Data/Scripts/AI/LandMode/ObiWanAssists.lua $
--
-- Original Author: Steve_Copeland
--
-- $Author: Brian_Hayes $
--
-- $Change: 637819 $
--
-- $DateTime: 2017/03/22 10:16:16 $
--
-- $Revision: #1 $
--
--/////////////////////////////////////////////////////////////////////////////////////////////////
-- This plan simply puts ObiWan in the right places.
-- It relies on the object script obiwanplan.lua to activate abilities.
require("pgevents")
function Definitions()
Category = "ObiWanAssists"
TaskForce = {
{
"MainForce"
,"DenyHeroAttach"
,"Obi_Wan_Kenobi = 1"
}
}
IgnoreTarget = true
AllowEngagedUnits = true
duration_to_assist = 20
duration_to_fight = 30
end
function MainForce_Thread()
BlockOnCommand(MainForce.Produce_Force())
QuickReinforce(PlayerObject, AITarget, MainForce)
MainForce.Set_As_Goal_System_Removable(false)
obiwan = MainForce.Get_Unit_Table()[1]
if not TestValid(obiwan) then
MessageBox("unexpected state; obiwan unavailable")
ScriptExit()
end
-- Continuously try to attack, assist the most significant nearby unit, and heal up
while true do
ConsiderHeal(obiwan)
enemy_location = FindTarget.Reachable_Target(PlayerObject, "Current_Enemy_Location", "Tactical_Location", "Any_Threat", 0.5)
if TestValid(enemy_location) then
DebugMessage("%s-- moving toward enemy concentration", tostring(Script))
BlockOnCommand(MainForce.Attack_Move(enemy_location), duration_to_fight)
end
ConsiderHeal(obiwan)
best_ally = FindTarget(MainForce, "Needs_ObiWan_Assist", "Friendly_Unit", 1.0, 1500)
if TestValid(best_ally) then
DebugMessage("%s-- assisting %s", tostring(Script), tostring(best_ally))
BlockOnCommand(MainForce.Guard_Target(best_ally), duration_to_assist)
end
MainForce.Set_Plan_Result(true)
-- Make sure the loop always yields
Sleep(1)
end
end
-- He really tries to preserve himself
function MainForce_Unit_Damaged(tf, unit, attacker, deliberate)
if unit.Get_Hull() < 0.5 or unit.Get_Time_Till_Dead() < 30 then
Try_Ability(unit, "TARGETED_INVULNERABILITY", unit)
end
Default_Unit_Damaged(tf, unit, attacker, deliberate)
end

View File

@@ -0,0 +1,147 @@
-- $Id: //depot/Projects/StarWars_Steam/FOC/Run/Data/Scripts/AI/LandMode/PalpatineManager.lua#1 $
--/////////////////////////////////////////////////////////////////////////////////////////////////
--
-- (C) Petroglyph Games, Inc.
--
--
-- ***** ** * *
-- * ** * * *
-- * * * * *
-- * * * * * * * *
-- * * *** ****** * ** **** *** * * * ***** * ***
-- * ** * * * ** * ** ** * * * * ** ** ** *
-- *** ***** * * * * * * * * ** * * * *
-- * * * * * * * * * * * * * * *
-- * * * * * * * * * * ** * * * *
-- * ** * * ** * ** * * ** * * * *
-- ** **** ** * **** ***** * ** *** * *
-- * * *
-- * * *
-- * * *
-- * * * *
-- **** * *
--
--/////////////////////////////////////////////////////////////////////////////////////////////////
-- C O N F I D E N T I A L S O U R C E C O D E -- D O N O T D I S T R I B U T E
--/////////////////////////////////////////////////////////////////////////////////////////////////
--
-- $File: //depot/Projects/StarWars_Steam/FOC/Run/Data/Scripts/AI/LandMode/PalpatineManager.lua $
--
-- Original Author: Steve_Copeland
--
-- $Author: Brian_Hayes $
--
-- $Change: 637819 $
--
-- $DateTime: 2017/03/22 10:16:16 $
--
-- $Revision: #1 $
--
--/////////////////////////////////////////////////////////////////////////////////////////////////
-- This plan simply puts palpatine in the right places.
-- It relies on the object script darthpalpatine.lua to activate abilities.
require("pgevents")
function Definitions()
Category = "PalpatineManager"
TaskForce = {
{
"MainForce"
,"DenyHeroAttach"
,"Emperor_Palpatine = 1"
}
}
IgnoreTarget = true
AllowEngagedUnits = true
attack_attention_span = 30
defend_attention_span = 60
end
function MainForce_Thread()
BlockOnCommand(MainForce.Produce_Force())
QuickReinforce(PlayerObject, AITarget, MainForce)
MainForce.Set_As_Goal_System_Removable(false)
palpatine = MainForce.Get_Unit_Table()[1]
if not TestValid(palpatine) then
MessageBox("unexpected state; palpatine unavailable")
ScriptExit()
end
-- Don't let Palpatine waste the landing party on Easy or Normal difficlties
difficulty = PlayerObject.Get_Difficulty()
if (EvaluatePerception("Is_Skirmish_Mode", PlayerObject) == 0)
and (difficulty == "Normal" or difficulty == "Easy") then
friendly_structure = Find_Nearest(MainForce, "Structure", PlayerObject, true)
if TestValid(friendly_structure) then
BlockOnCommand(MainForce.Guard_Target(friendly_structure), 40)
else
Sleep(40)
end
end
-- Continuously try to attack, assist the most significant nearby unit, and heal up
while true do
ConsiderHeal(palpatine)
-- Occasionally, Palpatine will join the front line battle on harder difficulties
if difficulty == "Hard" or (difficulty == "Normal" and GameRandom.Get_Float() < 0.5) then
if not palpatine.Has_Attack_Target() then
enemy_location = FindTarget.Reachable_Target(PlayerObject, "Current_Enemy_Location", "Tactical_Location", "Any_Threat", 0.5)
if TestValid(enemy_location) then
DebugMessage("%s-- moving toward enemy concentration", tostring(Script))
BlockOnCommand(MainForce.Attack_Move(enemy_location), attack_attention_span)
end
nearest_enemy = Find_Nearest(MainForce, PlayerObject, false)
if TestValid(nearest_enemy) then
DebugMessage("%s-- attack_moving to nearest enemy %s", tostring(Script), tostring(nearest_enemy))
BlockOnCommand(MainForce.Attack_Move(nearest_enemy), attack_attention_span)
end
end
end
ConsiderHeal(palpatine)
-- Palpatine spends most of his time defending structures needing help
structure_to_defend = FindTarget(MainForce, "Need_To_Defend_Structure", "Friendly_Structure", 1.0)
while TestValid(structure_to_defend) and structure_to_defend.Is_Category("Structure") and (structure_to_defend.Get_Hull() < 0.9) do
DebugMessage("%s-- guarding %s", tostring(Script), tostring(structure_to_defend))
BlockOnCommand(MainForce.Guard_Target(structure_to_defend), defend_attention_span, Defended_Structure_Is_Gone)
structure_to_defend = FindTarget(MainForce, "Need_To_Defend_Structure", "Friendly_Unit", 1.0)
end
MainForce.Set_Plan_Result(true)
-- Make sure the loop always yields
Sleep(1)
end
end
function ConsiderDefending()
end
function Defended_Structure_Is_Gone()
-- DELME
-- if TestValid(structure_to_defend) then
-- DebugMessage("%s-- structure %s is still alive", tostring(String), tostring(structure_to_defend))
-- end
return not TestValid(structure_to_defend)
end

View File

@@ -0,0 +1,84 @@
-- $Id: //depot/Projects/StarWars_Steam/FOC/Run/Data/Scripts/AI/LandMode/Patrol.lua#1 $
--/////////////////////////////////////////////////////////////////////////////////////////////////
--
-- (C) Petroglyph Games, Inc.
--
--
-- ***** ** * *
-- * ** * * *
-- * * * * *
-- * * * * * * * *
-- * * *** ****** * ** **** *** * * * ***** * ***
-- * ** * * * ** * ** ** * * * * ** ** ** *
-- *** ***** * * * * * * * * ** * * * *
-- * * * * * * * * * * * * * * *
-- * * * * * * * * * * ** * * * *
-- * ** * * ** * ** * * ** * * * *
-- ** **** ** * **** ***** * ** *** * *
-- * * *
-- * * *
-- * * *
-- * * * *
-- **** * *
--
--/////////////////////////////////////////////////////////////////////////////////////////////////
-- C O N F I D E N T I A L S O U R C E C O D E -- D O N O T D I S T R I B U T E
--/////////////////////////////////////////////////////////////////////////////////////////////////
--
-- $File: //depot/Projects/StarWars_Steam/FOC/Run/Data/Scripts/AI/LandMode/Patrol.lua $
--
-- Original Author: James Yarrow
--
-- $Author: Brian_Hayes $
--
-- $Change: 637819 $
--
-- $DateTime: 2017/03/22 10:16:16 $
--
-- $Revision: #1 $
--
--/////////////////////////////////////////////////////////////////////////////////////////////////
require("pgevents")
ScriptPoolCount = 5
function Definitions()
Category = "Patrol"
IgnoreTarget = true
AllowEngagedUnits = false
TaskForce =
{
{
"MainForce",
"Infantry | Air | Vehicle | LandHero = 1, 3"
}
}
end
function MainForce_Thread()
BlockOnCommand(MainForce.Produce_Force())
QuickReinforce(PlayerObject, AITarget, MainForce)
Try_Ability(MainForce, "FORCE_CLOAK")
Try_Ability(MainForce, "STEALTH")
Set_Land_AI_Targeting_Priorities(MainForce)
BlockOnCommand(MainForce.Attack_Move(AITarget))
-- Guard the area until a higher desire goal pulls us away
BlockOnCommand(MainForce.Guard_Target(AITarget))
end
-- Make sure that units don't sit idle at the end of their move order, waiting for others
function MainForce_Unit_Move_Finished(tf, unit)
DebugMessage("%s -- Unit move finished: %s.", tostring(Script), tostring(unit))
unit.Guard_Target(AITarget)
end

View File

@@ -0,0 +1,151 @@
-- $Id: //depot/Projects/StarWars_Steam/FOC/Run/Data/Scripts/AI/LandMode/PreDefendStructure.lua#1 $
--/////////////////////////////////////////////////////////////////////////////////////////////////
--
-- (C) Petroglyph Games, Inc.
--
--
-- ***** ** * *
-- * ** * * *
-- * * * * *
-- * * * * * * * *
-- * * *** ****** * ** **** *** * * * ***** * ***
-- * ** * * * ** * ** ** * * * * ** ** ** *
-- *** ***** * * * * * * * * ** * * * *
-- * * * * * * * * * * * * * * *
-- * * * * * * * * * * ** * * * *
-- * ** * * ** * ** * * ** * * * *
-- ** **** ** * **** ***** * ** *** * *
-- * * *
-- * * *
-- * * *
-- * * * *
-- **** * *
--
--/////////////////////////////////////////////////////////////////////////////////////////////////
-- C O N F I D E N T I A L S O U R C E C O D E -- D O N O T D I S T R I B U T E
--/////////////////////////////////////////////////////////////////////////////////////////////////
--
-- $File: //depot/Projects/StarWars_Steam/FOC/Run/Data/Scripts/AI/LandMode/PreDefendStructure.lua $
--
-- Original Author: James Yarrow
--
-- $Author: Brian_Hayes $
--
-- $Change: 637819 $
--
-- $DateTime: 2017/03/22 10:16:16 $
--
-- $Revision: #1 $
--
--/////////////////////////////////////////////////////////////////////////////////////////////////
-- This plan serves to head off the main attacking force by placing an RPS appropriate forces
-- in the vicinity of the main base structure that will receive the enemy first.
require("pgevents")
ScriptPoolCount = 5
function Definitions()
Category = "PreDefend_Structure"
AllowEngagedUnits = true
MinContrastScale = 0.5
MaxContrastScale = 1.2
TaskForce = {
{
"MainForce"
,"DenyHeroAttach"
,"Infantry = 0,10"
,"Vehicle | Air = 0,10"
,"LandHero = 0,3"
},
{
"GuardForce"
,"EscortForce" -- This should force a good RPS match for the enemies in our target's zone
,"Infantry = 0,10"
,"Vehicle | Air = 0,10"
,"LandHero = 0,3"
}
}
RequiredCategories = {"Infantry | Vehicle | Air"}
structure = nil
end
function MainForce_Thread()
-- We don't actually want the forces for contrast to AITarget, this plan
-- is only concerned with the forces surrounding the AITarget. We have
-- to produce and release them to get them back on the freestore, however.
BlockOnCommand(MainForce.Produce_Force())
--MainForce.Release_Forces(1.0)
QuickReinforce(PlayerObject, AITarget, MainForce, GuardForce)
Set_Land_AI_Targeting_Priorities(MainForce)
-- Find our structure nearest the enemy
structure = Find_Nearest(AITarget, "Structure", PlayerObject, true)
DebugMessage("%s -- PreDefending structure: %s.", tostring(Script), tostring(structure))
if TestValid(structure) then
BlockOnCommand(MainForce.Attack_Move(structure), 20)
end
ScriptExit()
end
-- Make sure that units don't sit idle at the end of their move order, waiting for others
function MainForce_Unit_Move_Finished(tf, unit)
Default_Unit_Move_Finished(tf, unit)
-- As each unit arrives, guard the structure
if TestValid(structure) then
unit.Guard_Target(structure)
end
end
function GuardForce_Thread()
BlockOnCommand(GuardForce.Produce_Force())
QuickReinforce(PlayerObject, AITarget, GuardForce, MainForce)
Set_Land_AI_Targeting_Priorities(GuardForce)
-- Find our structure nearest the enemy
structure = Find_Nearest(AITarget, "Structure", PlayerObject, true)
DebugMessage("%s -- PreDefending structure: %s.", tostring(Script), tostring(structure))
if TestValid(structure) then
BlockOnCommand(GuardForce.Attack_Move(structure), 20)
end
ScriptExit()
end
-- Make sure that units don't sit idle at the end of their move order, waiting for others
function GuardForce_Unit_Move_Finished(tf, unit)
Default_Unit_Move_Finished(tf, unit)
-- As each unit arrives, guard the structure
if TestValid(structure) then
unit.Guard_Target(structure)
end
end
function MainForce_Original_Target_Destroyed()
ScriptExit()
end
function GuardForce_Original_Target_Destroyed()
ScriptExit()
end

View File

@@ -0,0 +1,63 @@
--/////////////////////////////////////////////////////////////////////////////////////////////////
-- (c) Galyana's Ultimate Empire at War Modifications
--
-- ****** *** *** ************ *** ***
-- * * * * * * * *
-- * * * * * * *
-- * * * * * * *
-- * * * * * **** * * *
-- * * * ****** * * * *
-- * **** * * * * * * * *** *
-- * * * * * * * * * *
-- * * * * * * * * * *
-- * * * * * * * ** * * *
-- ****** ****** ************ **** ** *******
--/////////////////////////////////////////////////////////////////////////////////////////////////
-- C O N F I D E N T I A L S O U R C E C O D E -- D O N O T D I S T R I B U T E
--/////////////////////////////////////////////////////////////////////////////////////////////////
--
-- File: GUEaW/Data/Scripts/AI/LandMode/PurchaseEarlyLandUpgrades.LUA
--
-- Original Editor: Giovanni Galyana
--
-- Final Edit By: Giovanni Galyana
--
-- Date: 17 December, 2023
--
-- Revisions: 4
--
--/////////////////////////////////////////////////////////////////////////////////////////////////
require("pgevents")
function Definitions()
Category = "Purchase_Early_Land_Upgrades"
IgnoreTarget = true
TaskForce = {
{
"ReserveForce"
,"DenySpecialWeaponAttach"
,"DenyHeroAttach"
-- Buy some early game relative upgrades for infantry
,"RL_Combat_Armor_L1_Upgrade | RL_Combat_Armor_L2_Upgrade | RL_Upgraded_Scopes_L1_Upgrade | RL_Weatherproof_Upgrade | EL_Increased_Mobility_Upgrade | EL_Scout_Snipers_Upgrade | EL_Weatherproof_Upgrade | UL_Ability_Recharge_L1_Upgrade | UL_Smuggled_Droid_Systems_L1_Upgrade | UL_Bounty_Upgrade | HL_Combat_Training_L1_Upgrade | HL_Combat_Training_L2_Upgrade | PL_More_Garrisons_L1_Upgrade | PL_Bacta_Pack_L1_Upgrade | PL_Reinforced_Structures_L1_Upgrade = 1"
}
}
RequiredCategories = {"Upgrade"}
AllowFreeStoreUnits = false
end
function ReserveForce_Thread()
BlockOnCommand(ReserveForce.Produce_Force())
ReserveForce.Set_Plan_Result(true)
ScriptExit()
end

View File

@@ -0,0 +1,102 @@
--/////////////////////////////////////////////////////////////////////////////////////////////////
-- (c) Galyana's Ultimate Empire at War Modifications
--
-- ****** *** *** ************ *** ***
-- * * * * * * * *
-- * * * * * * *
-- * * * * * * *
-- * * * * * **** * * *
-- * * * ****** * * * *
-- * **** * * * * * * * *** *
-- * * * * * * * * * *
-- * * * * * * * * * *
-- * * * * * * * ** * * *
-- ****** ****** ************ **** ** *******
--/////////////////////////////////////////////////////////////////////////////////////////////////
-- C O N F I D E N T I A L S O U R C E C O D E -- D O N O T D I S T R I B U T E
--/////////////////////////////////////////////////////////////////////////////////////////////////
--
-- File: GUEaW/Data/Scripts/AI/LandMode/PurchaseLandUpgradesGeneric.LUA
--
-- Original Editor: Giovanni Galyana
--
-- Final Edit By: Giovanni Galyana
--
-- Date: 1 January, 2024
--
-- Revisions: 12
--
--/////////////////////////////////////////////////////////////////////////////////////////////////
require("pgevents")
function Definitions()
Category = "Purchase_Land_Upgrades_Generic"
IgnoreTarget = true
TaskForce = {
{
"ReserveForce"
,"DenySpecialWeaponAttach"
,"DenyHeroAttach"
-- Even though only one can be purchased, the 0,10 should increase the liklihood of items from these lists being chosen.
,"RL_Combat_Armor_L1_Upgrade | RL_Combat_Armor_L2_Upgrade | RL_Combat_Armor_L3_Upgrade | RL_Upgraded_Scopes_L1_Upgrade | RL_Upgraded_Scopes_L2_Upgrade | RL_Weatherproof_Upgrade | RL_Light_Shield_Regenerators_L1_Upgrade | RL_Light_Shield_Regenerators_L2_Upgrade | RL_Experimental_Shielding_L1_Upgrade | RL_Light_Aircraft_Armor_L1_Upgrade | RL_Light_Aircraft_Armor_L2_Upgrade | RL_Light_Aircraft_Armor_L3_Upgrade | RL_Enhanced_Repulsors_L1_Upgrade | RL_Enhanced_Repulsors_L2_Upgrade | RL_Heavy_Armor_L1_Upgrade | RL_Heavy_Armor_L2_Upgrade | RL_Improved_Treads_L1_Upgrade | RL_Improved_Treads_L2_Upgrade | RL_Improved_Tank_Damage_L1_Upgrade = 0,10"
,"RL_Reinforced_Structures_Upgrade | RL_Enhanced_Turret_Defense_L1_Upgrade | RL_Enhanced_Turret_Defense_L2_Upgrade | RL_Enhanced_Turret_Defense_L3_Upgrade | RL_Enhanced_Base_Shield_Upgrade | RL_Bombing_Run_Use_Upgrade | RL_Planetary_Bombard_Use_Upgrade | RL_More_Garrisons_L1_Upgrade | RL_More_Garrisons_L2_Upgrade | RL_More_Garrisons_L3_Upgrade = 0,10"
,"RL_SMITE_UPGRADE | RL_Commerce_L1_Upgrade | RL_Commerce_L2_Upgrade | RL_Commerce_L1_Upgrade_FCU | RL_Commerce_L2_Upgrade_FCU | RSR_Commerce_L1_Upgrade | RSR_Commerce_L2_Upgrade | RL_Efficient_Farms_L1_Upgrade | RL_Efficient_Farms_L2_Upgrade | RL_Refinement_L1_Upgrade | RL_Refinement_L2_Upgrade | RL_Refinement_L3_Upgrade | RL_Improved_Quarry_L1_Upgrade | RL_Improved_Quarry_L2_Upgrade | RL_Improved_Quarry_L3_Upgrade | RL_Increased_Production_L1_Upgrade | RL_Increased_Production_L2_Upgrade | RL_Increased_Production_L3_Upgrade | RL_Increased_Production_L1_Upgrade_FCU | RL_Increased_Production_L2_Upgrade_FCU | RL_Increased_Production_L3_Upgrade_FCU = 0,10"
,"RG_Combat_Armor_L1_Upgrade | RG_Combat_Armor_L2_Upgrade | RG_Combat_Armor_L3_Upgrade | RG_Combat_Commanders_L1_Upgrade | RG_Combat_Commanders_L2_Upgrade | RG_Upgraded_Scopes_L1_Upgrade | RG_Upgraded_Scopes_L2_Upgrade | RG_Light_Shield_Regenerators_L1_Upgrade | RG_Light_Shield_Regenerators_L2_Upgrade | RG_Experimental_Shielding_L1_Upgrade | RG_Light_Aircraft_Armor_L1_Upgrade | RG_Light_Aircraft_Armor_L2_Upgrade | RG_Light_Aircraft_Armor_L3_Upgrade | RG_Enhanced_Repulsors_L1_Upgrade | RG_Enhanced_Repulsors_L2_Upgrade | RG_Heavy_Armor_L1_Upgrade | RG_Heavy_Armor_L2_Upgrade | RG_Improved_Treads_L1_Upgrade | RG_Improved_Treads_L2_Upgrade | RG_Improved_Tank_Damage_L1_Upgrade = 0,10"
,"RG_Reinforced_Structures_Upgrade | RG_Enhanced_Turret_Defense_L1_Upgrade | RG_Enhanced_Turret_Defense_L2_Upgrade | RG_Enhanced_Turret_Defense_L3_Upgrade | RG_Enhanced_Base_Shield_Upgrade = 0,5"
,"EL_Increased_Mobility_Upgrade | EL_Increased_Mobility_L2_Upgrade | EL_Increased_Mobility_L3_Upgrade | EL_Scout_Snipers_Upgrade | EL_Overclocked_Snipers_Upgrade | EL_Weatherproof_Upgrade | EL_Light_Reflective_Armor_L1_Upgrade | EL_Light_Reflective_Armor_L2_Upgrade | EL_Enhanced_Reactors_L1_Upgrade | EL_Enhanced_Reactors_L2_Upgrade | EL_Upgraded_Cooling_Systems_L1_Upgrade | EL_Upgraded_Cooling_Systems_L2_Upgrade | EL_Heavy_Reflective_Armor_L1_Upgrade | EL_Heavy_Reflective_Armor_L2_Upgrade | EL_Fortified_Transports_Upgrade | EL_Improved_ATAT_Reactors_L1_Upgrade | EL_Improved_ATAT_Reactors_L2_Upgrade | EL_Siege_Bombers_Upgrade = 0,10"
,"EL_Bombing_Run_Use_Upgrade | EL_Planetary_Bombard_Use_Upgrade | EL_Magnetically_Sealed_Structure_Upgrade | EL_Repair_Nanites_L1_Upgrade | EL_Repair_Nanites_L2_Upgrade | EL_Enhanced_Turret_Firepower_L1_Upgrade | EL_Enhanced_Turret_Firepower_L2_Upgrade | EL_Enhanced_Turret_Firepower_L3_Upgrade | EL_Enhanced_Base_Shield_Upgrade = 0,10"
,"EL_SMITE_UPGRADE | EL_Refinement_L1_Upgrade | EL_Refinement_L2_Upgrade | EL_Refinement_L3_Upgrade | EL_Refinement_L4_Upgrade | EL_Refinement_L5_Upgrade | EL_Improved_Quarry_L1_Upgrade | EL_Improved_Quarry_L2_Upgrade | EL_Improved_Quarry_L3_Upgrade | EL_Increased_Production_L1_Upgrade | EL_Increased_Production_L2_Upgrade | EL_Increased_Production_L3_Upgrade | EL_Increased_Production_L1_Upgrade_FCU | EL_Increased_Production_L2_Upgrade_FCU | EL_Increased_Production_L3_Upgrade_FCU | EL_Advanced_Chemical_Refinement_Upgrade = 0,10"
,"EG_Increased_Mobility_Upgrade | EG_Increased_Mobility_L2_Upgrade | EG_Increased_Mobility_L3_Upgrade | EG_Scout_Snipers_Upgrade | EG_Overclocked_Snipers_Upgrade | EG_Light_Reflective_Armor_L1_Upgrade | EG_Light_Reflective_Armor_L2_Upgrade | EG_Enhanced_Reactors_L1_Upgrade | EG_Enhanced_Reactors_L2_Upgrade | EG_Upgraded_Cooling_Systems_L1_Upgrade | EG_Upgraded_Cooling_Systems_L2_Upgrade | EG_Heavy_Reflective_Armor_L1_Upgrade | EG_Heavy_Reflective_Armor_L2_Upgrade | EG_Fortified_Transports_Upgrade | EG_Improved_ATAT_Reactors_L1_Upgrade | EG_Improved_ATAT_Reactors_L2_Upgrade | EG_Siege_Bombers_Upgrade = 0,10"
,"EG_Magnetically_Sealed_Structure_Upgrade | EG_Repair_Nanites_L1_Upgrade | EG_Repair_Nanites_L2_Upgrade | EG_Enhanced_Turret_Firepower_L1_Upgrade | EG_Enhanced_Turret_Firepower_L2_Upgrade | EG_Enhanced_Turret_Firepower_L3_Upgrade | EG_Enhanced_Base_Shield_Upgrade =0,5"
,"UL_Rancor_Stimulant_L1_Upgrade | UL_Rancor_Stimulant_L2_Upgrade | UL_Ability_Recharge_L1_Upgrade | UL_Ability_Recharge_L2_Upgrade | UL_Selective_Breeding_L1_Upgrade | UL_Selective_Breeding_L2_Upgrade | UL_Smuggled_Droid_Systems_L1_Upgrade | UL_Smuggled_Droid_Systems_L2_Upgrade | UL_Improved_Chipsets_L1_Upgrade | UL_Improved_Chipsets_L2_Upgrade | UL_Improved_Hydraulics_L1_Upgrade | UL_Improved_Hydraulics_L2_Upgrade | UL_Cloaking_Generator_L1_Upgrade | UL_Cloaking_Generator_L2_Upgrade | UL_Weapon_Boost_L1_Upgrade | UL_Weapon_Boost_L2_Upgrade | UL_Heavy_Shielding_L1_Upgrade | UL_Heavy_Shielding_L2_Upgrade | UL_FCU_Armor_Plating_L1_Upgrade | UL_FCU_Reactors_L1_Upgrade = 0,10"
,"UL_Bombing_Run_Use_Upgrade | UL_Planetary_Bombard_Use_Upgrade | UL_Black_Market_Shielding_L1_Upgrade | UL_Black_Market_Shielding_L2_Upgrade | UL_Bounty_Upgrade | UL_Enhanced_Deployment_L1_Upgrade | UL_Enhanced_Deployment_L2_Upgrade = 0,10"
,"UL_SMITE_UPGRADE | UL_Refinement_L1_Upgrade | UL_Refinement_L2_Upgrade | UL_Refinement_L3_Upgrade | UL_Improved_Quarry_L1_Upgrade | UL_Improved_Quarry_L2_Upgrade | UL_Improved_Quarry_L3_Upgrade | UL_Increased_Gambling_L1_Upgrade | UL_Increased_Gambling_L2_Upgrade | UL_Increased_Gambling_L3_Upgrade | UL_Extort_Cash_L1_Upgrade | UL_Extort_Cash_L2_Upgrade | UL_Extort_Cash_L3_Upgrade | UL_Increased_Production_L1_Upgrade_FCU | UL_Increased_Production_L2_Upgrade_FCU | UL_Increased_Production_L3_Upgrade_FCU = 0,10"
,"UG_Rancor_Stimulant_L1_Upgrade | UG_Rancor_Stimulant_L2_Upgrade | UG_Ability_Recharge_L1_Upgrade | UG_Ability_Recharge_L2_Upgrade | UG_Selective_Breeding_L1_Upgrade | UG_Selective_Breeding_L2_Upgrade | UG_Smuggled_Droid_Systems_L1_Upgrade | UG_Smuggled_Droid_Systems_L2_Upgrade | UG_Improved_Chipsets_L1_Upgrade | UG_Improved_Chipsets_L2_Upgrade | UG_Improved_Hydraulics_L1_Upgrade | UG_Improved_Hydraulics_L2_Upgrade | UG_Cloaking_Generator_L1_Upgrade | UG_Cloaking_Generator_L2_Upgrade | UG_Weapon_Boost_L1_Upgrade | UG_Weapon_Boost_L2_Upgrade | UG_Heavy_Shielding_L1_Upgrade | UG_Heavy_Shielding_L2_Upgrade = 0,10"
,"UG_Black_Market_Shielding_L1_Upgrade | UG_Black_Market_Shielding_L2_Upgrade | UG_Enhanced_Deployment_L1_Upgrade | UG_Enhanced_Deployment_L2_Upgrade = 0,5"
,"HL_Combat_Training_L1_Upgrade | HL_Combat_Training_L2_Upgrade | HL_Combat_Training_L3_Upgrade | HL_Heavy_Rockets_L1_Upgrade | HL_Heavy_Rockets_L2_Upgrade | HL_Improved_Combat_Armor_L1_Upgrade | HL_Improved_Combat_Armor_L2_Upgrade | HL_Armor_Plating_L1_Upgrade | HL_Armor_Plating_L2_Upgrade | HL_Armor_Plating_L3_Upgrade | HL_Supercharged_Beams_L1_Upgrade | HL_Supercharged_Beams_L2_Upgrade | HL_Heavy_Armor_L1_Upgrade | HL_Heavy_Armor_L2_Upgrade | HL_Sailbarge_Repair_Crews_Upgrade | HL_Advanced_Gunship_Upgrade = 0,10"
,"HL_Shielded_Deployment_L1_Upgrade | HL_Secure_Area_Upgrade | HL_Kavadonian_Nanites_Upgrade | HL_Reinforced_Structures_L1_Upgrade | HL_Reinforced_Structures_L2_Upgrade | HL_Reinforced_Structures_L3_Upgrade | HL_Enhanced_Turret_Firepower_L1_Upgrade | HL_Enhanced_Turret_Firepower_L2_Upgrade | HL_Enhanced_Turret_Firepower_L3_Upgrade | HL_Enhanced_Base_Shield_Upgrade | HL_Bombing_Run_Use_Upgrade | HL_Planetary_Bombard_Use_Upgrade | HL_Increased_Supplies_L1_Upgrade | HL_Increased_Supplies_L1_Upgrade_FCU = 0,10"
,"HL_SMITE_UPGRADE | HL_Improved_Quarry_L1_Upgrade | HL_Improved_Quarry_L2_Upgrade | HL_Improved_Quarry_L3_Upgrade | HL_Improved_Quarry_L4_Upgrade | HL_Improved_Quarry_L5_Upgrade | HL_Increased_Production_L1_Upgrade | HL_Increased_Production_L2_Upgrade | HL_Increased_Production_L3_Upgrade | HL_Increased_Production_L1_Upgrade_FCU | HL_Increased_Production_L2_Upgrade_FCU | HL_Increased_Production_L3_Upgrade_FCU = 0,10"
,"HG_Combat_Training_L1_Upgrade | HG_Combat_Training_L2_Upgrade | HG_Combat_Training_L3_Upgrade | HG_Heavy_Rockets_L1_Upgrade | HG_Heavy_Rockets_L2_Upgrade | HG_Improved_Combat_Armor_L1_Upgrade | HG_Improved_Combat_Armor_L2_Upgrade | HG_Armor_Plating_L1_Upgrade | HG_Armor_Plating_L2_Upgrade | HG_Armor_Plating_L3_Upgrade | HG_Supercharged_Beams_L1_Upgrade | HG_Supercharged_Beams_L2_Upgrade | HG_Heavy_Armor_L1_Upgrade | HG_Heavy_Armor_L2_Upgrade | HG_Sailbarge_Repair_Crews_Upgrade = 0,10"
,"HG_Shielded_Deployment_L1_Upgrade | HG_Secure_Area_Upgrade | HG_Kavadonian_Nanites_Upgrade | HG_Reinforced_Structures_L1_Upgrade | HG_Reinforced_Structures_L2_Upgrade | HG_Reinforced_Structures_L3_Upgrade | HG_Enhanced_Turret_Firepower_L1_Upgrade | HG_Enhanced_Turret_Firepower_L2_Upgrade | HG_Enhanced_Turret_Firepower_L3_Upgrade | HG_Enhanced_Base_Shield_Upgrade = 0,5"
,"PL_More_Garrisons_L1_Upgrade | PL_Bacta_Pack_L1_Upgrade | PL_Bacta_Pack_L2_Upgrade | PL_Improved_Vehicle_Health_L1_Upgrade | PL_Improved_Vehicle_Health_L2_Upgrade | PL_Improved_Vehicle_Damage_L1_Upgrade | PL_Improved_Vehicle_Damage_L2_Upgrade | PL_Increased_Production_L1_Upgrade | PL_Increased_Production_L2_Upgrade | PL_Increased_Production_L3_Upgrade | PL_Reinforced_Structures_L1_Upgrade | PL_Reinforced_Structures_L2_Upgrade | PL_Bombing_Run_Use_Upgrade | PL_Planetary_Bombard_Use_Upgrade = 0,10"
,"PG_Bacta_Pack_L1_Upgrade | PG_Bacta_Pack_L2_Upgrade | PG_Improved_Vehicle_Health_L1_Upgrade | PG_Improved_Vehicle_Health_L2_Upgrade | PG_Improved_Vehicle_Damage_L1_Upgrade | PG_Improved_Vehicle_Damage_L2_Upgrade | PG_Reinforced_Structures_L1_Upgrade | PG_Reinforced_Structures_L2_Upgrade | PG_Enhanced_Base_Shield_Upgrade = 0,10"
}
}
RequiredCategories = {"Upgrade"}
AllowFreeStoreUnits = false
end
function ReserveForce_Thread()
ReserveForce.Set_Plan_Result(true)
ReserveForce.Set_As_Goal_System_Removable(false)
BlockOnCommand(ReserveForce.Produce_Force())
-- Give some time to accumulate money.
tech_level = PlayerObject.Get_Tech_Level()
min_credits = 2000
if tech_level == 2 then
min_credits = 3000
elseif tech_level >= 3 then
min_credits = 4000
end
max_sleep_seconds = 50
current_sleep_seconds = 0
while (PlayerObject.Get_Credits() < min_credits) and (current_sleep_seconds < max_sleep_seconds) do
current_sleep_seconds = current_sleep_seconds + 1
Sleep(1)
end
ScriptExit()
end

View File

@@ -0,0 +1,167 @@
--/////////////////////////////////////////////////////////////////////////////////////////////////
-- (c) Galyana's Ultimate Empire at War Modifications
--
-- ****** *** *** ************ *** ***
-- * * * * * * * *
-- * * * * * * *
-- * * * * * * *
-- * * * * * **** * * *
-- * * * ****** * * * *
-- * **** * * * * * * * *** *
-- * * * * * * * * * *
-- * * * * * * * * * *
-- * * * * * * * ** * * *
-- ****** ****** ************ **** ** *******
--/////////////////////////////////////////////////////////////////////////////////////////////////
-- C O N F I D E N T I A L S O U R C E C O D E -- D O N O T D I S T R I B U T E
--/////////////////////////////////////////////////////////////////////////////////////////////////
--
-- File: GUEaW/Data/Scripts/AI/LandMode/SecureBuildPad.LUA
--
-- Original Editor: Giovanni Galyana
--
-- Final Edit By: Giovanni Galyana
--
-- Date: 2 January, 2018
--
-- Revisions: 0
--
--/////////////////////////////////////////////////////////////////////////////////////////////////
require("pgevents")
function Definitions()
Category = "Secure_Contestable"
IgnoreTarget = true
TaskForce =
{
{
"MainForce"
--,"Infantry | AT_AT_Walker = 1" -- AT-ATs can secure a point by dropping infantry
,"Infantry | LandHero = 1"
,"-Veers_AT_AT_Walker"
,"-Gargantuan_Battle_Platform"
,"-Pestelous_the_Hutt"
,"-Nikomer"
},
{
"EscortForce"
,"Infantry | Vehicle | LandHero = 0,1"
,"-Gallofree_HTT_Company"
,"-HAV_Juggernaut_Company"
,"-F9TZ_Cloaking_Transport_Company"
,"-AT_AA_Walker"
,"-Hutt_SailBarge"
}
}
AllowEngagedUnits = false
wait_for_build_time = 30
end
function MainForce_Thread()
BlockOnCommand(MainForce.Produce_Force())
QuickReinforce(PlayerObject, AITarget, MainForce, EscortForce)
MainForce.Activate_Ability("SPREAD_OUT", false)
Set_Land_AI_Targeting_Priorities(MainForce)
-- move to contestables
faction_name = PlayerObject.Get_Faction_Name()
if PlayerObject.Get_Difficulty() == "Easy" or faction_name == "PIRATES" then -- or faction_name == "HUTTS"
BlockOnCommand(MainForce.Attack_Move(AITarget))
else
BlockOnCommand(MainForce.Move_To(AITarget, MainForce.Get_Self_Threat_Max()))
end
MainForce.Set_As_Goal_System_Removable(false)
if TestValid(Target) then
if (EvaluatePerception("Is_Build_Pad", PlayerObject, Target) == 1) then
-- Build pads may have an existing enemy structure than needs to be removed
-- Note that the enemy player can build structures late or rebuild destroyed structures, thus the need to repeat.
structure = Target.Get_Build_Pad_Contents()
if (structure == nil) or
(TestValid(structure) and PlayerObject.Get_Faction_Name() ~= structure.Get_Owner().Get_Faction_Name()) then
--Wait for control to transition
BlockOnCommand(MainForce.Guard_Target(AITarget), 60, Target_Has_Structure)
--It's been a minute. If we still don't have control then give up
if Target.Get_Owner() ~= PlayerObject then
ScriptExit()
end
-- Attack any structure that might be there
if TestValid(structure) then
BlockOnCommand(MainForce.Attack_Target(structure))
end
-- Guard the spot to give another plan the chance to can something here
-- Wait indefinately, if this is a refinery pad.
if EvaluatePerception("Is_Refinery_Pad", PlayerObject, Target) == 1 or
EvaluatePerception("Is_Outpost_Pad", PlayerObject, Target) == 1 then
wait_for_build_time = -1
end
--MessageBox("%s, %s--Guarding for %d", tostring(Script), tostring(Target), wait_for_build_time)
BlockOnCommand(MainForce.Guard_Target(AITarget), wait_for_build_time, Target_Has_Structure)
end
else
-- Stand guard so that we can retain usage of this structure
MainForce.Guard_Target(AITarget)
Sleep(10)
end
end
MainForce.Set_Plan_Result(true)
ScriptExit()
end
-- Does the plan's original Target have a friendlystructure on it?
function Target_Has_Structure()
if TestValid(Target) then
structure = Target.Get_Build_Pad_Contents()
if TestValid(structure) then
--MessageBox("%s, %s-- Target has structure, abandonning guard.", tostring(Script), tostring(Target))
return true
end
end
return false
end
-- Override default handling, which will kill the plan
function MainForce_Original_Target_Owner_Changed(tf, old_player, new_player)
end
function EscortForce_Thread()
BlockOnCommand(EscortForce.Produce_Force())
QuickReinforce(PlayerObject, AITarget, EscortForce, MainForce)
-- Give an initial order to put the escorts in a state that the Escort function expects
Try_Ability(EscortForce, "FORCE_CLOAK")
EscortForce.Guard_Target(MainForce)
EscortAlive = true
while EscortAlive do
Escort(EscortForce, MainForce)
end
end
function EscortForce_No_Units_Remaining()
EscortAlive = false
end
-- Override default handling, which will kill the plan
function EscortForce_Original_Target_Owner_Changed(tf, old_player, new_player)
end

View File

@@ -0,0 +1,167 @@
--/////////////////////////////////////////////////////////////////////////////////////////////////
-- (c) Galyana's Ultimate Empire at War Modifications
--
-- ****** *** *** ************ *** ***
-- * * * * * * * *
-- * * * * * * *
-- * * * * * * *
-- * * * * * **** * * *
-- * * * ****** * * * *
-- * **** * * * * * * * *** *
-- * * * * * * * * * *
-- * * * * * * * * * *
-- * * * * * * * ** * * *
-- ****** ****** ************ **** ** *******
--/////////////////////////////////////////////////////////////////////////////////////////////////
-- C O N F I D E N T I A L S O U R C E C O D E -- D O N O T D I S T R I B U T E
--/////////////////////////////////////////////////////////////////////////////////////////////////
--
-- File: GUEaW/Data/Scripts/AI/LandMode/SecureBuildPadEscorted.LUA
--
-- Original Editor: Giovanni Galyana
--
-- Final Edit By: Giovanni Galyana
--
-- Date: 2 January, 2018
--
-- Revisions: 0
--
--/////////////////////////////////////////////////////////////////////////////////////////////////
require("pgevents")
function Definitions()
Category = "Secure_Contestable_Escorted"
IgnoreTarget = true
TaskForce =
{
{
"MainForce"
,"Infantry | LandHero = 1"
,"-Veers_AT_AT_Walker"
,"-Gargantuan_Battle_Platform"
,"-Pestelous_the_Hutt"
,"-Nikomer"
},
{
"EscortForce"
,"Infantry | Vehicle | LandHero = 1,3"
,"-Gallofree_HTT_Company"
,"-HAV_Juggernaut_Company"
,"-F9TZ_Cloaking_Transport_Company"
,"-AT_AA_Walker"
,"-Hutt_SailBarge"
}
}
AllowEngagedUnits = false
wait_for_build_time = 30
end
function MainForce_Thread()
BlockOnCommand(MainForce.Produce_Force())
QuickReinforce(PlayerObject, AITarget, MainForce, EscortForce)
MainForce.Activate_Ability("SPREAD_OUT", false)
Set_Land_AI_Targeting_Priorities(MainForce)
-- move to contestables
faction_name = PlayerObject.Get_Faction_Name()
if PlayerObject.Get_Difficulty() == "Easy" or faction_name == "PIRATES" then -- or faction_name == "HUTTS"
BlockOnCommand(MainForce.Attack_Move(AITarget))
else
BlockOnCommand(MainForce.Move_To(AITarget, MainForce.Get_Self_Threat_Max()))
end
MainForce.Set_As_Goal_System_Removable(false)
if TestValid(Target) then
if (EvaluatePerception("Is_Build_Pad", PlayerObject, Target) == 1) then
-- Build pads may have an existing enemy structure that needs to be removed
-- Note that the enemy player can build structures late or rebuild destroyed structures, thus the need to repeat.
structure = Target.Get_Build_Pad_Contents()
if (structure == nil) or
(TestValid(structure) and PlayerObject.Get_Faction_Name() ~= structure.Get_Owner().Get_Faction_Name()) then
-- Attack any structure that might be there
if TestValid(structure) then
BlockOnCommand(MainForce.Attack_Target(structure))
end
--Wait for control to transition
BlockOnCommand(MainForce.Guard_Target(AITarget), 60, Target_Has_Structure)
--It's been a minute. If we still don't have control then give up
if Target.Get_Owner() ~= PlayerObject then
ScriptExit()
end
-- Guard the spot to give another plan the chance to can something here
-- Wait indefinately, if this is a refinery pad and we have no refineries.
if (EvaluatePerception("Is_Refinery_Pad", PlayerObject, Target) == 1 or
EvaluatePerception("Is_Outpost_Pad", PlayerObject, Target) == 1) then
wait_for_build_time = -1
end
--MessageBox("%s, %s--Guarding for %d", tostring(Script), tostring(Target), wait_for_build_time)
BlockOnCommand(MainForce.Guard_Target(AITarget), wait_for_build_time, Target_Has_Structure)
end
else
-- Stand guard so that we can retain usage of this structure
MainForce.Guard_Target(AITarget)
Sleep(10)
end
end
MainForce.Set_Plan_Result(true)
ScriptExit()
end
-- Does the plan's original Target have a friendlystructure on it?
function Target_Has_Structure()
if TestValid(Target) then
structure = Target.Get_Build_Pad_Contents()
if TestValid(structure) then
--MessageBox("%s, %s-- Target has structure, abandonning guard.", tostring(Script), tostring(Target))
return true
end
end
return false
end
-- Override default handling, which will kill the plan
function MainForce_Original_Target_Owner_Changed(tf, old_player, new_player)
end
function EscortForce_Thread()
BlockOnCommand(EscortForce.Produce_Force())
QuickReinforce(PlayerObject, AITarget, EscortForce, MainForce)
Set_Land_AI_Targeting_Priorities(EscortForce)
Try_Ability(EscortForce, "FORCE_CLOAK")
-- Give an initial order to put the escorts in a state that the Escort function expects
EscortForce.Guard_Target(MainForce)
EscortAlive = true
while EscortAlive do
Escort(EscortForce, MainForce)
end
end
function EscortForce_No_Units_Remaining()
EscortAlive = false
end
-- Override default handling, which will kill the plan
function EscortForce_Original_Target_Owner_Changed(tf, old_player, new_player)
end

View File

@@ -0,0 +1,111 @@
-- $Id: //depot/Projects/StarWars_Steam/FOC/Run/Data/Scripts/AI/LandMode/SecureVictoryControlPoint.lua#1 $
--/////////////////////////////////////////////////////////////////////////////////////////////////
--
-- (C) Petroglyph Games, Inc.
--
--
-- ***** ** * *
-- * ** * * *
-- * * * * *
-- * * * * * * * *
-- * * *** ****** * ** **** *** * * * ***** * ***
-- * ** * * * ** * ** ** * * * * ** ** ** *
-- *** ***** * * * * * * * * ** * * * *
-- * * * * * * * * * * * * * * *
-- * * * * * * * * * * ** * * * *
-- * ** * * ** * ** * * ** * * * *
-- ** **** ** * **** ***** * ** *** * *
-- * * *
-- * * *
-- * * *
-- * * * *
-- **** * *
--
--/////////////////////////////////////////////////////////////////////////////////////////////////
-- C O N F I D E N T I A L S O U R C E C O D E -- D O N O T D I S T R I B U T E
--/////////////////////////////////////////////////////////////////////////////////////////////////
--
-- $File: //depot/Projects/StarWars_Steam/FOC/Run/Data/Scripts/AI/LandMode/SecureVictoryControlPoint.lua $
--
-- Original Author: James Yarrow
--
-- $Author: Brian_Hayes $
--
-- $Change: 637819 $
--
-- $DateTime: 2017/03/22 10:16:16 $
--
-- $Revision: #1 $
--
--/////////////////////////////////////////////////////////////////////////////////////////////////
require("pgevents")
function Definitions()
Category = "Secure_Victory_Control_Point"
IgnoreTarget = false
MinContrastScale = 0.5
MaxContrastScale = 1.5
TaskForce =
{
{
"MainForce"
,"Infantry = 100%"
},
{
"EscortForce"
,"Vehicle | LandHero = 100%"
,"EscortForce"
}
}
RequiredCategories = { "Infantry" }
end
function MainForce_Thread()
BlockOnCommand(MainForce.Produce_Force())
QuickReinforce(PlayerObject, AITarget, MainForce, EscortForce)
-- move to contestables
BlockOnCommand(MainForce.Move_To(AITarget, MainForce.Get_Self_Threat_Max()))
MainForce.Set_As_Goal_System_Removable(false)
-- Stand guard so that we can retain usage of this structure
MainForce.Guard_Target(AITarget)
Sleep(30)
MainForce.Set_Plan_Result(true)
ScriptExit()
end
-- Override default handling, which will kill the plan
function MainForce_Original_Target_Owner_Changed(tf, old_player, new_player)
end
function EscortForce_Thread()
BlockOnCommand(EscortForce.Produce_Force())
QuickReinforce(PlayerObject, AITarget, EscortForce, MainForce)
-- Give an initial order to put the escorts in a state that the Escort function expects
Try_Ability(EscortForce, "FORCE_CLOAK")
EscortForce.Guard_Target(MainForce)
EscortAlive = true
while EscortAlive do
Escort(EscortForce, MainForce)
end
end
function EscortForce_No_Units_Remaining()
EscortAlive = false
end
-- Override default handling, which will kill the plan
function EscortForce_Original_Target_Owner_Changed(tf, old_player, new_player)
end

View File

@@ -0,0 +1,79 @@
-- $Id: //depot/Projects/StarWars_Steam/FOC/Run/Data/Scripts/AI/LandMode/SellTacticalStructure.lua#1 $
--/////////////////////////////////////////////////////////////////////////////////////////////////
--
-- (C) Petroglyph Games, Inc.
--
--
-- ***** ** * *
-- * ** * * *
-- * * * * *
-- * * * * * * * *
-- * * *** ****** * ** **** *** * * * ***** * ***
-- * ** * * * ** * ** ** * * * * ** ** ** *
-- *** ***** * * * * * * * * ** * * * *
-- * * * * * * * * * * * * * * *
-- * * * * * * * * * * ** * * * *
-- * ** * * ** * ** * * ** * * * *
-- ** **** ** * **** ***** * ** *** * *
-- * * *
-- * * *
-- * * *
-- * * * *
-- **** * *
--
--/////////////////////////////////////////////////////////////////////////////////////////////////
-- C O N F I D E N T I A L S O U R C E C O D E -- D O N O T D I S T R I B U T E
--/////////////////////////////////////////////////////////////////////////////////////////////////
--
-- $File: //depot/Projects/StarWars_Steam/FOC/Run/Data/Scripts/AI/LandMode/SellTacticalStructure.lua $
--
-- Original Author: Steve_Copeland
--
-- $Author: Brian_Hayes $
--
-- $Change: 637819 $
--
-- $DateTime: 2017/03/22 10:16:16 $
--
-- $Revision: #1 $
--
--/////////////////////////////////////////////////////////////////////////////////////////////////
require("pgevents")
-- Sell a tactical structure if we no longer want it
-- and the build pad is badly needed for something else.
function Definitions()
Category = "Sell_Tactical_Structure"
TaskForce = {
{
"MainForce"
,"TaskForceRequired"
}
}
structure = nil
end
function MainForce_Thread()
MainForce.Set_As_Goal_System_Removable(false)
structure = Target.Get_Build_Pad_Contents()
if structure then
DebugMessage("%s -- Selling tactical structure: %s.", tostring(Script), tostring(structure))
structure.Sell()
-- Give some time for the open build pad and available funds
-- perceptions to update before letting another sell plan be proposed.
-- Also, just keep the AI from selling too often.
Sleep(60)
end
end

View File

@@ -0,0 +1,131 @@
-- $Id: //depot/Projects/StarWars_Steam/FOC/Run/Data/Scripts/AI/LandMode/StealVehicle.lua#1 $
--/////////////////////////////////////////////////////////////////////////////////////////////////
--
-- (C) Petroglyph Games, Inc.
--
--
-- ***** ** * *
-- * ** * * *
-- * * * * *
-- * * * * * * * *
-- * * *** ****** * ** **** *** * * * ***** * ***
-- * ** * * * ** * ** ** * * * * ** ** ** *
-- *** ***** * * * * * * * * ** * * * *
-- * * * * * * * * * * * * * * *
-- * * * * * * * * * * ** * * * *
-- * ** * * ** * ** * * ** * * * *
-- ** **** ** * **** ***** * ** *** * *
-- * * *
-- * * *
-- * * *
-- * * * *
-- **** * *
--
--/////////////////////////////////////////////////////////////////////////////////////////////////
-- C O N F I D E N T I A L S O U R C E C O D E -- D O N O T D I S T R I B U T E
--/////////////////////////////////////////////////////////////////////////////////////////////////
--
-- $File: //depot/Projects/StarWars_Steam/FOC/Run/Data/Scripts/AI/LandMode/StealVehicle.lua $
--
-- Original Author: James Yarrow
--
-- $Author: Brian_Hayes $
--
-- $Change: 637819 $
--
-- $DateTime: 2017/03/22 10:16:16 $
--
-- $Revision: #1 $
--
--/////////////////////////////////////////////////////////////////////////////////////////////////
require("pgevents")
function Definitions()
Category = "Steal_Vehicle"
TaskForce = {
{
"MainForce"
,"DenyHeroAttach"
,"CHEWBACCA = 1"
}
}
IgnoreTarget = true
AllowEngagedUnits = true
end
function MainForce_Thread()
BlockOnCommand(MainForce.Produce_Force())
QuickReinforce(PlayerObject, AITarget, MainForce)
MainForce.Set_As_Goal_System_Removable(false)
MainForce.Set_Single_Ability_Autofire("CAPTURE_VEHICLE", false)
-- Do something productive while waiting for the ability to become available
chewie = MainForce.Get_Unit_Table()[1]
if not chewie then
MessageBox("%s-- Couldn't find chewie", tostring(Script))
end
-- Keep chewie sprinting when he can
needs_sprint = true
Try_Ability(MainForce, "SPRINT")
-- While chewie is in a vehicle already or his ability isn't ready, do something productive.
while chewie.Get_Parent_Object() or not chewie.Is_Ability_Ready("CAPTURE_VEHICLE") do
if not ConsiderHeal(chewie) then
friendly_structure = Find_Nearest(chewie, "Structure", PlayerObject, true)
if TestValid(friendly_structure) then
BlockOnCommand(MainForce.Attack_Move(friendly_structure))
chewie.Guard_Target(friendly_structure)
else
ScriptExit()
end
end
Sleep(1)
end
BlockOnCommand(MainForce.Activate_Ability("CAPTURE_VEHICLE", AITarget))
needs_sprint = false
-- Give Chewie time to climb in before issuing another order, which could cancel the ability
Sleep(2)
-- Cause as much trouble as possible while in the enemy vehicle
nearest_enemy = Find_Nearest(chewie, PlayerObject, false)
while TestValid(nearest_enemy) and chewie.Get_Parent_Object() do
BlockOnCommand(MainForce.Attack_Move(nearest_enemy))
MainForce.Set_Plan_Result(true)
nearest_enemy = Find_Nearest(chewie, PlayerObject, false)
end
-- Go heal up
nearest_healer = Find_Nearest(chewie, "HealsInfantry", PlayerObject, true)
if nearest_healer then
Try_Ability(MainForce, "SPRINT")
BlockOnCommand(MainForce.Move_To(nearest_healer))
Sleep(20)
end
ScriptExit()
end
-- Try to recover use of an ability if it was lost while we were trying to use it.
function MainForce_Unit_Ability_Ready(tf, unit, ability)
--MessageBox("%s -- Recovering %s for %s!", tostring(Script), ability, tostring(unit))
if ability == "SPRINT" and needs_sprint then
unit.Activate_Ability("SPRINT", true)
end
-- Default handler behavior is still desired
Default_Unit_Ability_Ready(tf, unit, ability)
end

View File

@@ -0,0 +1,97 @@
--/////////////////////////////////////////////////////////////////////////////////////////////////
-- (c) Galyana's Ultimate Empire at War Modifications
--
-- ****** *** *** ************ *** ***
-- * * * * * * * *
-- * * * * * * *
-- * * * * * * *
-- * * * * * **** * * *
-- * * * ****** * * * *
-- * **** * * * * * * * *** *
-- * * * * * * * * * *
-- * * * * * * * * * *
-- * * * * * * * ** * * *
-- ****** ****** ************ **** ** *******
--/////////////////////////////////////////////////////////////////////////////////////////////////
-- C O N F I D E N T I A L S O U R C E C O D E -- D O N O T D I S T R I B U T E
--/////////////////////////////////////////////////////////////////////////////////////////////////
--
-- File: GUEaW/Data/Scripts/AI/LandMode/TacticalMultiplayerBuildLandUnitsGeneric.LUA
--
-- Original Editor: Giovanni Galyana
--
-- Final Edit By: Giovanni Galyana
--
-- Date: 17 April, 2023
--
-- Revisions: 8
--
--/////////////////////////////////////////////////////////////////////////////////////////////////
-- Rebel_Infantry_Squad_ALT | Rebel_Rifle_Squad_ALT | Rebel_Tank_Buster_Squad_ALT | Rebel_Infiltrator_Team_ALT | Rebel_Combat_Medic_Squad_ALT
-- Empire_T1_FCU_Company | Empire_T2_FCU_Company | Empire_T3_FCU_Company | Empire_T4_FCU_Company
-- Rebel_T1_FCU_Company | Rebel_T2_FCU_Company | Rebel_T3_FCU_Company | Rebel_T4_FCU_Company
-- Underworld_T1_FCU_Company | Underworld_T2_FCU_Company | Underworld_T3_FCU_Company | Underworld_T4_FCU_Company
-- Hutt_T1_FCU_Company | Hutt_T2_FCU_Company | Hutt_T3_FCU_Company | Hutt_T4_FCU_Company
require("pgevents")
function Definitions()
Category = "Tactical_Multiplayer_Build_Land_Units_Generic"
IgnoreTarget = true
TaskForce = {
{
"ReserveForce"
,"DenySpecialWeaponAttach"
,"DenyHeroAttach"
,"RC_Level_Two_Tech_Upgrade | RC_Level_Three_Tech_Upgrade | RC_Level_Four_Tech_Upgrade = 0,1"
,"EC_Level_Two_Tech_Upgrade | EC_Level_Three_Tech_Upgrade | EC_Level_Four_Tech_Upgrade = 0,1"
,"UC_Level_Two_Tech_Upgrade | UC_Level_Three_Tech_Upgrade | UC_Level_Four_Tech_Upgrade = 0,1"
,"HC_Level_Two_Tech_Upgrade | HC_Level_Three_Tech_Upgrade | HC_Level_Four_Tech_Upgrade = 0,1"
,"PC_Level_Two_Tech_Upgrade | PC_Level_Three_Tech_Upgrade | PC_Level_Four_Tech_Upgrade = 0,1"
,"Boba_Fett_Team_Land_MP | Darth_Team_Land_MP | General_Veers_Team | Emperor_Palpatine_Team | Mara_Jade_Team = 0,1"
,"Han_Solo_Team_Land_MP | Obi_Wan_Team | Droids_Team | Katarn_Team | Yoda_Team | Luke_Skywalker_Jedi_Team | Garm_Bel_Iblis_Team = 0,1"
,"Urai_Fen_Team | Bossk_Team | Silri_Team | Tyber_Zann_Team | IG88_Team_Land_MP = 0,1"
,"Sykariius_Team | Nikomer_Team | Xizor_Team | Pestelous_Team | Cuarson_Team = 0,1"
,"Pirate_Soldier_Squad_R | Rebel_Skiff_Team | Rebel_Heavy_Skiff_Team | Swamp_Speeder_Team_R | Pod_Walker_Company_R | Rebel_Infantry_Squad | Rebel_Tank_Buster_Squad | Rebel_Rifle_Squad | Rebel_Infiltrator_Team | Rebel_Combat_Medic_Squad | Rebel_Artillery_Brigade | Rebel_Scout_Tank_Brigade | Rebel_Light_Tank_Brigade | Rebel_Medium_Tank_Brigade | Rebel_Heavy_Tank_Brigade | Rebel_Experimental_Tank_Brigade = 0,3"
,"Pirate_Soldier_Squad_E | Empire_Skiff_Team | Empire_Heavy_Skiff_Team | Swamp_Speeder_Team_E | Pod_Walker_Company_E | Imperial_Anti_Infantry_Brigade | Imperial_Armor_Group | Imperial_Heavy_Scout_Squad | Imperial_Heavy_Assault_Company | Imperial_Light_Scout_Squad | Imperial_Stormtrooper_Squad | DarkTrooper_P1_Company | DarkTrooper_P2_Company | DarkTrooper_P3_Company | Noghri_Assassin_Squad | Imperial_Sniper_Team | Darkside_Adept_Team | Imperial_AT_RT_Scout_Squad | Imperial_AT_PT_Scout_Squad | Imperial_AT_TE_Assault_Company = 0,3"
,"Pirate_Soldier_Squad_U | Underworld_Skiff_Team | Underworld_Heavy_Skiff_Team | Swamp_Speeder_Team_U | Pod_Walker_Company_U | Canderous_Assault_Tank_Company | Destroyer_Droid_Company | Underworld_Disruptor_Merc_Squad | Mandalorian_Warrior_Company | MAL_Rocket_Vehicle_Company | Underworld_Merc_Squad | Night_Sister_Company | MZ8_Pulse_Cannon_Tank_Company | HAG_Company | B1_Battledroid_Company | B2_Battledroid_Company = 0,3"
,"Pirate_Soldier_Squad_H | Hutt_Soldier_Squad | Hutt_Elite_Soldier_Squad | Hutt_Sniper_Squad | Hutt_PLEX_Soldier_Squad | Heavy_Beam_Tank_Company | Hutt_Modified_Pod_Walker_Team | Hutt_Modified_Skiff_Team | Hutt_Heavy_Skiff_Team | Hutt_Modified_Swamp_Speeder_Team | AALL6_Company | Medium_Tank_Company = 0,3"
,"Rebel_MDU_Company | Rebel_Field_Mechanic_Squad | Rebel_Speeder_Wing | Rebel_AssaultSpeeder_Wing | Rebel_Atmospheric_XWing_Squad | Gallofree_HTT_Company | Valahari_Fighter_Company_R = 0,1"
,"Empire_MDU_Company | HAV_Juggernaut_Company | Lancet_Air_Wing | Scimitar_Assault_Squad | TIE_Neutralizer_Squad | Imperial_Anti_Aircraft_Company | Valahari_Fighter_Company_E = 0,1"
,"Underworld_MDU_Company | Underworld_Saboteur_Team | Vornskr_Wolf_Pack | Underworld_Ewok_Handler_Company | MagnaGuard_Company | B1_Repairdroid_Company | F9TZ_Cloaking_Transport_Company | Fanblade_Fighter_Company | Nantex_Fighter_Company | Gauntlet_Heavy_Fighter_Company | Valahari_Fighter_Company_U = 0,1"
,"Hutt_MDU_Company | Hutt_Bounty_Hunter_Company | Hutt_SailBarge_Company | Field_Com_Hutts_Team | Twilek_Commando_Company | Scyk_Fighter_Company | Hutt_Valahari_Fighter_Company | Sandfire_Company | Vaksai_Gunship_Company = 0,1"
,"Pirate_Soldier_Squad | Pirate_Scout_Squad | Pirate_PLEX_Squad | Pirate_Assassin_Company_P | Pirate_Diplomat_Company | Pirate_Swamp_Speeder_Team | Pirate_Skiff_Team | Pirate_Pod_Walker_Team | Heavy_Skiff_Team | Valahari_Fighter_Company = 0,3"
}
}
RequiredCategories = {"Infantry | Vehicle | LandHero | Upgrade"}
AllowFreeStoreUnits = false
end
function ReserveForce_Thread()
ReserveForce.Set_Plan_Result(true)
ReserveForce.Set_As_Goal_System_Removable(false)
BlockOnCommand(ReserveForce.Produce_Force())
-- Give some time to accumulate money.
tech_level = PlayerObject.Get_Tech_Level()
min_credits = 2000
max_sleep_seconds = 30
if tech_level == 2 then
min_credits = 3000
max_sleep_seconds = 45
elseif tech_level >= 3 then
min_credits = 4000
max_sleep_seconds = 60
end
current_sleep_seconds = 0
while (PlayerObject.Get_Credits() < min_credits) and (current_sleep_seconds < max_sleep_seconds) do
current_sleep_seconds = current_sleep_seconds + 1
Sleep(1)
end
ScriptExit()
end

View File

@@ -0,0 +1,63 @@
--/////////////////////////////////////////////////////////////////////////////////////////////////
-- (c) Galyana's Ultimate Empire at War Modifications
--
-- ****** *** *** ************ *** ***
-- * * * * * * * *
-- * * * * * * *
-- * * * * * * *
-- * * * * * **** * * *
-- * * * ****** * * * *
-- * **** * * * * * * * *** *
-- * * * * * * * * * *
-- * * * * * * * * * *
-- * * * * * * * ** * * *
-- ****** ****** ************ **** ** *******
--/////////////////////////////////////////////////////////////////////////////////////////////////
-- C O N F I D E N T I A L S O U R C E C O D E -- D O N O T D I S T R I B U T E
--/////////////////////////////////////////////////////////////////////////////////////////////////
--
-- File: GUEaW/Data/Scripts/AI/LandMode/TechUpgradeEmergency.LUA
--
-- Original Editor: Giovanni Galyana
--
-- Final Edit By: Giovanni Galyana
--
-- Date: 2 October, 2022
--
-- Revisions: 3
--
--/////////////////////////////////////////////////////////////////////////////////////////////////
-- This should go off whenever we hit the unit cap and have units in reserve
-- Note that the generic unit building will also do tech upgrades if affordable
require("pgevents")
function Definitions()
Category = "Tech_Upgrade_Emergency"
IgnoreTarget = true
TaskForce = {
{
"ReserveForce"
,"RC_Level_Two_Tech_Upgrade | RC_Level_Three_Tech_Upgrade | RC_Level_Four_Tech_Upgrade = 0,1"
,"EC_Level_Two_Tech_Upgrade | EC_Level_Three_Tech_Upgrade | EC_Level_Four_Tech_Upgrade = 0,1"
,"UC_Level_Two_Tech_Upgrade | UC_Level_Three_Tech_Upgrade | UC_Level_Four_Tech_Upgrade = 0,1"
,"HC_Level_Two_Tech_Upgrade | HC_Level_Three_Tech_Upgrade | HC_Level_Four_Tech_Upgrade = 0,1"
,"PC_Level_Two_Tech_Upgrade | PC_Level_Three_Tech_Upgrade | PC_Level_Four_Tech_Upgrade = 0,1"
}
}
RequiredCategories = {"Upgrade"}
AllowFreeStoreUnits = false
end
function ReserveForce_Thread()
BlockOnCommand(ReserveForce.Produce_Force())
ReserveForce.Set_Plan_Result(true)
ScriptExit()
end

View File

@@ -0,0 +1,106 @@
-- $Id: //depot/Projects/StarWars_Steam/FOC/Run/Data/Scripts/AI/LandMode/VaderAssistsLand.lua#1 $
--/////////////////////////////////////////////////////////////////////////////////////////////////
--
-- (C) Petroglyph Games, Inc.
--
--
-- ***** ** * *
-- * ** * * *
-- * * * * *
-- * * * * * * * *
-- * * *** ****** * ** **** *** * * * ***** * ***
-- * ** * * * ** * ** ** * * * * ** ** ** *
-- *** ***** * * * * * * * * ** * * * *
-- * * * * * * * * * * * * * * *
-- * * * * * * * * * * ** * * * *
-- * ** * * ** * ** * * ** * * * *
-- ** **** ** * **** ***** * ** *** * *
-- * * *
-- * * *
-- * * *
-- * * * *
-- **** * *
--
--/////////////////////////////////////////////////////////////////////////////////////////////////
-- C O N F I D E N T I A L S O U R C E C O D E -- D O N O T D I S T R I B U T E
--/////////////////////////////////////////////////////////////////////////////////////////////////
--
-- $File: //depot/Projects/StarWars_Steam/FOC/Run/Data/Scripts/AI/LandMode/VaderAssistsLand.lua $
--
-- Original Author: Steve_Copeland
--
-- $Author: Brian_Hayes $
--
-- $Change: 637819 $
--
-- $DateTime: 2017/03/22 10:16:16 $
--
-- $Revision: #1 $
--
--/////////////////////////////////////////////////////////////////////////////////////////////////
-- This plan simply puts Vader in the right places.
-- It relies on the object script darthvader.lua to activate abilities.
require("pgevents")
function Definitions()
Category = "VaderAssists"
TaskForce = {
{
"MainForce"
,"DenyHeroAttach"
,"Darth_Vader = 1"
}
}
IgnoreTarget = true
AllowEngagedUnits = true
duration_to_assist = 20
duration_to_fight = 30
end
function MainForce_Thread()
BlockOnCommand(MainForce.Produce_Force())
QuickReinforce(PlayerObject, AITarget, MainForce)
MainForce.Set_As_Goal_System_Removable(false)
vader = MainForce.Get_Unit_Table()[1]
if not TestValid(vader) then
MessageBox("unexpected state; vader unavailable")
ScriptExit()
end
-- Continuously try to attack, assist the most significant nearby unit, and heal up
while true do
ConsiderHeal(vader)
enemy_location = FindTarget.Reachable_Target(PlayerObject, "Current_Enemy_Location", "Tactical_Location", "Any_Threat", 0.5)
if TestValid(enemy_location) then
DebugMessage("%s-- moving toward enemy concentration", tostring(Script))
BlockOnCommand(MainForce.Attack_Move(enemy_location), duration_to_fight)
end
ConsiderHeal(vader)
best_ally = FindTarget(MainForce, "Needs_Vader_Assist", "Friendly_Unit", 1.0, 1500)
if TestValid(best_ally) then
DebugMessage("%s-- assisting %s", tostring(Script), tostring(best_ally))
BlockOnCommand(MainForce.Guard_Target(best_ally), duration_to_assist)
end
MainForce.Set_Plan_Result(true)
-- Make sure the loop always yields
Sleep(1)
end
end

View File

@@ -0,0 +1,84 @@
-- $Id: //depot/Projects/StarWars_Steam/FOC/Run/Data/Scripts/AI/LiftBlockadePlan.lua#1 $
--/////////////////////////////////////////////////////////////////////////////////////////////////
--
-- (C) Petroglyph Games, Inc.
--
--
-- ***** ** * *
-- * ** * * *
-- * * * * *
-- * * * * * * * *
-- * * *** ****** * ** **** *** * * * ***** * ***
-- * ** * * * ** * ** ** * * * * ** ** ** *
-- *** ***** * * * * * * * * ** * * * *
-- * * * * * * * * * * * * * * *
-- * * * * * * * * * * ** * * * *
-- * ** * * ** * ** * * ** * * * *
-- ** **** ** * **** ***** * ** *** * *
-- * * *
-- * * *
-- * * *
-- * * * *
-- **** * *
--
--/////////////////////////////////////////////////////////////////////////////////////////////////
-- C O N F I D E N T I A L S O U R C E C O D E -- D O N O T D I S T R I B U T E
--/////////////////////////////////////////////////////////////////////////////////////////////////
--
-- $File: //depot/Projects/StarWars_Steam/FOC/Run/Data/Scripts/AI/LiftBlockadePlan.lua $
--
-- Original Author: James Yarrow
--
-- $Author: Brian_Hayes $
--
-- $Change: 637819 $
--
-- $DateTime: 2017/03/22 10:16:16 $
--
-- $Revision: #1 $
--
--/////////////////////////////////////////////////////////////////////////////////////////////////
require("pgevents")
--
-- Galactic Mode Conquer Script
--
function Definitions()
Category = "Lift_Blockade"
TaskForce = {
-- First Task Force
{
"MainForce" -- Name of the MainForce, Variable and thread function.
,"MinimumTotalSize = 4"
,"MinimumTotalForce = 2500"
,"Frigate | Capital | Corvette | Fighter | Bomber = 100%"
}
}
RequiredCategories = { "Corvette | Frigate | Capital | Super" }
end
function MainForce_Thread()
-- Converge all task force units upon the target simultaneously
SynchronizedAssemble(MainForce)
if MainForce.Get_Force_Count() > 0 then
MainForce.Set_Plan_Result(true)
MainForce.Release_Forces(1.0)
end
Sleep(120)
ScriptExit()
end
function MainForce_Production_Failed(tf, failed_object_type)
ScriptExit()
end
function MainForce_No_Units_Remaining()
MainForce.Set_Plan_Result(false)
end

View File

@@ -0,0 +1,93 @@
-- $Id: //depot/Projects/StarWars_Steam/FOC/Run/Data/Scripts/AI/PathBonusForDistantTargets.lua#1 $
--/////////////////////////////////////////////////////////////////////////////////////////////////
--
-- (C) Petroglyph Games, Inc.
--
--
-- ***** ** * *
-- * ** * * *
-- * * * * *
-- * * * * * * * *
-- * * *** ****** * ** **** *** * * * ***** * ***
-- * ** * * * ** * ** ** * * * * ** ** ** *
-- *** ***** * * * * * * * * ** * * * *
-- * * * * * * * * * * * * * * *
-- * * * * * * * * * * ** * * * *
-- * ** * * ** * ** * * ** * * * *
-- ** **** ** * **** ***** * ** *** * *
-- * * *
-- * * *
-- * * *
-- * * * *
-- **** * *
--
--/////////////////////////////////////////////////////////////////////////////////////////////////
-- C O N F I D E N T I A L S O U R C E C O D E -- D O N O T D I S T R I B U T E
--/////////////////////////////////////////////////////////////////////////////////////////////////
--
-- $File: //depot/Projects/StarWars_Steam/FOC/Run/Data/Scripts/AI/PathBonusForDistantTargets.lua $
--
-- Original Author: Steve_Copeland
--
-- $Author: Brian_Hayes $
--
-- $Change: 637819 $
--
-- $DateTime: 2017/03/22 10:16:16 $
--
-- $Revision: #1 $
--
--/////////////////////////////////////////////////////////////////////////////////////////////////
require("pgevents")
-- Tell the script pooling system to pre-cache this number of scripts.
ScriptPoolCount = 1
--
--
--
function Definitions()
DebugMessage("%s -- In Definitions", tostring(Script))
Category = "Distant_System_Path_Bonus"
IgnoreTarget = true
TaskForce =
{
{
"EmptyForce"
, "TaskForceRequired"
}
}
DebugMessage("%s -- Done Definitions", tostring(Script))
planet_list = nil
markup_table = {}
end
function EmptyForce_Thread()
EmptyForce.Set_As_Goal_System_Removable(false)
planet_list = FindPlanet.Get_All_Planets()
while true do
for i,planet in pairs(planet_list) do
if TestValid(planet) then
path_start = _FindStageArea(PlayerObject, planet, EmptyForce)
if path_start then
path = Find_Path(PlayerObject, path_start, planet)
value = (EvaluatePerception("GenericPlanetValue", PlayerObject, planet)
+ EvaluatePerception("Is_Neglected_By_My_Opponent_Space", PlayerObject, planet)) / 2
markup_table[planet] = Apply_Markup(PlayerObject, path, value, markup_table[planet])
end
else
planet_list[i] = nil
end
Sleep(1)
end
end
end

Some files were not shown because too many files have changed in this diff Show More