找回密码
 点一下
查看: 962|回复: 3

哪里错了

[复制链接]
发表于 2011-8-18 16:42:57 | 显示全部楼层 |阅读模式
我想做一个战役图,可测试游戏时说是这个错误
缺少数组索引

//***************************************************************************
//*
//*  Global Variables
//*
//***************************************************************************

globals
    // User-defined
    integer                 udg_kaer                   = 0
    integer                 udg_jialisesi              = 0
    integer                 udg_bianlianger            = 0
    dialog array            udg_yesno
    button array            udg_yes
    button array            udg_no

    // Generated
    rect                    gg_rct______________000    = null
    rect                    gg_rct______________001    = null
    rect                    gg_rct______________002    = null
    rect                    gg_rct______________003    = null
    rect                    gg_rct______________004    = null
    rect                    gg_rct______________005    = null
    rect                    gg_rct______________009    = null
    camerasetup             gg_cam_Camera_001          = null
    camerasetup             gg_cam_Camera_002          = null
    sound                   gg_snd_BattleNetWindStereoLoop1 = null
    trigger                 gg_trg_zongti              = null
    trigger                 gg_trg_dianying            = null
    trigger                 gg_trg_bianliang           = null
    trigger                 gg_trg_mianxiang           = null
    trigger                 gg_trg_renwu               = null
    trigger                 gg_trg_tianqi              = null
    trigger                 gg_trg_keer_over           = null
    unit                    gg_unit_nvlk_0007          = null
    unit                    gg_unit_n000_0008          = null
    unit                    gg_unit_n001_0009          = null
    rect                    gg_rct______________006    = null
    rect                    gg_rct______________007    = null
    rect                    gg_rct______________008    = null
    trigger                 gg_trg_chufa1              = null
    trigger                 gg_trg_yincangrenwu1       = null
    trigger                 gg_trg_yincangrenwu2       = null
    camerasetup             gg_cam_Camera_003          = null
    trigger                 gg_trg_renwushibai         = null
endglobals

function InitGlobals takes nothing returns nothing
    local integer i = 0
    set udg_bianlianger = 0
    set i = 0
    loop
        exitwhen (i > 1)
        set udg_yesno = DialogCreate()
        set i = i + 1
    endloop

    set i = 0
    loop
        exitwhen (i > 1)
        set udg_yes = bj_lastCreatedButton
        set i = i + 1
    endloop

    set i = 0
    loop
        exitwhen (i > 10)
        set udg_no = bj_lastCreatedButton
        set i = i + 1
    endloop

endfunction

function Trig_yincangrenwu2_Conditions takes nothing returns boolean
    if ( not ( udg_bianlianger == 2 ) ) then
        return false
    endif
    return true
endfunction

function Trig_yincangrenwu2_Func015Func002C takes nothing returns boolean
    if ( not ( GetClickedButtonBJ() == udg_yes[1] ) ) then
        return false
    endif
    return true
endfunction

function Trig_yincangrenwu2_Func015C takes nothing returns boolean
    if ( not ( GetClickedButtonBJ() == udg_no[2] ) ) then
        return false
    endif
    return true
endfunction

function Trig_yincangrenwu2_Actions takes nothing returns nothing
    call DisableTrigger( GetTriggeringTrigger() )
    call DisableTrigger( gg_trg_yincangrenwu1 )
    call CreateQuestBJ( bj_QUESTTYPE_OPT_DISCOVERED, "TRIGSTR_059", "TRIGSTR_060", "ReplaceableTextures\\CommandButtons\\BTNVillagerKid.blp" )
    call TriggerSleepAction( 2 )
    call CinematicModeBJ( true, GetPlayersAll() )
    call CameraSetupApplyForceDuration( gg_cam_Camera_003, true, 0 )
    call TransmissionFromUnitTypeWithNameBJ( GetPlayersAll(), Player(0), udg_kaer, "TRIGSTR_039", GetUnitLoc(GetEnumUnit()), null, "TRIGSTR_040", bj_TIMETYPE_ADD, 4.00, true )
    call TransmissionFromUnitWithNameBJ( GetPlayersAll(), gg_unit_nvlk_0007, "TRIGSTR_041", null, "TRIGSTR_042", bj_TIMETYPE_ADD, 5.00, true )
    call ResetToGameCamera( 2.00 )
    call CinematicModeBJ( false, GetPlayersAll() )
    call DialogDisplayBJ( true, udg_yesno[0], Player(0) )
    call DialogSetMessage( udg_yesno, "TRIGSTR_053" )
    set udg_yes[1] = DialogAddButton(udg_yesno[0], "TRIGSTR_055", 514)
    set udg_no[2] = DialogAddButton(udg_yesno[0], "TRIGSTR_058", 0)
    if ( Trig_yincangrenwu2_Func015C() ) then
        call TransmissionFromUnitTypeWithNameBJ( GetPlayersAll(), Player(0), udg_kaer, "TRIGSTR_064", GetUnitLoc(GetEnumUnit()), null, "TRIGSTR_065", bj_TIMETYPE_ADD, 5.00, true )
        call QuestSetFailed( GetLastCreatedQuestBJ(), true )
        call QuestMessageBJ( GetPlayersAll(), bj_QUESTMESSAGE_FAILED, "TRIGSTR_061" )
        call ShowUnitHide( gg_unit_nvlk_0007 )
    else
        if ( Trig_yincangrenwu2_Func015Func002C() ) then
            call TransmissionFromUnitTypeWithNameBJ( GetPlayersAll(), Player(0), udg_kaer, "TRIGSTR_062", GetUnitLoc(GetEnumUnit()), null, "TRIGSTR_063", bj_TIMETYPE_ADD, 4.00, true )
            call TransmissionFromUnitWithNameBJ( GetPlayersAll(), gg_unit_nvlk_0007, "TRIGSTR_066", null, "TRIGSTR_067", bj_TIMETYPE_ADD, 3.00, true )
            call TransmissionFromUnitTypeWithNameBJ( GetPlayersAll(), Player(0), udg_kaer, "TRIGSTR_068", GetUnitLoc(GetEnumUnit()), null, "TRIGSTR_069", bj_TIMETYPE_ADD, 4.00, true )
            call SetUnitOwner( gg_unit_nvlk_0007, Player(0), false )
            call QuestMessageBJ( GetPlayersAll(), bj_QUESTMESSAGE_UPDATED, "TRIGSTR_070" )
        else
            call DoNothing(  )
        endif
    endif
endfunction

//===========================================================================
function InitTrig_yincangrenwu2 takes nothing returns nothing
    set gg_trg_yincangrenwu2 = CreateTrigger(  )
    call DisableTrigger( gg_trg_yincangrenwu2 )
    call TriggerAddCondition( gg_trg_yincangrenwu2, Condition( function Trig_yincangrenwu2_Conditions ) )
    call TriggerAddAction( gg_trg_yincangrenwu2, function Trig_yincangrenwu2_Actions )
endfunction

怎么回事 血精灵战役.zip (30 KB, 下载次数: 1)
 楼主| 发表于 2011-8-18 19:49:14 | 显示全部楼层
yincangrenwu2
    浜嬩欢
    鏉′欢
        bianlianger 绛変簬 2
    鍔ㄤ綔
        瑙﹀彂鍣?- 鍏抽棴 (褰撳墠瑙﹀彂)
        瑙﹀彂鍣?- 鍏抽棴 yincangrenwu1 <棰勮?>
        浠诲姟 - 鍒涘缓涓
回复

使用道具 举报

 楼主| 发表于 2011-8-18 19:52:43 | 显示全部楼层
[trigger]yincangrenwu2
    事件
    条件
        bianlianger 等于 2
    动作
        触发器 - 关闭 (当前触发)
        触发器 - 关闭 yincangrenwu1 <预设>
        任务 - 创建一个 可选 任务,标题: 小蒂米 任务说明: 你要找到小蒂... 任务图标: ReplaceableTextures\\CommandButtons\\BTNVillagerKid.blp
        等待 2.00 秒
        电影 - 打开 电影模式对 (所有玩家)
        镜头 - 将 Camera 003 <预设> 应用方式设置为 应用 使用时间 0.00 秒
        电影 - 对 (所有玩家) 播送信息,发言单位: 玩家1(红色) 的 kaer  显示名字:  卡尔 发言位置: ((选取单位) 的位置) 播放音效: 没有音效 显示信息: 你为什么在这... 持续时间: 添加 4.00 秒并 等待
        电影 - 对 (所有玩家) 播送信息,发言单位: 小蒂米 0007 <预设> 显示名字: 小蒂米 ,播放音效: 没有音效 显示信息: 我和我的家人... 持续时间: 添加 5.00 秒并 等待
        镜头 - 重置玩家镜头为游戏默认状态,使用时间 2.00 秒
        电影 - 关闭 电影模式对 (所有玩家)
        对话框 - 显示 yesno[0] 对 玩家1(红色)
        对话框 - 设置 对话框 的标题为 yes&no
        设置 yes[1] = (新建的对话框按钮,在 yesno[0] 上, 使用标题: yes 快捷键: Backspace)
        设置 no[2] = (新建的对话框按钮,在 yesno[0] 上, 使用标题: no 快捷键: 无)
        如果所有条件成立则做动作1,否则做动作2
            If - 条件
                (点击的对话框按钮) 等于 no[2]
            Then - 动作
                电影 - 对 (所有玩家) 播送信息,发言单位: 玩家1(红色) 的 kaer  显示名字:  卡尔 发言位置: ((选取单位) 的位置) 播放音效: 没有音效 显示信息: 不,叔叔们还有... 持续时间: 添加 5.00 秒并 等待
                任务 - 设置 (最后创建的任务) 失败
                任务 - 对 (所有玩家) 发送 任务失败 信息: 你拒绝了小蒂...
                单位 - 隐藏 小蒂米 0007 <预设>
            Else - 动作
                如果所有条件成立则做动作1,否则做动作2
                    If - 条件
                        (点击的对话框按钮) 等于 yes[1]
                    Then - 动作
                        电影 - 对 (所有玩家) 播送信息,发言单位: 玩家1(红色) 的 kaer  显示名字:  卡尔 发言位置: ((选取单位) 的位置) 播放音效: 没有音效 显示信息: 那你的父母在... 持续时间: 添加 4.00 秒并 等待
                        电影 - 对 (所有玩家) 播送信息,发言单位: 小蒂米 0007 <预设> 显示名字: 小蒂米 ,播放音效: 没有音效 显示信息: 在地图的西北... 持续时间: 添加 3.00 秒并 等待
                        电影 - 对 (所有玩家) 播送信息,发言单位: 玩家1(红色) 的 kaer  显示名字:  卡尔 发言位置: ((选取单位) 的位置) 播放音效: 没有音效 显示信息: 好,叔叔帮你找... 持续时间: 添加 4.00 秒并 等待
                        单位 - 改变 小蒂米 0007 <预设> 所属为 玩家1(红色) 并 保持颜色
                        任务 - 对 (所有玩家) 发送 任务更新 信息: 找到小蒂米的...
                    Else - 动作
                        无动作
[/trigger]
回复

使用道具 举报

 楼主| 发表于 2011-8-18 19:54:06 | 显示全部楼层
沙发板凳地板全占了
回复

使用道具 举报

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

本版积分规则

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

GMT+8, 2024-10-5 18:20 , Processed in 0.050077 second(s), 22 queries .

Powered by Discuz! X3.5

© 2001-2023 Discuz! Team.

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