找回密码
 点一下
查看: 937|回复: 7

初来咋到

[复制链接]
发表于 2012-8-17 20:51:15 | 显示全部楼层 |阅读模式
            嗯.......新人......第一次来,以后有什么不便的地方请多多包涵啊,同时也请多多照顾我这个新人.....
            转入正题————
魔兽地图编辑器我之前弄了很久了,终于明白了怎么修改兵种..哈哈...直说了吧,其中还是有很多问题要请教各位大哥哥姐姐:
         比如:我把一个不死族大大的改变了,然后又让电脑控制这个族,可是电脑只建造了两个通灵塔、一个地穴和一个黑暗祭坛就不动了。请问这是为什么?如果要重写触发器要写什么啊,求详细点的解答...(真的很急啊.....弄了一个星期也弄不明白啊......)
发表于 2012-8-18 02:06:14 | 显示全部楼层
这是电脑AI的问题
AI是不会变通的,所以它只会造原有的单位,而不会造新单位
如果原有单位被删除,那么它就什么都不会造了
a.png
打开AI编辑器可以看见,AI的建造顺序是一定的,只有造了前面的单位才能造后面的单位
修了地穴才会造食尸鬼,有了食尸鬼才能造坟场............
反之,如果食尸鬼被删除了,那么造不了食尸鬼的电脑就什么也不会做了
回复

使用道具 举报

发表于 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即可
回复

使用道具 举报

 楼主| 发表于 2012-8-18 16:40:20 | 显示全部楼层
...............................要改的東西好多啊............儘量努力吧........
    謝謝各位哥哥姐姐,如果再遇到新的問題再來請教各位吧...!
回复

使用道具 举报

 楼主| 发表于 2012-8-18 18:07:43 | 显示全部楼层
可是我真正的是把所有兵種的名字、技能、攻擊防禦、血量、魔法、還有恢復血量和魔法的速度............都改了,AI編輯器也自動跟著改了.........但是我想要和改了的兵種玩.....一個一個重新編輯不是很麻煩?有沒有什麽更效率的方法啊...
回复

使用道具 举报

发表于 2012-8-18 19:53:46 | 显示全部楼层
——student:           可是我真正的是把所有兵種的名字、技能、攻擊防禦、血量、魔法、還有恢復血量和魔法的速度............都改了,AI編輯器也自動跟著改了.........但是我想要和改了的兵種玩.....一個一個重新編輯不是很麻煩?有沒有 .. (2012-08-18 18:07)
如果LZ只是想让电脑跟原设差不多的顺序出兵呢,直接玩就是了
但是如果想跟真正适合这些兵种的AI玩呢请一点一点修改或重新制作AI~
回复

使用道具 举报

 楼主| 发表于 2012-8-18 20:31:58 | 显示全部楼层
問題就在於,修改後直接玩那些電腦只會讓農民挖金和砍樹啊.......
  如果要重新編輯AI,是不是要一個一個編,有沒有什麽更效率的方法啊.......
回复

使用道具 举报

发表于 2012-8-18 21:52:08 | 显示全部楼层
——student:                問題就在於,修改後直接玩那些電腦只會讓農民挖金和砍樹啊.......
  如果要重新編輯AI,是不是要一個一個編,有沒有什麽更效率的方法啊....... (2012-08-18 20:31)
当然是要每个兵种单独设置AI
LZ不会想让步兵去背柴的吧……
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 点一下

本版积分规则

Archiver|移动端|小黑屋|地精研究院

GMT+8, 2024-7-3 08:33 , Processed in 0.033077 second(s), 22 queries .

Powered by Discuz! X3.5

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表