The 3rd Age

MasterHero Mod 1.9

MasterHero Mod 1.9

Enhances Visuals, provide series of modifications and additions to the game play, support WOR

Button for The 3rd AgeButton for The Dwarf HoldsButton for The Elven AllianceButton for Helm's Deep Last HopeButton for GothmogtheOrcButton for BFME+Button for The Four AgesButton for HDR HeadquartersButton for Middle Earth CenterButton for Project Perfect Mod

Become an affiliate!

   

Quick Lists

Top Rated Popular New Updated Last Comments Users

Register and log in to move these advertisements down

Custom Structures & AI for BFME1

Avatar of Hebblewhite

Hebblewhite

Category: Worldbuilder
Level: Expert
Created: Wednesday July 18, 2007 - 15:36
Updated: Friday July 20, 2007 - 6:01
Views: 6820
Summary: Getting the BFME1 AI system to construct and utilise your custom structures effectively at run time

Rating

Staff says

4.3

Members say

4.5

Average

4.4/5.0

10 votes

Page 1 2 3 4 5 6
              
Code

*** IF ***
Counter 'g_PredBuild_My_Soldier_Building_Count' IS Less Than counter 'g_PREDBUILD_MAX_INFANTRY'
*AND* Counter 'g_PredBuild_My_Soldier_Building_Count' IS Equal To 0
*** OR ***
Counter 'g_PredBuild_My_Soldier_Building_Count' IS Less Than counter 'g_PREDBUILD_MAX_INFANTRY'
*AND* Counter 'g_PredBuild_Barracks_Building_Count' IS Greater Than or Equal To counter 'g_PREDBUILD_OPP_SINGLE_UNIT'
*** OR ***
Counter 'g_PredBuild_My_Soldier_Building_Count' IS Less Than counter 'g_PREDBUILD_MAX_INFANTRY'
*AND* Counter 'g_PredBuild_Barracks_Building_Count' IS Less Than counter 'g_PredBuild_Archer_Building_Count'
*AND* Counter 'g_PredBuild_Barracks_Building_Count' IS Less Than counter 'g_PredBuild_Artillery_Building_Count'
*AND* Counter 'g_PredBuild_Barracks_Building_Count' IS Less Than counter 'g_PredBuild_Infantry_Building_Count'
*AND* Counter 'g_PredBuild_Economy_Building_Count' IS Greater Than or Equal To counter 'g_PredBuild_Factory_Building_Count'

*** THEN ***
Counter 'l_PredBuild_Barracks_Building_Priority' , Add with value 2


Again, note that we are using the infantry method that ties into the Soldier_Building_Counter, that allows us to monitor how close we are to the maximum number of appropriate infantry types at any given time.

Repeat the same process for the “[S A nd] [E N H]g_PredBuild - Set Infantry Building Filler Priority” script file. Don’t forget to change the name, and then add the following code:

              
Code

*** IF ***
Counter 'g_PredBuild_My_Soldier_Building_Count' IS Less Than counter 'g_PREDBUILD_MAX_INFANTRY'

*** THEN ***
Counter 'l_PredBuild_Barracks_Building_Priority' , Add with value 1



That’s pretty much it for the main scripting necessary for our new structure to function, with the exception of one last thing…


Part 3:

We now need to initialise any working values we require when the map is first loaded. Open “ai_initialise.map”. In our case, the only value left outstanding is that of the “Barracks_Building_Count” we have used previously.

Open the “[ns A]Non Over Ride-able Paper Work” script folder, and add the following line to the “[ns A D][E N H]g_Init - Initialize Global Variables (NonOverride)” script file:

              
Code

Set 'g_PredBuild_Barracks_Building_Count' to 0

Links / Downloads

 HitsAdded
Custom Structures & AI for BFME11853July 18, 2007 - 15:40

Comments

Display order: Newest first

Hebblewhite - Wednesday July 18, 2007 - 15:58

I've attached a pdf version for easier reading!


Cheers,

Hebblewhite

Go to top

 

"One site to rule them all, one site to find them,
one site to host them all, and on the network bind them."

 
9:13:53