一般性的動作項目,包括等候、迴圈、設定變數、If判斷、JASS程式語句等
事件 | 內容 | 說明 |
---|---|---|
Do Nothing | Do nothing | 不執行任何動作,一般是用在If/then/else設定下面,如果其中一個不想執行動作,則用Do nothing。此外為了Trigger設計結構的完整性,也會有人用到 |
Comment | -------- Comment Text -------- | 註解文字,電腦不會執行它 |
Custom Script | Custom script: Script Code | 執行一行的JASS程式碼 *當你修改變數或Trigger的名稱時,電腦會幫你修正所有JASS碼及Trigger。但是如果你用Custom script來寫的話,電腦不會幫你修正! |
Wait | Wait Time seconds | 暫停X秒後再執行下一行動作。輸入負數或0會等待極短的時間 *每一次Wait會延遲約0.0x~0.2x秒,因此Wait 0.00 seconds實際上還是會等待一小段時間。由於這個誤差,因此Wait較適合做長時間的等待動作;略短的時間等待可能要考慮誤差;再更短的等待就不適合使用Wait了 |
Wait (Game-Time) | Wait Time game-time seconds | 暫停X遊戲秒後再執行下一行動作。輸入負數或0則不等待 *本動作是利用Wait的原理搭配計時器來製作的,因此Wait game-time較佔用系統資源,尤其地圖很大很複雜時儘量少用,以免造成lag,其他使用上的細節同Wait。 *如果遊戲速度為Fast,遊戲秒和真實秒基本上差不多。遊戲速度為Normal或Slow時,遊戲秒就會明顯長一些。因此,如果你在製作網路地圖(一般b.net上是鎖定玩Fast的),可以考慮使用Wait取代Wait game-time,以節省系統資源。 |
Wait For Condition | Wait until Condition, checking every Interval seconds | 每X秒判斷一次,直到判斷條件為真才執行下一行動作 *基本細節同Wait |
Wait For Sound | Wait for Sound to be Time seconds from finished playing | 等待聲音,直到該聲音剩X秒結束時,才執行下一行動作 *這個動作只等待正在播放的聲音。如果該聲音還沒開始播放或是已經播畢,則不執行任何動作。 |
Set Variable | Set Variable = Value | 設定任一型態的變數為指定的值 |
Skip Remaining Actions | Skip remaining actions | 略過後面的所有動作 *由於程式的設定,當你有使用到子函式(Pick every XXX in and do Actions)時,這個動作只會跳出那個子函式。例如你寫: Unit Group - Pick every unit in (Units in (Playable map area)) and do (Actions) Loop - Actions Unit - Change color of (Picked unit) to Red Skip remaining actions Special Effect - Create a special effect attached to the overhead of (Picked unit) using Abilities\Spells\Other\TalkToMe\TalkToMe.mdl Game - Display to (All players) the text: Test! 則程式只會執行: Unit Group - Pick every unit in (Units in (Playable map area)) and do (Actions) Loop - Actions Unit - Change color of (Picked unit) to Red Game - Display to (All players) the text: Test! 也就是只略過Pick中的actions,而不會結束整個Trigger |
If / Then / Else, Multiple Functions | If (All Conditions are True) then do (Then Actions) else do (Else Actions) | 如果所有的判斷條件皆為真,則執行Then Actions中的動作,否則執行Else Actions中的的動作 |
If / Then / Else | If Condition then do Action else do Action | 如果判斷條件為真,則執行前面的動作,否則執行後面的動作 |
For Each Integer A, Do Multiple Actions | For each (Integer A) from Start to End, do (Actions) | 使迴圈索引Integer A從Start到End,執行多行動作(第一次執行時Integer A = Start,第二次Integer A = Start +1,……,一直執行到Integer A = End執行完) *End必須要≧Start *等待的動作不應被使用在本動作的子動作中 |
For Each Integer B, Do Multiple Actions | For each (Integer B) from Start to End, do (Actions) | 使迴圈索引Integer B從Start到End,執行多行動作(第一次執行時Integer B = Start,第二次Integer B = Start +1,……,一直執行到Integer B = End執行完) *End必須要≧Start *等待的動作不應被使用在本動作的子動作中 |
For Each Integer Variable, Do Multiple Actions | For each (Integer Variable) from Start to End, do (Actions) | 使用指定的整數變數當作迴圈索引,從Start到End,執行多行動作(第一次執行時該變數 = Start,第二次該變數 = Start +1,……,一直執行到該變數 = End執行完) *End必須要≧Start *等待的動作可以使用在本動作的子動作中 ,但是請確定等待的時間內,該變數的值不會被其他的觸發修改。否則可能會嚴重出錯! |
For Each Integer A, Do Action | For each (Integer A) from Start to End, do Action | 使迴圈索引Integer A從Start到End,執行單行動作(第一次執行時Integer A = Start,第二次Integer A = Start +1,……,一直執行到Integer A = End執行完) *End必須要≧Start |
For Each Integer B, Do Action | For each (Integer B) from Start to End, do Action | 使迴圈索引Integer B從Start到End,執行單行動作(第一次執行時Integer B = Start,第二次Integer B = Start +1,……,一直執行到Integer B = End執行完) *End必須要≧Start |
For Each Integer Variable, Do Action | For each (Integer Variable) from Start to End, do Action | 使用指定的整數變數當作迴圈索引,從Start到End,執行單行動作(第一次執行時該變數 = Start,第二次該變數 = Start +1,……,一直執行到該變數 = End執行完) *End必須要≧Start |
討論區