Tom có 1 tutorial về:
Mã:
SlideMove // ko cần OFF sẵn, cứ ON luôn
Events
Time - Every 0.04 seconds of game time
Conditions
Actions
For each (Integer A) from 1 to SlideIndex, do (Actions)
Loop - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
SlideTick[(Integer A)] Equal to 0
Then - Actions
For each (Integer B) from (Integer A) to (SlideIndex - 1), do (Actions)
Loop - Actions
Set SlideAngle[(Integer A)] = SlideAngle[((Integer A) + 1)]
Set SlideDistance[(Integer A)] = SlideDistance[((Integer A) + 1)]
Set SlideTick[(Integer A)] = SlideTick[((Integer A) + 1)]
Set SlideUnit[(Integer A)] = SlideUnit[((Integer A) + 1)]
Set SlideIndex = (SlideIndex - 1)
Else - Actions
-------- ---------------- --------
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
SlideTick[(Integer A)] Greater than 0
Then - Actions
Set SlideTick[(Integer A)] = (SlideTick[(Integer A)] - 1)
Set TempLoc = (Position of SlideUnit[(Integer A)])
Set TempLoc2 = (TempLoc offset by SlideDistance[(Integer A)] towards SlideAngle[(Integer A)] degrees)
Unit - Move SlideUnit[(Integer A)] instantly to TempLoc2
Special Effect - Create a special effect at TempLoc2 using Abilities\Spells\Human\FlakCannons\FlakTarget.mdl
Special Effect - Destroy (Last created special effect)
Destructible - Pick every destructible within 200.00 of TempLoc2 and do (Actions)
Loop - Actions
Destructible - Kill (Picked destructible)
Custom script: call RemoveLocation( udg_TempLoc )
Custom script: call RemoveLocation( udg_TempLoc2 )
Else - Actions
Đầu tiên có 1 cái loop, vòng lặp từ 1 đến SlideIndex (số slide đang dùng ấy) Nếu SlideIndex = 0 thì ko lặp.
Sau đó kiểm tra SlideTick từ 1 đến SlideIndex, cái nào = 0 thì dừng slide đó, nhg thay vì tắt trigger như trên thì ta giảm SlideIndex.
Mã:
For each (Integer B) from (Integer A) to (SlideIndex - 1), do (Actions)
Loop - Actions
Set SlideAngle[(Integer A)] = SlideAngle[((Integer A) + 1)]
Set SlideDistance[(Integer A)] = SlideDistance[((Integer A) + 1)]
Set SlideTick[(Integer A)] = SlideTick[((Integer A) + 1)]
Set SlideUnit[(Integer A)] = SlideUnit[((Integer A) + 1)]
Set SlideIndex = (SlideIndex - 1)
Loop B này dùng để đẩy index lùi lại. Ví dụ ta có thế này:
Và Slide 4 dừng, thì phải lặp từ slide 4, và đẩy các dữ liệu (unit, distance, angle, tick) lùi lại, tức là 5 -> 4, 6 -> 5, 7 -> 6 và giảm SlideIndex đi 1 đơn vị
Mã:
1 2 3 4 5 6 7 //cũ: index = 7
1 2 3 5 6 7 //đẩy lùi lại, bây giờ index = 6
còn phía dưới thì cứ move unit bình thường.
Bây giờ Slide đã MUI rồi, 100 unit slide cùng lúc cũng ko sao.
Vậy mọi người xem demo map Tom attach ở dưới nhá.