找回密码
 点一下
查看: 2431|回复: 13

用游戏缓存做了个英雄复活,为什么我打死电脑的英雄不复活呢?

[复制链接]
发表于 2008-2-2 23:20:56 | 显示全部楼层 |阅读模式
[codes=jass]
function H2I takes handle h returns integer
    return h
    return 0
endfunction

function I2TMD takes integer i returns timerdialog
    return i
    return null
endfunction

function I2U takes integer i returns unit
    return i
    return null
endfunction

function  returnhero takes nothing  returns nothing
    local integer alive=GetStoredInteger(udg_Gc,I2S(H2I(GetExpiredTimer())),"timerdialog")
    local integer hero= GetStoredInteger(udg_Gc,I2S(H2I(GetExpiredTimer())),"hero")
    if(hero==null)then
    call DisplayTextToPlayer(Player(0),0,0,"空的")
    endif
    call DisplayTextToPlayer(Player(0),0,0,"也运行了")
    call ReviveHeroLoc( I2U(hero), GetRectCenter(gg_rct______________000), false )
    call DestroyTimer(GetExpiredTimer())
    call DestroyTimerDialog(I2TMD(alive))
    call FlushStoredMission(udg_Gc, I2S(H2I(GetExpiredTimer())))
    call FlushStoredInteger(udg_Gc, I2S(alive), "timerdialog")
    call FlushStoredInteger(udg_Gc, I2S(alive), "hero")  
endfunction

function trg_relive_Actions takes nothing returns nothing
    local timerdialog hero
    call DisplayTextToPlayer(Player(0),0,0,"运行了")
    set bj_lastStartedTimer =CreateTimer()
    set hero=CreateTimerDialog(bj_lastStartedTimer )
    call TimerDialogDisplay(hero, true )
    call StoreInteger(udg_Gc,I2S(H2I(bj_lastStartedTimer)),"timerdialog",H2I(hero))
    call StoreInteger(udg_Gc,I2S(H2I(bj_lastStartedTimer)),"hero",H2I(GetDyingUnit()))
    call TimerStart(bj_lastStartedTimer ,6,false,function returnhero)
endfunction

function trg_relive_Conditions takes nothing returns boolean
    if(IsUnitType(GetDyingUnit(), UNIT_TYPE_HERO) == true)then  
        return  true
    endif
        return false
endfunction

function InitTrig_relive takes nothing returns nothing
    set  gg_trg_relive = CreateTrigger(  )
    call TriggerRegisterAnyUnitEventBJ( gg_trg_relive, EVENT_PLAYER_UNIT_DEATH )
    call TriggerAddCondition( gg_trg_relive, Condition( function trg_relive_Conditions ) )
    call TriggerAddAction( gg_trg_relive, function trg_relive_Actions )
endfunction
[/codes]
我打死我的英雄打死N个都复活 ,我打死电脑的  他怎么就不复活呢
发表于 2008-2-2 23:47:11 | 显示全部楼层
这个函数必然是正确的~~

so~~唯一的可能性只有…………

哈哈~~楼主看起来对we入手很快~~可是还可能遗漏了一些“局外人因素”

据我估计~~楼主把电脑玩家的祭坛去了看~~
回复

使用道具 举报

 楼主| 发表于 2008-2-2 23:57:04 | 显示全部楼层
我地图还在制作中 电脑连主城都没有 更别说祭坛了
回复

使用道具 举报

发表于 2008-2-2 23:57:32 | 显示全部楼层
是传说中的RPWT吗??
我把这段代码基本原封不动(除了区域)复制到图里测试,结果很正常………………
回复

使用道具 举报

发表于 2008-2-2 23:59:10 | 显示全部楼层
确实~~楼主需要去提高下rp~~

这里16个玩家~~全部可以复活的~~

123.w3x

18 KB, 下载次数: 24

回复

使用道具 举报

 楼主| 发表于 2008-2-3 00:00:40 | 显示全部楼层
找到原因了 实在是很郁闷 用J复活英雄 竟然还要看人口是不是满了 人口满了还不能复活  丢个人口100的农场给他他就复活了
回复

使用道具 举报

发表于 2008-2-3 00:02:59 | 显示全部楼层
引用第5楼hunluan89于2008-02-03 00:00发表的  :
找到原因了 实在是很郁闷 用J复活英雄 竟然还要看人口是不是满了 人口满了还不能复活  丢个人口100的农场给他他就复活了

啊??我都是没有农场的,两边两个光杆英雄就复活了啊………………
果然需要提高一下RP呢~~
回复

使用道具 举报

发表于 2008-2-3 00:04:34 | 显示全部楼层
Hmmm~~war3这种东西~~其实是有很多“局外人”因素的啦~~


另外 复活英雄的函数是可以返回Boolean的~~表示复活是否成功~~很多函数也是这样~~

楼主以后debug的话也可以注意下~~
回复

使用道具 举报

 楼主| 发表于 2008-2-3 00:07:48 | 显示全部楼层
大哥你们英雄所占人口是不是0啊 ..
回复

使用道具 举报

发表于 2008-2-3 00:09:26 | 显示全部楼层
引用第8楼hunluan89于2008-02-03 00:07发表的  :
大哥你们英雄所占人口是不是0啊 ..

初始值5人口啊
回复

使用道具 举报

发表于 2008-2-3 00:09:45 | 显示全部楼层
显然不是0~~你看看我那演示右上角明显写着5~~

另外~~我不是什么大哥~~
回复

使用道具 举报

 楼主| 发表于 2008-2-3 00:10:37 | 显示全部楼层
如果没有人口房 我都最大人口是0  呵呵  我说了连主城都没有 所以嘛...
回复

使用道具 举报

发表于 2008-2-3 00:12:37 | 显示全部楼层
你看我那演示里有房子么?~~
回复

使用道具 举报

 楼主| 发表于 2008-2-3 00:16:13 | 显示全部楼层
说不定我真的RP很差  所以我玩DOTA坚决不玩蓝胖子 那个大技在别人手里能连续5次RP爆发杀退神装幻影刺客 在我手里连续5次不爆发 让人跑掉 郁闷啊
回复

使用道具 举报

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

本版积分规则

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

GMT+8, 2024-5-22 20:55 , Processed in 0.079040 second(s), 21 queries .

Powered by Discuz! X3.5

© 2001-2023 Discuz! Team.

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