Topic hỏi đáp về cách làm map | version 11

Status
Không mở trả lời sau này.
Xin chào, mình muốn hỏi về Jass:
Làm thế nào để tạo lệnh hiển thị chính xác HP và MP của Unit khi chơi nhỉ? Tầm hơn 16k là bị đen rồi không nhìn bình thường được nữa. Mình muốn sử dụng "call DisplayTimedTextToPlayer" để hiển thị cho người dùng lệnh biết.
 
Chỉnh sửa cuối:
Events
A unit start the efect ò an abillity
Conditions
Abillity being cast equal to Knockback Knife
Actions
EGUI-Knockback Unit-Target Unit of abillity being cast facing Unit-Facing angles.

Thế thôi mà lai. bị error

Install EGUI vào map chưa :-??
 
Cho hỏi là...làm sao để lưu 1 group từ 1 function này qua function khác vậy?
Mình làm thế này nhưng chẳng hiểu vì sao (hình như cái group lưu không được) mà unit trong group đó chỉ nhích lên...1 tí rồi đứng luôn :(

[spoil]
Mã:
struct SWdata
    unit SWCast
    group SWgroup
    real SWangle
    integer SWticktruct

function SWStart takes nothing returns nothing
    local timer SW = GetExpiredTimer()
    local SWdata data = GetTimerData( SW )
    local group SWgroup2
    local unit SWpick
    local location SWloc1
    local location SWloc2

    set SWgroup2 = CreateGroup()
    set SWgroup2 = data.SWgroup
    loop
        set SWpick = FirstOfGroup( SWgroup2 )
        exitwhen SWpick==null
        call GroupRemoveUnit( SWgroup2, SWpick )
        if not UnitHasBuffBJ(SWpick, 'Avul') and not IsUnitType( SWpick, UNIT_TYPE_DEAD ) and IsUnitEnemy(SWpick, GetOwningPlayer(data.SWCast) ) and not IsUnitType( SWpick, UNIT_TYPE_STRUCTURE ) and ( GetUnitAbilityLevelSwapped('A006',  SWpick) >= 1 )then
            set SWloc1 = GetUnitLoc( SWpick )
            set SWloc2 = PolarProjectionBJ( SWloc1, 40, data.SWangle )
    
            call SetUnitPositionLocFacingBJ( SWpick, SWloc2, data.SWangle )
            call RemoveLocation( SWloc1 )
            call RemoveLocation( SWloc2 )
            set SWloc1 = null
            set SWloc2 = null
        endif
 
    endloop 
    
    call DestroyGroup( SWgroup2 )
    set SWgroup2 = null 
    set SWpick = null
    set data.SWtick = data.SWtick - 1

    if data.SWtick < 1 then
        call DestroyGroup( data.SWgroup )
        set data.SWgroup = null    
        call ReleaseTimer( SW )
        call data.destroy()
    endif
    
    set SW = null
endfunction

function SWAct takes nothing returns nothing
    local SWdata data = SWdata.create()
    local timer SW = NewTimer()
    local unit SWCast = GetTriggerUnit()
    local location SWloc1 = GetUnitLoc(SWCast)
    local location SWloc2 = GetSpellTargetLoc()
    local group SWgroup =  GetUnitsInRangeOfLocAll( 80, SWloc2 )
    set data.SWangle = AngleBetweenPoints( SWloc2, SWloc1 )
    set data.SWgroup = SWgroup
    set data.SWtick = 30
    set data.SWCast = SWCast
    
    call SetTimerData( SW, data )
    call TimerStart( SW, 0.04, true, function SWStart )
    
    call RemoveLocation( SWloc1 )
    call RemoveLocation( SWloc2 )
    set SWloc1 = null
    set SWloc2 = null
    set SWCast = null
    set SW = null
endfunction

function SWConds takes nothing returns boolean
     return GetSpellAbilityId() == 'A003'
endfunction

function Trig_Swallow_Actions takes nothing returns nothing
endfunction

//===========================================================================
function InitTrig_Swallow takes nothing returns nothing
    set gg_trg_Swallow = CreateTrigger(  )
    call TriggerRegisterAnyUnitEventBJ( gg_trg_Swallow, EVENT_PLAYER_UNIT_SPELL_EFFECT )
    call TriggerAddCondition( gg_trg_Swallow, Condition( function SWConds ) )
    call TriggerAddAction( gg_trg_Swallow, function SWAct )
endfunction
[/spoil]
 
cho em hỏi sau khi cast chiêu này nó gây giựt 1 chút ai biết tại sao không
Trigger 1
VMBD Copy Copy
Events
Conditions
Actions
Trigger - Turn off (This trigger)
Set TKUnit[1] = (Damage source)
Set TKUnit[2] = (Triggering unit)
Set TKPoint[1] = (Position of TKUnit[1])
Set TKPoint[2] = (Position of TKUnit[2])
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(TKUnit[2] has buff TK ) Equal to True
(Unit-type of TKUnit[1]) Equal to |cff0000ffLiªn Hoµn æ|r
Then - Actions
Unit - Create 1 TK for (Owner of TKUnit[1]) at TKPoint[1] facing Default building facing degrees
Set TKUnit[3] = (Last created unit)
Unit - Add a 1.50 second Generic expiration timer to TKUnit[3]
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Level of Th­¬ng Khung ThËp Tam Thøc for TKUnit[1]) Greater than or equal to 5
Then - Actions
Unit - Add Thien Phong Cuong Cu2 to TKUnit[3]
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Level of Th­¬ng Khung ThËp Tam Thøc for TKUnit[1]) Equal to 10
Then - Actions
Unit - Add Th­¬ng Khung to TKUnit[3]
Else - Actions
Unit - Turn collision for TKUnit[3] Off
Trigger - Turn on VM2 Copy Copy <gen>
Wait 1.00 seconds
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
Then - Actions
Trigger - Turn on (This trigger)
Trigger - Turn on VM2 Copy Copy <gen>
Custom script: call RemoveLocation ( udg_TKPoint[1] )
Custom script: call RemoveLocation ( udg_TKPoint[2] )
Unit - Remove TKUnit[3] from the game
Else - Actions
Else - Actions
Trigger - Turn on (This trigger)
Trigger - Turn on VM2 Copy Copy <gen>
Trigger2
VM2 Copy Copy
Events
Time - Every 0.05 seconds of game time
Conditions
Actions
Set TKPoint[3] = (Position of TKUnit[3])
Unit - Move TKUnit[3] instantly to (TKPoint[3] offset by 75.00 towards (Angle from TKPoint[1] to TKPoint[2]) degrees)
Set TKGroup = (Units within 100.00 of TKPoint[3])
Unit Group - Pick every unit in TKGroup and do (Actions)
Loop - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
((Picked unit) belongs to an enemy of (Owner of TKUnit[1])) Equal to True
((Picked unit) is alive) Equal to True
Then - Actions
Set TKPoint[4] = (Position of (Picked unit))
Special Effect - Create a special effect at TKPoint[4] using MDX\NgaoTuyet.mdx
Special Effect - Destroy (Last created special effect)
Unit - Cause TKUnit[1] to damage (Picked unit), dealing (Real((Strength of TKUnit[1] (Include bonuses)))) damage of attack type Hero and damage type Cold
Custom script: call RemoveLocation ( udg_TKPoint[4] )
Else - Actions
Custom script: call RemoveLocation ( udg_TKPoint[3] )
Custom script: call DestroyGroup ( udg_TKGroup )
Chiêu này dạng autocast , ai biết tại sao bị dựt không ?
 
mọi người cho mình hỏi có cách nào tăng range tấn công không ? mình chỉnh trong object không tác dụng,muốn chỉnh trong trigger vậy nó nằm ở chỗ nào ?
 
Vào phần Upgrade kiếm bên Human cái Up màu đen của Rifeman, add cái up đó cho Hero muốn tăng ranger, sau đó viết trigger khi làm gì đó thì up ranger lên
 
bạn đã chỉnh Acquisition Range trong object chưa? Phải chỉnh Acquisition Range > Range thì unit mới đánh xa được nếu không nó sẽ đi vào phạm vi Acquisition Range rồi mới tấn công.
 
Cám ơn,cái đó thì mình biết,và chỉnh như ý bạn FlameDrake mình cũng làm rồi,range tăng.

Nhưng mình đang làm một cái spell khi mình cast buff lên người,sẽ tăng range,hết buff thì range lại về như cũ.

Mình thử rồi mà range nó cứ tăng mãi thôi chứ không về như cũ,ai biết thì vui lòng chỉ giúp mình với :D
 
Spell: Counter Magic Aura
Mô tả: phản lại spell trong phạm vi 900 range (tương tự spell steal nhưng là aura)

Mã:
CMA Learn
    Events
        Unit - A unit Learns a skill
    Conditions
        (Learned Hero Skill) Equal to (==) Endurance Aura
    Actions
        Unit Group - Add (Triggering unit) to CMAGroup[1]
Mã:
CMA
    Events
        Time - Every 1.00 seconds of game time
    Conditions
    Actions
        Unit Group - Pick every unit in CMAGroup[1] and do (Actions)
            Loop - Actions
                Set CMAInt = (CMAInt + 1)
                If (CMAInt Equal to (==) 51) then do (Set CMAInt = 1) else do (Do nothing)
                Set CMAUnit[CMAInt] = (Picked unit)
         Do Multiple ActionsFor each (Integer A) from 1 to 50, do (Actions)
            Loop - Actions
                Set CMAPoint = (Position of CMAUnit[(Integer A)])
                Set CMAGroup[2] = (Units within 900.00 of CMAPoint)
                Unit Group - Pick every unit in CMAGroup[2] and do (Actions)
                    Loop - Actions
                        Unit - Create 1 Dummy for (Owner of CMAUnit[(Integer A)]) at CMAPoint facing Default building facing (270.0) degrees
                        Unit - Add a 0.10 second Generic expiration timer to (Last created unit)
                        Unit - Add Spell Steal (custom) to (Last created unit)
                        Unit - Order (Last created unit) to Human Spell Breaker - Spell Steal (Picked unit)
                Custom script:   call DestroyGroup(udg_CMAGroup[2])
                Custom script:   call RemoveLocation(udg_CMAPoint)

Ai giúp giùm cái spell trên. Không biết leak hay lỗi chỗ nào mà lag quá trời. Yêu cầu là spell MUI luôn nha. Thanks trước.
 
ơ thế Install làm sao hở bạn???

Tìm cái map EGUI.w3x.Mở ra copy hết trigger rồi bỏ vào map.Thế là xong !

---------- Post added at 20:25 ---------- Previous post was at 20:21 ----------

Spell: Counter Magic Aura
Mô tả: phản lại spell trong phạm vi 900 range (tương tự spell steal nhưng là aura)

Code:
CMA Learn
Events
Unit - A unit Learns a skill
Conditions
(Learned Hero Skill) Equal to (==) Endurance Aura
Actions
Unit Group - Add (Triggering unit) to CMAGroup[1]
Code:
CMA
Events
Time - Every 1.00 seconds of game time
Conditions
Actions
Unit Group - Pick every unit in CMAGroup[1] and do (Actions)
Loop - Actions
Set CMAInt = (CMAInt + 1)
If (CMAInt Equal to (==) 51) then do (Set CMAInt = 1) else do (Do nothing)
Set CMAUnit[CMAInt] = (Picked unit)
Do Multiple ActionsFor each (Integer A) from 1 to 50, do (Actions)
Loop - Actions
Set CMAPoint = (Position of CMAUnit[(Integer A)])
Set CMAGroup[2] = (Units within 900.00 of CMAPoint)
Unit Group - Pick every unit in CMAGroup[2] and do (Actions)
Loop - Actions
Unit - Create 1 Dummy for (Owner of CMAUnit[(Integer A)]) at CMAPoint facing Default building facing (270.0) degrees
Unit - Add a 0.10 second Generic expiration timer to (Last created unit)
Unit - Add Spell Steal (custom) to (Last created unit)
Unit - Order (Last created unit) to Human Spell Breaker - Spell Steal (Picked unit)
Custom script: call DestroyGroup(udg_CMAGroup[2])
Custom script: call RemoveLocation(udg_CMAPoint)
Ai giúp giùm cái spell trên. Không biết leak hay lỗi chỗ nào mà lag quá trời. Yêu cầu là spell MUI luôn nha. Thanks trước.

Cái spell này nghĩa là ai cast vào là bị phản à.Sao đây lại cứ 1s pick toàn bộ unit xung quanh rồi loop cái này
Loop - Actions
Unit - Create 1 Dummy for (Owner of CMAUnit[(Integer A)]) at CMAPoint facing Default building facing (270.0) degrees
Unit - Add a 0.10 second Generic expiration timer to (Last created unit)
Unit - Add Spell Steal (custom) to (Last created unit)
Unit - Order (Last created unit) to Human Spell Breaker - Spell Steal (Picked unit)

Cứ 1s làm toàn bộ unit xung quanh như vậy thì làm sao mà không lag đc
 
Àh bác FlameDrake ơi , theo sau khi em chơi 9X Hero Def thì bác cho em hỏi mấy cái Skin UI Tile bác kím đâu mà đẹp dzữ , zới lại pác cho em cái trigger hiệu ứng delay khi shake cái camera qua lại (nhìn ảo ảo :D ) với cái trigger "vn" để go home (em chỉ mún test với cái trigger "-gh" của em) .

tks bác ạh ^^ !
 
Ai có thể chỉ mình cách gói gọn cái đống này thành 1 không ?

1-2.jpg
 
Ai có thể chỉ mình cách gói gọn cái đống này thành 1 không ?

1-2.jpg

For each (Integer A) from 1 to 5 do (Actions)
Player - Make (Owner of Unit) treat Player(Integer A) as an enemy
 
Àh bác FlameDrake ơi , theo sau khi em chơi 9X Hero Def thì bác cho em hỏi mấy cái Skin UI Tile bác kím đâu mà đẹp dzữ , zới lại pác cho em cái trigger hiệu ứng delay khi shake cái camera qua lại (nhìn ảo ảo :D ) với cái trigger "vn" để go home (em chỉ mún test với cái trigger "-gh" của em) .

tks bác ạh ^^ !

về phần ui thì tìm ở hiveworkshop => skin. Camera ko rõ cậu nói gì, thử shake camera hay smoothing xem. Còn lại events là player chat gh, actions unit - move unit owner by triggering player to region x...
 
Àh bác FlameDrake ơi , theo sau khi em chơi 9X Hero Def thì bác cho em hỏi mấy cái Skin UI Tile bác kím đâu mà đẹp dzữ , zới lại pác cho em cái trigger hiệu ứng delay khi shake cái camera qua lại (nhìn ảo ảo :D ) với cái trigger "vn" để go home (em chỉ mún test với cái trigger "-gh" của em) .

tks bác ạh ^^ !
- Skin giao diện cho map ở đây, có demo luôn, vào coi HD rồi làm theo :D, riêng con chuột thì phải chỉnh đúng race mới hiện ( nếu Human thì chỉnh đường dẫn là Human )
- Font chữ map thì có thể down tại đây
Còn về tưng tưng Camera thì là ( 30 là giựt tưng tưng càng cao càng tưng ác tui thấy 30 ổn nên cho 30, nếu muốn hết tưng thì cho về 0 khi end skill )
Mã:
Camera - Shake the camera for (Owner of Thằng cast skill) with magnitude [B]30.00[/B]
Còn về lệnh vn để về nhà thì, trước tiên bác cần set số Hero của map để tiện cho việc move ( VD: 9x có 6 player thì set 6 Hero, ví dụ sau khi Hero xuất hiện thì set Hero[1] = Last create unit cho player 1, tương tự các player khác
Và code thì bao nhiêu player thì bấy nhiêu code
Mã:
Go Home 1
    Events
        Player - Player 1 (Red) types a chat message containing [B]vn[/B] as An exact match
    Conditions
    Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                [B](Hero[1] is alive) Equal to True[/B]
            Then - Actions
                Set War_Hero = (Center of War Hero <gen>)
                Camera - Pan camera for (Owner of Hero[1]) to War_Hero over 0.00 seconds
                Unit - Move Hero[1] instantly to War_Hero
                Special Effect - Create a special effect at War_Hero using Abilities\Spells\Human\MassTeleport\MassTeleportCaster.mdl
                Special Effect - Destroy (Last created special effect)
                Custom script:   call RemoveLocation(udg_War_Hero)
            Else - Actions
P.S:
- Bác phải nhớ trước khi muốn move nó về nhà thì thêm hàm if là nó phải còn sống, nếu nó vừa chết mà move về, có thể sẽ ảnh hưởng đến trigger hồi sinh của nó :D
- Chắc bác sẽ nói tại sao ko viết 1 trigger rồi nhét 6 player gõ vn sẽ về nhà = vòng Loop, thì mình xin nhắc luôn nếu nhét 6 player vào 1 và làm Loop thì khi 1 player gõ vn thì 6 thằng bay về nhà hết, nên phải chia ra :D để thằng nào gõ thì thằng đó về :D

-----

À nhân tiện mình cũng hỏi luôn, nghe nhiều ng` nói model HQ HQ là model rì thế, Hàn Quốc chăng ? và ở đâu có thể down những model HQ này
 
Chỉnh sửa cuối:
Ai vui lòng check giúp mình với,mình đang làm cái buff làm unit đang liên minh với nhau biến thành kẻ thù,mình lò mò từ trưa tới giờ mới làm được mà nó lag lag,anh biết leak chỗ nào giúp mình :D

1-3.jpg


2-1.jpg
 
Làm sao để 1 unit đạng creep có khả năng kháng phép + không sử dụng đc 1 số skill vào unit đấy ,không thể hút máu , -def trụ như town gốc
 
Ko rõ chữ hq nhưng theo em hiểu là high quality ( chất lượng cao bác ạ)

Một unit kháng phép thì ép cho unit đó ability spell immunity...
 
Mã:
Go Home All
    Events
        Player - Player 1 ....... types a chat message containing [B]vn[/B] as An exact match
        Player - Player 2 ....... types a chat message containing [B]vn[/B] as An exact match
        Player - Player 3 ....... types a chat message containing [B]vn[/B] as An exact match
        Player - Player 4 ....... types a chat message containing [B]vn[/B] as An exact match
        Player - Player 5 ....... types a chat message containing [B]vn[/B] as An exact match
        Player - Player 6 ....... types a chat message containing [B]vn[/B] as An exact match
    Conditions
    Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                (Hero[[B]Player number of (Triggering player)[/B]] is alive) Equal to True
            Then - Actions
                Set War_Hero = (Center of War Hero <gen>)
                Camera - Pan camera for (Owner of Hero[[B]Player number of (Triggering player)][/B]) to War_Hero over 0.00 seconds
                Unit - Move Hero[[B]Player number of (Triggering player)[/B]] instantly to War_Hero
                Special Effect - Create a special effect at War_Hero using Abilities\Spells\Human\MassTeleport\MassTeleportCaster.mdl
                Special Effect - Destroy (Last created special effect)
                Custom script:   call RemoveLocation(udg_War_Hero)
            Else - Actions

Cách của FD không sai ... chỉ là [-X
Nên tối ưu lại như trên xem sao :>
 
Status
Không mở trả lời sau này.
Back
Top