# Wave Time Since Combat
Grammar — How long since the specified wave waveRef has been in combat
Flags —Native
|Function
Returns how long since the specified wave has been in combat.
# Arguments
wave
— Wave
Returns — int
native int AIWaveGetTimeSinceCombat(wave w);
# Related
Category: AI Advanced / Waves / Functions
- Create Wave Info —
waveinfo
— AIWaveInfoCreate - Create Wave Info From Wave —
waveinfo
— AIWaveInfo - Create Wave —
wave
— AIWaveCreate - Wave Unit Count —
int
— AIWaveUnitCount - Wave State —
int
— AIWaveState - Wave Target Unit —
wavetarget
— AIWaveTargetUnit - Wave Target UnitGroup —
wavetarget
— AIWaveTargetUnitGroup - Wave Target Unit Point —
wavetarget
— AIWaveTargetUnitPoint - Wave Target Point —
wavetarget
— AIWaveTargetPoint - Wave Target Player —
wavetarget
— AIWaveTargetPlayer - Wave Target Melee —
wavetarget
— AIWaveTargetMelee - Wave Target Melee Harass —
wavetarget
— AIWaveTargetMeleeHarass - Wave Target Merge —
wavetarget
— AIWaveTargetMerge - Wave Target Patrol —
wavetarget
— AIWaveTargetPatrol - Wave Target Escort —
wavetarget
— AIWaveTargetEscort - Wave Target Escort No Leash —
wavetarget
— AIWaveTargetEscortNL - Wave Target Gather Offense —
wavetarget
— AIWaveTargetGatherO - Wave Target Gather Defense —
wavetarget
— AIWaveTargetGatherD - Wave Target Harass Retreat —
wavetarget
— AIWaveHarassRetreat - Wave Target Region —
wavetarget
— AIWaveTargetRegion - Wave Get Target —
wavetarget
— AIWaveGetTarget - Is Wave In Combat —
bool
— AIWaveIsInCombat - Wave Time In Combat —
int
— AIWaveGetTimeInCombat - Wave Time Since Combat —
int
— AIWaveGetTimeSinceCombat - Wave Time Since Ordered —
int
— AIWaveGetTimeSinceOrdered - Wave Eval —
int
— AIWaveEval - Wave Eval Ratio —
int
— AIWaveEvalRatio - Eval Ratio —
int
— AIEvalRatio - Wave Get —
wave
— AIWaveGet - Wave Type —
int
— AIWaveType - Get Best Attack Target Point —
point
— AIGetBestTarget - Wave To String —
string
— AIWaveToString - Wave To Text —
text
— AIWaveToText
# Examples
mods/core.sc2mod — base.sc2data/TriggerLibs/MeleeWaveAI.galaxy:62
", ratio=" + IntToString(AIWaveEvalRatio(w, c_evalRange)) +
", combat=" + IntToString(AIWaveGetTimeInCombat(w)) +
", safe=" + IntToString(AIWaveGetTimeSinceCombat(w)) +
", threat=" + threat
);
mods/core.sc2mod — base.sc2data/TriggerLibs/MeleeWaveAI.galaxy:544
}
}
else if (AIWaveGetTimeSinceCombat(w) < 30) {
// recently in combat
if ((distEnemy >= 0 )&& (distEnemy * 6 < distFriend * 4)) {
mods/core.sc2mod — base.sc2data/TriggerLibs/MeleeWaveAI.galaxy:579
AISetAttackState(player, e_attackState_Attack);
}
else if (count >= 15 && AIGetFlag(player, e_flagsTimeout) && AIWaveGetTimeSinceCombat(w) >= 150) {
AISetAttackState(player, e_attackState_Attack);
}
mods/core.sc2mod — base.sc2data/TriggerLibs/MeleeWaveAI.galaxy:589
AISetAttackState(player, e_attackState_Attack);
}
else if (count >= 20 && AIGetFlag(player, e_flagsTimeout) && AIWaveGetTimeSinceCombat(w) >= 300 - 4*count) {
AISetAttackState(player, e_attackState_Attack);
}
mods/core.sc2mod — base.sc2data/TriggerLibs/MeleeWaveAI.galaxy:596
// if the last attack was a failure (we either retreated right away or lost more then we killed)
if (AIWaveGetTimeSinceCombat(w) >= 60) {
if (count >= 8 && count < 12) {
if (WaveTestUseDropAttack(player,w)) {
mods/core.sc2mod — base.sc2data/TriggerLibs/MeleeWaveAI.galaxy:779
AISetAttackState(player, e_attackState_Attack);
}
else if (AIGetFlag(player, e_flagsTimeout) && AIWaveGetTimeSinceCombat(w) >= 600 - 2*count) {
AISetAttackState(player, e_attackState_Attack);
}
mods/warcoop/warmeleeai.sc2mod — base.sc2data/TriggerLibs/MeleeWaveAI.galaxy:192
", ratio=" + IntToString(AIWaveEvalRatio(w, c_evalRange)) +
", combat=" + IntToString(AIWaveGetTimeInCombat(w)) +
", safe=" + IntToString(AIWaveGetTimeSinceCombat(w)) +
", threat=" + threat
);
mods/warcoop/warmeleeai.sc2mod — base.sc2data/TriggerLibs/MeleeWaveAI.galaxy:634
}
}
else if (AIWaveGetTimeSinceCombat(w) < 30) {
// recently in combat
if ((distEnemy >= 0 )&& (distEnemy * 6 < distFriend * 4)) {
mods/warcoop/warmeleeai.sc2mod — base.sc2data/TriggerLibs/MeleeWaveAI.galaxy:668
AISetAttackState(player, e_attackState_Attack);
}
else if (count >= 10 && AIGetFlag(player, e_flagsTimeout) && AIWaveGetTimeSinceCombat(w) >= 120) {
AISetAttackState(player, e_attackState_Attack);
}
mods/warcoop/warmeleeai.sc2mod — base.sc2data/TriggerLibs/MeleeWaveAI.galaxy:678
AISetAttackState(player, e_attackState_Attack);
}
else if (count >= 15 && AIGetFlag(player, e_flagsTimeout) && AIWaveGetTimeSinceCombat(w) >= 300 - 5*count) {
AISetAttackState(player, e_attackState_Attack);
}
mods/warcoop/warmeleeai.sc2mod — base.sc2data/TriggerLibs/MeleeWaveAI.galaxy:875
AISetAttackState(player, e_attackState_Attack);
}
else if (AIGetFlag(player, e_flagsTimeout) && AIWaveGetTimeSinceCombat(w) >= 300-10*count) {
AISetAttackState(player, e_attackState_Attack);
}