@lionnl2 : There is a script in the NL2 directory just for that.
All Comments
3781 to 3800 of 19728Filter comments
Hi,
can anyone help me to write a script for a track triggered door?
Sorry if I write something wrong because I am from Germany!
I hope anyone can help me.
bestdani posted on February 1st, 2022
The idea is this:
I guess i was wrong, lol. There he is.
Welcome back, Daniel.
Hint #1 Added
EDIT : Nevermind , i got it working , tnx
@bestdani. I assume i have to attach the demo script to the excisting coaster in my park ?
Inverted Steel posted on February 1st, 2022
I've been trying to figure this out but part of my train (is supposed to) emit bright LED's. Does anyone know how I can replicate light being emitted from the train in a texture PNG file (I've got a texture file for the Inverted Wing which I'm using for my textures)? I've tried in GIMP but it's just a dull colour plastered on the surface as opposed to emitting light.
Or do I need to try something else (I'm trying to avoid attaching objects to the train). I don't really know much about textures (I make all my 3D models etc. without them and then I just use my imagination and ngl textures just seems really difficult and alien to me) but the LEDs are something that I think will look really good on my current WIP coaster (especially at night time).
I would also like to ask what modelling software is used by NL2 users (to create realistic looking trains for example and then subsequently to animate them) and any scripting advice or places to learn this which is relevant to NL2.
As far as I know there is no emission texture channel assigned for the NL2 trains, threfore you would have to model your own 3d model piece that fits onto the train and attach it and use the nl2mat editor to assign the emission color on your own textured model.
For modeling I strongly recommend using blender - it's not only free of money but free software and very powerful.
Some helpful quickstart might be this YouTube Playlist
For scripting try this: How to start with Scripting?
MrRC posted on January 29th, 2022
How can I assign a number to a train. How can I read that number in a script?
To make different trains do different things when they pass over a trigger.
The idea is this:

Demo:
import com.nolimitscoaster.*;
import nlvm.lang.System;
public class TriggerDemoDetectTrain extends Script implements TrackTriggerListener {
// assumes you have not more than 4 trains on the coaster!
private static final int[] ASSIGNED_TRAIN_NUMBERS = {
1, // Train 1
2, // Train 2
3, // Train 3
42 // Train 4
};
private TrackTrigger trigger;
private Coaster coaster;
private int numberOfTrains;
public bool onInit() {
coaster = sim.getCoasterForEntityId(getParentEntityId());
numberOfTrains = coaster.getTrainCount();
TrackTrigger trigger = coaster.getTrackTrigger("enter your trigger name here");
trigger.addTrackTriggerListener(this);
return false;
}
public void onTrainEntering(TrackTrigger trigger, Train train) {
for (int i = 0; i < numberOfTrains; ++i) {
if (train == coaster.getTrainAt(i)) {
int assignedNumber = ASSIGNED_TRAIN_NUMBERS[i];
System.out.println("Train with assigned number " + assignedNumber + " entered the trigger.");
return;
}
}
}
public void onTrainLeaving(TrackTrigger trigger, Train train) {
}
}
I have a feeling he's not that active on here anymore. His last post on the forum was from late in 2020.
I hope Bestdani does respond to this.
MrRC posted on January 28th, 2022
How can I assign a number to a train. How can I read that number in a script?
To make different trains do different things when they pass over a trigger.
Id love know too.






MrRC posted on January 29th, 2022
I made some custom catwalk lights :
Nice!
Im running on Mac and I dragged the file into the upload box and the .nl2pkg file had an error so It couldn't upload it.
I made some custom catwalk lights :

How can I assign a number to a train. How can I read that number in a script?
To make different trains do different things when they pass over a trigger.
1 min search with Google and i found this :
how does one script multimove? I look it up and there aren't any tutorials out there too my knowledge. Can someone help me out here?
I hope, this is not to difficult :

Hint #1 : Indonesia
MrRC posted on January 27th, 2022
Vic's Roller Coaster / Vikova horská drága @ Majaland Praha ?
YES!!!