Posted: Fri Jan 06, 2017 3:46 pm Post subject:
FreeUnit AI questions
Good day.
I have some questions regarding the FreeUnit logic, I've uses this to spawn an attack vehicle instead of a harvester unit, and the unit will not attack even when attacked, unless you manually command and move them.
Now there is a problem with AI controlled player as they would build the buiding and completely ignored the free unit, the free unit would just sit there doing nothing even when attacked
Here is what I was trying to achieve, I would like the freeunit regarded as a crate goodie unit, which AI would treat them as a crate goodie unit and use that specific AI script.. don't know much about this ai script but I can see ai controlled crate goodie unit will always return to their base and defend when attacked.
Also one thing, I've tried the chronowarp to teleport the freeunit from AI side, then after that AI can control them which put them in guard mode.
Is there anything I should try in rulesmd before looking at the very complex aimd as I never touch them before. Or it is an impossible task? QUICK_EDIT
DefaultToGuardArea=yes could be useful in this case, but ultimately you'll have to make AI scripts use that unit.
Have been looking at the aimd editing guide and... it was too complex for me
Anyway I've found a workaround by accident, the AI will somehow recognize a cloaking=yes unit, so I just clone a few existing unit and give them the ability to cloak, and assign them as FreeUnit, so now the AI will use the FreeUnit to guard their base when attacked. Must be some default base defense script, they will always sit in the base.
But then this is only for the ai controlled player, but for human player, be it cloaked or not, I still have to manually move the unit to "wake" them up.. else they would just sit there and wouldn't retaliate against enemy in it's weapon range. QUICK_EDIT
Funnily enough, this bug doesn't exist for harvies. Then again, maybe Westwood did some hardcoding to fix this, but only for harvesters _________________ One and only developer of the Command & Conquer Dune "C&C D" mod.
m7 wrote:
I tend to release things I create so that assets are never lost to hard drive problems, accidental deletion, or me having to pretend to care about rippers taking things from my project when it is done.
Funnily enough, this bug doesn't exist for harvies. Then again, maybe Westwood did some hardcoding to fix this, but only for harvesters
Yeah, I think the free unit logic supposedly only work for unit that has a harvester tag, as I could remember somewhere I've read the harvester has a default guard range of 255.. but then you can use the FreeUnit=? to spawn whatever vehicle you want next to the building..
As for the ai editing, so far I only learned to change the number and type of vehicle ai will create, attack what sort of stuff, such as harvester or specific building etc.. need more time to understand the rest of the stuff.
Also I've notices one thing after ai build the building that gives a free unit that have cloaking ability, when the cloaked unit appear it would first reveal itself then after a split second it become conceal and ai will immediately command the unit to "scatter" away from the spawn spot. I think this is due to the ai thinks that it is a naval unit as the cloaking logic only used for naval unit in RA/YR, so they somehow recognized it and it is how the naval yard spawn unit, how they appear aside etc.
Btw, adding the harvester=yes tag to the unit will fix this problem, but then I have to add ; infront of "oreminerunderattack" in evamd to disable the harvester under attack warning voice message since it is getting a little bit annoying , but you will still be getting the harvester position in minimap... 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