How do I make the Rohan AI unable to build Entmoots?
#1
Posted 20 December 2011 - 03:03 AM
I also have a problem that is quite similar to the one above, it's about a building you can build on the economy plot in addition to the already existing resource structures.
So my question is where (in which file) do I have to change the AI behavior concerning those economy plot structures? The problem is that the AI builds that new building on ALL economy plots and what I want to do is to make the AI only build it on a few occasions.
Hopefully my text wasn't too confusing and you understood what I meant.
#2
Posted 23 January 2012 - 10:45 AM
Lookie here:
*** IF *** 4000 is Less Than or Equal the number of credits possessed by Player '<This Player>' *AND* Unit 'ECON_FLAG_16' is unpackable for the player: Player '<This Player>'. *** THEN *** Unpack the base: Unit 'ECON_FLAG_16'and reference it as UnitRef 'AI_ECON_PLOT_16'.
*** IF *** 4000 is Greater Than the number of credits possessed by Player '<This Player>' *AND* Unit 'ECON_FLAG_16' is unpackable for the player: Player '<This Player>'. *** THEN *** Unit 'ECON_FLAG_16' use Ability 'Command_UnpackExplicitRohanFarm'.
If you look at the code, the two unpack buttons are coded differently:
CommandButton Command_ConstructEntMoot Command = CASTLE_UNPACK Object = EntMoot TextLabel = CONTROLBAR:ConstructEntMoot ButtonImage = BREntMoot ButtonBorderType = BUILD ; Identifier for the User as to what kind of button this is DescriptLabel = CONTROLBAR:ToolTipEntMoot Radial = Yes End
CommandButton Command_UnpackExplicitRohanFarm Command = CASTLE_UNPACK_EXPLICIT_OBJECT TextLabel = CONTROLBAR:UnpackRohanFarm Object = RohanFarmMultiplayer ButtonImage = BCFarm ButtonBorderType = BUILD ; Identifier for the User as to what kind of button this is DescriptLabel = CONTROLBAR:ToolTipRohanFarmUnpack Radial = Yes End
Now then, if you look, the button to unpack a moot is a "CASTLE_UNPACK", and the one for the farm is a "CASTLE_UNPACK_EXPLICIT_OBJECT".
This seems to directly correspond to the AI scripts.
*** THEN *** Unpack the base: Unit 'ECON_FLAG_16'and reference it as UnitRef 'AI_ECON_PLOT_16'.
*** THEN *** Unit 'ECON_FLAG_16' use Ability 'Command_UnpackExplicitRohanFarm'.
I think these may be the scripts you need to edit. In "ai_rohan.map".
Meaning, remove all the ones that don't build a farm.
If that doesn't fix your problem, let me know, and I can look into it some more.
As for your second question, you should be able to just modify the conditions of these scripts to check how many instances of the building there are already. And decide from there whether another one should be built.
Edited by Ganon, 23 January 2012 - 11:20 AM.
#3
Posted 22 March 2012 - 01:00 PM
Thanks Ganon.
Edited by Baki, 29 March 2012 - 08:40 PM.
#4
Posted 12 January 2016 - 01:35 AM
Hi guys. I want to ask something under this topic. I give infinite money to AI. So, rohan builds entmoot at the begining of game. It makes nearly 20 ent. How can I make rohan build entmoot at mid or late game (not in early game) ? Also rohan must build less entmoot.
Edited by numan, 12 January 2016 - 01:37 AM.
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users