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

[求助]帮忙看下,哪里错了,怎么保存不了呢?

[复制链接]
发表于 2011-6-3 16:21:59 | 显示全部楼层 |阅读模式
function Trig_Unit_DeathConditions takes nothing returns boolean
    return ((GetOwningPlayer(GetTriggerUnit()) == Player(10)) and (IsUnitType(GetTriggerUnit(), UNIT_TYPE_HERO) == false))
endfunction

function Trig_Unit_DeathActions takes nothing returns nothing
    set udg_Killa_Iingter[GetConvertedPlayerId(GetOwningPlayer(GetKillingUnitBJ()))] = ( udg_Killa_Iingter[GetConvertedPlayerId(GetOwningPlayer(GetKillingUnitBJ()))] + 1 )
    call MultiboardSetItemValue( MultiboardGetItem(udg_Panel, GetConvertedPlayerId(GetOwningPlayer(GetKillingUnitBJ())), 1), I2S(udg_Killa_Iingter[GetConvertedPlayerId(GetOwningPlayer(GetKillingUnitBJ()))]) )
    local unit u = GetTriggerUnit()
    call TriggerSleepAction(2)
    call RemoveUnit( loc_u() )
    set loc_u = null
endfunction

//===========================================================================
function InitTrig_Unit_Death takes nothing returns nothing
    set gg_trg_Unit_Death = CreateTrigger()
    call TriggerRegisterAnyUnitEventBJ( gg_trg_Unit_Death, EVENT_PLAYER_UNIT_DEATH )
    call TriggerAddCondition(gg_trg_Unit_Death, Condition(function Trig_Unit_DeathConditions))
    call TriggerAddAction(gg_trg_Unit_Death, function Trig_Unit_DeathActions)
endfunction






我是Jass菜鸟,这是我第一次写Jass,各位Jass大大别笑话。最好能帮我看下错误。
发表于 2011-6-3 17:46:37 | 显示全部楼层
错误提示是什么
出错的不一定是代码本身
比如全局变量名称无法对应什么的也会导致无法保存

LZ是T转J吧,改了哪里?
回复

使用道具 举报

发表于 2011-6-3 17:51:45 | 显示全部楼层
仔细看了下

    local unit u = GetTriggerUnit()

本地变量声明要在函数的最前面

应该修改成这样
[jass]
function Trig_Unit_DeathActions takes nothing returns nothing
    local unit u
    set udg_Killa_Iingter[GetConvertedPlayerId(GetOwningPlayer(GetKillingUnitBJ()))] = ( udg_Killa_Iingter[GetConvertedPlayerId(GetOwningPlayer(GetKillingUnitBJ()))] + 1 )
    call MultiboardSetItemValue( MultiboardGetItem(udg_Panel, GetConvertedPlayerId(GetOwningPlayer(GetKillingUnitBJ())), 1), I2S(udg_Killa_Iingter[GetConvertedPlayerId(GetOwningPlayer(GetKillingUnitBJ()))]) )
    u = GetTriggerUnit()
    call TriggerSleepAction(2)
    call RemoveUnit( loc_u() )
    set loc_u = null
endfunction
[/jass]

J请放入【jass】和【/jass】之间
【】换成[]
回复

使用道具 举报

 楼主| 发表于 2011-6-3 18:00:09 | 显示全部楼层
谢谢,解决了
回复

使用道具 举报

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

本版积分规则

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

GMT+8, 2024-5-4 13:08 , Processed in 0.066013 second(s), 18 queries .

Powered by Discuz! X3.5

© 2001-2023 Discuz! Team.

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