Posted: Fri Dec 04, 2015 7:04 am Post subject:
AI Ore Miner problem
Can anyone enlighten me as to why the AI automatically builds a miner whenever it has a War Factory available? AI Triggers are disabled and Auto-Production isn't on. This makes some of my missions look a bit odd, as there is no ore in those maps. How do I stop the AI from doing this?
Also, why is it that this automatically-created miner doesn't mine ore, while pre-placed miners do? How might I make the produced miner mine ore?Thanks. QUICK_EDIT
Thanks, that worked, the AI stopped building the miner.
This brings me to another problem though, how do I get the AI to automatically replace the miner whenever it is destroyed? That is, I only want one active miner per refinery at any time.
I tried setting HarvestersPerRefinery=1,1,1 then adding a miner to the map. I enabled AI Triggers, Production and Autocreate. The AI did not build a miner until I had destroyed the first miner. However, this new miner did not automatically harvest; it just sat outside the factory doing nothing. In addition, after I destroyed the miner that the AI built, the AI did not build a new miner to replace it.
Do I need to manually set up a system of teams, scripts and taskforces to make the AI build a miner whenever the previous one is destroyed, and to get it to harvest ore?
Seems a tad complicated if that's the case, is there a simpler way to get the AI to do what I want it to? That is, I want there to always be one harvester per refinery; the AI must build new miners to replace the ones I destroy, and these miners must auto-harvest. QUICK_EDIT
Are you using the standard RA2 miners or are you using a new custom made one? If so do the original ones act in the same manor as your new one?
If there isn't a patch of ore nearby a harvester wont activate. TiberiumLongScan= is used to control the distance a harvester will look for ore, try increasing it or moving the ore closer to your base.
Hover and flying units also wont automatically harvest and need to be manually told to start. But that is only for human players, the AI normally activates them without any problems.
To make the AI replace any harvesters consistently your need to make an AI trigger/team/script. There are already scripts in the aimd.ini for the Chrono & War Miner on medium and hard difficulties. _________________
Regarding the created harvester not harvesting ore, looks like the problem was that the ore field was too far away; moving it closer fixed that. Thanks for that tip!
If I'm understanding you correctly regarding the scripts in the .ini file, the existing scripts should fix my problem? (The mission is being played on hard mode, and the harvester in question is the Chrono Miner)
I'm still a little confused though. If the existing scripts should fix my problem, why is it that the AI doesn't rebuild the Chrono Miner after I destroy the first one it constructs? Or did you mean that I need to create new AI triggers altogether (and use the existing ones as a reference)? QUICK_EDIT
I was afraid that was the case. Thanks for the assistance!
Side note: I don't suppose you know of any method to add an 'event' that has the effect of [When unit X is at 100% health]? I know that the existing trigger events have things like [First damaged/Quarter health], but I was thinking of trigger that required you to restore the health of a unit to activate an action, rather than damaging the unit. I can't use Engineers to fake this hp-restoring 'event' as the object this tag will be attached to is a unit, not a building. Is such a trigger possible? QUICK_EDIT
None of those events work the way I want them to, but I eventually managed to find a satisfactory workaround for what I wanted using the PoweredUnit and PowersUnit command. I had initially wanted to be able to use the repair of a vehicle as an event, but what I found works too. QUICK_EDIT
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You can download files in this forum