找回密码
 点一下
查看: 1015|回复: 2

ai函数问题

[复制链接]
1
发表于 2009-4-22 18:43:45 | 显示全部楼层 |阅读模式
1 GetCreepCamp函数的作用是什么?获取潜行单位?那么传入的两个整数呢。。。?
native GetCreepCamp         takes integer min, integer max, boolean flyers_ok returns unit

2 关于DisplayText类函数
native DisplayTextIII       takes integer p, string str, integer v1, integer v2, integer v3 returns nothing
integer p参数是什么作用?
似乎一般用GetAiPlayer()的样子

3 是否SetProduce只能用来造单位而不能建筑?MS "BJ"函数里都用的SetExpansion 看到有用SetProduce造建筑的。。。

4 //设置AI会替换几次被杀的防卫者?   不懂什么意思。。。
native SetReplacementCount  takes integer qty                           returns nothing

5 等待时间攻击玩家的函数好难看懂啊,那位大人能解释下原理么?
[jass]
function CommonSuicideOnPlayer takes boolean standard, boolean bldgs, integer seconds, player p, integer x, integer y returns nothing
    local integer save_peons

    if not PrepSuicideOnPlayer(seconds) then
        return
    endif

    set save_peons = campaign_wood_peons
    set campaign_wood_peons = 0

    loop
        //xxx
        if allow_signal_abort and CommandsWaiting() != 0 then
            call Trace("ABORT -- attack wave override\n")
        endif
        //xxx

        exitwhen allow_signal_abort and CommandsWaiting() != 0

        loop
            exitwhen allow_signal_abort and CommandsWaiting() != 0

            call FormGroup(5,true)
            exitwhen sleep_seconds <= 0
            call TraceI("waiting %d seconds before suicide\n",sleep_seconds) //xxx
        endloop

        if standard then
            if bldgs then
                exitwhen SuicidePlayer(p,sleep_seconds >= -60)
            else
                exitwhen SuicidePlayerUnits(p,sleep_seconds >= -60)
            endif
        else
            call AttackMoveXYA(x,y)
        endif

        call TraceI("waiting %d seconds before timeout\n",60+sleep_seconds) //xxx
        call SuicideSleep(5)
    endloop

    set campaign_wood_peons = save_peons
    set harass_length = 0

    call SuicideOnPlayerWave()
endfunction[/jass]


拜谢了。。。
不知道帖子是不是违规

评分

参与人数 2威望 +102 收起 理由
马甲君 + 101 鼓励深入AI研究
一抹煞白 + 1 因为我懒的去学JASS,所以 ..

查看全部评分

1
 楼主| 发表于 2009-4-24 13:22:01 | 显示全部楼层
globals
    player user = Player(11)
    constant integer DOOR='ndkw'
endglobals

//============================================================================
//  main
//============================================================================
function main takes nothing returns nothing
    local integer i=0
    call DebugS("stringtest")
    loop
    call DisplayTextIII(GetAiPlayer(),"Player %d have %d heros and %d buildings\\n",1,2,3)
    call DisplayTextI(i,"stringtest%d\\n",i)
    set i=i+1
    call Sleep(1)
    endloop
endfunction
这样都出不来。。。555
回复

使用道具 举报

发表于 2009-4-24 20:25:57 | 显示全部楼层
main函数是在初始化的时候执行的,这个时侯地图载入进度条只有80%的样子

这个时侯显示文本谁会看到?
回复

使用道具 举报

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

本版积分规则

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

GMT+8, 2024-7-21 20:17 , Processed in 0.215771 second(s), 23 queries .

Powered by Discuz! X3.5

© 2001-2023 Discuz! Team.

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