It does, yes. I don't know why, in so much as I can't tell you why 1 in 100 causes the CTD, but as per the above it is repeatable by spamming the missile units. We had it with harlequins way back when and that is the solution I believe.
![Photo](https://forums.revora.net/uploads/profile/photo-thumb-427700.jpg?_r=1543820124)
Questions about modding weapons
#22
Posted 21 January 2019 - 09:43 PM
I was trying to change the bloodletter model/texture and error log says file doesn't exist, so I change it back to the original, and error log still says it doesn't exist! See attached screenshot.
Attached Files
Developer of the Cinematic Battles mod.
#23
Posted 22 January 2019 - 08:15 AM
Wait, what it says, is irrelevant to textures! (textures cannot be the cause for a mod NOT to load, anyway )
It simply says that the hh_chaos_bloosletter ENTITY, does not exist at the specified entities' folder.
Please have a look therein.
- Industrial_Strength and Moreartillery like this
#24
Posted 12 February 2019 - 12:57 AM
How do I change which honor guard unit a province gives?
Developer of the Cinematic Battles mod.
#25
Posted 13 February 2019 - 04:33 PM
Find the relevant .ter file in scenarios/sp, open it in notepad and change it.
- Industrial_Strength and Moreartillery like this
#26
Posted 04 March 2019 - 06:14 AM
@thudo Regarding build programs, when the ai reachs a new tier do the new tier squads replace the old tier squads or is it cumulative?
Also how does the ai treat squads that aren't in the build program? I know it will build them but how does it decide how many to make and when?
Developer of the Cinematic Battles mod.
#27
Posted 06 March 2019 - 05:46 AM
- Cumulative but it depends how "attractive" (either static or random) you make them in the unitstats.ai.
- Please consultant the UA builds and even in the SM AI note its unitstats.ai and we figured how to get the UA SM AI to randomly build. say, 7+ different Land Raiders the player/AI had access to choose. It works super well.
Note in that unitstats where the randomization occurs: its both in the RATING and the first line of the effectiveness values.. those two sections per unit make the difference on "how attractive" the AI should be building that unit hence why you always want TOP TIER Commanders to always be favoured so you give them both a high Rating and first line effectiveness values.
- Gambit, Industrial_Strength and Moreartillery like this
Dawn of War Advanced AI Headquarters
Latest DoW Advanced AI Download!
#28
Posted 08 March 2019 - 03:47 AM
Where can I get Gnairf's ai tools?
Developer of the Cinematic Battles mod.
#29
Posted 08 March 2019 - 03:59 AM
Gnarif... wow that name I have not heard in what seems like a decade.
You mean his AeP tool to compare attrib builds which can then be compared between different ones to ensure the AI is updated correctly each time like I've been doing for, oh, a decade+? with it?
Yes I have it. Use it all the time to spot internal attrib issues and balance changes the mod team never likely knew about. Very useful.
- Industrial_Strength likes this
Dawn of War Advanced AI Headquarters
Latest DoW Advanced AI Download!
#30
Posted 08 March 2019 - 07:06 AM
Yeah I was reading the old ai subforum, there's some good info there. So can I have a copy of it?
Developer of the Cinematic Battles mod.
#31
Posted 08 March 2019 - 02:27 PM
- Moreartillery likes this
Dawn of War Advanced AI Headquarters
Latest DoW Advanced AI Download!
#32
Posted 10 March 2019 - 10:23 AM
How do I tell the ai not to build a unit with a specific BuildProgram? I tried changing the Object-Count to 0 and negative numbers but it still builds them.
Hover tank strategy
{ 2, 180, 280, 0, -1, "Unit", "eldar_squad_wraithlord" }, -- no wraithlords { 2, 180, 280, 0, -1, "Unit", "eldar_squad_wraithguard" }, -- no wraithguard { 2, 180, 280, 0, -1, "Unit", "eldar_squad_wave_serpent" }, -- no waveserpents { 2, 180, 280, 0, -1, "Unit", "eldar_squad_falcon_grav_tank" }, -- no falcons
I think ai also ignores Min. ArmyStrength.
Developer of the Cinematic Battles mod.
#33
Posted 10 March 2019 - 11:27 AM
How do I tell the ai not to build a unit with a specific BuildProgram?
The current code does not support it. I have created additional code for it.
You have to force-modify the SquadLimits.standard.SQUAD_NAME...
Do you have access to the latest Chaos Daemons mod?
I have created a new function there, called SetSquadLimitsBasedOnStrategy(iStrategy).
See in strategies/daemonsbuildbasestrategy.ai
If you do not have it, just say so and I will tell you how to do it.
I think ai also ignores Min. ArmyStrength.
This is for the AI to check if it should attack the enemy with the army it has currently deployed.
And I think it does use it. But if you insist, I can give a quick check on the CORE attack plan...
Edited by Gambit, 10 March 2019 - 11:28 AM.
- Industrial_Strength likes this
#34
Posted 10 March 2019 - 08:59 PM
Do you have access to the latest Chaos Daemons mod?
I have created a new function there, called SetSquadLimitsBasedOnStrategy(iStrategy).See in strategies/daemonsbuildbasestrategy.ai
I couldn't find it in that file.
This is for the AI to check if it should attack the enemy with the army it has currently deployed.
I thought it meant not to build that thing until the army had reached a minimum strength, for example
{ 1, 200, 200, 700, 1, "Building", "eldar_soul_shrine" },
would mean don't build soul shrine before our army strength reaches 700. I could be wrong though.
Edit: I just deleted my build plan and the ai played the same way, are you sure the ai uses these?
Edited by Moreartillery, 10 March 2019 - 09:45 PM.
Developer of the Cinematic Battles mod.
#35
Posted 10 March 2019 - 10:00 PM
I couldn't find it in that file.
OK, I will post the code here!
Gimme sometime, I have to go to sleep now ( there is a flu... "fluctuating" arounf, and I feel a bit dizzy ).
I thought it meant not to build that thing until the army had reached a minimum strength, for example
Ah, yes it is JUST for that!!
Sorry for what I said above, I misunderstood.
Edit: I just deleted my build plan and the ai played the same way, are you sure the ai uses these?
The question is, are you sure you are loading YOUR build plan? Have a look into the loader.ai of your race...
#36
Posted 11 March 2019 - 12:17 AM
Edit: I just deleted my build plan and the ai played the same way, are you sure the ai uses these?The question is, are you sure you are loading YOUR build plan? Have a look into the loader.ai of your race...
I set it to only load the plan I'm working on, the logfile confirms its working. The ai plays the same way even if the plan is just two brackets with nothing in them. Maybe theres a default plan in another file that I haven't found?
Developer of the Cinematic Battles mod.
#37
Posted 11 March 2019 - 11:05 AM
Hmmm... I do not know for sure. Normally, even if there is no plan the AI will spawn something...
As to why your own plan is not taken into account, ... There are many factors that come into play and I cannot remotely suggest anything.
Now here is the code for changing (even limiting to 0) the number of squads produced, based on plan.
What follows, is the code as appears in Chaos Daemons (latest build), you will have to modify names appropriately.
So, set the SquadLimits normally, in your YOUR_RACEstrategyinfo.ai file. Nothing changed here.
Then, use the following code in your YOUR_RACEbuildbasestrategy.ai file, and only include the squads that you want to change their SquadLimits - the others will not change, of course:
a) go into your YOUR_RACEBuildBaseStrategy:ChooseBuildProgram() function, and when your code chooses a strategy, add a call to the new function that changes the limits. Here is an example from Chaos Daemons:
function DaemonsBuildBaseStrategy:ChooseBuildProgram() ..... if (iRandom <= iBuildProgram1) then g_iHarassingLeader = 1 self:SetSquadLimitsBasedOnStrategy(1) return 1 elseif (iRandom <= iBuildProgram2) then g_iHarassingLeader = 2 self:SetSquadLimitsBasedOnStrategy(2) return 2 .....
As you can see, there is a call to the SetSquadLimitsBasedOnStrategy function. This is the one that changes the squad limits.
And this function is VERY simple!!! (put it anywhere into your YOUR_RACEbuildbasestrategy.ai file. I have but it immediately after the DaemonsBuildBaseStrategy:ChooseBuildProgram() function, for consistency). So here it is:
function DaemonsBuildBaseStrategy:SetSquadLimitsBasedOnStrategy(iStrategy) if iStrategy == 1 then -- Khorne BuildBaseStrategyInfo.deamons_race.SquadLimits.standard.daemon_squad_flesh_hound = math.random(4,6) BuildBaseStrategyInfo.deamons_race.SquadLimits.standard.daemon_squad_bloodletters = math.random(5,8) BuildBaseStrategyInfo.deamons_race.SquadLimits.standard.daemon_squad_plague_bearers = math.random(1,2) BuildBaseStrategyInfo.deamons_race.SquadLimits.standard.daemon_squad_fiends = 0 BuildBaseStrategyInfo.deamons_race.SquadLimits.standard.daemon_squad_fiends_advanced = 0 BuildBaseStrategyInfo.deamons_race.SquadLimits.standard.daemon_squad_daemonettes = 0 BuildBaseStrategyInfo.deamons_race.SquadLimits.standard.daemon_squad_screamers = math.random(1,2) elseif iStrategy == 2 then -- Slaanesh BuildBaseStrategyInfo.deamons_race.SquadLimits.standard.daemon_squad_flesh_hound = 0 BuildBaseStrategyInfo.deamons_race.SquadLimits.standard.daemon_squad_bloodletters = 0 BuildBaseStrategyInfo.deamons_race.SquadLimits.standard.daemon_squad_plague_bearers = math.random(1,2) BuildBaseStrategyInfo.deamons_race.SquadLimits.standard.daemon_squad_fiends = 0 BuildBaseStrategyInfo.deamons_race.SquadLimits.standard.daemon_squad_fiends_advanced = math.random(4,6) BuildBaseStrategyInfo.deamons_race.SquadLimits.standard.daemon_squad_daemonettes = math.random(3,5) BuildBaseStrategyInfo.deamons_race.SquadLimits.standard.daemon_squad_screamers = math.random(1,2) elseif iStrategy == 3 then ...
As you can see, it CANNOT get any simpler.
What it does, is simply putting new values to the SquadLimits sub-array, based on strategy chosen.
QUITE simple
If you have any issues, please let me know. For Chaos Daemons - where we DO want specific roster based on strategy, it works flawlessly.
NOTE: Another update that I am ALWAYS coding in AI, (and updated the vanilla TAU ai in Unification Bugfix), is a check, on AI re-initialisation.
See, if the AI has already chosen a tactic, and this tactic is exclusive (like in chaos daemons), then you want the AI to ALWAYS re-select THAT strategy, on re-initialisation (for example after a save->load).
So in my ChooseBuildProgram() I make an additional check at the beginning, to see WHICH strategy to return.
Here is an example from Chaos Daemons.
function DaemonsBuildBaseStrategy:ChooseBuildProgram() -- Check build program count if (table.getn(self.info.BuildPrograms) ~= 5) then return BuildBaseStrategy.ChooseBuildProgram(self) end -- If a Mark has already been chosen (from a saved game, change players wincondition, etc.), -- continue with that Program and do not change, or the tech will be messed-up. if cpu_manager.cpu_player:IsResearchComplete("daemons_mark_khorne") then g_iHarassingLeader = 1 self:SetSquadLimitsBasedOnStrategy(1) return 1 elseif cpu_manager.cpu_player:IsResearchComplete("daemons_mark_slaanesh") then g_iHarassingLeader = 2 self:SetSquadLimitsBasedOnStrategy(2) return 2 elseif cpu_manager.cpu_player:IsResearchComplete("daemons_mark_tzeentch") then g_iHarassingLeader = 3 self:SetSquadLimitsBasedOnStrategy(3) return 3 elseif cpu_manager.cpu_player:IsResearchComplete("daemons_mark_nurgle") then g_iHarassingLeader = 4 self:SetSquadLimitsBasedOnStrategy(4) return 4 end -- If no strategy program has been chosen, chose one. -- Get map size and closest enemy distance local sMapSize, iClosestEnemyDistance = self:GetMapSize() ...
As you can see, if there IS a strategy chosen (the checks) the AI returns THAT strategy (first it sets the new limits, of course).
The above method checks for a Research. If you need code for a structure-based strategy selection, just see the Witch Hunters Code
- Moreartillery likes this
#38
Posted 14 March 2019 - 04:27 AM
Thats amazingly useful! Is it possible to change the squad limit mid battle?
Edited by Moreartillery, 14 March 2019 - 04:53 AM.
- Industrial_Strength likes this
Developer of the Cinematic Battles mod.
#39
Posted 14 March 2019 - 08:11 AM
Of course! But it may be tricky....
Just decide on the conditions, and put a simple line like this:
BuildBaseStrategyInfo.deamons_race.SquadLimits.standard.daemon_squad_flesh_hound = math.random(4,6)
In your code.
Or make a different function, and call it whenever necessary.
If you want the new limits to be strategy-dependent as well, the store the strategy (at the place the code chooses it) in a global variable, and use an IF statement to discern.
- Industrial_Strength likes this
#40
Posted 16 March 2019 - 05:53 AM
The squad limits code isn't working for me, is this set up right?
class 'EldarBuildBaseStrategy' (BuildBaseStrategy) function EldarBuildBaseStrategy:__init( baseinfo ) super( baseinfo ) -- Add detector units (Best first, worst last) end function EldarBuildBaseStrategy:ChooseBuildProgram() -- Check build program count if (table.getn(self.info.BuildPrograms) ~= 4) then return BuildBaseStrategy.ChooseBuildProgram(self) end -- Get map size and closest enemy distance local sMapSize, iClosestEnemyDistance = self:GetMapSize() -- Set probabilities of the strategies according to the map size local iBuildProgram1 -- Basic strategy local iBuildProgram2 -- Reaper rush local iBuildProgram3 -- Banshee rush local iBuildProgram4 -- Hover Tank strategy if (sMapSize == "small" or iClosestEnemyDistance <= 100) then iBuildProgram1 = 34 iBuildProgram2 = 33 iBuildProgram3 = 33 iBuildProgram4 = 0 elseif (sMapSize == "large" and iClosestEnemyDistance >= 100) then iBuildProgram1 = 0 iBuildProgram2 = 0 iBuildProgram3 = 0 iBuildProgram4 = 100 else iBuildProgram1 = 0 iBuildProgram2 = 0 iBuildProgram3 = 0 iBuildProgram4 = 100 end -- Modify probabilities according to the closest enemy player local oEnemy = cpu_manager:FindClosestEnemyPlayer(false) local sEnemy = oEnemy:GetPlayerRaceName() if (sEnemy == "space_marine_race" or "chaos_marine_race") then iBuildProgram2 = iBuildProgram2 + 0 iBuildProgram3 = iBuildProgram3 - 0 elseif (sEnemy == "guard_race" or sEnemy == "tau_race" or sEnemy == "ork_race") then iBuildProgram1 = iBuildProgram1 - 0 iBuildProgram2 = iBuildProgram2 + 0 iBuildProgram3 = iBuildProgram3 - 0 end -- Now choose a program iBuildProgram2 = iBuildProgram1 + iBuildProgram2 iBuildProgram3 = iBuildProgram2 + iBuildProgram3 iBuildProgram4 = iBuildProgram3 + iBuildProgram4 local iRandom = math.random(1, 100) if (iRandom <= iBuildProgram1) then return 1 elseif (iRandom <= iBuildProgram2) then return 2 elseif (iRandom <= iBuildProgram3) then return 3 elseif (iRandom <= iBuildProgram4) then return 4 end end function EldarBuildBaseStrategy:SetSquadLimitsBasedOnStrategy(iStrategy) if iStrategy == 4 then -- Hover tank BuildBaseStrategyInfo.eldar_race.SquadLimits.standard.eldar_guardian_squad = 3 BuildBaseStrategyInfo.eldar_race.SquadLimits.standard.eldar_dire_avenger_squad = 0 BuildBaseStrategyInfo.eldar_race.SquadLimits.standard.eldar_squad_dark_reapers = 4 BuildBaseStrategyInfo.eldar_race.SquadLimits.standard.eldar_squad_banshees = 0 BuildBaseStrategyInfo.eldar_race.SquadLimits.standard.eldar_squad_rangers = 3 BuildBaseStrategyInfo.eldar_race.SquadLimits.standard.eldar_squad_striking_scorpions = 1 BuildBaseStrategyInfo.eldar_race.SquadLimits.standard.eldar_harlequin_squad = 0 BuildBaseStrategyInfo.eldar_race.SquadLimits.standard.eldar_squad_jetbikes = 1 BuildBaseStrategyInfo.eldar_race.SquadLimits.standard.eldar_squad_wraithlord = 0 BuildBaseStrategyInfo.eldar_race.SquadLimits.standard.eldar_squad_wraithguard = 0 BuildBaseStrategyInfo.eldar_race.SquadLimits.standard.eldar_squad_wave_serpent = 0 BuildBaseStrategyInfo.eldar_race.SquadLimits.standard.eldar_squad_falcon_grav_tank = 0 end end
Developer of the Cinematic Battles mod.
Reply to this topic
![](https://secure.gravatar.com/avatar/d41d8cd98f00b204e9800998ecf8427e?s=100&d=https%3A%2F%2Fforums.revora.net%2Fpublic%2Fstyle_images%2Frevora2013%2Fprofile%2Fdefault_large.png)
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users