# Research
Grammar — Research upgrade upgradeType|Upgrade in player player’s town town with priority priority
Flags —Native
|Action
Instructs the AI to research the specified upgrade.
# Arguments
int
— Playerint
— Priorityint
— Townstring
<gamelink::Upgrade> — Upgrade Type
Returns — void
native void AIResearch(
int player,
int priority,
int town,
string aliasUpgradeType,
);
# Related
Category: AI Advanced / Construction / Actions
- Build —
void
— AIBuild - Train —
void
— AITrain - Research —
void
— AIResearch - Make Always —
void
— AIMakeAlways - Make Once —
void
— AIMakeOnce - Clear Build Queue —
void
— AIClearBuildQueue - Clear Train Queue —
void
— AIClearTrainQueue - Clear Research Queue —
void
— AIClearResearchQueue - Clear Stock —
void
— AIClearStock - Enable Stock —
void
— AIEnableStock - Set StockEx —
void
— AISetStockEx - Set Stock —
void
— AISetStock - Set StockOpt —
void
— AISetStockOpt - Set StockUnitNext —
void
— AISetStockUnitNext - Set StockTown —
bool
— AISetStockTown - Set StockExpand —
bool
— AISetStockExpand - Set StockAlias —
void
— AISetStockAlias - Set StockFree —
void
— AISetStockFree - Default Economy —
void
— AIDefaultEconomy - Default Expansion —
void
— AIDefaultExpansion
# Examples
campaigns/libertystory.sc2campaign — base.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.sc2campaign — base.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.sc2campaign — base.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.sc2mod — base.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.sc2mod — base.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.sc2mod — base.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.sc2mod — base.sc2data/TriggerLibs/Orc/Orc.galaxy:28
if((AIDefaultGetFirstMissingReq(player, aliasType)==null)&&(count>0)){
//TriggerDebugOutput(1, StringToText("passed"), true);
AIResearch(player,0,-1,aliasType);
}
}