Skip to content

Dragón Groar's NoLimits 2 Script Generator

126 to 146 of 146

dg posted on May 23rd, 2026

Hi. With the current tools built in the generator, you can define 4 different speeds for the lift: before the train is fully on the lift section, before the lift trigger (you must set these two in the previous block, in the exit that leads to your lift, in the "Next block entrance" tab), after the lift trigger and after the train has started leaving the lift (you must set these two in the lift itself, in the exit that leads to your next block). With the built-in tools, that's as much as you can do.

If you want to get a bit wet on the scripting territory, that's where my second option comes into play. I hope to be able to add some easier trigger-based speed control, but it's hard to come up with an easy way to set it up when the script can't read the triggers the coaster has (it's a feature missing from NL2).

I've downloaded Greneey's package and looked at their code. Let me give you here a modified+simplified version that works with my generator's scripts. You will have to do minor modifications to it to work in your case, though. Check the lines that contain comments (they start with // and are shown in grey here) to see what you have to do. Paste the code into a file named DgVariableLiftSpeeds.nlvm. After modifying it, just add it to your coaster like you did with your main script and set up as many triggers as you want.

import com.nolimitscoaster.*;
import dgScriptGenerator.*;

// Script derived from Greneey's Variable Lift Speed package, heavily modified to work with DragónGroar's Script Generator
public class DgVariableLiftSpeeds extends Script implements TrackTriggerListener {
	
	private String scriptName = "DG's Variable Lift Speeds Script";
	
	private Coaster coaster;
	private DgBlockSystemController blockSystemController;
	private BlockSetup block;
	
	private TrackTrigger[] trackTriggers;
	private double[] trackTriggerSpeeds;
	
	public bool onInit () {
		coaster = sim.getCoasterForEntityId(getParentEntityId());
		if (coaster == null) { System.err.println(scriptName + ": " + "Script is not attached to a coaster."); return false; }
		
		blockSystemController = DgScriptGeneratorManager.getBlockSystemController(coaster);
		
		// In the next line, replace YOUR_LIFT_NAME with your actual lift name, as setup on the NL2 editor and the Script Generator. Don't remove the "double quotes".
		block = BlockSetup.findBlock(blockSystemController.getBlocks(),"YOUR_LIFT_NAME");
		if (block == null) { System.err.println(scriptName + ": " + "No block selected."); return false; }
		
		// Setup here the number of triggers the section will have.
		int triggersNumber = 1;
		
		trackTriggers = new TrackTrigger[triggersNumber];
		trackTriggerSpeeds = new double[triggersNumber];
		
		// Here go your track triggers. Duplicate this next two code lines as many times as the number you set up before.
		// Each trigger will change the train's speed to its specified target value.
		// Keep in mind that the speed set on the NL2 editor needs to be higher. The script can't push the speed faster than what is set up there.
		// Don't forget to change the number between brackets each time you duplicate the lines, to indicate a different track trigger number, starting with 0 and going up.
		trackTriggers[0] = coaster.getTrackTrigger("YOUR_TRACK_TRIGGER_NAME");
		trackTriggerSpeeds[0] = 5.0;
		
		// Example (feel free to remove the // at the beginning and use these lines as well):
		//trackTriggers[1] = coaster.getTrackTrigger("YOUR_SECOND_TRACK_TRIGGER_NAME");
		//trackTriggerSpeeds[1] = 5.0;
		
		for (int i = trackTriggers.length - 1; i >= 0; i--) {
			if (trackTriggers[i] != null) {
				trackTriggers[i].addTrackTriggerListener(this);
			} else {
				System.err.println(scriptName + ": " + "No trigger found at index " + i + ". Ignoring.");
			}
		}

		return true;
	}

	public void onNextFrame (float tick) {}

	private void setLiftTargetSpeed (double targetSpeed) {
		// Here, select (by removing the // at the beginning) which of the following functions you want to use depending on the units of the speed you set up earlier.
		//block.limitSpeed(targetSpeed);    // speed is specified in m/s
		//block.limitSpeedKmh(targetSpeed); // speed is specified in km/h
		//block.limitSpeedMph(targetSpeed); // speed is specified in mph
	}

	public void onTrainEntering (TrackTrigger trigger, Train train) {
		for (int i = trackTriggers.length - 1; i >= 0; i--) {
			if (trigger == trackTriggers[i]) {
				setLiftTargetSpeed(trackTriggerSpeeds[i]);
			}
		}
	}
	
	public void onTrainLeaving (TrackTrigger trigger, Train train) {}
}

Don't forget that, for the script coming out of the generator not to interfere with your custom speed limits, the 4 speed limits I mentioned earlier must all be empty (you must see the "No change" text). Keep in mind that the generated script will ALWAYS reset the speed limits when the block is reset (aka during a coaster mode change), when the train hits the block's trigger (where it would stop if the next block was occupied), during a swing launch and when the block is freed. You might want to consider adding some extra triggers or playing with the built-in fields as well as with the customized script to do exactly what you want to do.

Any other thing you may need, don't hesitate to ask :D
~DG

DG, you are a godsend. Thank you. Please pin this or something so people can come back to it.

I don't really think this is something this forum supports, haha, but I've decided I'd add this script within a folder in the program itself as a sample extension script. It'll be there on the next version.

I believe it's not only going to be useful for those that don't code, but also for those that do to have an example of how to work with my scripts as well, so it'll be there. I'll make sure to put a link on the "Script Extension" help category to open this new samples folder, and maybe I'll even add a couple more samples I've been tinkering with... (I'll have to adapt them from functional script to a sample first, though).

SentinelParks posted on May 18th, 2026

Hello ThatFlyerGuy1, how did you go about this?

Hi, sorry it's taken me so long to get back to you.

What I did was I set my lift speed to the maximum desired speed. In areas where I wanted it to run slower, I used getLiftCurrentSpeed() and toggled rapidly between idle and forward when the lift was above or below the desired speed respectively. This eliminates the rather annoying flickering in the sections panel when the ride is running in automatic. I can't tell you how to define your sections, that is up to you.

The sounds are simple and are just driven off of mathematical functions related to the returned speed value.

Posted June 8, 2026· Edited June 8, 2026

UPDATE 1.4.0 RELEASED

A new update is here with some of the last big features I had originally planned for the generator. I still have a few things I'd like to add, but they all require a bit of study to work. I feel like this is the right time to ask: do you miss any feature on the program? Let me know if you do!
The changes on this version are:

  • Added: visually linked coasters: for custom trains, link the hidden coaster to the frozen one to make all elements of the frozen one work automatically.
  • Added: rolling launch features: documented how to configure a rolling launch with already existing features and added a "Prevalidate" option for Manual Block mode (early availability of Advance button).
  • Added: brake behaviour override per block/section: now you can control them independently of the coaster's global value if you need to.
  • Added: load from clipboard button in code tab.
  • Improved: optimized switches' "skip position" feature: now it only runs when necessary rather than every frame.
  • Improved: revamped all help topics. Basic guide rewritten to be more intuitive, code blocks can now be copied to clipboard, added links between different help boxes, links now show cursor hand, etc...
  • Fixed: brake behaviour not properly loaded back from a script and being reset when opening the Coaster tab again.
  • Script extension: added sample scripts. They can be used both as a base or example for more complex extension scripts or (for non-coders) as templates for the features they show off. Check the Script extension help topic for the link to the folder they're in and instructions to use them.

As always, the download link is updated in the first post.

Hello ! Is it possible to add a track trigger to move a switch track back to its initial position, I had a to put a mini block and use it as a trigger to move the switch track fast enough to take the next train.
Have a good day!

HOTFIX UPDATE 1.4.1 RELEASED

There were a few bugs in the previous release which I have fixed in this update.
The list of changes is:

  • Fixed: help links to sample extension scripts didn't work properly.
  • Fixed: automatic exit not taking preference if multiple exits were available in the same direction (not normal, but might happen in certain rides with special cycles).
  • Fixed: crashing and resetting the coaster wouldn't restart the block system controller properly on some occasions.
  • Fixed: when using the system built-in save dialog, you would no longer be warned if you were replacing a script. The old popup has been added back in this case.
  • Script extension: in a Section's set() method, which controls mechanism movement, you can now pass a boolean to actuate only the transports (and actuate the brakes in a separate call).
  • Script extension: added sample script: ClearSwitchOnTrigger, which demonstrates how to clear a switch when passing a trigger.

As always, the download link is updated in the first post.

Posted July 1, 2026· Edited July 1, 2026

elshlagos posted on June 27th, 2026

Hello ! Is it possible to add a track trigger to move a switch track back to its initial position, I had a to put a mini block and use it as a trigger to move the switch track fast enough to take the next train.
Have a good day!

Hi!

It is now, I had actually added a couple more stuff in the scripts that made it easier to do just what you want to do, so I've dropped a new sample script in the last update of the generator which you can check out.

It's called "ClearSwitchOnTrigger" and in this case, it's a plug and play extension sample. You just need to copy it to your park and assign it to your coaster below its own Block System Controller script. Then, create triggers with the name of your switch followed by "_clear" (skip the quotes) and it should work.

I could add this functionality straight into the generator, but I don't think I want to, because it's really easy to provoke an unsafe situation where a train may roll towards an incorrectly cleared switch, so I'll leave it as an extension script for those of you that still want to do it and kinda know what you're doing with it, but I won't add it as a function on the generator at least for the time being.

Let me know if you need more help.

Posted July 18, 2026· Edited July 18, 2026

Hi DG,

I started today to work with your program.

I made a simple coaster with a transfer as a lift.

I followed the instructions and got a script made by your program, but i got some error messages :

Error in File 'DoorCoaster.nlvm' in Line 89: Not a package: ?s
...1 error(s), 0 warning(s)
Press H for Quick Help
Waiting for scripts to finish...
Fly View

Maybe u can help me out here.

System Win XP 32 bits

I do run your program on a laptop with 64 bits Win11 25H2 26200.8875
And export it by USB stick to my WinXP 32 bits (the whole directory)

**EDIT :

I did copy the whole map of the park to the laptop and get the same results.
**

Posted July 19, 2026· Edited July 19, 2026

MrRC posted on July 18th, 2026

[...]
Error in File 'DoorCoaster.nlvm' in Line 89: Not a package: ?s
...1 error(s), 0 warning(s)

Maybe u can help me out here.
[...]

Hi. Unfortunately, I'm going to need to see your script to help you. Can you copy-paste here the first lines of the generated script? I need all the lines between the one that says "//Version = X.X.X" and the one that is exactly " */", just before the one that says "import com.nolimitscoaster.*;".

If you can send those lines I can recreate your script and reproduce the error myself to see how to fix it both in your case and potentially permanently in the generator. :D

Posted July 19, 2026· Edited July 19, 2026

I hope this will do for u :

/*
{
"coaster" : {
"name" : "DoorCoaster",
"brakeBehav" : "Auto",
"visuallyLinkedCoasters" : [
]
},
"switches" : [
{
"name" : "Lift_1",
"type" : "Transfer",
"skipPositions" : [
]
}
],
"sections" : [
],
"blocks" : [
{
"name" : "Station",
"type" : "Station",
"offlineBehav" : "Connected",
"stationPasses" : 0,
"idleLiftSpeed" : "Crawl",
"brakeBehav" : "Default",
"linkedSections" : [
],
"exits" : [
]
},
{
"name" : "Brake_1",
"type" : "Brake",
"offlineBehav" : "Connected",
"stationPasses" : 0,
"idleLiftSpeed" : "Crawl",
"brakeBehav" : "Default",
"linkedSections" : [
],
"exits" : [
]
},
{
"name" : "Lift_Brake",
"type" : "Brake",
"offlineBehav" : "Connected",
"stationPasses" : 0,
"idleLiftSpeed" : "Crawl",
"brakeBehav" : "Default",
"linkedSections" : [
],
"exits" : [
]
},
{
"name" : "EM_Brake",
"type" : "Brake",
"offlineBehav" : "Connected",
"stationPasses" : 0,
"idleLiftSpeed" : "Crawl",
"brakeBehav" : "Default",
"linkedSections" : [
],
"exits" : [
]
},
{
"name" : "Final_Brake",
"type" : "Brake",
"offlineBehav" : "Connected",
"stationPasses" : 0,
"idleLiftSpeed" : "Crawl",
"brakeBehav" : "Default",
"linkedSections" : [
],
"exits" : [
]
}
]
}
*/

There is much more below this.

Kind regards,
MrRC

Posted July 19, 2026· Edited July 19, 2026

MrRC posted on July 19th, 2026

There is much more below this.

Yes, but with those first lines it's enough to load your configuration to the program and generate the script again, and that way you don't need to send that many characters. Big scripts can hit NLC's limit on their own...

So, I think I know what your main issue is, but I also found a second one in your script...

The error you have is most likely that when moving the script from one computer to the other, you have forgotten to also copy the folder "dgScriptGenerator" that is generated right next to the script. This folder contains additional scripts and functions that the main script needs to work correctly. You need to copy it with your script and place them both in your park for the script to work in NL2.
What I don't understand is why the error in NL2 is so undescriptive in that case, but at least now I know what that means...

Additionally, I see you haven't set up any exit for any block in your script. For the script to actually do something, you need to tell each block which other blocks the train can go to from there. Make sure to click in the settings button (the three lines with the small circles) on each block and set up the exits list and set up each exit on their own settings button (you need to let it know if you want it to be a forwards or backwards exit, if the train should be launched or not, if it will pass any switches when moving from this block to that next one or if you want to enable any other special function from the generator). Make sure to check each function's help on their own question mark button to know exactly how they are supposed to be used...

U write :
".. you have forgotten to also copy the folder "dgScriptGenerator" that is generated right next to the script. .."

No i didn't forget to copy that to.

".. Additionally, I see you haven't set up any exit for any block in your script. For the script to actually do something, you need to tell each block which other blocks the train can go to from there. Make sure to click in the settings button (the three lines with the small circles) on each block and set up the exits list and set up each exit on their own settings button (you need to let it know if you want it to be a forwards or backwards exit, if the train should be launched or not, if it will pass any switches when moving from this block to that next one or if you want to enable any other special function from the generator). Make sure to check each function's help on their own question mark button to know exactly how they are supposed to be used... .."

I have to look into that.

Tnx for your precious time to hopefully solve this problem.

Kind regards,
MrRC

Hello!

Is there a native Linux version of this tool available? It works great on Windows, however, I have been unable to get it working properly under Wine.
Thank you!

Posted July 24, 2026· Edited July 24, 2026

dg

salut dg.
alors j'ai téléchargé la derniére version du logiciel , je suis content qu'il y ait une nouvelle version d'ailleurs. le truc c'est que j'ai pas trés bien compris les nouveautés qu'il y a dans cette version 1.4.x et les boutons "help" ne m'ont pas aidé, est ce que ça te dérangerais de me faire un topic de toutes les fonctions nouvelles et changées avec leur description , s'il te plaît ?
merci d'avance.

Hi! I've learned the basics of how to use this program, so I'm trying to do more advanced stuff. for example, I have a coaster on which on the second launch I would like it to fully stop, launch backwards, up the last element, then back forewords through the rest of the layout ONLY when I Emergency stop the train on the launch, so basically just a basic launch recovery. If there is anyone able to give me the steps to do that, it would be greatly appreciated. Thank you!

![](file:///C:/Users/mklic/OneDrive/Pictures/Screenshots/Screenshot%202026-09-04%20145547.png)

I think all you need to do is on the previous block in the settings where it says next block segment set it to swing brake. Then set the swing launch on the next block. As long as the block doesn't go immediently into a switch track after or transfer track then it should pass through normally but swing launch when stopped.

Posted September 6, 2026· Edited September 6, 2026

CCA_Games posted on September 5th, 2026

I think all you need to do is on the previous block in the settings where it says next block segment set it to swing brake. Then set the swing launch on the next block. As long as the block doesn't go immediently into a switch track after or transfer track then it should pass through normally but swing launch when stopped.

Is there any way you can make a quick tutorial on just that part? your tutorial isn't super helpful because your making a swing launch at the same time. It would be VERY VERY helpful!

EK gaming posted on September 5th, 2026

Is there any way you can make a quick tutorial on just that part? your tutorial isn't super helpful because your making a swing launch at the same time. It would be VERY VERY helpful!

Maybe, but probably not till monday or Tuesday or next week

126 to 146 of 146