Board index Roller Coaster Games NoLimits Coaster 2 Printing Train Speed by Scripting

Printing Train Speed by Scripting

All discussion relation to NoLimits Coaster 2 should be posted here. Purchase NoLimits Coaster from this page: nolimits-coaster-2-purchase-and-upgrade-links-t32524.html

Post January 6th, 2015, 9:15 am

Posts: 1
Points on hand: 50.00 Points
Hello everyone,

I am new to scripting in NL2 and I still have the demo version and I am trying to start using the Classes.

I wanted to use getSpeed() method from Train Class but still did not get it

import com.nolimitscoaster.*;
import com.nolimitscoaster.Train;

public class Speedata extends Script
{

private static final double Trainspeed=0 ;
public void onNextFrame(float tick)
  {
  Trainspeed = Train.getSpeed();
  System.out.println(Trainspeed);
  }
 
}


Can any one help me getting that?

Thanks

Post January 12th, 2015, 7:20 pm
TTD03 User avatar
True Addicts
True Addicts

Posts: 7307
Points on hand: 738.00 Points
Bank: 111,265.11 Points

Post January 13th, 2015, 5:44 am

Posts: 191
Points on hand: 764.00 Points
*raises an arm* ... here...

...but i??????m sorry, i can??????t help with that this time. =)

Post January 13th, 2015, 8:36 am
Mikey User avatar
Site Admin
Site Admin

Posts: 1598
Points on hand: 6,049.50 Points
Location: Houston, Texas

I am not sure specifically what language this is in, but it looks a little bit like java.

# You declared some modules that are relevant in your code
import com.nolimitscoaster.*;
import com.nolimitscoaster.Train;

# You created a class called "Speedata"
public class Speedata extends Script
{
#You declared a private (non-global variable called Trainspeed with a value of 0
private static final double Trainspeed=0 ;

# Void is a return type that will return no value.
public void onNextFrame(float tick)
{
Trainspeed = Train.getSpeed();
System.out.println(Trainspeed);
}

Reading this code and not knowing anything about the modules or java, I have to ask;

1. Where are you declaring what train to get the speed from.
2. Since it would output to console, where exactly would you see the speed on screen?

}
Image

Post January 13th, 2015, 9:40 am
TTD03 User avatar
True Addicts
True Addicts

Posts: 7307
Points on hand: 738.00 Points
Bank: 111,265.11 Points


Return to NoLimits Coaster 2

 


  • Related topics
    Replies
    Views
    Last post