Jump to content


Photo

Questions about modding weapons


101 replies to this topic

#21 fuggles

fuggles

    title available

  • Members
  • 4,741 posts

Posted 04 December 2018 - 09:56 PM

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.



#22 Moreartillery

Moreartillery
  • Members
  • 107 posts

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



#23 Gambit

Gambit

    title available

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

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 :p )

It simply says that the hh_chaos_bloosletter ENTITY, does not exist at the specified entities' folder.

Please have a look therein.


-In search of Papasmurf...

#24 Moreartillery

Moreartillery
  • Members
  • 107 posts

Posted 12 February 2019 - 12:57 AM

How do I change which honor guard unit a province gives?



#25 fuggles

fuggles

    title available

  • Members
  • 4,741 posts

Posted 13 February 2019 - 04:33 PM

Find the relevant .ter file in scenarios/sp, open it in notepad and change it.



#26 Moreartillery

Moreartillery
  • Members
  • 107 posts

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?



#27 thudo

thudo

    Wacko AI Guy!

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

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.


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

Dawn of War Advanced AI Headquarters

Latest DoW Advanced AI Download!

#28 Moreartillery

Moreartillery
  • Members
  • 107 posts

Posted 08 March 2019 - 03:47 AM

Where can I get Gnairf's ai tools?



#29 thudo

thudo

    Wacko AI Guy!

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

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? :p

 

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.


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

Dawn of War Advanced AI Headquarters

Latest DoW Advanced AI Download!

#30 Moreartillery

Moreartillery
  • Members
  • 107 posts

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?



#31 thudo

thudo

    Wacko AI Guy!

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

Posted 08 March 2019 - 02:27 PM

Here ya go. Download HERE!

 

It includes a How To Use doc but if you have questions let me know.


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

Dawn of War Advanced AI Headquarters

Latest DoW Advanced AI Download!

#32 Moreartillery

Moreartillery
  • Members
  • 107 posts

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.



#33 Gambit

Gambit

    title available

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

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. :grad:

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.

-In search of Papasmurf...

#34 Moreartillery

Moreartillery
  • Members
  • 107 posts

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.


#35 Gambit

Gambit

    title available

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

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 :p ).

 

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...


-In search of Papasmurf...

#36 Moreartillery

Moreartillery
  • Members
  • 107 posts

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?



#37 Gambit

Gambit

    title available

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

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 :p

 

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 :grad:

 


-In search of Papasmurf...

#38 Moreartillery

Moreartillery
  • Members
  • 107 posts

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.


#39 Gambit

Gambit

    title available

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

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.


-In search of Papasmurf...

#40 Moreartillery

Moreartillery
  • Members
  • 107 posts

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




Reply to this topic



  


0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users