The 3rd Age

Build anywhere mod (buildmod)

Build anywhere mod (buildmod)

Let's you build anywhere in skirmish

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: 6964
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
The first step in achieving this forces us to include our new structure in the basic attack strategy used by the AI system.

Open the “[ns A] Attack Rohan AI” script folder.

The scripts in this folder allow us to build multiple factory structures of the same type. In the case of Rohan, we are effectively talking about Archery Ranges and Stables. Note that the Archery Range scripts can only be activated twice, and the Stables three times.

We can go the whole hog and make three entries for our new Barracks Building.

Copy the first “[ns A D][E N H]a_BB - Stables 1” script and then change its name to “[ns A D][E N H]a_BB – Barracks 1”. Modify the condition/action statements in accordance with the following:

              
Code

*** IF ***
Flag named 'AI_On' IS TRUE
*AND* Counter 'g_Attack_Urgency' IS Greater Than or Equal To counter 'g_ATTACK_BUILD_WAVE_1'
*AND* 400 is Less Than the number of credits possessed by Player '<This Player>'
*AND* Can player Player '<This Player>' build at base Unit 'AI_CURRENT_CONSTRUCTION_SITE'
*AND* Unit 'AI_CURRENT_CONSTRUCTION_SITE' has Less Than threat level 25.00 within radius 500.00
*AND* Player '<This Player>' has Less Than 1 unit or structure of type 'RohanBarracks'

*** THEN ***
Build building 'RohanBarracks' at a foundation that is the most near, relative to the object of type, 'Flank1' which is part of the base named, Unit 'AI_CURRENT_CONSTRUCTION_SITE' ... then finally reference the new building as: UnitRef 'AI_BARRACKS_1' .
Enable Script 'a_BB - Barracks 1 ReEnable'.



Note the final statement in the event section of the above script… We now need to create a new “a_BB – Barracks 1 ReEnable” script, so the building can be replaced should the need arise during combat.

Copy the “[ns na D][E N H]a_BB - Stables 1 ReEnable” script file and then change the name to “[ns na D][E N H]a_BB - Barracks 1 ReEnable”. Modify the condition/action statements in accordance with the following:

              
Code

*** IF ***
Counter 'g_Attack_Urgency' IS Greater Than or Equal To counter 'g_ATTACK_BUILD_WAVE_1'
*AND* Player '<This Player>' has Greater Than or Equal To 1 unit or structure of type 'RohanBarracks'

*** THEN ***
Enable Script 'a_BB - Barracks 1'.



Repeat as many times as you feel necessary… I would recommend three times for starters, but take care to replicate the correct scripts and values.

Links / Downloads

 HitsAdded
Custom Structures & AI for BFME11949July 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."

 
15:04:42