May 17, 2021, 09:35:56 AM

Author Topic: How to order a global retreat?  (Read 785 times)

AlsoKnownAs

  • Member
  • ***
  • Posts: 42
  • Having a drink in some bar far from Earth
    • View Profile
How to order a global retreat?
« on: April 11, 2010, 03:09:12 PM »
Hi everyone, hope you guys can help me out in this  :D .

I realize that my entire army does not retreat when I use the function;

Quote
AISetAttackState(player, e_attackState_Retreat);

Instead, only those that are in the attackWave retreats whereas the others who are coming to reinforce (called from the function AIWaveMerge(player, c_waveMain, c_waveAttack);) does not retreat and fought till they die if they are left behind or simply during the time when they are coming to merge with the attackWave.

Is there a way to call for a global retreat which applies to the merging wave and attack wave? Thanks in advance  ;D .

SuXue

  • Resident
  • **
  • Posts: 39
    • View Profile
Re: How to order a global retreat?
« Reply #1 on: April 12, 2010, 07:33:31 AM »
maybe you can try running this for all waves w
 AIWaveSetType(w, c_waveStateRetreat, AIWaveTargetGatherO(player, c_townMain))

AlsoKnownAs

  • Member
  • ***
  • Posts: 42
  • Having a drink in some bar far from Earth
    • View Profile
Re: How to order a global retreat?
« Reply #2 on: April 12, 2010, 08:15:49 AM »
Quote
 AIWaveSetType(w, c_waveStateRetreat, AIWaveTargetGatherO(player, c_townMain))

I've tried the above with no avail  :D , it seems like when a unit/unitgroup its planning to merge with a specific wave, it is somewhat designated a wave with specific integer/index attached to it (example: 14#0, 15#0, 16#0, 7#0 and etc...), completely random @_@. I'm not certain of this, but when you try to merge the main wave with the attack wave, the units that are on their journey will be displaced from its original main wave and placed in some temporary wave or something  ??? .

I can solve the problem by manually attaching these units to the wave, but that is not my objective. So, any help would very much be appreciated XD. Thanks SuXue, for helping  :D .

Kernel64

  • Sr. Member
  • ****
  • Posts: 207
    • View Profile
Re: How to order a global retreat?
« Reply #3 on: April 12, 2010, 01:23:01 PM »
This: AIWaveTargetGatherD(..) could be your problem. Use this target only if you wish the AI to leave units behind from the wave you're controlling.

A retreat with this as target will cause the AI to leave a portion of its force behind.