[ai cần bài hướng dẫn vô đây] "request" tutorials

Status
Không mở trả lời sau này.
attachment.php


Trong hình trên:
caster là điểm của hero khi vừa cast spell, target là điểm "mục tiêu"
A là góc giữa caster và target, gọi là "góc cast"
D là khoảng cách giữa caster và target

Giờ phải đi tìm a bC
---
Giả sửa tổng thời gian khi bắt đầu move "crescent" này tới lúc nó mất (tới target point) thì là 1 giây, ta dùng 0.04s timer vậy sẽ có 1 / 0.04 = 25 tick

Để tính a, ta dùng D * Sin( góc ), "góc" ở đây sẽ chạy từ 0 -> 90, 25 tick -> mỗi tick góc này sẽ tăng 90 / 25 tạm gọi là góc sin. Vậy ta có a = D * Sin( sin * tick )

Tương tự với b, nhg "D" của b thì là "độ rộng" mà ta cho trước (của Twinmoon hiện nay là 200) -> 200 * Sin( góc ), nhg với góc chạy từ 0 -> 180 -> mỗi tick góc này tăng 180 / 25, tạm gọi là góc "sin2". Vậy ta có b = 200 * Sin( sin2 * tick)

Sau khi có ab thì ta tìm điểm C.
Đơn giản, chỉ là:
Point with Polar Offset với điểm gốc là caster, khoảng cách là a và góc là A => ta đc điểm C'.

Point with Polar Offset với điểm gốc là C', khoảng cách là b và góc là A+90 ( "crescent" bên trái là +90, còn bên phải là -90, như hình là "crescent" bên trái ) => ta đc điểm C

Sau đó chỉ cần move "crescent dummy" vào C là xong.
--
đến phần deal dmg, để deal dmg, ta pick unit xung quanh C, nhớ là phải có 1 group chứa "những unit đã bị crescent đi qua", điều kiện pick unit thì ngoài các điều kiện thông thường, phải thêm điều kiện: Matching unit is in "group chứa những unit đã bị crescent đi qua" equal to False

--
Vậy là xong.
 

Attachments

  • twinmoon.JPG
    twinmoon.JPG
    15.5 KB · Đọc: 90
Thế cho em hỏi biến có trong phần đấy. Nhìn vào trong đấy chả biết cái nào là biến cái nào là code. Thấy mấy phần set xxx thì tạo biến ra, bên cạnh có số thì là real hoặc interger. Rõ ràng thế nhưng nó vẫn báo lỗi/
 
thx anh Tom nhìu lắm :-*
mà cái spell của cha Huy đưa lên hay mà nhìn khó ghê
spell đó cũng phải pro cỡ anh Tom mới làm đc , đừng nói nịnh nha =))
 
quái thật ! em làm thử đúng rồi mà ko đc :( , thử với 1 con cũng ko xong
anh xem giùm em nha
Mã:
Axe
    Events
        Unit - A unit Starts the effect of an ability
    Conditions
        (Ability being cast) Equal to Circle 
    Actions
        Set Cast = (Triggering unit)
        Set Target = (Target unit of ability being cast)
        Set TempLoc = (Position of Cast)
        Set TempLoc2 = (Position of Target)
        Set Angle = (Angle from TempLoc to TempLoc2)
        Set Distance = (Distance between TempLoc and TempLoc2)
        Set Tick = 25
        Unit - Create 1 Dummy for (Owner of Cast) at TempLoc facing Angle degrees
        Set Dummy = (Last created unit)
        Unit - Add a 1.20 second Generic expiration timer to Dummy
        Trigger - Turn on Move <gen>
        Wait 1.20 seconds
        Trigger - Turn off Move <gen>
        Custom script:   call RemoveLocation (udg_TempLoc)
Mã:
Move
    Events
        Time - Every 0.04 seconds of game time
    Conditions
    Actions
        Set a = (Distance x (Sin((3.60 x (Real(Tick))))))
        Set b = (300.00 x (Sin((7.20 x (Real(Tick))))))
        Set c = (TempLoc offset by a towards Angle degrees)
        Set C = (c offset by b towards (Angle + 90.00) degrees)
        Unit - Move Dummy instantly to C
        Set TempLoc3 = (Position of Dummy)
        Set Group = (Units within 150.00 of TempLoc3 matching ((((Matching unit) belongs to an enemy of (Owner of Cast)) Equal to True) and (((Matching unit) is in Group) Equal to False)))
        Unit Group - Pick every unit in Group and do (Actions)
            Loop - Actions
                Unit - Cause Dummy to damage (Picked unit), dealing 500.00 damage of attack type Spells and damage type Normal
        Custom script:   call DestroyGroup (udg_Group)
        Custom script:   call RemoveLocation (udg_C)
 
thứ 1: tick là để "đếm" số lần chạy của timer, cần 1s, với 25 tick chạy 0.04s mỗi tick -> 0.04s x 25 = 1s. Tick cứ để ở 25, ko giảm, ko tăng thì nó đứng yên 1 chỗ là đúng rồi. Wait gì mà wait, 25 tick, mỗi lần chạy timer thì giảm, bằng 0 thì dừng trigger thôi
thứ 2: nếu tick giảm ko đc thì tăng tick, thay vì 25 -> 0 thì 0 -> 25.
 
uhm move rồi nhưng mà sao tạo dummy ngay point của cast mà lúc cast spell thì nó tạo ngay point của target và move từ target bay lại cast ???
 
thứ 2: nếu tick giảm ko đc thì tăng tick, thay vì 25 -> 0 thì 0 -> 25.

ko đọc ?
1222222222222222222222222222222222222222222
 
có mà em có làm giảm tick nó mới move chứ nhưng mà chả biết sao nó tạo dummy ngay chỗ target và move lại cast lạ thật :-o
mà tăng tick cũng vậy cũng y như giảm tick :(
Mã:
Axe
    Events
        Unit - A unit Starts the effect of an ability
    Conditions
        (Ability being cast) Equal to Circle 
    Actions
        Set Cast = (Triggering unit)
        Set Target = (Target unit of ability being cast)
        Set TempLoc = (Position of Cast)
        Set TempLoc2 = (Position of Target)
        Set Angle = (Angle from TempLoc to TempLoc2)
        Set Distance = (Distance between TempLoc and TempLoc2)
        Set Tick = 25
        Unit - Create 1 Dummy for (Owner of Cast) at TempLoc facing Angle degrees
        Set Dummy = (Last created unit)
        Unit - Add a 1.00 second Generic expiration timer to Dummy
        Unit - Create 1 Dummy for (Owner of Cast) at TempLoc facing Angle degrees
        Set Dummy2 = (Last created unit)
        Unit - Add a 1.00 second Generic expiration timer to Dummy2
        Trigger - Turn on Move <gen>
        Custom script:   call RemoveLocation (udg_TempLoc)
Mã:
Move
    Events
        Time - Every 0.04 seconds of game time
    Conditions
    Actions
        Set a = (Distance x (Sin((3.60 x (Real(Tick))))))
        Set b = (300.00 x (Sin((7.20 x (Real(Tick))))))
        Set c = ((Position of Cast) offset by a towards Angle degrees)
        Set C = (c offset by b towards (Angle + 90.00) degrees)
        Unit - Move Dummy instantly to C
        Set C = (c offset by b towards (Angle - 90.00) degrees)
        Unit - Move Dummy2 instantly to C
        Set TempLoc3 = (Position of Dummy)
        Set TempLoc4 = (Position of Dummy2)
        Set Tick = (Tick - 1)
        Set Group = (Units within 150.00 of TempLoc3 matching ((((Matching unit) belongs to an enemy of (Owner of Cast)) Equal to True) and (((Matching unit) is in Group) Equal to False)))
        Unit Group - Pick every unit in Group and do (Actions)
            Loop - Actions
                Unit - Cause Dummy to damage (Picked unit), dealing 200.00 damage of attack type Spells and damage type Normal
        Custom script:   call DestroyGroup (udg_Group)
        Set Group2 = (Units within 150.00 of TempLoc4 matching ((((Matching unit) belongs to an enemy of (Owner of Cast)) Equal to True) and (((Matching unit) is in Group2) Equal to False)))
        Unit Group - Pick every unit in Group and do (Actions)
            Loop - Actions
                Unit - Cause Dummy to damage (Picked unit), dealing 200.00 damage of attack type Spells and damage type Normal
        Custom script:   call DestroyGroup (udg_Group2)
        Custom script:   call RemoveLocation (udg_C)
        Custom script:   call RemoveLocation (udg_c)
 
trigger trên là giảm tick mà #-o
--
hay làm "đúng" theo Twinmoon, giảm tick, offset từ target, với a * (-1)
 
hix làm theo cách của anh cũng ko xong :(
nếu offset từ target thì nó cũng giống như offset từ caster nhưng nó ngược lại , nghĩa là tạo dummy sau lưng target rồi move về target :(
 
tí nữa xóa hết.
---
hay làm "đúng" theo Twinmoon, giảm tick, offset từ target, với a * (-1)

??
123123123123123123123
 
Tui chả hiếu tại sao ông rongdoVN kô làm đc, tui đã làm và thành công;)) Thank anh Tom:))

Mã:
Twinmoon
    Events
        Unit - A unit Starts the effect of an ability
    Conditions
        (Ability being cast) Equal to Breath of Fire 
    Actions
        Set Twinmoon_Caster = (Triggering unit)
        Set Twinmoon_PointsCaster = (Position of Twinmoon_Caster)
        Set Twinmoon_PointsTarget = (Target point of ability being cast)
        Set Twinmoon_Real[0] = (Angle from Twinmoon_PointsCaster to Twinmoon_PointsTarget)
        Set Twinmoon_Real[1] = (Distance between Twinmoon_PointsCaster and Twinmoon_PointsTarget)
        Set Twinmoon_Tick = 0
        For each (Integer A) from 1 to 3, do (Actions)
            Loop - Actions
                Unit - Create 1 Twinmoon Dummys for (Owner of Twinmoon_Caster) at Twinmoon_PointsCaster facing Twinmoon_Real[0] degrees
                Set Twinmoon_Dummys[(Integer A)] = (Last created unit)
        If ((Twinmoon Move <gen> is on) Equal to True) then do (Trigger - Turn off Twinmoon Move <gen>) else do (Do nothing)
        If ((Twinmoon Move <gen> is on) Equal to False) then do (Trigger - Turn on Twinmoon Move <gen>) else do (Do nothing)

Mã:
Twinmoon Move
    Events
        Time - Every 0.04 seconds of game time
    Conditions
    Actions
        Set Twinmoon_Real2[1] = (Twinmoon_Real[1] x (Sin((3.60 x (Real(Twinmoon_Tick))))))
        Set Twinmoon_Real2[2] = (200.00 x (Sin((7.20 x (Real(Twinmoon_Tick))))))
        Set Twinmoon_Points[1] = (Twinmoon_PointsCaster offset by Twinmoon_Real2[1] towards Twinmoon_Real[0] degrees)
        Set Twinmoon_Points[2] = (Twinmoon_Points[1] offset by Twinmoon_Real2[2] towards (Twinmoon_Real[0] + 90.00) degrees)
        Set Twinmoon_Points[3] = (Twinmoon_Points[1] offset by Twinmoon_Real2[2] towards (Twinmoon_Real[0] - 90.00) degrees)
        Set Twinmoon_Tick = (Twinmoon_Tick + 1)
        Unit - Move Twinmoon_Dummys[1] instantly to Twinmoon_Points[1]
        Unit - Move Twinmoon_Dummys[2] instantly to Twinmoon_Points[2]
        Unit - Move Twinmoon_Dummys[3] instantly to Twinmoon_Points[3]
        Custom script:   call RemoveLocation (udg_Twinmoon_Points[1])
        Custom script:   call RemoveLocation (udg_Twinmoon_Points[2])
        Custom script:   call RemoveLocation (udg_Twinmoon_Points[3])
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                Twinmoon_Tick Greater than or equal to 26
            Then - Actions
                Trigger - Turn off (This trigger)
                For each (Integer A) from 1 to 3, do (Actions)
                    Loop - Actions
                        Unit - Kill Twinmoon_Dummys[(Integer A)]
            Else - Actions
 
tui làm ngược lại với ông hèn gì nó move ngược lại :(
tăng tick thế mà tui đi giảm tick =))
 
thứ 1: tick là để "đếm" số lần chạy của timer, cần 1s, với 25 tick chạy 0.04s mỗi tick -> 0.04s x 25 = 1s. Tick cứ để ở 25, ko giảm, ko tăng thì nó đứng yên 1 chỗ là đúng rồi. Wait gì mà wait, 25 tick, mỗi lần chạy timer thì giảm, bằng 0 thì dừng trigger thôi
thứ 2: nếu tick giảm ko đc thì tăng tick, thay vì 25 -> 0 thì 0 -> 25.

Tại pa kô đọc chứ sao, rõ ràng ông Tom bảo + tick rồi mà cứ đi giảm tickb-(
 
Anh Tom ơi, giúp em cái vụ spell này:
_Triệu gọi crushing wave từ dưới đất mọc lên và nhảy vào đầu thằng target.
Khổ nỗi em kô làm đc cái thể loại hướng của nó. Lúc cái crushing wave đang mọc từ dưới đất lên cao thì hướng của nó là hướng về trên trời và lúc nhảy vào đầu thằng cast thì hướng cắm xuống đất. Thấy map bọn TQ có cái spell như thế, thấy hay hay mà kô làm đc;))
 
Các Bác Ơi Giúp Giùm NEWGEN WE Của Mình Với! Mình Tạo Map Bằng NewGen , Create 1 Biến Skill Là Ability , Rồi Set Biến Đó = War Storm. Và Sau Đó Save Map Thì NewGen Báo Lỗi. Thế Lấo?:((
 
vậy bạn bít làm cách nào cho nhà chính banh thì thắng hok>< mình hok biết
 
Events
Unit - A unit Dies
Conditions
(Dying unit) Equal to .....
Actions
Game - Victory Player..... (Show dialogs, Show scores)
Nếu làm map mele thì có sẵn trigger
Melee Initialization
Events
Map initialization
Conditions
Actions
Melee Game - Enforce victory/defeat conditions (for all players)
 
Status
Không mở trả lời sau này.
Back
Top