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

Status
Không mở trả lời sau này.
^ Như thế này phải ko :
Mã:
    Events
        Unit - A unit Starts the effect of an ability
    Conditions
        (Ability being cast) Equal to Locust Swarm1 
    Actions
        Set BatUnit[2] = (Triggering unit)
        Animation - Remove the alternate animation tag to BatUnit[2]
Thử rồi nhưng vẫn thế.

Làm thế nào để 1 unit bị đánh, mất máu nhưng ko thể chết? (Giống skill gì đó của Dazzle trong Dota)
 
Chỉnh sửa cuối:
cho thêm cái wait nữa
--
còn vụ ko chết thì xem tutorial về "Fake miss"
 
anh Tom ơi, Fake miss có thể làm = jass thường ko ?? hay phải xài new gen. Cái new gen hôm bữa anh post down về em xài cũng ko đc nó báo phải bỏ CD vào gì đấy :|
 
Mình chưa hiểu Trigger là gì. Trigger nhập ở đâu? Và cách để create 1 Hero đơn giản. Các Models mình download về thì cútom spell như thế nào?
 
Cho hỏi làm cách nào để move unit đi mà unit vẫn thực hiện order nó đang làm ? :-s
Vd: Skill của pudge trong DotA kéo unit về, unit vừa bị kéo đến vẫn tự động đi đến nơi được order trước đó...
 
hình như là dùng lệnh SetUnitX( unit, tọa độ x) và SetUnitY(unit, toạn độ y)
 
^^: Dùng lệnh
Mã:
SetUnitX( udg_biếnUnit, GetLocationX( udg_biếnPoint ) )
SetUnitY( udg_biếnUnit, GetLocationY( udg_biếnPoint ) )
(Dĩ nhiên là phải dùng custom script)
 
Last edited by a moderator:
Em hỏi. Cái omnislash của em nó thế này ( trong dota slash lvl đến 8 lần mà em ko tìm được lỗi sai nào mà chỉnh để nó đúng như dota) Cái slash của em chỉnh kiểu gì cũng chỉ đc 2 lần rồi hết?????
Mã:
function Trig_Omnislash_Conditions takes nothing returns boolean
    if ( not ( GetSpellAbilityId() == 'A0C6' ) ) then
        return false
    endif
    return true
endfunction

function Trig_Omnislash_Func004001 takes nothing returns boolean
    return ( GetUnitAbilityLevelSwapped('A0C6', udg_o) == 1 )
endfunction

function Trig_Omnislash_Func005001 takes nothing returns boolean
    return ( GetUnitAbilityLevelSwapped('A0C6', udg_o) == 2 )
endfunction

function Trig_Omnislash_Func006001 takes nothing returns boolean
    return ( GetUnitAbilityLevelSwapped('A0C6', udg_o) == 3 )
endfunction

function Trig_Omnislash_Func017Func003002003001 takes nothing returns boolean
    return ( IsUnitType(GetFilterUnit(), UNIT_TYPE_STRUCTURE) != true )
endfunction

function Trig_Omnislash_Func017Func003002003002001001 takes nothing returns boolean
    return ( IsUnitType(GetFilterUnit(), UNIT_TYPE_FLYING) != true )
endfunction

function Trig_Omnislash_Func017Func003002003002001002 takes nothing returns boolean
    return ( IsUnitAliveBJ(GetFilterUnit()) == true )
endfunction

function Trig_Omnislash_Func017Func003002003002001 takes nothing returns boolean
    return GetBooleanAnd( Trig_Omnislash_Func017Func003002003002001001(), Trig_Omnislash_Func017Func003002003002001002() )
endfunction

function Trig_Omnislash_Func017Func003002003002002 takes nothing returns boolean
    return ( IsUnitEnemy(GetFilterUnit(), GetOwningPlayer(udg_o)) == true )
endfunction

function Trig_Omnislash_Func017Func003002003002 takes nothing returns boolean
    return GetBooleanAnd( Trig_Omnislash_Func017Func003002003002001(), Trig_Omnislash_Func017Func003002003002002() )
endfunction

function Trig_Omnislash_Func017Func003002003 takes nothing returns boolean
    return GetBooleanAnd( Trig_Omnislash_Func017Func003002003001(), Trig_Omnislash_Func017Func003002003002() )
endfunction

function Trig_Omnislash_Func017Func006Func005A takes nothing returns nothing
    set udg_p = GetEnumUnit()
    set udg_pl = GetUnitLoc(udg_p)
    call SetUnitPositionLoc( udg_o, udg_pl )
    call RemoveLocation( udg_pl )
    call SetUnitAnimation( udg_o, "attack" )
    call UnitDamageTargetBJ( udg_o, udg_p, GetRandomReal(150.00, 250.00), ATTACK_TYPE_CHAOS, DAMAGE_TYPE_UNIVERSAL )
    call AddSpecialEffectTargetUnitBJ( "chest", udg_o, "Abilities\\Spells\\NightElf\\Blink\\BlinkCaster.mdl" )
    call DestroyEffectBJ( GetLastCreatedEffectBJ() )
endfunction

function Trig_Omnislash_Func017Func006C takes nothing returns boolean
    if ( not ( CountUnitsInGroup(udg_EG[1]) > 0 ) ) then
        return false
    endif
    return true
endfunction

function Trig_Omnislash_Actions takes nothing returns nothing
    set udg_o = GetTriggerUnit()
    set udg_t = GetSpellTargetUnit()
    set udg_tl = GetUnitLoc(udg_t)
    if ( Trig_Omnislash_Func004001() ) then
        set udg_loop = 3
    else
        call DoNothing(  )
    endif
    if ( Trig_Omnislash_Func005001() ) then
        set udg_loop = 5
    else
        call DoNothing(  )
    endif
    if ( Trig_Omnislash_Func006001() ) then
        set udg_loop = 8
    else
        call DoNothing(  )
    endif
    call SetUnitInvulnerable( udg_o, true )
    call AddSpecialEffectTargetUnitBJ( "weapon", udg_o, "Abilities\\Weapons\\PhoenixMissile\\Phoenix_Missile_mini.mdl" )
    set udg_Effect = GetLastCreatedEffectBJ()
    call SetUnitVertexColorBJ( udg_o, 100, 100, 100, 50.00 )
    call SetUnitPositionLoc( udg_o, udg_tl )
    call RemoveLocation( udg_tl )
    call SetUnitAnimation( udg_o, "attack" )
    call UnitDamageTargetBJ( udg_o, udg_t, GetRandomReal(150.00, 250.00), ATTACK_TYPE_CHAOS, DAMAGE_TYPE_UNIVERSAL )
    call AddSpecialEffectTargetUnitBJ( "chest", udg_o, "Abilities\\Spells\\NightElf\\Blink\\BlinkCaster.mdl" )
    call DestroyEffectBJ( GetLastCreatedEffectBJ() )
    set bj_forLoopAIndex = 1
    set bj_forLoopAIndexEnd = udg_loop
    loop
        exitwhen bj_forLoopAIndex > bj_forLoopAIndexEnd
        call PolledWait( 0.05 )
        set udg_o_current_loc = GetUnitLoc(udg_o)
        set udg_EG[1] = GetUnitsInRangeOfLocMatching(600.00, udg_o_current_loc, Condition(function Trig_Omnislash_Func017Func003002003))
        set udg_EG[2] = GetRandomSubGroup(1, udg_EG[1])
        call RemoveLocation( udg_o_current_loc )
        if ( Trig_Omnislash_Func017Func006C() ) then
            call ForGroupBJ( udg_EG[2], function Trig_Omnislash_Func017Func006Func005A )
            call DestroyGroup( udg_EG[1] )
            call DestroyGroup( udg_EG[2] )
        else
            call DestroyGroup( udg_EG[1] )
            call DestroyGroup( udg_EG[2] )
            call SetUnitVertexColorBJ( udg_o, 100, 100, 100, 0.00 )
            call SetUnitInvulnerable( udg_o, false )
        endif
        set bj_forLoopAIndex = bj_forLoopAIndex + 1
    endloop
    call SetUnitVertexColorBJ( udg_o, 100, 100, 100, 0.00 )
    call SetUnitInvulnerable( udg_o, false )
    call DestroyEffectBJ( udg_Effect )
endfunction

//===========================================================================
function InitTrig_Omnislash takes nothing returns nothing
    set gg_trg_Omnislash = CreateTrigger(  )
    call TriggerRegisterAnyUnitEventBJ( gg_trg_Omnislash, EVENT_PLAYER_UNIT_SPELL_EFFECT )
    call TriggerAddCondition( gg_trg_Omnislash, Condition( function Trig_Omnislash_Conditions ) )
    call TriggerAddAction( gg_trg_Omnislash, function Trig_Omnislash_Actions )
endfunction
 
Ý là unit khi đang bị move (unpause) mà player order 1 việc gì đó thì khi move xong nó vẫn thực hiện lệnh đó.
Vd: như khi hổ đang leap, trong lúc leap mà order 1 lệnh thì khi leap đến điểm đó nó sẽ thực hiện lệnh đó.
Hoặc là ulti của AA, nhấn vào quả cầu băng ulti rồi order nó move thì sẽ thấy rằng, dù đang bị move nhưng button "move" vẫn phát sáng.
--> Giống như là đang bị stun mà order nó thì hết stun nó sẽ làm ngay order ấy đấy :-s
Chứ set point thì phải làm thêm cái trigger set point mỗi khi player order à @-)
P/s: Dạo này ai cũng biết Jass hết nhỉ, thế ra mình lỗi thời rồi ư :-ss
 
^^: Để nguyên trigger đi, cứ convert ra jass làm gì ? Dạo này có phong trào convert GUI ra Jass để hỏi à :-ss.
^: Kô hiểu à ? Có ai bảo "phải làm thêm cái trigger set point mỗi khi player order" đâu ? Ý người ta muốn nói ở đây thay mấy cái lệnh move của GUI = 2 dòng Custom Script kia kìa.
 
Bạn nói thế thì mình cho thêm lệnh pause ở đầu và unpause ở sau nhưng vẫn thế. Anh Tom giúp em đi

---------- Post added at 19:03 ---------- Previous post was at 19:00 ----------

Đây thì GUI đây.
Mã:
Events
    Unit - A unit Starts the effect of an ability
Conditions
    (Ability being cast) Equal to Omnislash 
Actions
    Set o = (Triggering unit)
    Set t = (Target unit of ability being cast)
    Set tl = (Position of t)
    If ((Level of Omnislash  for o) Equal to 1) then do (Set loop = 6) else do (Do nothing)
    If ((Level of Omnislash  for o) Equal to 2) then do (Set loop = 10) else do (Do nothing)
    If ((Level of Omnislash  for o) Equal to 3) then do (Set loop = 17) else do (Do nothing)
    Unit - Make o Invulnerable
    Unit - Pause o
    Special Effect - Create a special effect attached to the weapon of o using Abilities\Weapons\PhoenixMissile\Phoenix_Missile_mini.mdl
    Set Effect = (Last created special effect)
    Animation - Change o's vertex coloring to (100.00%, 100.00%, 100.00%) with 50.00% transparency
    Unit - Move o instantly to tl
    Custom script:   call RemoveLocation( udg_tl )
    Animation - Play o's attack animation
    Unit - Cause o to damage t, dealing (Random real number between 150.00 and 250.00) damage of attack type Chaos and damage type Universal
    Special Effect - Create a special effect attached to the chest of o using Abilities\Spells\NightElf\Blink\BlinkCaster.mdl
    Special Effect - Destroy (Last created special effect)
    For each (Integer A) from 1 to loop, do (Actions)
        Loop - Actions
            Wait 0.05 game-time seconds
            Set o_current_loc = (Position of o)
            Set EG[1] = (Units within 600.00 of o_current_loc matching ((((Matching unit) is A structure) Not equal to True) and (((((Matching unit) is A flying unit) Not equal to True) and (((Matching unit) is alive) Equal to True)) and (((Matching unit) belongs to an enemy of (Own
            Set EG[2] = (Random 1 units from EG[1])
            Custom script:   call RemoveLocation( udg_o_current_loc )
            If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                If - Conditions
                    (Number of units in EG[1]) Greater than 0
                Then - Actions
                    Unit Group - Pick every unit in EG[2] and do (Actions)
                        Loop - Actions
                            Set p = (Picked unit)
                            Set pl = (Position of p)
                            Unit - Move o instantly to pl
                            Custom script:   call RemoveLocation( udg_pl )
                            Animation - Play o's attack animation
                            Unit - Cause o to damage p, dealing (Random real number between 150.00 and 250.00) damage of attack type Chaos and damage type Universal
                            Special Effect - Create a special effect attached to the chest of o using Abilities\Spells\NightElf\Blink\BlinkCaster.mdl
                            Special Effect - Destroy (Last created special effect)
                    Custom script:   call DestroyGroup( udg_EG[1] )
                    Custom script:   call DestroyGroup( udg_EG[2] )
                Else - Actions
                    Custom script:   call DestroyGroup( udg_EG[1] )
                    Custom script:   call DestroyGroup( udg_EG[2] )
                    Unit - Unpause o
                    Animation - Change o's vertex coloring to (100.00%, 100.00%, 100.00%) with 0.00% transparency
                    Unit - Make o Vulnerable
    Animation - Change o's vertex coloring to (100.00%, 100.00%, 100.00%) with 0.00% transparency
    Unit - Unpause o
    Unit - Make o Vulnerable
    Special Effect - Destroy Effect
Đó sai ở chỗ nào chỉ tớ cái
 
^^: à, hiểu rồi, làm gì nặng lời thế...:|
Thế muốn làm move và face angle thì sao ? [..]
 
Cách lấy tọa độ X và Y. Ví dụ mình có 2 biến Real x,y,angle và 2 biến Point Point và Loc
Trong GUI

Set Point = (Loc offset by 200.00 towards angle degrees)
Unit - Move unit instantly to Point

Trong Jass

set udg_x = udg_Loc + 200 * Cos( udg_angel)
set udg_y = udg_Loc + 200 * Sin( udg_angel)

call SetUnitX (udg_unit, udg_x)
call SetUnitY (udg_unit, udg_y)

Nếu thây phức tạp quá thì 1 cách đơn giản khác, sau khi set 1 Point như trên xong, ta dùng

set udg_x = GetLocationX (udg_Point)
set udg_y = GetLocationY (udg_Point)

rùi dùng

call SetUnitX (udg_unit, udg_x)
call SetUnitY (udg_unit, udg_y)

khá là đơn giản :D và dùng tọa độ thì khỏi cần remove leak gi hết nhé
 
anhso-16_untitled.jpg

làm thế nào nữa để khi biến hình không bị mất Item
 
Mình làm 1 spell khi channel thì làm cho thời gian chạy nhanh hơn (nếu là buổi sáng) hoặc chạy lùi lại (nếu là buổi tối) :
Mã:
    Events
        Time - Every 0.05 seconds of game time
    Conditions
    Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                ((In-game time of day) Equal to 18.02) or ((In-game time of day) Equal to 17.58)
            Then - Actions
                Unit - Order Night[3] to Stop
            Else - Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                (In-game time of day) Less than 17.58
            Then - Actions
                Game - Set the time of day to ((In-game time of day) + 0.01)
            Else - Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                (In-game time of day) Greater than 18.02
            Then - Actions
                Game - Set the time of day to ((In-game time of day) - 0.01)
            Else - Actions
(Trước và sau trigger này là 2 trigger Turn on và Turn off nên ko cần post nhé)
Tại sao khi channel, đến 17:35 thì ko thấy time "chạy" nữa, mặc dù vẫn đang trong thời gian channel. Từ 17:35 đến 18:02 là cast ko thấy time "chạy", mà trên trigger quy định là 17:58 mới vô hiệu hóa cơ mà?
 
Chỉnh sửa cuối:
Không mất item thì ta chỉ việc tạo 1 biến itemtype array, set tất cả các item trên người hero vào biến trước khi biến hình rùi sau khi biến hình chỉ việc Create lại item cho hero
 
có thể chỉ mình kĩ cái đc không làm rồi mà mất item hoài ag

---------- Post added at 14:49 ---------- Previous post was at 14:17 ----------

anhso-02_untitled.jpg

khi biến hình rồi mà 0 mất đi cái mặt nạ để biến hình
chỉnh cái nào mới mất mặt na
 
Đây là 1 số skill khá cơ bản và rất rễ làm nên em post lên cho 1 số thằng newbie xem: (có 2 skill của DotA).
Special Spell

---------- Post added at 18:10 ---------- Previous post was at 18:06 ----------

Nếu có lỗi hay bug gì thì nói nhé

---------- Post added at 18:13 ---------- Previous post was at 18:10 ----------

địa hình và 1 số triggers lấy nguyên mẫu của vua_do_hoa (Trigger Item va hero) vì lười tạo ý mà

---------- Post added at 20:05 ---------- Previous post was at 18:13 ----------

sr cái skill juxtarose của PL làm sai rồi :((
 
có thể chỉ mình kĩ cái đc không làm rồi mà mất item hoài ag

---------- Post added at 14:49 ---------- Previous post was at 14:17 ----------

anhso-02_untitled.jpg

khi biến hình rồi mà 0 mất đi cái mặt nạ để biến hình
chỉnh cái nào mới mất mặt na

=))
Dùng Unit -Replace
rùi chép lại từ khúc wait 10s trở xuống:))
 
sao làm hoài mà chả đc gì cả
mới tạo map nên còn gà
 
Status
Không mở trả lời sau này.
Back
Top