Jump to content


thudo

Member Since 27 Mar 2004
Offline Last Active Yesterday, 05:57 PM

#1102216 How do I add custom sound files for a unit?

Posted by thudo on 09 July 2019 - 04:18 PM

Then I can assume your custom speech path is broken or you have invalid FDA files or, as Kaskr mentioned you are missing valid _rat or .con files..  have to follow the standards. ;)




#1102194 How do I add custom sound files for a unit?

Posted by thudo on 08 July 2019 - 11:35 PM

I think you mean..

 

Speech/Races/Orks/Bosszagstruk

 

Ya sure your mod path has that? What is your mod called on your .module?

 

You sure you have the correct path + FDAs are all converted correctly?




#1102185 How do I add custom sound files for a unit?

Posted by thudo on 08 July 2019 - 06:46 PM

What does your speech_directory section under the EBPS unit say though?

 

Also, if you run the game with -DEV as I asked, play the game to get the beep from your unit, exit game, then check the soundmessages,txt under \[Where Soulstorm is located\logfiles\[last run]

 

It will tell you what path it is looking for when it is beeping.




#1102182 How do I add custom sound files for a unit?

Posted by thudo on 08 July 2019 - 05:57 PM

I am currently writing full TUTs on this and the other parts of the DoW1 workflow but if your path is correct can I ask what is it?

 

You have to create the same path in your [Soulstorm]\DXP2\Data\Sound... as it would be for where your Speech Path is looking.. you can use other projects as an example how to do this.

 

Also, did you run with -DEV in your Command Line like this:

 

start soulstorm.exe -dev -nomovies -modname [name of your mod's .module file]




#1102180 How do I add custom sound files for a unit?

Posted by thudo on 08 July 2019 - 03:46 PM

speech_directory section under the EBPS unit.




#1101983 DoW1 Mod Project Basic Mod Workflow Checklist

Posted by thudo on 01 July 2019 - 05:36 AM

MISC - Updated: July 16, 2019.

 

This section deals with some odds and ends to consider when debugging issues with your mod.

 

 

Initial Launch Troubleshooting

 

When starting the game from the desktop these could be possible issues to examine and correct:

 

Hint #1: Note this example warning in the warnings.log:

MOD -- Warning: Failed to open folder 'Ultramarines\Locale\english\Data'.
MOD -- Warning: Failed to open folder 'Ultramarines\Data_Shared_Textures\Full'.
MOD -- Warning: Failed to open folder 'Ultramarines\Data_Sound\Full'.
MOD -- Warning: Failed to open folder 'Ultramarines\Data_Music'.
MOD -- Warning: Failed to open folder 'Ultramarines\Data_Whm\High'.

Solution: These errors are generated when in your project's .MODULE file has excess "DataFolder.X" row entries which are not required. Instead, only use this line: "DataFolder.1 = Data". This could also occur with "ArchiveFile.X" rows so please comment them out (use ";;" to disable each line) or remove all "ArchiveFile.X" line rows.

 

As example in your project's .MODULE file this:

DataFolder.1 = %LOCALE%\Data
DataFolder.2 = Data
DataFolder.3 = Data_Shared_Textures\%TEXTURE-LEVEL%
DataFolder.4 = Data_Sound\%SOUND-LEVEL%
DataFolder.5 = Data_Music
DataFolder.6 = Data_Whm\%MODEL-LEVEL%

and/or this:

ArchiveFile.1 = %LOCALE%\DXP2DataLoc
ArchiveFile.2 = %LOCALE%\DXP2DataKeys
ArchiveFile.3 = DXP2Data
ArchiveFile.4 = DXP2Data-SharedTextures-%TEXTURE-LEVEL%
ArchiveFile.5 = %LOCALE%\DXP2Data-Sound-Speech
ArchiveFile.6 = DXP2Data-Sound-%SOUND-LEVEL%
ArchiveFile.7 = DXP2Data-Music
ArchiveFile.8 = DXP2Data-Whm-%MODEL-LEVEL%

should be condensed to this:

DataFolder.1 = Data

This will simplify the deployment and pathing of your project's assets.

 

 

Hint #2: Note this example warning in the warnings.log:

LOCALIZER -- Requested string ID '18210121' does not fit in a valid key range!
LOCALIZER -- Requested string ID '691600' does not exist!

Solution: Missing UCS # (not found anywhere in either the vanilla UCS or your project's UCS files). Use a program like Beyond Compare or Total Commander to locate these missing UCS #s to determine if these missing values need to be placed in your project's own .UCS file OR rename these values in the impacted AE object as "$0" which nulls/disables the value.

 

Note: Go to the UCS section here to ensure you have followed the best practice instructions to ensure your UCS entries are consistent and accounted for.

 

 

Hint #3: Note this example warning in the warnings.log:

SIM -- Attempted to load duplicate blueprint, EBPs\Environment\gameplay\ultra_marine_bomb.rgd (1137)

Solution: This AE object "ultra_marine_bomb" has the same name as used by another loaded object possibly in your EBPS\RACES\[MOD_NAME]\TROOPS folder. Only use unique names for loaded AE objects so rename the one in EBPs\Environment\gameplay (so outside your EBPS\RACES\[MOD_NAME]\TROOPS).

 

 

SCAR specific errors

 

A few SCAR errors you should identify and correct in your project usually found as you are starting to load a map:

 

 

Hint #1: Note this example warning in either the warnings.log or scarlog.txt found in [root Soulstorm folder]\logfiles\[last game run instance]:

[string "DATA:Scar/WinConditions/AIDonations.scar"]:577: `}' expected (to close `{' at line 16) near `ultra_marine_race'

Solution: Broken script logic in this impacted .SCAR file. Open this file in Notepad (it is a text file after all) and correct the broken logic.




#1101980 DoW1 Mod Project Basic Mod Workflow Checklist

Posted by thudo on 01 July 2019 - 12:29 AM

AI - Updated: March 18, 2023.

 

This section will cover various AI issues and how to best to troubleshoot them using example scenarios.

 

In an fashion, an assumption will be made that the developer trying to debug their Dawn of War AI has a "modest" understanding of LUA coding and basic scripting logic but this cannot always be the case.

 

 

Master AI Documentation

 

Find attached below the master documented which I created a decade+ ago which will make you go through step-by-step the AI workflow and give you an understanding how the basic script logic works and relates to the various parts. Please consult the attached text file to get a good broad overview of scripting AI in Dawn of War.

 

This document will be updated if required but I find if you have any concerns how to do something in the LUA logic for your project's AI chances are another project has likely done something similar and you can "adopt its scripts" for use within your own. This, of course, depends on whether it suits your needs "as is" or if "new features" are required to be added to it.

 

 

Common AI issues

 

Note: Please ensure you are first running the game in -DEV mode as per instructions in the first message of this thread.

 

In this section, there are two logs you will need to consult: warnings.txt found in both [root Soulstorm folder] and [root Soulstorm folder]\logfiles\[last game run instance] and ailog.txt in [root Soulstorm folder]\logfiles\[last game run instance]. The ailog.txt, however, should largely be consulted first since most of the following warnings will be dumped there first.

 

We will break down Dawn of War AI errors based on the .ai files which should be examined causing problem.

 

Also, throughout the course of this section we will be using the Ultramarines faction mod project as an example.

 

Loader.ai

 

This file is located in your project's [Mod Name]\Data\ai\races\[Faction AI race root folder]

 

Hint #1:

Failed to import lua file 'Data:AI/Races/ultra_marine_race/Tactics/UltraMarineMyCoolUnitTactic.ai'
 *ALERT: failed to import 'Races/ultra_marine_race/Tactics/UltraMarineMyCoolUnitTactic.ai', file failed to open
  Lua             Races/ultra_marine_race/Loader.ai Ln   36 (LoadRace)
  Lua             Races/RaceLoader.ai            Ln   94 (?)
  Lua             Core/cpu_manager.ai            Ln  405 (Initialize)
  Lua             DATA:AI/default.ai             Ln  115 (InitializeAI)
  main            DATA:AI/default.ai             Ln  133 ((null))
Error loading script file 'DATA:AI/default.ai' for race 'ultra_marine_race'!

Solution: Check your Loader.ai file (example above is "Races/ultra_marine_race/Loader.ai Ln   36") and see what line is loading which missing .ai file. This means you are trying to load an invalid .ai file.


Hint #2:

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

Solution: A syntax error exists and must be corrected first before any of the rest of your .ai files are loaded since the Loader.ai is the focal point to which all other .ai files in your project are called from.
 

 

Hint #3:

*ALERT: [string "Races/ultra_marine_race/Loader.ai"]:118: attempt to perform arithmetic on global `a' (a nil value)

Solution: Using the example, at Line 118 of the Loader.ai the script logic was expecting a numeric value but found an invalid letter "a" instead.

 

 

Hint #4:

*ALERT: [string "Core/utility.ai"]:93: Assertion failed at Races/RaceLoader.ai, line 69
Error loading script file 'DATA:AI/default.ai' for race 'ultra_marine_race'!

Solution: Incomplete or invalid line found in your Loader.ai. Please correct the syntax so the command is valid.
 

 

[Faction name]unitstats.ai

 

This file is located in your project's [Mod Name]\Data\ai\races\[Faction AI race root folder]\info

 

Hint #1:

*ALERT: AIStats:LoadUnitStats() threw exception (cannot find entity blueprint 'ultra_marine_scout')
  Lua             Core/cpu_manager.ai            Ln  413 (Initialize)
  Lua             DATA:AI/default.ai             Ln  115 (InitializeAI)
  main            DATA:AI/default.ai             Ln  133 ((null))
Error loading script file 'DATA:AI/default.ai' for race 'ultra_marine_race'!

Solution: Check your Unitstats.ai file and ensure all your EBPS and SBPS units match up correctly. The above example means the SBPS entity in your unitstats.ai is not accurated linked to the expected EBPS entity (which they should be in your project's AE code).

 

 

Hint #2:

AI Unit Stats: 'ultra_marine_squad_builder' -- invalid ebp name 'ultra_marine_builde'!
 *ALERT: AIStats:LoadUnitStats() threw exception (cannot find entity blueprint 'ultra_marine_builde')
  Lua             Core/cpu_manager.ai            Ln  413 (Initialize)
  Lua             DATA:AI/default.ai             Ln  115 (InitializeAI)
  main            DATA:AI/default.ai             Ln  133 ((null))
Error loading script file 'DATA:AI/default.ai' for race 'ultra_marine_race'!

Solution: Check your Unitstats.ai file and ensure the EBPS name that was flagged is actually named correct and is valid for this entry + associated properly with its SBPS entity.

 

 

Hint #3:

*ALERT: AIStats:LoadUnitStats() threw exception (unable to make cast)
  Lua             Core/cpu_manager.ai            Ln  413 (Initialize)
  Lua             DATA:AI/default.ai             Ln  115 (InitializeAI)
  main            DATA:AI/default.ai             Ln  133 ((null))
Error loading script file 'DATA:AI/default.ai' for race 'ultra_marine_race'!

Solution: This one is specifically related to your Unitstats.ai file which could mean a EBPS/SBPS entity is missing Effectiveness values or something invalid located only in Unitstats.ai.

 

 

Hint #4:

Warning: ultra_marine_squad_honour_guard has no unit strength!

Solution: This one is specifically related to your Unitstats.ai file where near the top of this .ai file you are missing this required line:

UnitStrengths.ultra_marine_squad_honour_guard = XXXX 

where XXXX is the assigned ArmyStrength value in comparison to other units in vanilla or faction mod projects.

 

 

Hint #5:

*ALERT: [string "Races/ultra_marine_race/Info/UltraMarineUnitstats.ai"]:8: unexpected symbol near `='
  Lua             Races/ultra_marine_race/Loader.ai Ln   44 (LoadGlobalInfo)
  Lua             Races/RaceLoader.ai            Ln   81 (?)
  Lua             Core/cpu_manager.ai            Ln  400 (Initialize)
  Lua             DATA:AI/default.ai             Ln  115 (InitializeAI)
  main            DATA:AI/default.ai             Ln  133 ((null))
Error loading script file 'DATA:AI/default.ai' for race 'ultra_marine_race'!

Solution: A general missing syntax error where a character is missing that was expected to complete the line. In this case it is in the Unitstats.ai file where this line:

UnitStrengths.ultra_marine_squad_cool_crew =

has to be:

UnitStrengths.ultra_marine_squad_cool_crew = 35

This is because a value was expected to close this particular line.

 

 

Hint #6:

*ALERT: no static 'UC_LightInfantryMd' in class 'UnitStatsAI'
  main            Races/ultra_marine_race/Info/UltraMarineUnitstats.ai Ln   43 ((null))
  C               =[C]                           Ln   -1 (import)
  Lua             Races/ultra_marine_race/Loader.ai Ln   44 (LoadGlobalInfo)
  Lua             Races/RaceLoader.ai            Ln   81 (?)
  Lua             Core/cpu_manager.ai            Ln  400 (Initialize)
  Lua             DATA:AI/default.ai             Ln  115 (InitializeAI)
  main            DATA:AI/default.ai             Ln  133 ((null))
Error loading script file 'DATA:AI/default.ai' for race 'ultra_marine_race'!

Solution: Check your Unitstats.ai file and ensure one of your Class types (based on the line reported above, as example) is corrected as there are standard Class Types the game uses.

 

 

Hint #7:

'ultra_marine_scout': upgrade 'ultra_marine_marine_shotgun' is an invalid upgrade for this entity type!

Solution: In your faction mod's AI Unitstats.ai the hardpoint associated with the unit is not valid based on the loaded EBPS unit. Please ensure your AI is updated here with the correct weapon\ names assigned to the EBPS unit.
 

 

[Faction name]buildbasestrategy.ai

 

This file is located in your project's [Mod Name]\Data\ai\races\[Faction AI race root folder]\strategies

 

Hint #1:

Cannot get prerequisites: Trying to build an invalid research: ultra_marine_support_research
Cannot get prerequisites: Trying to build an invalid addon: ultra_marine_captain_upgrade

Solution: Check that your AE project actually uses these entities and they can be buildable even by a human player. If the above research and addon are part of your project BUT non-buildable in-game then the above warnings will be dumped. In this instance, the AI should not be asked to build the above research or addon.

 

 

Hint #2:

*ALERT: [string "Core/utility.ai"]:93: Assertion failed at Core/Strategies/Strategy.ai, line 31
Error loading script file 'DATA:AI/default.ai' for race 'ultra_marine_race'!

Solution: Syntax error in your project's BuildBaseStrategy .ai file likely related to a misspelled declaration not following process or accidental capitalization.

 

 

[Faction name]buildbasestrategyinfo.ai

 

This file is located in your project's [Mod Name]\Data\ai\races\[Faction AI race root folder]\strategies

 

Hint #1:

Trying to add a limit to a non-existant squad: ultra_marine_squad_honour_guar

Solution: Check your [race name]strategyinfo.ai file to see if such a squad is actually a valid one. As example, go to ultramarinestrategyinfo.ai and note the "SquadLimits" section for this specific error:

                ultra_marine_squad_honour_guar = 1,

In this case, based on the Ultramarines faction AI's Unitstats.ai file the correct valid SBPS squad name is actually:

                ultra_marine_squad_honour_guard = 1,

So use only valid SBPS squad names here.

 

 

Hint #2:

*ALERT: [string "Core/utility.ai"]:93: Assertion failed at Core/Strategies/BuildOrderStrategy.ai, line 211
Error loading script file 'DATA:AI/default.ai' for race 'ultra_marine_race'!

Solution: Syntax error in your project's BuildBaseStrategyInfo .ai file likely related to a misspelled declaration not following process or accidental capitalization.

 

[Faction name]tactic .ai files

 

These files are located in your project's [Mod Name]\Data\ai\races\[Faction AI race root folder]\tactics

 

Hint #1:

*ALERT: MilitaryManager:Update() threw exception (lua runtime error)
  Lua             Core/cpu_manager.ai            Ln 1564 (?)
  Lua             Core/cpu_manager.ai            Ln  419 (Initialize)
  Lua             DATA:AI/default.ai             Ln  115 (InitializeAI)
  main            DATA:AI/default.ai             Ln  133 ((null))
Error loading script file 'DATA:AI/default.ai' for race 'ultra_marine_race'!

or

*ALERT: MilitaryManager:Update() threw exception (lua runtime error)
  Lua             Core/cpu_manager.ai            Ln 1564 (?)
  Lua             Core/cpu_manager.ai            Ln 1416 (Update)
  Lua             DATA:AI/default.ai             Ln   53 (AI_Think)

Solution: This error generally means there is a syntax framework error in a loaded .ai of yours. It can be caused by something like this:

function UltraMarineBuilderTactic:__init( quad_ai ) super( squad_ai )

The correct syntax should be:

function UltraMarineBuilderTactic:__init( squad_ai ) super( squad_ai )

Be mindful of your script logic and keep to conventions. If you cannot find it, comment out large sections of your loader.ai especially in the CreateTactic(oSquadAI) section. This will allow you to better troubleshoot which .ai file is causing the problem.

 

 

Hint #2:

*ALERT: [string "Races/ultra_marine_race/Tactics/UltraMarineInfantryTactic.ai"]:155: `)' expected near `then'
  Lua             Races/ultra_marine_race/Loader.ai Ln   27 (LoadRace)
  Lua             Races/RaceLoader.ai            Ln   94 (?)
  Lua             Core/cpu_manager.ai            Ln  405 (Initialize)
  Lua             DATA:AI/default.ai             Ln  115 (InitializeAI)
  main            DATA:AI/default.ai             Ln  133 ((null))
Error loading script file 'DATA:AI/default.ai' for race 'ultra_marine_race'!

Solution: Locate this .ai file (example above is the .ai file mentioned in your loader.ai at this part "Races/ultra_marine_race/Loader.ai Ln   36") and correct the missing ")" required to properly secure the Function.


Hint #3:

*ALERT: [string "Races/ultra_marine_race/Tactics/UltraMarine..."]:153: stack overflow: [string "Races/ultra_marine_race/Tactics/UltraMarine..."]:153
[string "Races/ultra_marine_race/Tactics/UltraMarine..."]:163

Solution: Stack Overflows are likely caused by a unit that has the same ability applied twice or more which basically overflows the AI's buffer trying to preform duplicate tasks. ie. [My_Mod]InfantryTactic has frag_grenades ability active while the same named ability is called in an attachable commander unit with same abilities.

 

Best to keep ability names exclusive from generic abilities, disable any InitAbilities/DoAbilities, or disable the AI attachment logic.
 

 

Hint #4:

Warning: Ability ID in function DoAbility of player 1001 not defined!

Solution: In one of your AI Tactic files there is a DoAbility script which has broken logic that is undeclared and missing being bound to an actual ability name attached to your EBPS unit.

 

As an example in this Ultramarine Commander Tactic .ai file this is incorrect:

function UltraMarineCommanderTactic:InitAbilities()

end

function UltraMarineCommanderTactic:DoAbilities()

    Ability.DoAbility( self.squad_ai, UltraMarineCommander.nuke_id, Ability.Filters.IsInCombat )
end

Notice there is no actual AE ability name being declared/assigned in the InitAbilities() section leaving that ability "UltraMarineCommander.nuke_id" in DoAbilities() orphaned, thus, generating the warning message(s).

To fix this we must assign "UltraMarineCommander.nuke_id" to a EBPS unit's proper AE ability name as follows:

function UltraMarineCommanderTactic:InitAbilities()

    if (UltraMarineCommander.nuke_id == nil) then
        UltraMarineCommander.nuke_id = cpu_manager.stats:GetAbilityID( "ultra_marine_nuke" )
    end
end

function UltraMarineCommanderTactic:DoAbilities()

    Ability.DoAbility( self.squad_ai, UltraMarineCommander.nuke_id, Ability.Filters.IsInCombat )
end

Now it is properly assigned, however, be careful that "ultra_marine_nuke" is actually the real AE ability name assigned to this EBPS unit assigned this tactic .ai file otherwise the game will Crash to Desktop (CTD). More on this below.

Note: The "Player 1001" basically means the error is being reported for Player1 (Player0 tends to be Slot 0 where a human player traditionally starts in a 1vs1 skirmish games).
 

 

Hint #5:

*ALERT: expected class to derive from or a newline
  Lua             Races/ultra_marine_race/Loader.ai Ln   32 (LoadRace)
  Lua             Races/RaceLoader.ai            Ln   94 (?)
  Lua             Core/cpu_manager.ai            Ln  405 (Initialize)
  Lua             DATA:AI/default.ai             Ln  115 (InitializeAI)
  main            DATA:AI/default.ai             Ln  133 ((null))
Error loading script file 'DATA:AI/default.ai' for race 'ultra_marine_race'!

Solution: Check your Loader.ai file (example above is "Races/ultra_marine_race/Loader.ai Ln   32") and see what line is loading which .ai file. It is likely a bad .ai with incorrect declared values like a Tactic file with invalid syntax which is incorrect for your project.

An example that can cause this is from a loaded Tactic .ai:

 

This is incorrect:

class 'UltraMarineCommanderTactic' (UltraMarinInfantryTactic)

while this is correct:

class 'UltraMarineCommanderTactic' (UltraMarineInfantryTactic)

Note that the corrected name is derived from the loaded ultramarineinfantrytactic.ai (which uses "UltraMarineInfantryTactic" internally) so your project should use something unique and propagated to your other Infantry-based tactic files.
 

 

Misc / Generic AI Errors

 

Below are some odd and end AI warnings/errors to watch for.

 

Hint #1:

*ALERT: [string "Races/ultra_marine_race/Strategies/UltraMarineBuildBaseSt..."]:400: `end' expected (to close `function' at line 227) near `<eof>'
  Lua             Races/ultra_marine_race/Loader.ai Ln   23 (LoadRace)
  Lua             Races/RaceLoader.ai            Ln   94 (?)
  Lua             Core/cpu_manager.ai            Ln  405 (Initialize)
  Lua             DATA:AI/default.ai             Ln  115 (InitializeAI)
  main            DATA:AI/default.ai             Ln  133 ((null))
Error loading script file 'DATA:AI/default.ai' for race 'ultra_marine_race'!

Solution: Locate this .ai file (example above is the .ai file mentioned in your loader.ai at this part "Races/ultra_marine_race/Loader.ai Ln   36") and correct the missing "end" required to close the function.


Hint #2:

RaceLoader: Create build base strategy of race AI ultra_marine_race...
*ALERT: [string "Races/ultra_marine_race/Loader.ai"]:53: attempt to call global `MarineBuildBaseStrategy' (a nil value)
*ALERT: [string "Races/ultra_marine_race/Strategies/Ultra..."]:247: attempt to index global `tBuildType' (a nil value)
Error loading script file 'DATA:AI/default.ai' for race 'ultra_marine_race'!

Solution: Not properly declared functions or values. Need to ensure they are valid and have a link to script logic. As example for Ultramarines.. "MarineBuildBaseStrategy" should have been "UltraMarineBuildBaseStrategy" as "MarineBuildBaseStrategy" is not valid for the Ultramarines project since "UltraMarineBuildBaseStrategy" is already declared in both the project's loader.ai and the its UltraMarineBuildBaseStrategy.ai file.

For the missing link to `tBuildType' that is due because the call was not first declared so it would need this before any kind of tBuildType is asked for.

                local tBuildType = CpuBuildType()

It can then be associated with an Addon or Research, etc..
 

 

Added: March 18, 2023

Hint #3:

*ALERT: AIStats:LoadUnitStats() threw exception (not a table inside stats table)
Lua Core/cpu_manager.ai Ln 413 (Initialize)
Lua DATA:AI/default.ai Ln 115 (InitializeAI)
main DATA:AI/default.ai Ln 133 ((null))

Solution: Check your entire AI path that it is valid. The above error will occur if your faction's AI is not in the correct folder path. ie.

This is incorrect:

Data\ai\ultra_marine_race\

This is correct:

Data\ai\races\ultra_marine_race\

So ensure your full AI path in the project is in the correct standard that is expected.

 

 

Cause of "most" AI (Crash to Desktop) CTDs

These are more elusive and frustrating as if a severe AI issue is found the game will crash to desktop without warning.

There is a method to firmly determine if its a BuildStrategy or Tactic causing the mysterious CTD but that is covered in the AI dox in the attachment below.

In this case, let's cover some basic Dawn of War CTDs and perhaps where to look to fix them.
 

 

Hint #1: Invalid or misspelled names of key declarations like those in Unitstats.ai. As example in the ultramarines Unitstats.ai:

UltraMarineUnitStats =
{
    race = "ultra_marine_race",

If any of the above have a spelling mistake will cause a CTD.

 

Hint #2: Giving a unit an ability in its own tactic file that it does not have OR the ability itself is misspelled in the unit's tactic file.

As example:

If in your unit's EBPS in the ability section:

GameData["ability_ext"]["abilities"]["ability_01"] = "abilities\\ultra_marine_rally.lua"

But then in this unit's loaded Tactic .ai file you have this:

function UltraMarineCommanderTactic:InitAbilities()

    if (UltraMarineCommander.rally_id == nil) then
        UltraMarineCommander.rally_id = cpu_manager.stats:GetAbilityID( "ultra_marine_rall" )
    end
end

When this unit shows up on the map for the first time the entire game will CTD.

The correct syntax is:

function UltraMarineCommanderTactic:InitAbilities()

    if (UltraMarineCommander.rally_id == nil) then
        UltraMarineCommander.rally_id = cpu_manager.stats:GetAbilityID( "ultra_marine_rally" )
    end
end

So it is critical to ensure all your declared and valid abilities for an EBPS unit have a tactic associated.

 

 

Hint #3: Any invalid abilities placed in your project's generic Infantry Tactic .ai file under this section.. once more, using Ultramarines as an example:

function UltraMarineInfantryTactic:AddTargetAbilities()
    table.insert(InfantryTactic.TargetAbilities, { nil, "ultra_marine_cool_bombs", Ability.Filters.CloseInfantryEnemy, 1, 0 })
end

If the mod project OR any loaded mod project (including vanilla factions) do not have this ability anywhere the game will immediate CTD when the first Infantry unit is created on the battlefield for your project.

It is important to ensure all ability names are valid as well as their context of use / proper function is coded correctly so the AI can use their abilities to the best of their potential.
 

 

Hint #4: Any hard-coded Build Order items in your project's BuildBaseStrategyInfo .ai file within the "BuildPrograms" section must be 100% accurate.

If a single one of these is misspelled or not present and then called in the loaded Tier (below showing only Tier1 items) then the game will immediately CTD.

Using Ultramarines as an example these are all valid units:

                { 1, 220, 50, 0, 1,    "Unit",     "ultra_marine_squad_commander" },
                { 1, 100, 0, 0, 1,     "Unit",     "ultra_marine_squad_scout" }, -- Force a capturing squad
                { 1, 190, 0, 0, 1,     "Unit",     "ultra_marine_squad_marine" },
                { 1, 400, 0, 0, 1,     "Building", "ultra_marine_hq" },
                { 1, 150, 0, 700, 1,   "Research", "ultra_marine_squad_cap_research" },
                { 1, 250, 150, 900, 1, "Research", "ultra_marine_tier2_research" },

However if in, say, Tier2 there is a bad item like the following research when the AI reaches Tier2 it will immediately crash as the AI scans all forthcoming items in the current Tier first but cannot compensate here if even one is invalid, thus, will crash.

                { 2, 150, 0, 650, 1,   "Research", "ultra_marine_i_am_cool_research" },

So its absolutely paramount to ensure all items under "BuildPrograms" are accurate.
 

 

Hint #5: Under your project's BuildBaseStrategy .ai there are various obstacles to avoid crashing. The main ones are sections which call Buildings and their Addons directly. We will use the Ultramarines project as an example.

 

At the top of your project's BuildBaseStrategy .ai file it is critical to ensure all Detector Units (used to spot enemy Infiltrated units) are valid. Make sure all SBPS units in your project are the correct name AND can actually find infiltrators.

function UltraMarineBuildBaseStrategy:__init( baseinfo ) super( baseinfo )
    self:AddDetectorUnit("ultra_marine_squad_very_cool_unit")

This can especially be tested against a vanilla Tau enemy as they have early Tier1 infantry which are shrouded.

 

So be aware the above must be a valid SBPS unit in your project and should be able to detect enemy infiltrators.

 

Next, this is declaring all valid Buildings for your project:

function UltraMarineBuildBaseStrategy:GetBuildingName( sType )

Here, the most critical buildings that are mandatory by the AI to be declared are the HQ, Generators, Large Generator, Listening Post, and Vehicle Buildings. Both Mines and Turrets are optional and can generally be omitted if your project does not use them.
 
There are some projects which have no Generators, Large Generators or Vehicle Buildings so there are methods to "trick the AI" not to build such placeholder structures while the player sees nothing themselves in the game's UI so it appears clean.

This one declares all valid building Addons within your project:

function UltraMarineBuildBaseStrategy:GetAddonBuilding( sType )

Every building that has an addon must be declared here especially if the addon is called for anywhere directly by your project's AI in a build order sequence or dynamically.

Do not use an addon name or associate it with a valid building unless they are both valid to one another otherwise the game will immediately crash.

Another section is where dynamic builds can be undertaken:

function UltraMarineBuildBaseStrategy:BuildFlexible()

If you are ever using squad quantities used as a prereq to build a research or addon, etc then make sure all squad names are valid. A single invalid one will crash the game.

 

Once more, an example from the ultramarine's project:

Note the invalid squad name declared in the array:

function UltraMarineBuildBaseStrategy:BuildFlexible()

    -- Dynamic research item syntax: ResearchName, MinTier, RequisitionCost, PowerCost, MinSquadCap, MinSupportCap, SquadName, SquadMinCount
    local iBasicInfantrySquads = self:CountSquads("ultra_marine_squad_scout") + self:CountSquads("ultra_marine_squad_marine") + self:CountSquads("ultra_marine_squad_dumb_doofus")

    -- Compute tier 1 researches
    if (self.tierLevel >= 1) then

        if (iBasicInfantrySquads >= 1) then
            self:DynamicResearch("ultra_marine_tier2_research", 1, 250, 150, 0, 0, nil, 0)
        end
    end

That one invalid squad name will crash the game in Tier1 so ensure all declared squad SBPS names are valid.

The same goes for all other buildable items like Researches, Addons, and Buildings. If any of those are also invalid you will likely crash the game in the Tier they are called. Examples of invalid dynamic calls:

        self:DynamicResearch("ultra_marine_pathetic_research", 1, 150, 100, 0, 0, nil, 0)
        self:DynamicAddon("ultra_marine_silly_addon_1", 100, 1, 100, 100, 0, 0, nil, nil, false)
        self:DynamicBuild("ultra_marine_dumb_hq", 2, 1, 100, 100, 0, 0)

Note: you will not crash the game if such items are actually loaded in the project in their respective AE folders but if they are simply never buildable or unobtainable then you likely get the error mentioned before:

Cannot get prerequisites: Trying to build an invalid research: ultra_marine_cool_support_research
Cannot get prerequisites: Trying to build an invalid addon: ultra_marine_captain_upgrade

The above research and addon are actually part of the project but cannot ever be built since they are unavailable for anything to build them since they are not active.

If you feel such items should be buildable an exception might be to add these to a bypass like these examples in your BuildBaseStrategy .ai in this function:

function UltraMarineBuildBaseStrategy:__init( baseinfo ) super( baseinfo )

    -- dark40k - set items that need bypass for CpuPrerequisites
    CpuPrerequisites2.AddSpecialItem("ultra_marine_cool_support_research", CpuPrerequisites.BT_Research)
    CpuPrerequisites2.AddSpecialItem("ultra_marine_captain_upgrade", CpuPrerequisites.BT_Addon)

Other items like _Squad and _Building are also covered for exceptions. That is, however, a seperate topic and should be covered in the AI dox attached.
 

 

Other Common AI issues

 

Here are lesser problematic common AI issues.

 

In this section, there are two logs you will need to consult: warnings.txt found in both [root Soulstorm folder] and [root Soulstorm folder]\logfiles\[last game run instance] and ailog.txt in [root Soulstorm folder]\logfiles\[last game run instance].

 

Hint #1:

info is null:false bad ability name: all_run!
info is null:false bad ability name: all_autorepair
info is null:false bad ability name: all_bumpertank

Solution: False-Positive STEAM-only AI warning. This does not impact the AI itself. These warnings never show up for the older/legacy CD/DVD versions.

Attached Files




#1101979 DoW1 Mod Project Basic Mod Workflow Checklist

Posted by thudo on 01 July 2019 - 12:29 AM

ICONS - Updated: July 02, 2019.

 

Recommended File Paths

 

For all enabled/active icons:

 

[Mod Name]\Data\Art\ui\ingame\[mod name_icons]

 

For disabled/inactive icons:

 

[Mod Name]\Data\Art\ui\ingame_disabled\[mod name_icons]

 

Bonus #1: when adding an Advanced Build Menu for your builders to build extra buildings beyond the hard-coded 11 slots this icon path should exist with a suitable icon so long as such an option is enabled in AE:

 

For all enabled/active command icons:

 

[Mod Name]\Data\Art\ui\ingame\command_icons

 

For disabled/inactive command icons:

 

[Mod Name]\Data\Art\ui\ingame_disabled\command_icons

 

The icon filename should be named: "build_structure_advanced2" and generally looks as follows:

 

W3egv85.jpg

 

Bonus #2: When adding SCAR game modes like HEROES, AI Donations, and other SCAR-based logic use this section for those icons:

 

[Mod Name]\Data\Art\ui\ingame\event_cue_icons\custom

 

Such icons can look as follows:

 

a1RM7F5.jpg   18YcYMN.jpg   EW1GSbm.jpg

 

 

Icon File Format and Dimensions

 

Dawn of War primarily uses for its icons the TGA or Truevision TARGA (Type 2) format so all icons should be saved in this format.

 

As for Dimensions, 64x64 is traditionally used with a Bit Depth of 32.

 

 

Filename Sorting and Naming Convention

 

This will help keep the icons for your project neat and organized so they can be found quickly.

 

Sort your icons based on their function as follows:

 

ability_XXXX_icon

addon_XXXX_icon

building_XXXX_icon

commander_XXXX_icon

hero_XXXX_icon

infantry_XXXX_icon

infantry_builder_XXXX_icon

infantry_command_squad_XXXX_icon

infantry_sergeant_XXXX_icon

research_XXXX_icon

upgrade_XXXX_icon  <-- meant for weapon upgrades

vehicle_XXXX_icon

 

Note that the last part of the filename "_icon" is used just to ensure its identified correctly as such especially if you need to search for them.

 

 

How Icon Upgrades Work

 

When one of your unit upgrades a hardpoint you'll notice that when this happens in the game UI menu the unit's main image turns PINK. This is due to the required icon filenames missing.

 

Firstly, ensure you have these icons present (using an Infantry entity as example):

 

infantry_XXXX_icon

infantry_XXXX_icon__multi

infantry_XXXX_icon__[weapon name in the entity's combat_ext EBPS]

infantry_XXXX_icon__[another weapon name in the entity's combat_ext EBPS]

 

For the third and forth icons above, the weapon name added to the file comes from the unit's EBPS file found in the combat_ext section only for weapons that are not in the first Hardpoint section.

 

This should only be added if needed: there is no need to always add such icons except for visible weapon icon upgrades OR if after the unit upgrades the unit's main image turns PINK.

 

As an example.. here is the Devastator squad from the Ultramarines project using RGDedit (raw AE code format):

Spoiler
Notice the second weapon "ultra_marine_heavy_bolter_tactical".. that would mean the icon would be called "infantry_devastator_icon__ultra_marine_heavy_bolter_tactical".

 

So if this icon exists in the enabled icon folder then when the Devastator Squad upgrades to that hardpoint, the unit's main image in-game will not turn PINK and will use the icon graphic represented in "infantry_devastator_icon__ultra_marine_heavy_bolter_tactical".

 

Hint #1: If in your Unit's EBPS combat_ext section you have complex upgrades set this way:

GameData["combat_ext"]["complex_upgrades"] = true

..then there is no requirement for any __multi or unit's own __weapon_name squad icons as by having complex upgrades set to True negates such icon options.

 

Hint #2: There is no need to make DISABLED versions of both __multi or __weapon_name squad icons as the game only handles the unit's main image icon which must have its own ENABLED and DISABLED variants.

 

 

How On and Off Icons Work for Toggle Abilities

 

Within your ability's icon_name section at the bottom of its AE code ability the name should be as follows:

 

ability_XXXX_icon

 

So the raw code would look like:

 

GameData["ui_info"]["icon_name"] = "ultra_marine_icons/ability_xxxx_icon"

 

However, in your actual icon section you should have two icon files:

 

ability_XXXX_icon_off

ability_XXXX_icon_on

 

Each of the above should be graphically edited to signify what the ability would look like ENABLED and DISABLED.

 

Bonus: if this toggle is impacted by a No Ability Aura that can impact the unit then you also need to add both of the above in your:

 

[Mod Name]\Data\Art\ui\ingame_disabled\[mod name_icons] folder

 

If this is the case, both "ability_XXXX_icon_off" and "ability_XXXX_icon_on" will need to coloured in a way so they both look as if they are coloured/tinted like the rest of the disabled icons.

 

If the above is not done, when a No Ability Aura/Modifier is applied, the ability icon will become PINK.

 

 

Ability Template PSD (for use in Photoshop)

 

Attached below is a PSD file which can be used in Photoshop to create a basic ability icon.

 

This should include most border colours, action/event avatars, and some assorted backgrounds to use.

Attached Files




#1101978 DoW1 Mod Project Basic Mod Workflow Checklist

Posted by thudo on 01 July 2019 - 12:29 AM

SOUND and SPEECH - Updated: April 15, 2021.

 

This section deals with most of the DoW1 speech workflow process in which one can adhere to the "best practices" expected so your speech integration goes as smooth as possible.

 

 

Spottings Folder Standards

 

These are all the major 30/40K faction spotting folders which should be in your:

 

[Mod Name]\Data\sound\speech\races\[mod name]\shared\spotting

 

Spoiler

 

Each folder should have its own associated .con file found in this main spotting folder.

 

This is a blank 0Kb file like "alpha_legion.con" you can make yourself using, say, Notepad which tells the game to point to the folder name in question as a valid target.

 

Update

(Sept 25, 2020) - Added Soul Drinkers to Spotting Naming Standards list below.

(April 15, 2021) - Added Angry Marines to Spotting Naming Standards list below.

 

Per Faction Spotting Naming Standards

 

In each of the above folders, if you have written then voiced all the factions then the file naming conventions to be used should be as follows:

 

Spoiler

 

Note: some overlap may occur and some spotting voices can be re-used/re-purposed for like-wise factions if your project does not have all the unique voices.

 

ie.. since there are two Eldar-based factions where one is the default vanilla race and the other is the Eldar Craftworld faction mod we can use the "Spotting_Eldar" for both since they are obviously related.

 

 

Speech Workflow Template for individual Units and Faction Spotting

 

Attached is a ZIP file which contains the main speech paths and workflow for adding your speech files to your faction mod.

 

It contains everything you need to directly add the paths to your [Mod Name]\Data\ path.

 

Firstly, it adds the "eventspeech.lua" file meant for [Mod Name]\Data\soundscripts\speechlogic which controls which spotting folders are used when a specific enemy faction is spotted for the first time. This file will change over time as we find new factions to add or corrects mistakes.

 

Secondly, it adds a sample faction speech path so you can quickly build your logical paths for each individual units (based on the four unit types: Builder, Commander, Infantry, and Vehicle) and your faction's main battlefield spotting folders. It is set up in a way to be fairly clear and ready to be used while maintaining our standards.

 

There is CMD batch file contained in each main root folder so when you copy your final FDA files relevant for each path there you can merely run the CMD and it will move/copy all files to where they need to go.

 

Update (Jul 14, 2019) - zip file is now at 1.1 as I added some needed _rat files in the various paths within \sound to ensure any custom work is played correctly.

 

 

WAV to FDA then back to WAV Speech Conversion Tool

 

Also provided below is a very helpful batch tool that, depending what file type you copy your files into, the CMD will properly convert them either from WAV->FDA or FDA-> WAV. When converting from WAV->FDA then you are ready to move those FDAs to the mod's speech paths as mentioned in the previous section so they can quickly be placed in their correct folders.

 

 

Understanding the Per Unit Speech Workflow

 

Generally, as mentioned above, there are four main unit types (Builder, Commander, Infantry, and Vehicle) and while most speech events like Unit_Complete, Selection, Move, Attack, and Death are universal across all unit types, some deviate by incorporating building options or the ability to Join or Detach from squads. For the sake of covering all bases, the Vehicle template has Jump (for units like Landspeeders which can jump around the battlefield) and Load/Unload (for units like Dreadnoughts which can garrison into building to then deepstrike). Regardless, use or omit as you wish but note what you need based on your project's design.

 

Notice however the Ability\ folder has two generic ability paths: Targeted and Protective. Use these folders as a template to add your own custom ability speech paths. As a rule, Targeted is more for direct-attack abilities while Protective is generally for healing auras. Nevertheless, use both these folders as a template.

 

Part of this Speech Workflow Template package is already built into the three speech events which you want muted/localized so they do not constantly get played: this is Charge, Combat, and Death. These three should not be played anywhere across the battlefield UNLESS the player's view is in the general area otherwise it becomes too overwhelming and would drown out other voices/sounds/music.

 

 

Troubleshooting Sound/Speech Issues

 

Here is a small most common broken sound/speech issues.

 

Note: Please ensure you are first running the game in -DEV mode as per instructions in the first message of this thread.

 

In this section, the log you will need to consult is soundmessages.txt found in [root Soulstorm folder]\logfiles\[last game run instance] or warnings.log (found in both [root Soulstorm folder] and [root Soulstorm folder]\logfiles\[last game run instance]).

 

Hint #1: Note this example warning in the soundmessages.txt:

No samples for patch, Data:Sound\speech\races\lotd\marine_tactical\charge
Using default patch for speech\races\lotd\marine_tactical\charge

Solution: While the Sound/Speech path may exist in your project the FDA or .RAT or .CON is missing - you should ensure these are both present and valid.

 

Hint #2: Note this example warning in the soundmessages.txt:

Failed to preload patch 'races\witch_hunters\valkyrie\valkyrie_drop_off'
    sound_valkyrie_landing
    art/ebps/races/witch_hunters/troops/valkyrie
Using default patch for races\witch_hunters\valkyrie\valkyrie_drop_off

Solution: Replace the missing speech path which is not present with the appropriate content..

 

Hint #3: Note this example warning in the soundmessages.txt:

FDA CODEC -- 'DATA:Sound\Speech\Races\Chaos_Marines\Possessed_Alternative\strategic_point_capture\401006.fda': 'Not a valid chunky file!'

Solution: This FDA is corrupt or damaged and will need to be re-evaluated to see why it does not play correctly in-game. Please convert it back from FDA->WAV (using the attached Speech Conversion Tool below) and check it to ensure it is a valid music file. Use other working FDAs as a template.

 

 

Hint #4: Note this example warning in the warnings.log:

SOUND -- failed to load playlist 'Data:SoundPlaylistMusic.lua'

Solution: There is missing syntax in this .LUA file (its a text file and can be edited in Notepad) located in your [Mod Name]\Data folder which usually means a missing " or , somewhere.

Attached Files




#1101974 DoW1 Mod Project Basic Mod Workflow Checklist

Posted by thudo on 01 July 2019 - 12:20 AM

Update - Oct 25, 2019

 

The intent of this thread is to give new DoW1 mod developers a reference point to building their projects with the objective to of ensuring we keep to what could be considered as being "best practices".

 

I will constantly be updating this as I tweak the sections especially based off feedback.

 

It will be broken down into various sections..

 

AE (Attribute Editor)

UCS

Art

Sound and Speech

Icons

AI

MISC

SCAR

 

..and possibly more but we'll see...

 

 

Launch Dawn Of War in DEV Mode

 

To fully troubleshoot your mod project you must always enter in DEV mode to see any background problems that you would otherwise not see the normal method.

 

Attached below is a CMD that you should unzip into where your root Soulstorm folder is then rename the filename to suit the name of your .module name (just to readily identify it with ease).

 

With this CMD it contains the following:

del *_ErrorLog.txt
del *_MiniDump.dmp
del %~dp0Mod_Name\data\ai\mapdb\*.dat
start soulstorm.exe -dev -nomovies -modname Mod_Name

The first two lines will clear all useless dump files which accumulate over time in your Soulstorm root which are basically not needed and 99% of the time never divulge anything useful.

 

The third line clears out all MapDB config info if that game mode is enabled for your mod. These should be cleared from time to time if present. Note the label there "Mod_Name": use the folder name of your mod in your root Soulstorm path.

 

Finally, the fourth line is the actual commandline which runs with the relevant args but the final variable "Mod_Name" should be the name of your .module so your mod will successfully launch with the correct switches.

 

 

What does using -DEV unlock?

 

Check THIS thread as it is covered in detail and should be quite valuable to all mod project developers.

Attached Files




#1101797 Alien Hunters - Deathwatch Development

Posted by thudo on 23 June 2019 - 02:10 PM

It will have a suitable voice for sure. <^_^




#1101592 UCS Ranges for all Projects

Posted by thudo on 14 June 2019 - 11:42 AM

Done!




#1101246 Alien Hunters - Deathwatch Development

Posted by thudo on 07 June 2019 - 12:16 AM

What I found..

Deathwatch-codex-review-05.jpg

 

So yep it can use one of the four.

 

As for the Servo-Skull.. no mention if it can be armed.. don't see why not honestly.. creative license.




#1100708 Alien Hunters - Deathwatch Development

Posted by thudo on 21 May 2019 - 03:54 AM

Spectacular! Those are fully voiced but I gave all the final voices for them to Fuggles as Centurions can play a major role for the Imperial Fists due to their Siege specialties!

 

Regardless, Ordo Xenos / Deathwatch voicing has already commenced (Corvus Blackstar and the Stormtroopers+Sergeant are done now) and the rest will soon follow.




#1099860 Stomp Stomp Stomp (V0.2 Alpha)

Posted by thudo on 22 April 2019 - 12:32 PM

- Unitstats,ai is a totally different issue then the tactic addons. I gather you know what must be done there. Unitstats.ai needs to be evaluated as there is invalid or broken data there.

- I'll need the updated UCS range so the running UCS list is updated.