找回密码
 点一下
查看: 2243|回复: 22

VJ不懂啊.下面的.execute在WE上报错.求解.

[复制链接]
发表于 2008-11-15 20:30:57 | 显示全部楼层 |阅读模式
[codes=jass]function Trig_AUfn_Conditions takes nothing returns boolean
    return GetSpellAbilityId() == 'AUfn'
endfunction

function Trig_AUfn_Actions takes nothing returns nothing
    local unit u = GetTriggerUnit()
    local unit ua
    local effect f
    local real x = GetUnitX(u)
    local real y = GetUnitY(u)
    local integer i = 1
    local integer n = 1
    loop
        exitwhen i > 3
        loop
            exitwhen n > 6
            set ua = CreateUnit(GetOwningPlayer(u),'n00J',x+150*i*Cos(3.14159/180*60*n),y+150*i*Sin(3.14159/180*60*n),0.00)
            call UnitApplyTimedLife(ua,'BHwe',4)
            call IssuePointOrderById(ua,851983,x,y)
            set f = AddSpecialEffect("Abilities\\Spells\\Undead\\FrostNova\\FrostNovaTarget.mdl",GetUnitX(ua),GetUnitY(ua))
            call DestroyEffectAfter.execute(f,7.0)
            set ua = null
            set f = null
            set n = n+1
        endloop
        set i = i+1
        set n = 1
    endloop
    set u = null
endfunction

function DestroyEffectAfter takes effect fx,real t returns nothing
    call TriggerSleepAction(t)
    call DestroyEffect(fx)
endfunction

//===========================================================================
function InitTrig_AUfn takes nothing returns nothing
    set gg_trg_AUfn = CreateTrigger()
    call TriggerRegisterAnyUnitEventBJ(gg_trg_AUfn,EVENT_PLAYER_UNIT_SPELL_EFFECT)
    call TriggerAddCondition(gg_trg_AUfn,Condition(function Trig_AUfn_Conditions))
    call TriggerAddAction(gg_trg_AUfn,function Trig_AUfn_Actions)
endfunction[/codes]这是模仿CH巫妖的霜冻新星~
发表于 2008-11-15 20:36:46 | 显示全部楼层
为什么一定要vj呢?vj貌似要借助其他第三方工具的,不能直接在we里写的吧
回复

使用道具 举报

 楼主| 发表于 2008-11-15 20:44:27 | 显示全部楼层
为什么要用VJ吗?其实我也不想的.某次写J发现:
[codes=jass]loop
       exitwhen i > 2
       loop
               exitwhen n> 5
               set ua = CreateUnit(GetOwningPlayer(u),'n00E',GetUnitX(u),GetUnitY(u),0.00)
            //怎么记录?所以这样才想去学VJ的.
       endloop
endloop[/codes]
回复

使用道具 举报

发表于 2008-11-15 20:47:49 | 显示全部楼层
灭有看懂,是指传递局部变量么?用return bug+gamecache就可以了啊
回复

使用道具 举报

 楼主| 发表于 2008-11-15 20:58:29 | 显示全部楼层
我也不明了.

[codes=jass]function Trig_A03X_Conditions takes nothing returns boolean
    return GetSpellAbilityId() == 'A03X'
endfunction

function Trig_A03X_Actionsb takes nothing returns nothing
    local unit ua = udg_danwei[127]
    local unit us
    local timer t = GetExpiredTimer()
    local real x = GetUnitX(ua)
    local real y = GetUnitY(ua)
    local real lx = GetStoredReal(GameCache(),I2S(H2I(t)),"X")
    local real ly = GetStoredReal(GameCache(),I2S(H2I(t)),"Y")
    local real move = SquareRoot((lx-x)*(lx-x)+(ly-y)*(ly-y))
    local integer i = 1
    if move <= 50 then
    call KillUnit(ua)
    endif
    if (not(GetUnitState(ua,UNIT_STATE_LIFE) == 0)) then
    call IssuePointOrderById(ua,851986,lx,ly)
    loop
        exitwhen i > 18
        set us = CreateUnit(GetOwningPlayer(ua),'n00H',x,y,0.00)
        call UnitApplyTimedLife(us,'BHwe',1)
        call ShowUnit(ua,false)
        call UnitAddAbility(us,'A024')
        call IssuePointOrderById(us,852218,x+100*Cos(20*i*3.14159/180),y+100*Sin(20*i*3.14159/180))
        set us = null
        set i = i+1
    endloop
    else
    loop
        exitwhen i > 36
        set us = CreateUnit(GetOwningPlayer(ua),'n00H',x,y,0.00)
        call UnitApplyTimedLife(us,'BHwe',1)
        call ShowUnit(ua,false)
        call UnitAddAbility(us,'A024')
        call IssuePointOrderById(us,852218,x+100*Cos(10*i*3.14159/180),y+100*Sin(10*i*3.14159/180))
        set us = null
        set i = i+1
    endloop
    set udg_danwei[127] = null
    call PauseTimer(t)
    call DestroyTimer(t)
    call FlushStoredMission(GameCache(),I2S(H2I(t)))
    endif
    set ua = null
    set t = null
endfunction

function Trig_A03X_Actions takes nothing returns nothing
    local unit u = GetTriggerUnit()
    local unit ua = CreateUnit(GetOwningPlayer(u),'n00K',GetUnitX(u),GetUnitY(u),0.00)
    local location l = GetSpellTargetLoc()
    local timer t = CreateTimer()
    local real lx = GetLocationX(l)
    local real ly = GetLocationY(l)
    local real ux = GetUnitX(u)
    local real uy = GetUnitY(u)
    call SetUnitAnimation(u,"spell")
    call UnitApplyTimedLife(ua,'BHwe',4)
    set udg_danwei[127] = ua
    call IssuePointOrderById(ua,851986,lx,ly)
    call StoreReal(GameCache(),I2S(H2I(t)),"X",lx)
    call StoreReal(GameCache(),I2S(H2I(t)),"Y",ly)
    call TimerStart(t,0.5,true,function Trig_A03X_Actionsb)
    call RemoveLocation(l)
    set u = null
    set ua = null
    set l = null
    set t = null
endfunction

//===========================================================================
function InitTrig_A03X takes nothing returns nothing
    set gg_trg_A03X = CreateTrigger()
    call TriggerRegisterAnyUnitEventBJ( gg_trg_A03X, EVENT_PLAYER_UNIT_SPELL_EFFECT )
    call TriggerAddCondition( gg_trg_A03X, Condition( function Trig_A03X_Conditions ) )
    call TriggerAddAction( gg_trg_A03X, function Trig_A03X_Actions )
endfunction[/codes]上面带了个全局set udg_danwei[127] = ua,我曾经试将ua放入缓存,但是保存地图时就报错了.

[codes=jass] call StoreInteger(GameCache(),I2S(H2I(t)),"TriggerUnit",H2I(ua))
//将上面这句代替set udg_danwei[127] = ua
//让后
local unit ua = I2U(GetStoredInteger(GameCache(),I2S(H2I(t)),"TriggerUnit"))
//将上面这句代替local unit ua = udg_danwei[127][/codes]这是CH巫妖的冰封球
回复

使用道具 举报

发表于 2008-11-15 21:04:39 | 显示全部楼层
hmmm感觉应该没有什么问题啊………………
报的是什么错误呢?
回复

使用道具 举报

 楼主| 发表于 2008-11-15 21:12:12 | 显示全部楼层
错误名字
回复

使用道具 举报

发表于 2008-11-15 21:13:34 | 显示全部楼层
是不是变量名没有对应好呢??
回复

使用道具 举报

 楼主| 发表于 2008-11-15 21:18:05 | 显示全部楼层
不会吧,我看过5遍了.除了call ShowUnit(ua,false)这句里面把us写错了ua外,我就没发现了.
回复

使用道具 举报

发表于 2008-11-15 21:19:49 | 显示全部楼层
额………………那么函数名呢??
把会报错的代码在发上来一下看看好吗?
回复

使用道具 举报

 楼主| 发表于 2008-11-15 21:30:47 | 显示全部楼层
[codes=jass]function Trig_A03X_Conditions takes nothing returns boolean
    return GetSpellAbilityId() == 'A03X'
endfunction

function Trig_A03X_Actionsb takes nothing returns nothing
    local unit ua = I2U(GetStoredInteger(GameCache(),I2S(H2I(t)),"TriggerUnit"))
    local unit us
    local timer t = GetExpiredTimer()
    local real x = GetUnitX(ua)
    local real y = GetUnitY(ua)
    local real lx = GetStoredReal(GameCache(),I2S(H2I(t)),"X")
    local real ly = GetStoredReal(GameCache(),I2S(H2I(t)),"Y")
    local real move = SquareRoot((lx-x)*(lx-x)+(ly-y)*(ly-y))
    local integer i = 1
    if move <= 50 then
    call KillUnit(ua)
    endif
    if (not(GetUnitState(ua,UNIT_STATE_LIFE) == 0)) then
    call IssuePointOrderById(ua,851986,lx,ly)
    loop
        exitwhen i > 18
        set us = CreateUnit(GetOwningPlayer(ua),'n00H',x,y,0.00)
        call UnitApplyTimedLife(us,'BHwe',1)
        call ShowUnit(us,false)
        call UnitAddAbility(us,'A024')
        call IssuePointOrderById(us,852218,x+100*Cos(20*i*3.14159/180),y+100*Sin(20*i*3.14159/180))
        set us = null
        set i = i+1
    endloop
    else
    loop
        exitwhen i > 36
        set us = CreateUnit(GetOwningPlayer(ua),'n00H',x,y,0.00)
        call UnitApplyTimedLife(us,'BHwe',1)
        call ShowUnit(us,false)
        call UnitAddAbility(us,'A024')
        call IssuePointOrderById(us,852218,x+100*Cos(10*i*3.14159/180),y+100*Sin(10*i*3.14159/180))
        set us = null
        set i = i+1
    endloop
    set udg_danwei[127] = null
    call PauseTimer(t)
    call DestroyTimer(t)
    call FlushStoredMission(GameCache(),I2S(H2I(t)))
    endif
    set ua = null
    set t = null
endfunction

function Trig_A03X_Actions takes nothing returns nothing
    local unit u = GetTriggerUnit()
    local unit ua = CreateUnit(GetOwningPlayer(u),'n00K',GetUnitX(u),GetUnitY(u),0.00)
    local location l = GetSpellTargetLoc()
    local timer t = CreateTimer()
    local real lx = GetLocationX(l)
    local real ly = GetLocationY(l)
    local real ux = GetUnitX(u)
    local real uy = GetUnitY(u)
    call SetUnitAnimation(u,"spell")
    call UnitApplyTimedLife(ua,'BHwe',4)
    call StoreInteger(GameCache(),I2S(H2I(t)),"TriggerUnit",H2I(ua))
    call IssuePointOrderById(ua,851986,lx,ly)
    call StoreReal(GameCache(),I2S(H2I(t)),"X",lx)
    call StoreReal(GameCache(),I2S(H2I(t)),"Y",ly)
    call TimerStart(t,0.5,true,function Trig_A03X_Actionsb)
    call RemoveLocation(l)
    set u = null
    set ua = null
    set l = null
    set t = null
endfunction

//===========================================================================
function InitTrig_A03X takes nothing returns nothing
    set gg_trg_A03X = CreateTrigger()
    call TriggerRegisterAnyUnitEventBJ( gg_trg_A03X, EVENT_PLAYER_UNIT_SPELL_EFFECT )
    call TriggerAddCondition( gg_trg_A03X, Condition( function Trig_A03X_Conditions ) )
    call TriggerAddAction( gg_trg_A03X, function Trig_A03X_Actions )
endfunction[/codes]
未命名.jpg
卡了N久截的图.
回复

使用道具 举报

发表于 2008-11-15 21:35:26 | 显示全部楼层
啊呀呀,你的顺序错了呢,要把local timer t 放在local unit ua前面呢,否则你的t都没有怎么获取相关的缓存呢?
回复

使用道具 举报

 楼主| 发表于 2008-11-15 21:42:55 | 显示全部楼层
原来这样啊.有事出去了.
回复

使用道具 举报

发表于 2008-11-16 06:32:06 | 显示全部楼层
参拜。
回复

使用道具 举报

发表于 2008-11-16 10:34:42 | 显示全部楼层
不怎么看的懂呢。。郁闷
回复

使用道具 举报

发表于 2008-11-16 10:37:27 | 显示全部楼层
学会了jass你就能看懂了………………
回复

使用道具 举报

 楼主| 发表于 2008-11-16 11:49:54 | 显示全部楼层
http://www.islga.org/bbs/read.ph ... d=vjass%B9%A4%BE%DF
VJ的这个工具下了不知道怎么装.惨了.我下了2次.居然不知道.
回复

使用道具 举报

发表于 2008-11-16 13:32:32 | 显示全部楼层
lz先把我前面提到的问题修改了试试看,jass语法检测我试过没有问题
回复

使用道具 举报

发表于 2008-11-16 13:44:32 | 显示全部楼层
用wow8的UI吧.......

我怎么觉得没必要用vj.....用个bj_lastCreatedEffect 当引数不就行了么........其他的也一样。
回复

使用道具 举报

 楼主| 发表于 2008-11-16 13:49:56 | 显示全部楼层
引用第17楼zhuzeitou于2008-11-16 13:32发表的  :
lz先把我前面提到的问题修改了试试看,jass语法检测我试过没有问题


是可以,不过呢,我想改最上面那编东西啊.
引用第18楼louter于2008-11-16 13:44发表的  :
用wow8的UI吧.......

我怎么觉得没必要用vj.....用个bj_lastCreatedEffect 当引数不就行了么........其他的也一样。
我连老狼UI都没用过.我觉得很麻烦啊.
回复

使用道具 举报

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

本版积分规则

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

GMT+8, 2024-7-21 10:20 , Processed in 0.132691 second(s), 22 queries .

Powered by Discuz! X3.5

© 2001-2023 Discuz! Team.

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