找回密码
 点一下
查看: 1718|回复: 4

谁能帮忙找下错误?

[复制链接]
发表于 2008-4-30 20:23:29 | 显示全部楼层 |阅读模式
function AI_1_g_func takes nothing returns nothing
local integer i = GetRandomInt(1,udg_count)
local unit u = GetFilterUnit()
if GetUnitState(u,UNIT_STATE_LIFE)>0.01 then
call IssuePointOrderById(u,851983,GetUnitX(udg_AI_Unit),GetUnitY(udg_AI_Unit))
endif
set u = null
endfunction
function AI_1_t takes nothing returns nothing
local group g
set udg_count = GetStoredInteger(udg_gc,"trigger","AI_1_Count")
if udg_count>0 then
set g = CreateGroup()
call GroupEnumUnitsOfPlayer(g,Player(PLAYER_NEUTRAL_AGGRESSIVE),Condition(function AI_1_g_func))
set udg_count = 0
call DestroyGroup(g)
endif
set g = null
endfunction

function Set_AI_1 takes unit u returns nothing//注册怪物追寻
local integer ih = h2i(u)
local integer i = GetStoredInteger(udg_gc,"trigger","AI_1_Count")+1
if GetStoredInteger(udg_gc,I2S(ih),"AI_1_Count")<=0 then
set udg_AI_Unit=u
call StoreInteger(udg_gc,I2S(ih),"AI_1_Count",i)
call StoreInteger(udg_gc,"trigger","AI_1_Count",i)
endif
endfunction

function Death_AI_1 takes unit u returns nothing//删除怪物追寻
local integer ih = h2i(u)
local integer i = GetStoredInteger(udg_gc,I2S(ih),"AI_1_Count")
local integer max = GetStoredInteger(udg_gc,"trigger","AI_1_Count")
set udg_AI_Unit=udg_AI_Unit[max]
set udg_AI_Unit[max]=null
call FlushStoredInteger(udg_gc,I2S(ih),"AI_1_Count")
call StoreInteger(udg_gc,"trigger","AI_1_Count",max-1)
endfunction

if GetStoredInteger(udg_gc,I2S(ih),"AI_1_Count")>0 then//删除AI系统怪物寻找
call Death_AI_1(u)
endif


怪物自动追人的J,帮忙看下错误,谢谢!
发表于 2008-4-30 21:03:31 | 显示全部楼层
还是看这个吧  

[jass]function AI_1_g_func takes nothing returns nothing
local integer i = GetRandomInt(1,udg_count)
local unit u = GetFilterUnit()
if GetUnitState(u,UNIT_STATE_LIFE)>0.01 then
call IssuePointOrderById(u,851983,GetUnitX(udg_AI_Unit),GetUnitY(udg_AI_Unit))
endif
set u = null
endfunction
function AI_1_t takes nothing returns nothing
local group g
set udg_count = GetStoredInteger(udg_gc,"trigger","AI_1_Count")
if udg_count>0 then
set g = CreateGroup()
call GroupEnumUnitsOfPlayer(g,Player(PLAYER_NEUTRAL_AGGRESSIVE),Condition(function AI_1_g_func))
set udg_count = 0
call DestroyGroup(g)
endif
set g = null
endfunction

function Set_AI_1 takes unit u returns nothing//注册怪物追寻
local integer ih = h2i(u)
local integer i = GetStoredInteger(udg_gc,"trigger","AI_1_Count")+1
if GetStoredInteger(udg_gc,I2S(ih),"AI_1_Count")<=0 then
set udg_AI_Unit=u
call StoreInteger(udg_gc,I2S(ih),"AI_1_Count",i)
call StoreInteger(udg_gc,"trigger","AI_1_Count",i)
endif
endfunction

function Death_AI_1 takes unit u returns nothing//删除怪物追寻
local integer ih = h2i(u)
local integer i = GetStoredInteger(udg_gc,I2S(ih),"AI_1_Count")
local integer max = GetStoredInteger(udg_gc,"trigger","AI_1_Count")
set udg_AI_Unit=udg_AI_Unit[max]
set udg_AI_Unit[max]=null
call FlushStoredInteger(udg_gc,I2S(ih),"AI_1_Count")
call StoreInteger(udg_gc,"trigger","AI_1_Count",max-1)
endfunction

if GetStoredInteger(udg_gc,I2S(ih),"AI_1_Count")>0 then//删除AI系统怪物寻找
call Death_AI_1(u)
endif
[/jass]
回复

使用道具 举报

发表于 2008-5-1 12:22:16 | 显示全部楼层
if GetStoredInteger(udg_gc,I2S(ih),"AI_1_Count")>0 then//删除AI系统怪物寻找
call Death_AI_1(u)
endif

这 不很明显吗 这些语句独立于函数体外 这样是不可以的
回复

使用道具 举报

发表于 2008-5-1 12:40:37 | 显示全部楼层
[jass]
function AI_1_g_func takes nothing returns nothing
local integer i = GetRandomInt(1,udg_count)
local unit u = GetFilterUnit()
if GetUnitState(u,UNIT_STATE_LIFE)>0.01 then
call IssuePointOrderById(u,851983,GetUnitX(udg_AI_Unit),GetUnitY(udg_AI_Unit))
endif
set u = null
endfunction

function AI_1_t takes nothing returns nothing
local group g
set udg_count = GetStoredInteger(udg_gc,"trigger","AI_1_Count")
if udg_count>0 then
set g = CreateGroup()
call GroupEnumUnitsOfPlayer(g,Player(PLAYER_NEUTRAL_AGGRESSIVE),Condition(function AI_1_g_func))
set udg_count = 0
call DestroyGroup(g)
endif
set g = null
endfunction

function Set_AI_1 takes unit u returns nothing//注册怪物追寻
local integer ih = h2i(u)
local integer i = GetStoredInteger(udg_gc,"trigger","AI_1_Count")+1
if GetStoredInteger(udg_gc,I2S(ih),"AI_1_Count")<=0 then
set udg_AI_Unit=u
call StoreInteger(udg_gc,I2S(ih),"AI_1_Count",i)
call StoreInteger(udg_gc,"trigger","AI_1_Count",i)
endif
endfunction

function Death_AI_1 takes unit u returns nothing//删除怪物追寻
local integer ih = h2i(u)
local integer i = GetStoredInteger(udg_gc,I2S(ih),"AI_1_Count")
local integer max = GetStoredInteger(udg_gc,"trigger","AI_1_Count")
set udg_AI_Unit=udg_AI_Unit[max]
set udg_AI_Unit[max]=null
call FlushStoredInteger(udg_gc,I2S(ih),"AI_1_Count")
call StoreInteger(udg_gc,"trigger","AI_1_Count",max-1)
endfunction

[/jass]
//条件
//if GetStoredInteger(udg_gc,I2S(ih),"AI_1_Count")>0 then//删除AI系统怪物寻找
//call Death_AI_1(u)
//endif
回复

使用道具 举报

发表于 2008-5-6 09:52:21 | 显示全部楼层
最好能描述一下什么样的错误,如果是语法错误直接用工具就行。谢谢。
回复

使用道具 举报

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

本版积分规则

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

GMT+8, 2024-11-22 03:39 , Processed in 0.038825 second(s), 18 queries .

Powered by Discuz! X3.5

© 2001-2023 Discuz! Team.

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