April 10, 2021, 05:11:28 PM

Author Topic: AI scripts Not Working with Patch 9?  (Read 2264 times)

Kernel64

  • Sr. Member
  • ****
  • Posts: 207
    • View Profile
AI scripts Not Working with Patch 9?
« on: April 22, 2010, 10:08:04 PM »
Are you guys having problems with the AI? I can't seem to get them to work.

ptanhkhoa

  • Member
  • ***
  • Posts: 90
    • View Profile
Re: AI scripts Not Working with Patch 9?
« Reply #1 on: April 22, 2010, 10:48:24 PM »
Same here  :-[ .

Kernel64

  • Sr. Member
  • ****
  • Posts: 207
    • View Profile
Re: AI scripts Not Working with Patch 9?
« Reply #2 on: April 22, 2010, 10:51:13 PM »
I'm trying this one:

It seems that the AI stuff within the core.sc2data and all that stuff were updated as well. I'm extracting everything from the patch file and manually putting them together.

I'll report back.

Edit:

Now having problems with ShadowFlare's WinMpQ
« Last Edit: April 22, 2010, 11:03:59 PM by Kernel64 »

gardenofaiur

  • GardenOfAiur.com
  • Resident
  • **
  • Posts: 17
  • The Blood Of The Fallen - GardenOfAiur.com
    • View Profile
    • Garden Of Aiur
Re: AI scripts Not Working with Patch 9?
« Reply #3 on: April 22, 2010, 11:12:04 PM »
yup, patch 9 breaks AI. Which is a shame, because now we can launch custom maps.

I've already done a clone of Garden Of Aiur, but the launchers go bizerk with player numbers.
[Garden Of Aiur] - http://www.gardenofaiur.com - The Blood Of The Fallen

Kernel64

  • Sr. Member
  • ****
  • Posts: 207
    • View Profile
Re: AI scripts Not Working with Patch 9?
« Reply #4 on: April 22, 2010, 11:22:48 PM »
yup, patch 9 breaks AI. Which is a shame, because now we can launch custom maps.

I've already done a clone of Garden Of Aiur, but the launchers go bizerk with player numbers.

I think there were just a few tweaks like the NativesLib in core/base.sc2data will try reinstalling since WinMPQ is not working.

edit:
I'm stuck. There's this error that says Invalid mainstate or something, even with the default AI.

Somehow, I'm also seeing problems when compiling a .galaxy from within the Editor. Not sure if they're both related, or if the editor supports script editing fully yet.

You guys have any luck?
« Last Edit: April 23, 2010, 07:56:43 AM by Kernel64 »

ptanhkhoa

  • Member
  • ***
  • Posts: 90
    • View Profile
Re: AI scripts Not Working with Patch 9?
« Reply #5 on: April 23, 2010, 08:41:41 AM »
I think the problem within the launcher, there are some extensive function that the launcher do not supported. Also I think they change the way to implement code too, I even didn't see the Exit Button Screen.
 Let wait for Vernam update launcher tonight, i'm eager to use the new function in this patch which very interesting  :D .

Kernel64

  • Sr. Member
  • ****
  • Posts: 207
    • View Profile
Re: AI scripts Not Working with Patch 9?
« Reply #6 on: April 23, 2010, 09:12:19 AM »
I'm using the LazyLaunch 2.0 and no other gui launchers. Still, I'm getting the error.

I suspect, that AI.galaxy is not being parsed.

sopen55

  • Member
  • ***
  • Posts: 41
    • View Profile
Re: AI scripts Not Working with Patch 9?
« Reply #7 on: April 23, 2010, 09:25:27 AM »
im goin with kernels theory.. i think its something abote the nativeslib cause i get an error related to that certain file. it also says the parameter is incorrect in timer natives

ptanhkhoa

  • Member
  • ***
  • Posts: 90
    • View Profile
Re: AI scripts Not Working with Patch 9?
« Reply #8 on: April 23, 2010, 10:02:10 AM »
haha , I found it out Kernel, the Melee AI in liberitymod galaxy don't have the AISetMainState Function .
Quote
void AIMeleeStart (int player) {
    point targDPoint;
    point targOPoint;
    wavetarget targD;
    wavetarget targO;

    if (DEBUG) {
        DebugMeleeInit();
    }

    AIStart(player, false, DifficultyAPM(PlayerDifficulty(player)));

    if (PlayerDifficulty(player) >= c_skirCheater) {
        AIHarvestBonus(player, 2.0);
    }

    AISetDifficulty(player, c_diffNormalVision, (PlayerDifficulty(player) != c_skirCheater));
    AISetDifficulty(player, c_diffLimitAPM,     (PlayerDifficulty(player) != c_skirCheater));

    AISetDifficulty(player, c_diffSpotChangelings,   (PlayerDifficulty(player) >= c_skirVeryHard));
    AISetDifficulty(player, c_diffWaveAvoidDanger,   (PlayerDifficulty(player) >= c_skirHard));
    AISetDifficulty(player, c_diffFleeDamage,        (PlayerDifficulty(player) >= c_skirHard));
    AISetDifficulty(player, c_diffEarlyDefenseScout, (PlayerDifficulty(player) >= c_skirHard));
    AISetDifficulty(player, c_diffUseExtraScouts,    (PlayerDifficulty(player) >= c_skirHard));
    AISetDifficulty(player, c_diffHoldAtIdleChokes,  (PlayerDifficulty(player) >= c_skirHard));
    AISetDifficulty(player, c_diffPressForward,      (PlayerDifficulty(player) >= c_skirMedium));
    AISetDifficulty(player, c_diffFleeWorkers,       (PlayerDifficulty(player) >= c_skirMedium));
    AISetDifficulty(player, c_diffFleeDanger,        (PlayerDifficulty(player) >= c_skirMedium));

    AISetDifficulty(player, c_diffRepairDamage, true);
    AISetDifficulty(player, c_diffOptimizeGas, true);
    AISetDifficulty(player, c_diffDefendWithPeons, true);
    AISetDifficulty(player, c_diffEnableDangerMap, true);
    AISetDifficulty(player, c_diffNormalTargetPrio, true);
    AISetDifficulty(player, c_diffAllowResourceReq, true);

    AISetDifficulty(player, c_diffAutoLoadBunkers, false);
    AISetDifficulty(player, c_diffEarlyGameRepair, false);

    //AISetFlag(player, e_flagsRunScared, AIDiffThreshold(player, false, c_skirVeryHard, true));
    AISetFlag(player, e_flagsRunScared, false); // TODO fix scared and re-add this

    AISetFlag(player, e_flagsLateScout, false);
    AISetFlag(player, e_flagsClearObs, false);

    AIDeclareTown(player, c_townOne, PlayerStartLocation(player));
    AISetMainTown(player, c_townOne);
    AIHarvest(player, c_townOne);
    AISetNumScouts(player, 1);
    AIScout(player);
    AISetAllStates(player, 1);
   
    targDPoint = AIWaveTargetGatherDPoint(player, c_townMain);
    targOPoint = AIWaveTargetGatherOPoint(player, c_townMain);
    targD = AIWaveTargetGatherD(player, c_townMain);
    targO = AIWaveTargetGatherO(player, c_townMain);

    AIWaveSet(player, c_waveMain,       AIWaveCreate(AIWaveInfoCreate(), player, targOPoint));
    AIWaveSet(player, c_waveAttack,     AIWaveCreate(AIWaveInfoCreate(), player, targOPoint));
    AIWaveSet(player, c_waveDivert1,    AIWaveCreate(AIWaveInfoCreate(), player, targOPoint));
    AIWaveSet(player, c_waveDivert2,    AIWaveCreate(AIWaveInfoCreate(), player, targOPoint));
    AIWaveSet(player, c_waveClearObs,   AIWaveCreate(AIWaveInfoCreate(), player, targOPoint));
    AIWaveSet(player, c_waveHome,       AIWaveCreate(AIWaveInfoCreate(), player, targDPoint));
    AIWaveSet(player, c_waveDefend,     AIWaveCreate(AIWaveInfoCreate(), player, targDPoint));

    AIWaveSetType(AIWaveGet(player, c_waveMain),     c_waveStateIdle, targO);
    AIWaveSetType(AIWaveGet(player, c_waveAttack),   c_waveStateIdle, targO);
    AIWaveSetType(AIWaveGet(player, c_waveDivert1),  c_waveStateIdle, targO);
    AIWaveSetType(AIWaveGet(player, c_waveDivert2),  c_waveStateIdle, targO);
    AIWaveSetType(AIWaveGet(player, c_waveClearObs), c_waveStateIdle, targO);
    AIWaveSetType(AIWaveGet(player, c_waveHome),     c_waveStateIdle, targD);
    AIWaveSetType(AIWaveGet(player, c_waveDefend),   c_waveStateIdle, targD);

    AISetMaxBestAttackersLimit(player, AIMeleeDiffSelect(player, 1, 1, 2, 4, 6, 8) );

    AITransportIgnore(player, "VikingAssault");
    AITransportSetPanic(player, 0.6);
    AITransportSetReturn(player, targDPoint);
   
    AISpecifiedMakers();
    AISpecifiedHealers(player);
    AISetDefaultCombatFlags(player, true);
    AIAddDetectionDangerUnits(player);

    //AISetNukeConstants(player);
}

Instead of this he uses the AISetAllStates Function, maybe the Lazy Launcher do not know to call it from the core, just change it to the old AISetMainStates function.

I found this AISetALLState in current AI.galaxy script in the Core
Quote
native void AISetAllStates (int player, int state);

Like you said, AI.galaxy doesn not parsed, . May be I should try to copy that to the Mod folder.
I'm backing up the Patch.Archive , 800 Mb =.=' , modified something then report to you guys.
« Last Edit: April 23, 2010, 10:34:44 AM by ptanhkhoa »

AlsoKnownAs

  • Member
  • ***
  • Posts: 42
  • Having a drink in some bar far from Earth
    • View Profile
Re: AI scripts Not Working with Patch 9?
« Reply #9 on: April 23, 2010, 08:09:01 PM »
A week gone and everything went wild  ??? ? So we are currently stuck with Blizzard's default AI until we get an appropriate launcher for patch 9  :( ?

mtma15

  • New Member
  • *
  • Posts: 4
    • View Profile
Re: AI scripts Not Working with Patch 9?
« Reply #10 on: April 23, 2010, 08:30:15 PM »
A week gone and everything went wild  ??? ? So we are currently stuck with Blizzard's default AI until we get an appropriate launcher for patch 9  :( ?

What blizzard AI are you talking about?

Kernel64

  • Sr. Member
  • ****
  • Posts: 207
    • View Profile
Re: AI scripts Not Working with Patch 9?
« Reply #11 on: April 24, 2010, 11:53:30 PM »
Strange. Initializing and running a Melee AI from a custom map trigger works without problems.

Somethings up. It's either they changed the map structure, or this has something to do with something else.

Someone should take a look from this angle, since I have zero idea how lazylaunch works.

Custom map trigger has this for melee start:

AIMeleeStart(3); where 3 is the AI player slot.


With the pre patch 9-10 maps:

MeleeInitAI();