Jump to content


Photo

Adding a unit into the AI


7 replies to this topic

#1 TheHaze

TheHaze
  • New Members
  • 4 posts

Posted 02 December 2008 - 09:27 AM

First of all...let me add to the masses in their praise for your work guys. Really, really awesome work!! (bet you wish you got paid for it!) :)

Now down to business...
I've added a few units (from other mods) into my own private mod and I've added some into the AI and they work perfectly...however...
There are a few that seem to cause the AI to just stop working.

For example..I'm adding in the Chaos Khorne Terminator models. They work fine ingame if played by me and all is well, but if I add in to the AI and then start a game with AI Chaos vs AI Chaos (using Thud's autoexec) on a 2player map...the first AI player runs and starts building fine, but the 2nd player doesn't appear to even start. No new troops and Slave doesn't build anything.

I've switched on the trace-mode in the utility AI file but it shows nothing for that player as if the AI doesn't even start. I've also checked the Warnings file and it shows nothing unusual (as far as I can see). Oh...and I'm using DoS v3.00, my pc is b1tchingly quick...and I get no CTD's.

I'll try to give as much info as possible...as to where/what I'm adding...
I'm adding these in the correct areas...but I'll collate the entries into each Icode window.

Can you tell me if I've left anything out or if you have any ideas what might be happening?
MANY MANY THANKS in advance! :wink_new:

The Haze ---- (Stuff I'm adding in follows)


File: chaosunits.ai
UnitStrengths.chaos_squad_khorne_terminators = 105	{		name = "Khorne Terminators",		sbp_name = "chaos_squad_khorne_terminator",		ebp_name = "chaos_khorne_terminator",		class = UnitStatsAI.UC_HeavyInfantryHigh,		rating = 8,		potential = 		{			{				name = "space_marine_storm_bolter",				effectiveness = GenerateUnitEffectiveness(5.9,5.7,5.5,5.7,5.6,5.3,2.9,1.8,4.8,1.8,3.1,4.1,2.7,2.9),				range = UnitStatsAI.RT_Ranged,			},			{				name = "chaos_multi_melta",				effectiveness = GenerateUnitEffectiveness(5.9,5.7,5.5,5.7,5.6,5.7,5.9,4.8,5.8,1.8,3.1,5.1,5.7,4.9),				range = UnitStatsAI.RT_ShortRanged,			},			{				name = "chaos_assault_cannon",				effectiveness = GenerateUnitEffectiveness(6.4,5.9,5.9,5.9,5.9,5.3,2.9,1.8,4.8,1.8,3.1,4.1,2.7,2.9),				range = UnitStatsAI.RT_Ranged,			},		}	},

File: chaosbuildbasestrategy.ai
(under the bit about returning squad-cap)
elseif (sSquadName == "chaos_squad_khorne_terminator") then		return 3, 0

File: chaosstrategyinfo.ai
(a couple of entries...the first in the build strategies and the 2nd in the Squad Limits)
{ 3, 240, 100, 0, 1,	 "Unit",	"chaos_squad_khorne_terminator" },	chaos_squad_chaos_terminator = 1,

Edited by TheHaze, 03 December 2008 - 09:13 AM.


#2 LarkinVB

LarkinVB

    title available

  • Members
  • 1,488 posts

Posted 02 December 2008 - 10:42 AM

Now down to business...


Some business tips :

Open the console after gamestart and I'm sure it will display an error message. AI trace mode is for finding errors while the AI is running.

Edited by LarkinVB, 02 December 2008 - 10:42 AM.


#3 thudo

thudo

    Wacko AI Guy!

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

Posted 02 December 2008 - 02:27 PM

bet you wish you got paid for it!

Being paid never has ZERO to do with it for our 4+year passion in this project IS our payment regardless of the constraints we have faced. If we got paid to do this, I doubt it would have been any better than what we accomplished. Feeding the heart and soul is more reward than 10x the bounty in gold.

As Larkin mentioned -- check your game console OR your \logfiles folder where the game is installed as it'll have your error. Very VERY easy to fix. :wink_new:
Advanced Skirmish AI Team Lead for the coolest Warhammer40k PC RTS out there:

Dawn of War Advanced AI Headquarters

Latest DoW Advanced AI Download!

#4 TheHaze

TheHaze
  • New Members
  • 4 posts

Posted 02 December 2008 - 02:33 PM

bet you wish you got paid for it!

Being paid never has ZERO to do with it for our 4+year passion in this project IS our payment regardless of the constraints we have faced. If we got paid to do this, I doubt it would have been any better than what we accomplished. Feeding the heart and soul is more reward than 10x the bounty in gold.

As Larkin mentioned -- check your game console OR your \logfiles folder where the game is installed as it'll have your error. Very VERY easy to fix. :)


Well if you had a donate button, I'd click it. :wink_new:

It always is a simple thing that you miss isn't it...but that's the learning experience...thinking you've checked everything and then "oops...there it is!"

#5 TheHaze

TheHaze
  • New Members
  • 4 posts

Posted 02 December 2008 - 09:41 PM

As Larkin mentioned -- check your game console OR your \logfiles folder where the game is installed as it'll have your error. Very VERY easy to fix. :p


I come back begging for help! :)
I've checked console...didn't see anything untoward (but it may have flashed past before I could see)...
AIlog.txt Log file shows the following...(so I guess it's something to do with the Unit Stats file...But I can't see anything wrong with it.) I've checked through and made sure every weapon name matches up etc...
So i beg now...pleeease throw me some more clues! :wink_new:

Loading Standard AI...RaceLoader: Init global race info...RaceLoader: Init chaos_marine_race... *ALERT: AIStats:LoadUnitStats() threw exception (unable to make cast)  Lua             Core/cpu_manager.ai            Ln  415 (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 'chaos_marine_race'!Loading Standard AI...RaceLoader: Init global race info...RaceLoader: Init chaos_marine_race...RaceLoader: Create build base strategy of race AI chaos_marine_race...player 1000 has chosen strategy: 3player 1000 has chosen squadlimits: standardGametime: 0AI 1000: Massive Battles mode activated!


#6 thudo

thudo

    Wacko AI Guy!

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

Posted 03 December 2008 - 01:20 AM

Check your chaosunitstats.ai, d00d. You added units that do not conform to what the game expects. Look at other units that came with the chaosunitstats.ai and spot the differences. You need to mimic your new units based on the vanilla units that were there already.
Advanced Skirmish AI Team Lead for the coolest Warhammer40k PC RTS out there:

Dawn of War Advanced AI Headquarters

Latest DoW Advanced AI Download!

#7 TheHaze

TheHaze
  • New Members
  • 4 posts

Posted 03 December 2008 - 09:15 AM

Check your chaosunitstats.ai, d00d. You added units that do not conform to what the game expects. Look at other units that came with the chaosunitstats.ai and spot the differences. You need to mimic your new units based on the vanilla units that were there already.



Looks like the units weapons were several numbers short compared to other units weapons.
Strange since I copied that from another mod that used the same AI.
But it works now and I've learnt some, so yeah...thanks. :shiftee:

#8 thudo

thudo

    Wacko AI Guy!

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

Posted 03 December 2008 - 02:19 PM

Yep.. most of DoW AI modding in terms of creating your own faction is ensuring you duplicate what the other vanilla factions have done to suit your own. A good file comparison app can really help here. However, glad you got it all working.
Advanced Skirmish AI Team Lead for the coolest Warhammer40k PC RTS out there:

Dawn of War Advanced AI Headquarters

Latest DoW Advanced AI Download!



Reply to this topic



  


0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users