Skip to content

All Comments

1001 to 1020 of 19724

Filter comments

The Official Scripting Ask Thread
Scripting

Hello. I'm currently making my second ever coaster and I want to have a part where the train rolls into some breaks, after which a switch changes the track, and the train gets launched out of the brakes backwards, up a spike, and then rolls back through the brakes and exits forwards. I have tried the Custom Block Logic Builder by bestdani (I think), but it complains that I only have one direction change, and refuses to execute. Thus, I have watched the YouTube tutorials by bestdani and made a small script using the blockhelper package, but when I use its .LeaveModeLaunchBwd() method, as soon as the train goes through the brakes the second time it gets slowed down and launch back up the spike again. Thus, I'm now trying to turn off the brakes before it goes back through them using a trigger.

public void onTrainEntering(TrackTrigger trigger, Train train) {
        if (trigger == enterTrigger) {
            brakeBlock_trigger.getSection().setBrakesOff();
        }
    }

Every time I try to run my script it gives me an error:

Error in File 'Coaster2_2.nlvm' in Line 53, Column 13: Unknown type: brakeBlock_trigger
Error in File 'Coaster2_2.nlvm' in Line 53, Column 13: Unknown symbol 'brakeBlock_trigger'

I am unsure what this means in the context of this script and would like to get a second opinion or a helping hand. I can provide more snippets from my script (or I can try to upload it to something like PasteBin) should the need arise. Thanks for reading.

View comment
1001 to 1020 of 19724