啊丹 发表于 2006-3-28 16:00:01

[lucy_tse][完美滴floating text]



Gold Text

Floating Text - Create floating text that reads (+ + Gold) at (Center of (Playable map area)) with Z offset 0.00, using font size 10.00, color (100.00%, 86.00%, 0.00%), and 0.00% transparency
Floating Text - Set the velocity of (Last created floating text) to 54.00 towards 90.00 degrees
Floating Text - Change permanent state of (Last created floating text) to Disable
Floating Text - Change the lifespan of (Last created floating text) to 2.00
Floating Text - Change the fadepoint of (Last created floating text) to 1.00

Lumber Text

Floating Text - Create floating text that reads (+ + Lumber) at (Center of (Playable map area)) with Z offset 0.00, using font size 10.00, color (0.00%, 78.00%, 31.00%), and 0.00% transparency
Floating Text - Set the velocity of (Last created floating text) to 54.00 towards 90.00 degrees
Floating Text - Change permanent state of (Last created floating text) to Disable
Floating Text - Change the lifespan of (Last created floating text) to 2.00
Floating Text - Change the fadepoint of (Last created floating text) to 1.00

Bounty Text

Floating Text - Create floating text that reads (+ + Bounty) at (Center of (Playable map area)) with Z offset 0.00, using font size 10.00, color (100.00%, 86.00%, 0.00%), and 0.00% transparency
Floating Text - Set the velocity of (Last created floating text) to 54.00 towards 90.00 degrees
Floating Text - Change permanent state of (Last created floating text) to Disable
Floating Text - Change the lifespan of (Last created floating text) to 3.00
Floating Text - Change the fadepoint of (Last created floating text) to 2.00

"miss" Text

Floating Text - Create floating text that reads miss at (Center of (Playable map area)) with Z offset 0.00, using font size 10.00, color (100.00%, 0.00%, 0.00%), and 0.00% transparency
Floating Text - Set the velocity of (Last created floating text) to 72.00 towards 90.00 degrees
Floating Text - Change permanent state of (Last created floating text) to Disable
Floating Text - Change the lifespan of (Last created floating text) to 3.00
Floating Text - Change the fadepoint of (Last created floating text) to 1.00

Critical Strike

Floating Text - Create floating text that reads (CriticalStrike + !) at (Center of (Playable map area)) with Z offset 0.00, using font size 10.00, color (100.00%, 0.00%, 0.00%), and 0.00% transparency
Floating Text - Set the velocity of (Last created floating text) to 72.00 towards 90.00 degrees
Floating Text - Change permanent state of (Last created floating text) to Disable
Floating Text - Change the lifespan of (Last created floating text) to 5.00
Floating Text - Change the fadepoint of (Last created floating text) to 2.00

Shadow Strike Text

Floating Text - Create floating text that reads ShadowStrike at (Center of (Playable map area)) with Z offset 0.00, using font size 10.00, color (62.00%, 100.00%, 0.00%), and 0.00% transparency
Floating Text - Set the velocity of (Last created floating text) to 72.00 towards 90.00 degrees
Floating Text - Change permanent state of (Last created floating text) to Disable
Floating Text - Change the lifespan of (Last created floating text) to 5.00
Floating Text - Change the fadepoint of (Last created floating text) to 2.00

Mana Burn Text

Floating Text - Create floating text that reads ManaBurn at (Center of (Playable map area)) with Z offset 0.00, using font size 10.00, color (32.00%, 32.00%, 100.00%), and 0.00% transparency
Floating Text - Set the velocity of (Last created floating text) to 72.00 towards 90.00 degrees
Floating Text - Change permanent state of (Last created floating text) to Disable
Floating Text - Change the lifespan of (Last created floating text) to 5.00
Floating Text - Change the fadepoint of (Last created floating text) to 2.00




偶当然米那么闲去慢慢测试,刚才这里瘫痪了,去wc3c逛看到滴

用来完美模拟像mana burn, shadow strike, critical strike之类会弹文字出来滴技能
lars
ft,他们都少了个最重要的东西啊:destroy。
看我写的floating text:

// Create Fading Text Tag
function FadingText_Remove takes nothing returns nothing
call DestroyTextTag( HI2TextTag(GetStoredInteger(udg_CC,"FadingText",I2S(Timer2HI(GetExpiredTimer())))) )
call FlushStoredInteger(udg_CC,"FadingText",I2S(Timer2HI(GetExpiredTimer())))
call DestroyTimer(GetExpiredTimer())
endfunction
function FadingText takes player p,string msg, integer red, integer green, integer blue, real x, real y returns nothing
local texttag t=CreateTextTag()
local integer alpha=255
local timer tm=CreateTimer()
if p!=null and GetLocalPlayer()!=p then
set msg=""
set alpha=0
endif
call SetTextTagText(t,msg,0.025)
call SetTextTagPos(t,x,y, 0.00)
call SetTextTagColor(t,red,green,blue,255)
call SetTextTagVelocity(t,0,0.02)
call StoreInteger(udg_CC,"FadingText",I2S(Timer2HI(tm)),TextTag2HI(t))
call TimerStart(tm,1.5,false,function FadingText_Remove)
endfunction

lars
我是改的以前大家常用的那个fading text,不需要trigger和全局变量了。
下面是各个颜色代码:

GoldTextColor=255,220,0
LumberTextColor=0,200,80
BountyTextColor=255,220,0
MissTextColor=255,0,0
CriticalStrikeTextColor=255,0,0
ShadowStrikeTextColor=160,255,0
ManaBurnTextColor=82,82,255
BashTextColor=0,0,255
ESPER_PALE

贴下新s3c的FadingText函数

function FadingText takes string msg, integer r, integer g, integer b, real x, real y, real speed, real lifespan, real fadepoint returns nothing
local texttag tt=CreateTextTag()
call SetTextTagText(tt,msg,0.025)
call SetTextTagPos(tt,x,y,0.00)
call SetTextTagColor(tt,r,g,b,255)
call SetTextTagVelocity(tt,0,speed*0.071/128)
call SetTextTagPermanent(tt,false)
call SetTextTagLifespan(tt,lifespan)
call SetTextTagFadepoint(tt,fadepoint)
call TriggerSleepAction(lifespan)
call DestroyTextTag(tt)
endfunction

只是想说明, 现在function(非trigger action)里面也可以用Sleep了, 只要这个函数是在trigger action里面被调用的
页: [1]
查看完整版本: [lucy_tse][完美滴floating text]