Space Engineers

Space Engineers

Ikke nok vurderinger
FTL Scripting
   
Utmerkelse
Favoritt
Favoritter
Fjern som favoritt
Filstørrelse
Lagt ut
Oppdatert
374.685 KB
30. juni 2016 kl. 21.27
3. mars 2020 kl. 0.06
5 endringslogger ( vis )

Abonner for å laste ned
FTL Scripting

Beskrivelse
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 kommentarer
Gwindalmir  [skaper] 2. juli 2016 kl. 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 2. juli 2016 kl. 11.28 
I'm getting an error with this script:
"Object reference not set to an instance of an object."