Skip to content

All Comments

3781 to 3800 of 19728

Filter comments

NL2 Ask Thread
NoLimits Coaster

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?

View comment
NL2 Ask Thread
NoLimits Coaster

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) {

    }
}
View comment
3781 to 3800 of 19728