Stygs 25 Posted May 17, 2017 Hi there. A couple of days ago, I had the idea of preventing the AI from using super weapons on certain buildings in the hope that this would make testing stuff easier. So I went ahead, added an ForbiddenObjectFilter & NO_FORBIDDEN_OBJECTS to the Superweapons and tested it on my test maps - and it worked great, turning the cursor red anywhere near the buildings. Then I tested it against the skirmish AI whereas the AI fired a Nuke directly at the building that should protect me against nukes. This raised a couple of questions: WTF? Why does the filter seem to stop humans, but the AI can ignore it? Is there any way to change that? Share this post Link to post
Lauren 77 Posted May 17, 2017 I would just use the mechanic used in the Temple Prime mission. Share this post Link to post
Stygs 25 Posted May 17, 2017 (edited) Just tried that: 1. You get a red decal around the area, even when you dont select the building and you color is not red. During a skirmish game, the ring was suddenly in the left lower corner of the map (no idea why). 2. It worked against my own Ion Cannon, I couldnt fire it anywhere near the building. 3. The AI completly ignored it and still fired their Ion Cannon right next to the building. I think I prefer the ForbiddenObjectFilter, at least that doenst have this annoying red decal around it. Never knew the AI could simply ignore that kind of limitations. Edited May 17, 2017 by Stygs Share this post Link to post
Madin 10 Posted May 17, 2017 (edited) 3 hours ago, Stygs said: Hi there. A couple of days ago, I had the idea of preventing the AI from using super weapons on certain buildings in the hope that this would make testing stuff easier. So I went ahead, added an ForbiddenObjectFilter & NO_FORBIDDEN_OBJECTS to the Superweapons and tested it on my test maps - and it worked great, turning the cursor red anywhere near the buildings. Then I tested it against the skirmish AI whereas the AI fired a Nuke directly at the building that should protect me against nukes. This raised a couple of questions: 1. WTF? 2. Why does the filter seem to stop humans, but the AI can ignore it? 3. Is there any way to change that? This is taken from a code article on the 3rd age website: "The use of 'AISpecialPowerUpdate' is limited though, for one by the limited number of unmodifiable 'SpecialPowerAIType' tags in the game. The other thing is that this Behavior overrides certain limitations that a normal human player would have when using that button. The 'AISpecialPowerUpdate' does only check if the ascociated SpecialPower is unpaused. That's it. If there are modelconditions defined in the CommandButton itself or in the SpecialPowerUpdate of the ascociated SpecialPower that usually restrict it's use, like for example 'ForbiddenConditions = MOUNTED', the AI completely ignores those restrictions/requirements and uses the CommandButton anyway. There are some tricks to get around this though. Sometimes it seems as if the AI doesn't care if the unit in question even has the CommandButton in the CommandSet. As long as the CommandButton itself is defined somewhere and ascociated with a SpecialPower or WeaponSlot that the Object in question possesses, it WILL use the CommandButton, no matter if it is actually listed in the Object's Commandset! I cannot confirm when it happens, but it does." 1. The 'AISpecialPowerUpdate' is terrible, you know this. 2. The AI is not checking those filters (for most 'SpecialPowerAIType', for some it seems to make a difference). Some of the 'SpecialPowerAIType' allow for you to define 'UnitKindof', or 'Ally\EnemyUnitInclude\Exclude'. This is the main place where you can define any kind of 'filter' that the AI will acknowledge (if the 'SpecialPowerAIType' allows it). Many of the 'SpecialPowerAIType' are hardcoded, and do not allow you to to add any kind of 'filter'. 3. Do not use the 'SPECIAL_POWER_SUPERWEAPON' 'SpecialPowerAIType'. Use the 'SPECIAL_POWER_ENEMY_TYPE_KILLER_STRUCTURES' or 'SPECIAL_POWER_RANGED_AOE_ATTACK' , 'SpecialPowerAIType'. Then use the 'UnitKindof', or 'Ally\EnemyUnitInclude\Exclude' to try and get the AI to use the special power correctly. Remember that this is where you make a filter for the AI, anywhere outside of the 'AISpecialPowerUpdate' is for a human player (for most 'SpecialPowerAIType', for some it seems to make a difference). Just general info, I take it you will do what Lauren wrote. Edited May 17, 2017 by Madin Clarification Share this post Link to post
Stygs 25 Posted May 17, 2017 I am aware that the AISpecialPowerUpdate is rather limited - I just never assumed the AI can simply target objects even when the specialpower itself forbidds it. Kinda assumed the AI would then just wait until the target becomes addvaible again :/ Share this post Link to post