Space Engineers

Space Engineers

評價次數不足
FTL Scripting
   
獎勵
加入最愛
已加入最愛
移除最愛
檔案大小
發佈於
更新時間
374.685 KB
2016 年 6 月 30 日 下午 9:27
2020 年 3 月 3 日 上午 12:06
5 項更新註記 (檢視)

訂閱以下載
FTL Scripting

描述
This is a sample on how to access the new properties and actions in the FTL mod.
If the FTL mod has loading errors, then this script will not work.

// FTL test void Main(string argument) { var ftl = GridTerminalSystem.GetBlockWithName("FTL Jump Drive"); if( ftl != null ) { var state = ftl.GetValue<string>("Phoenix.FTL.State"); Echo("State: " + state); Echo("TimeRemaining: " + ftl.GetValue<long>("Phoenix.FTL.TimeRemaining").ToString()); Echo("JumpDistance: " + ftl.GetValueFloat("JumpDistance").ToString()); Echo("JumpDistanceInMeters: " + ftl.GetValueFloat("Phoenix.FTL.JumpDistanceInMeters").ToString()); if( state == "Idle" ) { ftl.SetValue<Vector3D?>("Phoenix.FTL.OneTimeDestination", new Vector3D?(new Vector3D(10, 10, 10))); ftl.ApplyAction("Jump"); } } else { Echo("Block not found"); } }
2 則留言
Gwindalmir  [作者] 2016 年 7 月 2 日 下午 12:41 
@smith3700, If the mod has an error, this script won't work.
Currently the mod itself isn't loading my additions, I'm working on that now.
TheRealPeltier 2016 年 7 月 2 日 上午 11:28 
I'm getting an error with this script:
"Object reference not set to an instance of an object."