Besiege

Besiege

Not enough ratings
VDOT_Bv2 Logic Sample 邏輯範本
   
Award
Favorite
Favorited
Unfavorite
Types: Levels
File Size
Posted
Updated
288.440 KB
1 Sep, 2021 @ 3:21am
2 Sep, 2021 @ 11:38pm
2 Change Notes ( view )

Subscribe to download
VDOT_Bv2 Logic Sample 邏輯範本

In 2 collections by Nice Name
Nice Name Science
116 items
Logic Systems
12 items
Description


English Description
"Variable Distance Orbit Transformation Type-B Version-2" is a system that runs the movement of a target object orbiting a set pivot in a variable distance away as the gif above shows.

You can call it "Circular Motion", "Rotation around an axis" or anything you want, I named it VDOT is purely because at the beginning I didn't know how to name it, aaaand now it's just too late to change it. Don't laugh.

How it work
  1. Centering - Use "Transform" logic to move the target object to the rotation center.
  2. Rotating - Use "Transform" logic to rotate the target object on any axis.
  3. Returning - Use "Transform" logic to move the target object back to the orbit.
When doing steps above instantaneously, the target object will move like it's orbiting an axis or point.



Since the distant between the target and the center is not constant, we will use variables to track it when it comes to centering and returning the target object. This example level used IOv2 to do the calculations. (You only need to know this IO v2 allows the player to "get" a variable, since Besiege doesn't have the function to do so.)

For logic details, check out the logic overview at the bottom page.

How to use it
Press keys T, G, F, H to move the target object around.

In the example level I have made everything very clear and easy, only the following commands are required in VDOT:
 Forward
Variable forward =1, VDOT_Bv2
 This will move the target object 1 unit forward.
 Backward
Variable backward =1, VDOT_Bv2
 This will move the target object 1 unit backward.
 Turn Left
Variable left =1, VDOT_Bv2
 This will move the target object 1 degree to the left.
 Turn Right
Variable right =1, VDOT_Bv2
 This will move the target object 1 degree to the right.

As you can tell all the commands can only move the target object 1 meter or degree at once, so to keep the target object moving when holding a key, I made a "Loop Box" which manuals the loops of commands, so that the loops will keep sending commands to VDOT_Bv2.

--------------------------------------------------------

繁體中文簡介
「高階歸元乙型第貳版 (VDOT_Bv2)」,就如同頁面最上層的gif所展示的一樣,是指用來讓物件繞一軸以不定距離作圓周運動的系統。

你可以稱它作「圓周運動」、「繞軸旋轉」、「軌道運動」或其他你想怎麼稱它就怎麼稱它,我叫它「高階歸元」純粹是因為我當初不知道該怎麼稱呼它,所以一個叫「jj貓」的人就幫我給它如此命名了。不過,「歸元」實在是不利於理解,我有在考慮給它一個更加合適且淺顯易懂的名子。

運作原理
  1. 移至軸心 - 用「座標變換」把目標物件移至旋轉軸心。
  2. 旋轉目標 - 用「座標變換」讓目標物件於任一軸上旋轉。
  3. 返回圓周 - 用「座標變換」把目標物件移回圓周上。
若在一瞬間就執行完上述步驟,目標物件就會看似在進行圓周運動。



因為目標物件與旋轉軸心之間的距離不是固定的,所以我們必須要用Besiege的變數功能來記錄兩者之間的距離。此範本地圖使用了 IO v2 來負責處理這方面的計算(你只需要知道 IOv2 能夠讓玩家取得一個變數的值就好)

詳細邏輯請到預覽圖查看頁面最底的邏輯總覽。

操作
用按鍵 T, G, F, H 來移動目標物件。

在範本關卡裡,我已經把所有的邏輯都寫得挺清楚的了,用來操作高階歸元的指令只有以下四條:
 前進
變數 forward =1, VDOT_Bv2
 這會把目標物件往前移動一個單位。
 後退
變數 backward =1, VDOT_Bv2
 這會把目標物件往後移動一個單位。
 左轉
變數 left =1, VDOT_Bv2
 這會把目標物件往左旋轉一度。
 右轉
變數 right =1, VDOT_Bv2
 這會把目標物件往右旋轉一度。

你會發現這些指令都只能一次移動一個單位而已,這並不符合我的期待,因此為了讓物件在按下按鍵後持續移動直到放開按鍵,我還寫了一個「迴圈盒 (Loop Box)」用來重複傳送指令到 VDOT_Bv2.

///
用詞參考來源:
國家教育研究院雙語詞彙、學術名詞暨辭書資訊網[terms.naer.edu.tw]
CCCanyon與Anvil共同翻譯的《圍城》台灣繁體中文語言套件連結


Logic Flow Demonstration 邏輯流程展示


Logic Overview 邏輯總覽