坑爹的“创建永久性尸体”
魔兽地图编辑器吧
全部回复
仅看楼主
吧务
level 14
actboy168 楼主
这个UI的背后是BJ函数CreatePermanentCorpseLocBJ,尽管YDWE有替换有泄漏BJ函数的功能,但却无法对它生效。因为这个函数本身没有泄漏,但这个函数会开启一个计时器,泄漏在计时器函数的内部。而这个计时器的初始化又在InitBlizzard里。所以看起来改起来相当的麻烦。
另外,有谁能讲解下这个函数有什么功能?我没看懂b
lz
为啥把这个函数写得这么复杂,难道是因为blz不会用逆天变量的原因?
2018年06月18日 14点06分 1
level 3
为什么我总是第一个回复[阴险]
2018年06月18日 14点06分 2
电脑玩累了,拿起手机刚好碰到
2018年06月18日 14点06分
level 12
前排
2018年06月18日 14点06分 3
level 11
[惊讶]还有这个动作
2018年06月18日 14点06分 4
level 10
战役用的吧 自己作图谁用这坑爹玩意
2018年06月18日 14点06分 5
level 15
我还真用过,泄露就泄露吧,小事,没人会去反复创建尸体
2018年06月18日 16点06分 6
level 13
没用过bj
2018年06月18日 17点06分 7
level 13
只能说,用过。因为翻了一下太复杂就,自己写了一个。不过t党就没有法了
2018年06月18日 22点06分 8
发来看看,你写的
2018年06月18日 23点06分
回复 actboy168 :我只需要骨态的,肉态太麻烦,所以我只有一个创建尸体,播放骨态动画,然后设置播放速度。根本没有计时器
2018年06月19日 01点06分
那就尝试写一个,看看能不能做贡献
2018年06月19日 02点06分
2018年06月19日 02点06分
level 13
library libst
globals
hashtable hs_zyc=InitHashtable()
endglobals
function timer3_zyc takes nothing returns nothing
local unit u_zyc=LoadUnitHandle(hs_zyc,GetHandleId(GetExpiredTimer()),0)
call UnitSuspendDecay(u_zyc,true)
call SetUnitTimeScale(u_zyc, 0.0001)
call FlushChildHashtable(hs_zyc,GetHandleId(GetExpiredTimer()))
call DestroyTimer(GetExpiredTimer())
set u_zyc=null
endfunction
function timer2_zyc takes nothing returns nothing
local unit u_zyc=LoadUnitHandle(hs_zyc,GetHandleId(GetExpiredTimer()),0)
local timer t_zyc=CreateTimer()
call UnitSuspendDecay(u_zyc, true)
call SetUnitTimeScale(u_zyc, 10.0)
call SetUnitAnimation(u_zyc, "decay flesh")
call SaveUnitHandle(hs_zyc,GetHandleId(t_zyc),0,u_zyc)
call TimerStart(t_zyc,0.05,false,function timer3_zyc)
call FlushChildHashtable(hs_zyc,GetHandleId(GetExpiredTimer()))
call DestroyTimer(GetExpiredTimer())
set t_zyc=null
set u_zyc=null
endfunction
function timer1_zyc takes nothing returns nothing
local timer t_zyc
local unit u_zyc=LoadUnitHandle(hs_zyc,GetHandleId(GetExpiredTimer()),0)
if LoadBoolean(hs_zyc,GetHandleId(GetExpiredTimer()),1) then
call SetUnitTimeScale(u_zyc, 0.0001)
set t_zyc=CreateTimer()
call SaveUnitHandle(hs_zyc,GetHandleId(t_zyc),0,u_zyc)
call TimerStart(t_zyc,8,false,function timer2_zyc)
endif
call FlushChildHashtable(hs_zyc,GetHandleId(GetExpiredTimer()))
call DestroyTimer(GetExpiredTimer())
set u_zyc=null
set t_zyc=null
endfunction
function st_zyc takes boolean style_zyc,integer uid_zyc,player p_zyc,real x_zyc,real y_zyc,real f_zyc returns unit
local unit u_zyc=CreateCorpse(p_zyc,uid_zyc,x_zyc,y_zyc,f_zyc)
local timer t_zyc=CreateTimer()
local integer i_zyc=GetHandleId(t_zyc)
call SaveUnitHandle(hs_zyc,i_zyc,0,u_zyc)
call SetUnitBlendTime(u_zyc,0)
if style_zyc then
call SetUnitAnimation(u_zyc,"decay flesh")
else
call UnitSuspendDecay(u_zyc,true)
call SetUnitAnimation(u_zyc,"decay bone")
call SetUnitTimeScale(u_zyc, 0.0001)
endif
call SaveBoolean(hs_zyc,i_zyc,1,style_zyc)
call TimerStart(t_zyc,0.05,false,function timer1_zyc)
set u_zyc=null
set t_zyc=null
return LoadUnitHandle(hs_zyc,i_zyc,0)
endfunction
endlibrary
2018年06月19日 02点06分 9
level 13
可怕的贴吧排版
2018年06月19日 02点06分 10
这个是要替换BJ函数,所以你点点去掉,把integer改成boolean都是不行的。此外在你的代码中对于固态尸体,开启计时器有什么用?
2018年06月19日 03点06分
回复 actboy168 :开启计时器,只是顺便空哈希表,我以为是用一个像带c或者r这样的形式的来替换,那就是一个新的函数。。而且我觉得点也是一种麻烦[what]
2018年06月19日 03点06分
所以才写boolean的,功能应该是一样的,我看了他原本是整数的,可是本来就只有1和2
2018年06月19日 03点06分
如果有必要,改成integer 和点也是很方便的,固态开启计时器只是为了清空表,他就开了一个
2018年06月19日 03点06分
level 13
function timer1_zyc takes nothing returns nothing
local timer t_zyc
local unit u_zyc=LoadUnitHandle(hs_zyc,GetHandleId(GetExpiredTimer()),0)
call SetUnitTimeScale(u_zyc, 0.0001)
set t_zyc=CreateTimer()
call SaveUnitHandle(hs_zyc,GetHandleId(t_zyc),0,u_zyc)
call TimerStart(t_zyc,8,false,function timer2_zyc)
call FlushChildHashtable(hs_zyc,GetHandleId(GetExpiredTimer()))
call DestroyTimer(GetExpiredTimer())
set u_zyc=null
set t_zyc=null
endfunction
function st_zyc takes integer style_zyc,integer uid_zyc,player p_zyc,location loc_zyc,real f_zyc returns unit
local timer t_zyc
local integer i_zyc
set bj_lastCreatedUnit=CreateCorpse(p_zyc,uid_zyc,GetLocationX(loc_zyc),GetLocationY(loc_zyc),f_zyc)
call SetUnitBlendTime(bj_lastCreatedUnit,0)
if style_zyc ==0 then
set t_zyc=CreateTimer()
set i_zyc=GetHandleId(t_zyc)
call SetUnitAnimation(bj_lastCreatedUnit,"decay flesh")
call SaveUnitHandle(hs_zyc,i_zyc,0,bj_lastCreatedUnit)
call TimerStart(t_zyc,0.05,false,function timer1_zyc)
else
call UnitSuspendDecay(bj_lastCreatedUnit,true)
call SetUnitAnimation(bj_lastCreatedUnit,"decay bone")
call SetUnitTimeScale(bj_lastCreatedUnit, 0.0001)
endif
set t_zyc=null
return bj_lastCreatedUnit
endfunction
endlibrary
2018年06月19日 03点06分 11
就改了这两个函数
2018年06月19日 03点06分
timer2_zyc只是不知道他为何要等待一个最大死亡时间,不知道是不是要等单位死透了,修改这个时间可以使得hfoo直接肉态,但不知道其他单位有没有影响,甚至我设置了0秒同时不需要第三个计时器也是可以的,
2018年06月19日 04点06分
@--吧务-- 把8秒改成0秒好像也没什么问题,这样更平滑
2018年06月19日 04点06分
@--吧务-- 我把所有计时器去掉,好像也没问题?
2018年06月19日 05点06分
level 14
策划:我要一个尸体永远躺地上。
2018年06月19日 04点06分 12
233
2018年06月19日 04点06分
你这是在自嘲吗[什么?]
2018年06月19日 04点06分
吧务
level 14
actboy168 楼主
被我改成这样了[什么?]
@--吧务--
function YDWECreatePermanentCorpseLocBJNull takes integer style, integer unitid, player whichPlayer, location loc, real facing returns unit
set bj_lastCreatedUnit = CreateCorpse(whichPlayer, unitid, GetLocationX(loc), GetLocationY(loc), facing)
call SetUnitBlendTime(bj_lastCreatedUnit, 0)
call UnitSuspendDecay(bj_lastCreatedUnit, true)
if style == bj_CORPSETYPE_FLESH then
call SetUnitAnimation(bj_lastCreatedUnit, "decay flesh")
else
call SetUnitAnimation(bj_lastCreatedUnit, "decay bone")
endif
call SetUnitTimeScale(bj_lastCreatedUnit, 0.0001)
return bj_lastCreatedUnit
endfunction
#define CreatePermanentCorpseLocBJ(...) YDWECreatePermanentCorpseLocBJNull(__VA_ARGS__)
2018年06月19日 05点06分 13
我曾尝试过这样写,不知道为何失败。现在好像也没问题,只是一直不知道为何玻璃渣要等待,而从变量的理解起来就是,确认每种单位都死透了。就假设当时图灵所以失败吧[歪头]
2018年06月19日 05点06分
@--吧务-- blz一向很迷。至少blz的写法,骨态会在8秒后闪一下,肉态要8秒后显示才正常。怎么看都是很有问题的样子
2018年06月19日 05点06分
吧务
level 15
这个BJ原函数的骨态尸体根本不是永久的,会随平衡性常数设置的时间到期而消失。而且某些BJ函数和自带地图的代码是典型的说多错多
2018年06月19日 11点06分 14
1