|
发表于 2012-8-18 02:27:05
|
显示全部楼层
如果你想要AI能够自动修造你的地狱火
1)你可以将“食尸鬼”的参数和模型都修改成和“地狱火”一样,使其成为假的“地狱火”
然后电脑想修食尸鬼的时候就会修地狱火了
2)你可以使用“AI编辑器”自己制作一个AI
“AI编辑器”是一个简单的工具,研究一下暴雪提供的那两个AI示例你就能学会它
3)什么?自己制作的AI太傻了,你想要修改暴雪官方提供的AI吗?
很好,那么就让我们走进科学......
魔兽标准对战AI就放在“war3patch.mpq”里面,你可以使用Mpq工具打开它
其中script\\undead.ai就是不死族的AI文件
想要修改ai文件的话,“AI编辑器”是帮不了你的,因为ai编辑器所能编辑的文件是wai文件
你需要使用“记事本”来打开它
[jass]
function build_sequence takes nothing returns nothing
local integer WG2
call InitBuildArray()
if basic_opening then
call MeleeTownHall( 0, NECROPOLIS_1 )//城镇大厅
call SetBuildUnit( 1, ACOLYTE )//侍僧
call SetBuildUnit( 1, UNDEAD_MINE )//不死族金矿
call SetBuildNext( 5, ACOLYTE )//补到5个侍僧
call SetBuildUnit( 1, CRYPT )//地穴
call SetBuildUnit( 1, GHOUL )//食尸鬼
call SetBuildUnit( 1, ZIGGURAT_1 )//通灵塔
call SetBuildUnit( 1, UNDEAD_ALTAR )//祭坛
call SetBuildUnit( 2, GHOUL )//食尸鬼
call SetBuildUnit( 2, ZIGGURAT_1 )//通灵塔
call SetBuildUnit( 3, GHOUL )
call SetBuildUnit( 1, hero_id )
call SetBuildUnit( 6, GHOUL )
call SetBuildUpgr( 1, UPG_CANNIBALIZE )
call SetBuildUnit( 1, GRAVEYARD )
call SetBuildUnit( 7, GHOUL )
call SetBuildUnit( 1, NECROPOLIS_2 )
call SetBuildUnit( 3, ZIGGURAT_1 )
call SetBuildUnit( 8, GHOUL )
call SetBuildUnit( 2, CRYPT_FIEND )
call SetBuildUnit( 1, TOMB_OF_RELICS )
call SetBuildUnit( 3, CRYPT_FIEND )
call SetBuildUpgr( 1, UPG_FIEND_WEB )
if MeleeDifficulty() != MELEE_NEWBIE then
call SetBuildUnit( 1, hero_id2 )
endif
call undead_mine(1)
call BasicExpansion( c_mines < 2, UNDEAD_MINE )
return
endif
// need an acolyte or nothing will get built
//
if c_neclis_done >= 1 then
call SetBuildUnit( 1, ACOLYTE )
endif
// keep producing mines and acolytes to get gold
//
call undead_mine(0)
call undead_mine(1)
if c_undead_mines >= 2 then
call SetBuildNext( 10, ACOLYTE )
elseif c_undead_mines == 1 then
call SetBuildNext( 5, ACOLYTE )
endif
// ghouls collect lumber
//
set WG2 = Max(0,10 - c_wood / 120)
if WG2 > 0 then
call SetBuildUnit( 1, CRYPT )
call SetBuildNext( WG2, GHOUL )
endif
// if we have low gold in our mines then we need to expand
//
if c_gold_owned < 2000 or (c_mines < 2 and c_acolyte > 5) then
call BasicExpansion( c_mines < 2, UNDEAD_MINE )
if MeleeDifficulty() != MELEE_NEWBIE then
call GuardSecondary( 1, 2, ZIGGURAT_1 )
if c_grave_done >= 1 then
call GuardSecondary( 1, 2, ZIGGURAT_2 )
endif
endif
endif
// get enough burrows to handle current food demand
//
if c_food_used + 7 >= c_food_made then
call SetBuildUnit( c_zig_done + 1, ZIGGURAT_1 )
endif
// always rebuild heroes for defense
//
if c_altar_done >= 1 then
if b_hero1_done and MeleeDifficulty() != MELEE_NEWBIE then
if b_hero2_done then
if b_hero3_done or c_citadel_done >= 1 then
call SetBuildUnit( 1, hero_id3 )
endif
else
call SetBuildUnit( 1, hero_id2 )
endif
else
call SetBuildUnit( 1, hero_id )
endif
else
call SetBuildUnit( 1, UNDEAD_ALTAR )
endif
// minimum melee defense
//
if c_slaughter_done >= 1 and c_citadel_done >= 1 then
call SetBuildNext( 2, ABOMINATION )
else
call SetBuildUnit( 1, CRYPT )
call SetBuildNext( WG2+6, GHOUL )
endif
// minimum ranged/air defense
//
call SetBuildUnit( 1, GRAVEYARD )
if c_citadel_done >= 1 then
call SetBuildNext( 4, GARGOYLE )
else
call SetBuildUnit( 1, CRYPT )
call SetBuildNext( 3, CRYPT_FIEND )
endif
// siege attackers
//
if c_boneyard_done >= 1 then
call SetBuildNext( 2, FROST_WYRM )
elseif c_slaughter_done >= 1 then
call SetBuildNext( 2, MEAT_WAGON )
else
call MeleeTownHall( 0, NECROPOLIS_1 )
call SetBuildUnit ( 1, NECROPOLIS_1 )
call SetBuildUnit( 1, NECROPOLIS_2 )
call SetBuildUnit( 1, SLAUGHTERHOUSE )
call SetBuildNext( 2, MEAT_WAGON )
endif
// if we have a lot of gold then advance the tech tree
//
if c_gold > 1000 then
call MeleeTownHall( 0, NECROPOLIS_1 )
call SetBuildUnit( 1, NECROPOLIS_1 )
call SetBuildUnit( 1, CRYPT )
call SetBuildUnit( 1, GRAVEYARD )
call SetBuildUnit( 1, TOMB_OF_RELICS )
call SetBuildUnit( 1, NECROPOLIS_2 )
call SetBuildNext( Min(c_neclis_done,c_halls_done+1), NECROPOLIS_2 )
call SetBuildNext( Min(c_zig_done,c_spirit_done+1), ZIGGURAT_2 )
call SetBuildUnit( 1, SLAUGHTERHOUSE )
call SetBuildUnit( 1, DAMNED_TEMPLE )
call SetBuildUnit( 1, NECROPOLIS_3 )
call SetBuildUnit( 1, SAC_PIT )
call SetBuildUnit( 1, BONEYARD )
call do_upgrades()
if c_gold > 2000 then
call BuildFactory( CRYPT )
call BuildFactory( DAMNED_TEMPLE )
call BuildFactory( SLAUGHTERHOUSE )
call BuildFactory( BONEYARD )
endif
elseif c_food_used >= UPKEEP_TIER1 then
call do_upgrades()
endif
call undead_mine(1)
call BasicExpansion( c_mines < 2, UNDEAD_MINE )
call MeleeTownHall( 1, NECROPOLIS_1 )
if c_food_used >= UPKEEP_TIER2-10 and c_gold < 2000 then
return
endif
// extra troops
//
if c_citadel_done >= 1 and c_tomb_done >= 1 then
call SetBuildUnit( 1, OBS_STATUE )
if b_sphinx_ok then
call SetBuildUnit( 1, BLK_SPHINX )
endif
endif
if c_temple_done >= 1 then
call SetBuildUnit( 4, NECRO )
call SetBuildUnit( 2, BANSHEE )
endif
if c_citadel_done >= 1 and c_tomb_done >= 1 and b_sphinx_ok then
call SetBuildUnit( 2, BLK_SPHINX )
endif
if c_gold_owned < 10000 then
call undead_mine(2)
call BasicExpansion( c_mines < 3, UNDEAD_MINE )
call MeleeTownHall( 2, NECROPOLIS_1 )
call GuardSecondary( 2, 2, ZIGGURAT_1 )
endif
if c_food_used >= 60 and c_zep < 3 then
call GetZeppelin()
endif
endfunction
[/jass]
然后我们找到负责修造单位的那部分代码
我们可以清楚的看到不死族单位的建造顺序,然后将食尸鬼全部修改为地狱火,或者直接删除即可
然后保存,将修改后的AI文件导入地图,并修改路径为script\\undead.ai即可 |
|