# Research

Grammar — Research upgrade upgradeType|Upgrade in player player’s town town with priority priority
FlagsNative | Action

Instructs the AI to research the specified upgrade.

# Arguments

  • int — Player
  • int — Priority
  • int — Town
  • string<gamelink::Upgrade> — Upgrade Type

Returns — void

native void AIResearch(
	int player,
	int priority,
	int town,
	string aliasUpgradeType,
);

Category: AI Advanced / Construction / Actions

# Examples

campaigns/libertystory.sc2campaignbase.sc2data/TriggerLibs/CampaignLib.galaxy:852

    autoF8AEAD25_n = lp_count;
    for (autoF8AEAD25_i = 1; autoF8AEAD25_i <= autoF8AEAD25_n; autoF8AEAD25_i += 1) {
        AIResearch(lp_player, 4, -1, lp_upgrade);
    }
}

campaigns/swarmstory.sc2campaignbase.sc2data/TriggerLibs/SwarmCampaignLib.galaxy:3927

    autoE2BA9C4E_n = lp_count;
    for (autoE2BA9C4E_i = 1; autoE2BA9C4E_i <= autoE2BA9C4E_n; autoE2BA9C4E_i += 1) {
        AIResearch(lp_player, 4, -1, lp_upgrade);
    }
}

campaigns/voidstory.sc2campaignbase.sc2data/TriggerLibs/VoidCampaignMissionLib.galaxy:2492

    auto2117ABBB_n = lp_count;
    for (auto2117ABBB_i = 1; auto2117ABBB_i <= auto2117ABBB_n; auto2117ABBB_i += 1) {
        AIResearch(lp_player, 4, -1, lp_upgrade);
    }
}

mods/missionpacks/novacampaign.sc2modbase.sc2data/LibNCMI.galaxy:2837

    auto2117ABBB_n = lp_count;
    for (auto2117ABBB_i = 1; auto2117ABBB_i <= auto2117ABBB_n; auto2117ABBB_i += 1) {
        AIResearch(lp_player, 4, -1, lp_upgrade);
    }
}

mods/starcoop/starcoop.sc2modbase.sc2data/LibCOMI.galaxy:9066

    auto2117ABBB_n = lp_count;
    for (auto2117ABBB_i = 1; auto2117ABBB_i <= auto2117ABBB_n; auto2117ABBB_i += 1) {
        AIResearch(lp_player, 4, -1, lp_upgrade);
    }
}

mods/voidprologue.sc2modbase.sc2data/LibA3DDD02B.galaxy:2716

    autoE2BA9C4E_n = lp_count;
    for (autoE2BA9C4E_i = 1; autoE2BA9C4E_i <= autoE2BA9C4E_n; autoE2BA9C4E_i += 1) {
        AIResearch(lp_player, 4, -1, lp_upgrade);
    }
}

mods/warcoop/warmeleeai.sc2modbase.sc2data/TriggerLibs/Orc/Orc.galaxy:28

    if((AIDefaultGetFirstMissingReq(player, aliasType)==null)&&(count>0)){
        //TriggerDebugOutput(1, StringToText("passed"), true);
        AIResearch(player,0,-1,aliasType);
    }
}