Topic hỏi đáp (tập 3) về cách làm map

Status
Không mở trả lời sau này.
cho em hỏi cách add Model vào như thế nào và khi add vào rồi thì lấy nó ở đâu ? em tìm mãi mà chả thấy câu trả lời ở Topic nào cả. thanks trước.

Thực sự là chả muốn trả lời cái câu hỏi này một tý nào /:).
Cách Import model, icon trong Tổng hợp các bài hướng dẫn và một số link hữu dụng
bị "hide" hay sao mà kêu là "em tìm mãi mà chả thấy câu trả lời ở Topic nào cả" 8-x ?
 
Một chút Jass nhé bạn:

native SetUnitVertexColor takes unit whichUnit, integer red, integer green, integer blue, integer alpha returns nothing

call SetUnitVertexColor ( whichUnit, R, B, G, alpha )

Chỉnh cái alpha xuống 1 con số nhỏ hơn 255

Còn để nó mờ từ từ thì dùng timer :)

Dòng đầu tiên là gì, mình ko hiểu :-/? Nếu làm bằng GUI thì thế nào bạn?
 
Animation - Change Unit's vertex coloring to (100.00%, 100.00%, 100.00%) with 0.00% transparency

trong đó b chỉ màu của unit, i chỉ độ mờ;))
 
Ờ cái đấy thì biết. Nếu thế gộp lại thì nó thế này à :

Mã:
Animation - Change Unit's vertex coloring to (100.00%, 100.00%, 100.00%) with 0.00% transparency
Custom script:   call SetUnitVertexColor ( whichUnit, R, B, G, alpha )

Edit : zzz thế ko nói sớm T_T
 
Không!

Nếu dùng GUI thì lấy cái phía trên thôi :)

Muốn nó mờ dần thì tạo 1 biến i
local integer i = 255
set i = i - 25 // chẳng hạn
call SetUnitVertexColor( u, 255, 255, 255, i ) :-@
lấy timer đếm :)
 
Mã:
function Trig_text_Actions takes nothing returns nothing
    set bj_forLoopAIndex = 1
    set bj_forLoopAIndexEnd = 10
    loop
        exitwhen bj_forLoopAIndex > bj_forLoopAIndexEnd
        set udg_r = ( udg_r + 10.00 )
        call SetUnitVertexColorBJ( GetTriggerUnit(), 100, 100, 100, udg_r )
        call TriggerSleepAction( 0.25 )
        set bj_forLoopAIndex = bj_forLoopAIndex + 1
    endloop
endfunction

//===========================================================================
function InitTrig_text takes nothing returns nothing
    set gg_trg_text = CreateTrigger(  )
    call TriggerRegisterAnyUnitEventBJ( gg_trg_text, EVENT_PLAYER_UNIT_SPELL_EFFECT )
    call TriggerAddAction( gg_trg_text, function Trig_text_Actions )
endfunction
 
Spell trên là để tất cả unit đều cast được ?

Vì không có điều kiện check condition

Vả lại nó cũng không hoạt động vì trong loop có Wait :|
Mã:
function Trig_text_Actions takes nothing returns nothing
    set bj_forLoopAIndex = 1
    set bj_forLoopAIndexEnd = 10
    loop
        exitwhen bj_forLoopAIndex > bj_forLoopAIndexEnd
        set udg_r = ( udg_r + 10.00 )
        call SetUnitVertexColorBJ( GetTriggerUnit(), 100, 100, 100, udg_r )
        [COLOR=Red]call TriggerSleepAction( 0.25 )[/COLOR]
        set bj_forLoopAIndex = bj_forLoopAIndex + 1
    endloop
endfunction

//===========================================================================
function InitTrig_text takes nothing returns nothing
    set gg_trg_text = CreateTrigger(  )
    call TriggerRegisterAnyUnitEventBJ( gg_trg_text, EVENT_PLAYER_UNIT_SPELL_EFFECT )
    call TriggerAddAction( gg_trg_text, function Trig_text_Actions )
 
Spell trên là để tất cả unit đều cast được ?

Vì không có điều kiện check condition

Vả lại nó cũng không hoạt động vì trong loop có Wait :|
Mã:
function Trig_text_Actions takes nothing returns nothing
    set bj_forLoopAIndex = 1
    set bj_forLoopAIndexEnd = 10
    loop
        exitwhen bj_forLoopAIndex > bj_forLoopAIndexEnd
        set udg_r = ( udg_r + 10.00 )
        call SetUnitVertexColorBJ( GetTriggerUnit(), 100, 100, 100, udg_r )
        [COLOR=Red]call TriggerSleepAction( 0.25 )[/COLOR]
        set bj_forLoopAIndex = bj_forLoopAIndex + 1
    endloop
endfunction

//===========================================================================
function InitTrig_text takes nothing returns nothing
    set gg_trg_text = CreateTrigger(  )
    call TriggerRegisterAnyUnitEventBJ( gg_trg_text, EVENT_PLAYER_UNIT_SPELL_EFFECT )
    call TriggerAddAction( gg_trg_text, function Trig_text_Actions )

để an toàn thì set unit và chon dk là đc rùi:-w
vã lại cái này là mẫu nên ko chú ý lắm:-*
 
Trong loop có Wait thì kô ảnh hưởng đâu.
Cái cần sửa là thêm Condition và:
Mã:
function Trig_text_Actions takes nothing returns nothing
[B]    set bj_forLoopAIndex = 1
    set bj_forLoopAIndexEnd = 10[/B]
    loop
[B]        exitwhen bj_forLoopAIndex > bj_forLoopAIndexEnd[/B]
        set udg_r = ( udg_r + 10.00 )
        call SetUnitVertexColorBJ( GetTriggerUnit(), 100, 100, 100, udg_r )
        call TriggerSleepAction( 0.25 )
[B]        set bj_forLoopAIndex = bj_forLoopAIndex + 1[/B]
    endloop
endfunction

dùng mấy cái này làm gì cho nó dài dòng ra ? Sao kô set biến rồi loop ?

Mã:
function Trig_text_Actions takes nothing returns nothing
    local integer it = 1
    loop
        exitwhen it > 10
        set udg_r = ( udg_r + 10.00 )
        call SetUnitVertexColorBJ( GetTriggerUnit(), 100, 100, 100, udg_r )
        call TriggerSleepAction( 0.25 )
        set it = it + 1
    endloop
endfunction

Với cả dạng này dùng timer mới chính xác và hoạt động tốt đc, dùng wait kô chuẩn đâu.
 
Cho mình hỏi có đoạn code nào tăng giảm Combat - Cooldown Time ( thời gian sau mỗi lần đánh thì phải :) ) của hero hay unit ..
HỎi vậy bởi nhiều thứ kiếm được trong common.ai ý chứ :-j

Chả lẽ mỗi lần cast skill lại cho nó biến Morph hay tạo hero/unit khác thế vào nó không hay cho lắm :)
 
^ Chậm 1 nhịp mới đau :-w
^ Cứ buff cho nó cái nào có tốc độ đánh ấy, sao phải cầu kì :-*

? : Mình có làm 1 spell như này : khi 1 unit cast skill A,B,C nào đó thì cộng dam (bằng item damage bonus) và tốc độ đánh (bằng Endurance Aura) cho nó và giảm dần chúng theo thời gian. Nhưng mà nó chỉ giảm dam có 1 lần rồi thôi 8-> Làm sao giờ!! ~X(
Mã:
Fire dam
    Events
        Unit - A unit Starts the effect of an ability
    Conditions
        ((Ability being cast) Equal to Serpent Ward1 (Rokhan)) or (((Ability being cast) Equal to Inferno ) or ((Ability being cast) Equal to Faerie Fire))
        (Level of Critical Strike  for (Triggering unit)) Greater than 0
    Actions
        Set FL1 = (Triggering unit)
        Set Damage = Item Damage Bonus (+1)
        Set DamageLevel = (((Level of Damage for FL1) + 1) + (Level of Critical Strike  for FL1))
        Unit - Add Damage to FL1
        Unit - Set level of Damage for FL1 to DamageLevel
        Unit - Add Endurance Aura  to FL1
        Unit - Set level of Endurance Aura  for FL1 to (((Level of Endurance Aura  for FL1) + 1) + (Level of Critical Strike  for FL1))
Mã:
FD Time
    Events
        Time - Every 2.00 seconds of game time
    Conditions
        (FL1 has buff Brilliance Aura1 ) Equal to True
    Actions
        Unit - Set level of Damage for FL1 to (DamageLevel - 1)
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                (Level of Endurance Aura  for FL1) Greater than 1
            Then - Actions
                Unit - Set level of Endurance Aura  for FL1 to ((Level of Endurance Aura  for FL1) - 1)
            Else - Actions
 
Đâu phải, lấy dummy cast thì đã quá dễ rùi :|

Còn ở đây là cái Cooldown Time kia mà, trong game một hero có thể nhờ item mà max speed.. nếu tăng attack speed thì dù có tăng lên 999999 nó đánh cũng không nhanh lên

Còn chỉnh Cooldown Time nó khác :-j

Chả lẽ lại xài Chaos ;))

Edit: Chữ kí đẹp chứ :">
Gamevn hình như không có Pastebin ..
 
Cho mình hỏi có đoạn code nào tăng giảm Combat - Cooldown Time ( thời gian sau mỗi lần đánh thì phải :) ) của hero hay unit ..
HỎi vậy bởi nhiều thứ kiếm được trong common.ai ý chứ :-j

Chả lẽ mỗi lần cast skill lại cho nó biến Morph hay tạo hero/unit khác thế vào nó không hay cho lắm :)

không có :-??
 
YAN[asian];13992079 nói:
^ Chậm 1 nhịp mới đau :-w
^ Cứ buff cho nó cái nào có tốc độ đánh ấy, sao phải cầu kì :-*

? : Mình có làm 1 spell như này : khi 1 unit cast skill A,B,C nào đó thì cộng dam (bằng item damage bonus) và tốc độ đánh (bằng Endurance Aura) cho nó và giảm dần chúng theo thời gian. Nhưng mà nó chỉ giảm dam có 1 lần rồi thôi 8-> Làm sao giờ!! ~X(
[spoil]
Mã:
Fire dam
    Events
        Unit - A unit Starts the effect of an ability
    Conditions
        ((Ability being cast) Equal to Serpent Ward1 (Rokhan)) or (((Ability being cast) Equal to Inferno ) or ((Ability being cast) Equal to Faerie Fire))
        (Level of Critical Strike  for (Triggering unit)) Greater than 0
    Actions
        Set FL1 = (Triggering unit)
        Set Damage = Item Damage Bonus (+1)
        Set DamageLevel = (((Level of Damage for FL1) + 1) + (Level of Critical Strike  for FL1))
        Unit - Add Damage to FL1
        Unit - Set level of Damage for FL1 to DamageLevel
        Unit - Add Endurance Aura  to FL1
        Unit - Set level of Endurance Aura  for FL1 to (((Level of Endurance Aura  for FL1) + 1) + (Level of Critical Strike  for FL1))
Mã:
FD Time
    Events
        Time - Every 2.00 seconds of game time
    Conditions
        (FL1 has buff Brilliance Aura1 ) Equal to True
    Actions
        Unit - Set level of Damage for FL1 to (DamageLevel - 1)
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                (Level of Endurance Aura  for FL1) Greater than 1
            Then - Actions
                Unit - Set level of Endurance Aura  for FL1 to ((Level of Endurance Aura  for FL1) - 1)
            Else - Actions
[/spoil]

Sửa lại thế này:
[spoil]
Mã:
FD Time
    Events
        Time - Every 2.00 seconds of game time
    Conditions
        (FL1 has buff Brilliance Aura1 ) Equal to True
    Actions
        Set Damage Level = (DamageLevel - 1)
        Unit - Set level of Damage for FL1 to DamageLevel
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                (Level of Endurance Aura  for FL1) Greater than 1
            Then - Actions
                Unit - Set level of Endurance Aura  for FL1 to ((Level of Endurance Aura  for FL1) - 1)
            Else - Actions
[/spoil]

Vì nếu ko set thì giá trị Damage Level mỗi khi trừ, nó vẫn giữ nguyên ban đầu nên khi - 1 thì nó vẫn như lần giảm 1.
 
cho em hỏi sau khi em làm một spell = jass có sử dụng handle Vars của kattana thì vô test skill nó lại bị out ra ngoài màn hình khi vào war3 vậy đó là lỗi gì thế do WE hay do code có vấn đề nếu có thì xem dùm em
function Meteor_Condition takes nothing returns boolean
return GetSpellAbilityId() == 'A000'
endfunction

function ma takes nothing returns nothing
local timer mt = GetExpiredTimer()
local unit mc = GetHandleUnit(mt,"caster")
local location mcl = GetHandleLocation(mt,"location")
local location ml = GetHandleLocation(mt,"location")
local unit md = GetLastCreatedUnit()
local location mdl = GetUnitLoc(md)
local unit mu
call CreateNUnitsAtLoc(1,'m000',GetOwningPlayer(mc),ml,bj_UNIT_FACING)
call UnitApplyTimedLifeBJ(0.9,'BTLF',md)
local group mdg = GetUnitsInRangeOfLocAll(100,mdl)
loop
set mu = FirstOfGroup(mdg)
exitwhen mu==null
if IsUnitEnemy(mu,GetOwningPlayer(mc)) == true then
call GroupRemoveUnit(mdg,mu)
call UnitDamageTargetBJ(mc,mu,50, ATTACK_TYPE_CHAOS,DAMAGE_TYPE_FIRE)
endloop
set mdg = null
set md = null
set mu = null
endfunction

function Meteor_Start takes nothing returns nothing
local timer mt = CreateTimer()
local unit mc = GetSpellAbilityUnit()
local location mcl = GetUnitLoc(mc)
local location ml = GetRandomLocInRect(RectFromCenterSizeBJ(mcl,600 , 600))
local integer mi = 0
call SHHandle(mt , "caster" , mc)
call SHHandle(mt , "location",ml)
call SHHandle(mt , "location",mcl)
call TimerStart(mt,0.04,true,function ma)
call FlushHandleLocal(mt)
if i > 25 then
call PauseTimer(mt)
call DestroyTimer(mt)
endif
set mc = null
call RemoveLocation(mcl)
set mcl = null
call RemoveLocation(mc)
set mc = null
set mi = 0
endfunction


function InitTrig_Meteor takes nothing returns nothing
local trigger mtr = CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(mtr,EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(mtr,Condition(function Meteor_Condition ))
call TriggerAddAction(mtr,function Meteor_Start)
endfunction
 
Status
Không mở trả lời sau này.
Back
Top