AI Q & A
#82
Posted 27 December 2008 - 02:40 PM
The values for threat can be changed.
Break dancing into the hearts of millions
#83
Posted 12 May 2010 - 11:02 PM
#84
Posted 30 August 2011 - 09:52 PM
But I've come to this thread many times in the past for these great AI tips.
And I'm sure many others will follow.
Now for my AI tip...
I think we've all seen how sometimes while playing in Skirmish, an AI player might get a large part of their base destroyed and they just refuse to rebuild.
Well this stems from the fact that the building system is a little bugged.
When the AI has a base that it's currently building on, it references that base as AI_CURRENT_CONSTRUCTION_SITE.
These scripts set up the reference:
e_Update Current Construction Site:
(This one initializes it)
*** IF *** True. *** THEN *** Run Subroutine 'ee_Check Current Construction Site'. Run Subroutine 'ee_Set Current Construction Site'.
ee_Check Current Construction Site:
(This one checks if the base has any build plots available)
*** IF *** Can player Player '<This Player>' build at base Unit 'AI_CURRENT_CONSTRUCTION_SITE' *** THEN *** Set Flag named 'l_Econ - Current Construction Site Buildable' to TRUE *** ELSE *** Set Flag named 'l_Econ - Current Construction Site Buildable' to FALSE
ee_Set Current Construction Site:
(And this one looks for a new base owned by this player to reference as AI_CURRENT_CONSTRUCTION_SITE if the current one has no build plots left)
*** IF *** Flag named 'l_Econ - Current Construction Site Buildable' IS FALSE *** THEN *** Run Subroutine 'ee_Check Expansion 16'. Run Subroutine 'ee_Check Expansion 15'. Run Subroutine 'ee_Check Expansion 14'. Run Subroutine 'ee_Check Expansion 13'. Run Subroutine 'ee_Check Expansion 12'. Run Subroutine 'ee_Check Expansion 11'. Run Subroutine 'ee_Check Expansion 10'. Run Subroutine 'ee_Check Expansion 9'. Run Subroutine 'ee_Check Expansion 8'. Run Subroutine 'ee_Check Expansion 7'. Run Subroutine 'ee_Check Expansion 6'. Run Subroutine 'ee_Check Expansion 5'. Run Subroutine 'ee_Check Expansion 4'. Run Subroutine 'ee_Check Expansion 3'. Run Subroutine 'ee_Check Expansion 2'. Run Subroutine 'ee_Check Expansion 1'.
Spot the problem?
There's no system in place to set the Flag named l_Econ - Current Construction Site Buildable to False IF the base is destroyed.
When an AI player builds an expansion such as an outpost or camp, the AI_CURRENT_CONSTRUCTION_SITE Reference is automatically placed on this new base.
But if this new base get's destroyed while it's actively building, (As in it still had some empty plots) then the reference dies with it. And the AI only knows how to build at a base with the AI_CURRENT_CONSTRUCTION_SITE reference.
Meaning the AI is unable to build at it's earlier bases because they lost the reference when the new base was built.
UNLESS it buys a new expansion somewhere. Because, again the reference is auto-placed on any new base.
The simplest way to fix this is to add 2 new scripts.
Open "ai_economy_execution.map".
And add these scripts to the same folder as the above scripts. (Should be "Economy Execution")
ee_Current Construction Destroyed:
*** IF *** Unit 'AI_CURRENT_CONSTRUCTION_SITE' has been destroyed. *** THEN *** Set Flag named 'l_Econ - Current Construction Site Buildable' to FALSE
...
ee_Current Construction Missing:
*** IF *** Unit 'AI_CURRENT_CONSTRUCTION_SITE' exists and is alive. *** THEN *** Null operation. (Does nothing.) *** ELSE *** Set Flag named 'l_Econ - Current Construction Site Buildable' to FALSE
And that's it!
P.S. They should both have these settings:
Edited by _Bender_, 30 August 2011 - 10:26 PM.
#85
Posted 20 January 2012 - 03:31 PM
John 3:16 (NIV)
For God so loved the world that he gave his one and only Son, that whoever believes in him shall not perish but have eternal life.
Psalm 23:1 (ESV)
A Psalm of David.
The LORD is my shepherd; I shall not want.
#86
Posted 20 January 2012 - 04:09 PM
#87
Posted 16 April 2012 - 08:56 AM
Break dancing into the hearts of millions
#88
Posted 22 July 2012 - 01:59 AM
#89
Posted 22 July 2012 - 02:44 AM
Add the script to the Generic tab in Team builder in " Hero - Boromir"
Break dancing into the hearts of millions
#90
Posted 22 July 2012 - 09:47 AM
The 4th Age version 0.8 has been released: Link
#91
Posted 23 July 2012 - 02:02 AM
Attached Files
#92
Posted 23 July 2012 - 04:30 AM
Break dancing into the hearts of millions
#93
Posted 23 July 2012 - 09:27 AM
Or, since you're only doing one change, you might want to try to just copy the name of the script in the hero file, then paste it into the gondor file where it should be, in Boromirs generic section. It'll work in-game. But I'm not sure if WB will accept a 'non-existing' script.. So it might not add it, it might you dissapear when you click Enter, or whatever. The first tip is always working though.
The 4th Age version 0.8 has been released: Link
#94
Posted 24 July 2012 - 01:44 AM
libraries\ai_gondor\ai_gondor.map
libraries\lib_hero_behaviors\lib_hero_behaviors.map
libraries\lib_object_lists\lib_object_lists.map
Are you saying this is the wrong method?
I know it works at least partially because I've added Frodo, Sam, and Elrond to the game and the AI spawns them automatically and they act normally (except for not using their special abilities). I figure if I can get Boromir's new ability to automatically work, I can get theirs working, too. Would you please try again to help me understand? Thanks.
#95
Posted 24 July 2012 - 07:02 PM
What I do is this;
Extract the Libraries.big into the main BFME folder, and save the .big file somewhere
Edit the files I want from there, so that WB will read all the edited files aswell
When I'm done, I take the files I've edited and place them into my mod working folder\.big, delete the rest of the extracted stuff and move Libraries.big back in place.
Or, if I'm doing alot of work, I keep it all there until I've tested it in-game and what-not.
The 4th Age version 0.8 has been released: Link
#96 Guest_BOO_YA_*
Posted 09 August 2012 - 07:13 PM
I've had to repost this several times now........................the page keeps failing every time i hit post........
The mod I'm using is Elven Alliance.
#97
Posted 11 August 2012 - 03:55 PM
#98
Posted 11 August 2012 - 04:12 PM
This isn't really an AI question. However, if you just want to change the command limits in the Elven Alliance (or Elven Alliance Community Edition), open data\ini\objects\gamedata1.ini and edit the command point values you see there. As far as changing build prices, the easiest thing would be probably be to go to the unit's or horde's ini file and change the "BuildCost" value to what you want.
#99
Posted 08 January 2013 - 11:57 AM
But, I've been thinking, what if the engine treats AI scripts the same way as code? As in, if something is missing from your mod's Library files, then it just uses the vanilla ones?
That would mean that anytime you need to do away with any scripts, you can't just delete them. And that you don't want to ever rename one, without replacing it with a fake one of the old name.
I've found that the best way to deal with them, is to make them duds, like this:
*** IF *** True. *** THEN *** Null operation. (Does nothing.)
And in addition, set the script as not active, and to deactivate, if somehow it did run.
It's solved my problem. I no longer have rogue scripts running.
Edited by Ganon, 08 January 2013 - 12:07 PM.
#100
Posted 08 January 2013 - 12:09 PM
Break dancing into the hearts of millions
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users