The 3rd Age

The Elven LegacY MoD

The Elven LegacY MoD

This mod for bfme 1 Mod based on Elvestar 5.5

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: 6377
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
Custom Structures & AI fo BFME1

Introduction

Let's imagine you have just created a new and impressive Barracks structure for the Rohan faction, but your pesky AI system doesn’t want to use it! Time for a fix…

I've been working on the optimisation of the predictive building AI lately, and thought I'd produce this tutorial on what is the definitive, and most efficient way of getting your AI system to build and use your custom structures at run time.

Here goes:


NOTE: Before this will work you need to make sure you have added all of the appropriate unit reference scripts in "lib_objects_lists.map" and team entries in “ai_rohan.map” for all of your new hordes/heroes or else the AI system won't build them regardless of what we do here! Anyway, on with the show...


There are 3 main parts involved in getting your “factory” structures to work. The first places us smack bang in "ai_rohan.map".

Part 1:

Open the script editor, and navigate to the “[ns A]Pred Build Overrides” script folder. Look down the list until you see the “[S A nd] [E N H]g_PredBuild - Build Archer Building” script.

Copy it.

Immediately change its name to “[S A nd] [E N H]g_PredBuild - Build Barracks Building”. Then modify the condition/action statements in accordance with the following:

              
Code

*** IF ***
Can player Player '<This Player>' build at base Unit 'AI_CURRENT_CONSTRUCTION_SITE'

*** THEN ***
Build building 'RohanBarracks' at a foundation that is the most near, relative to the object of type, 'CastleRight' which is part of the base named, Unit 'AI_CURRENT_CONSTRUCTION_SITE' ... then finally reference the new building as: UnitRef 'AI_BARRACKS' .


The above script will force a build of any particular structure we desire (in this case it refers to a RohanBarracks). At this point, if you run your game, you should see your new structure pop up inside an enemy base, but it will not be used… we now need to tie the structure into the AI combat reasoning system.

Links / Downloads

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

 
6:21:18