The Official Scripting Ask Thread
MrRC posted on January 21st, 2020
@postyork
I don't think that's not possible. I have more than FIVE years of experience with scripting.
Sorry, do you mean you think it is or it isn't possible?
I've only been scripting for a few months so I bet you know better than me!
@postyork,
Sorry, stupid language mistake.
NOT possible.
MrRC posted on January 23rd, 2020
@ AceDFe19
Thats not possible.
Too bad, thank you.
it is possible with custom trains
ScootSceet posted on January 25th, 2020
it is possible with custom trains
I would like to know, can u share it with us ?

use a zero distance switch to allow the wireframe train to switch over to the launch track.

the black line shows the path of the wireframe train. the fake train(custom train shown in colour) would stop where the two tracks cross over, it would then have a simple rotation animation so it turns to face the direction of launch then proceed.
Amazing animation


after the wireframe train is in position, the custom train would then attach back and continue the layout.
I hope its understandable, i would actually make it all work buts its real late.
Yes i understand what u mean. U can make it turn with tracktriggers using the rotation script
I'm looking for a script with Tracktriggers that start a delay timer combined with the rotating script.
Hey everyone!
I've recently started to figure out how scripting works, but on my current project to test my scripting abilities, I've run into a problem:
I want to launch a train out of the Station into the first Block of the Track, but despite the Train visibally entering the next block, the Number of Trains on the Station Block never goes to 0, so I cannot pull the next Train from the Unloading into the Loading Station.

This is the current Block Layout and the first Train clears the red Block after going over the Hill of the Lift-Launch, but even if the Train reaches the end of the orange Block, the function
stationLaunchBlock.getNumberOfTrainsOnBlock();
still returns 1.
Does anyone know how to fix this issue or did I assign the different Blocks wrong during initialization?
My current code can be found here: https://github.com/NavaParo/NoLimitsScripting/blob/master/RunCoaster.nlvm
And this image gives more information about my namings of different Track parts:

If you need more information about the project, pease ask.
Thanks a million already in advance!
Edit: Fixed the link to the code
Your link goes to a 404 on this forum (empty)
See here :

@ Nava, check your PM
I don't have enough time to go through your entire code at this moment, but one thing immediately struck my eye: The use of Magic Numbers
You refer to blockstates as numbers (state 1, state 2, state 3). Try to work with constants to give these numbers a name, e.g. a meaning.
public static final int STATE_BLOCK_FREE = 0;
public static final int STATE_BLOCK_APPROACHING = 1;
public static final int STATE_BLOCK_LEAVING = 2;
...
Then you can do something like:
block.registerState(STATE_BLOCK_FREE,"Free",block.LAMP_OFF);
if(nextBlock.getState() == STATE_BLOCK_FREE)
By the way, line 68, you're ending the if with a semicolon instead, which shouldn't be there:
if(block.getState() != 2);
{
block.setState(0);
}
Nava posted on February 17th, 2020
[...] or did I assign the different Blocks wrong during initialization?
Looks indeed like this is the issue, in line 164 you set
stationLaunchBlock = coaster.getBlock("StationUnload");
I guess you meant the block "StationLoad" there instead ;-)
@ Nava check your email.
Your project is ready.
Kind regards,
Sjaak (MrRC)
bestdani posted on February 18th, 2020
I guess you meant the block "StationLoad" there instead ;-)
Good call!
Thanks for the help everyone, even if the solution was a really simple one <3
Is there a scrips to create rolling station blocks? So I can start a train entering the station a little before it's clear.
I am trying to make a script that causes ride errors and stops the train along the course. I have figure out how to do this on a coaster that has a lift but I am having some trouble on a launched coaster. My idea is to use a track trigger to decide when to stop the train. The issue is that I have not found a way to use tack triggers in a block script and don't know if it's possible to link two scrips together. My thinking was to somehow activate the Emergency Stop using a script but so far all I have found is isEmergencyStop which only returns if the E-Stop is or isn't activated, Is there a way to make the emergency stop active? I was also thinking of maybe somehow thinking that F8 on the keyboard was pressed without having to press it. I am relatively new to scripting so I apologize if there is a simple solution I am overlooking.
there is unfortunately no way to use a script to set the E-stop, the only way i could think of doing it would be to set the brakes on and the transports off
I there a way to implement the track trigger listener into a block script?
Why do I get this message? The trains work fine and attach.

@ Drew can u send me the Package file to my email : svhas2004@home.nl and i will look into that.
I cannot package the file because of the class not found error.
OK i understand, can u copy the WHOLE error screen for me and place it here as a text file
I cannot copy the whole text of the error. It lets me select all but not copy.
When u select it all (blue) u can right click on highlighted text and choose copy (in Windows any version)

@ AceDFe19
Thats not possible.