public class HelloWorldPlay extends com.nolimitscoaster.Script { public bool onInit() { System.out.println("Hello World"); return false; } } |
public class HelloWorldEditor { public static void main() { System.out.println("Hello World"); } } |
public class MyScript extends com.nolimitscoaster.Script { ... } |
import com.nolimitscoaster.*; public class MyScript extends Script { ... } |
import com.nolimitscoaster.*; public class DemoScript extends Script { // Reference to the scene object instance private SceneObject sco; // Variable to sum up the total simulation time private float totalTime; public bool onInit() { // Get the entity ID of the scene object instance this script is attached to... int parentID = getParentEntityId(); // Get a reference to the scene object instance sco = sim.getSceneObjectForEntityId(parentID); if (sco == null) { // Something is wrong, most likely this script is not attached to a scene object return false; } // Everything fine return true; } public void onNextFrame(float tick) { // Demonstrate some animation by rotating the object... totalTime += tick; sco.setRotation(0, totalTime, 0); } } |
import com.nolimitscoaster.*; public class DemoScript extends Script { // Reference to the coaster private Coaster coaster; public bool onInit() { // Get the entity ID of the coaster this script is attached to... int parentID = getParentEntityId(); // Get a reference to the scene object instance coaster = sim.getCoasterForEntityId(parentID); if (coaster == null) { // Something is wrong, most likely this script is not attached to a coaster return false; } // Everything fine return true; } public void onNextFrame(float tick) { //... } } |