Skip to content

All Comments

13601 to 13620 of 19729

Filter comments

The Official Scripting Ask Thread
Scripting

Hi, okay that information helped, I have a download link from dropbox: https://www.dropbox.com/s/ti0fljrn2d50f6t/instant%20animations.nl2pkg?dl=0.

Actually NL2 is shipped with a lot of examples how to do it and and introduction text in the manual, just look at the demo objects in the installation folder, there are some that use triggers already.

There are of course several ways to achieve this, with triggers you first have to define your script to implement two callback that the trigger which are implemented by the TrackTriggerListner interface:

Here's some example recipe using the most simplest approach I can think of in the moment by using a simple state machine, of course depending of what you do this could become more elaborated* when focusing on some details.

import com.nolimitscoaster.*;

public class MyScript extends Script implements TrackTriggerListener{
	// unforunately there are no enums in the language, we have to define them manually
	private static final int DOOR_CLOSED = 0;
	private static final int DOOR_MOVE_TO_OPENED = 1;
	private static final int DOOR_OPENED = 2;
	private static final int DOOR_MOVE_TO_CLOSED = 3;

	// some variables we will use
	private SceneObject doorObject;
	private TrackTrigger triggerOpen;
	private TrackTrigger triggerClose;
	private int doorState;

	public bool onInit() {
		doorObject = sim.getSceneObject("door object");
		doorState = DOOR_CLOSED;
		
		triggerOpen = sim.getCoaster("coaster name").getTrackTrigger("open door");
		triggerClose = sim.getCoaster("coaster name").getTrackTrigger("close door");
		triggerOpen.addTrackTriggerListener(this);
		triggerClose.addTrackTriggerListener(this);
		
		return true;
	}
	
	public void onNextFrame(float tick) {
		switch doorState{
			case DOOR_MOVE_TO_OPENED:
				// do something to animate the door, I'd suggest to involve
				// Tools.switchRampC1(...) or C2 when doing this
				break;
			case DOOR_MOVE_TO_CLOSED:
				// same reversed
				break;
		}
	}
	
	public void onTrainEntering(TrackTrigger trigger, Train train) {
		if(trigger == triggerOpen){
			state = DOOR_MOVE_TO_OPENED;
		}else if(trigger == triggerClose){
			state = DOOR_MOVE_TO_CLOSED;
		}
	}
	
	public void onTrainLeaving(TrackTrigger trigger, Train train) {
	
	}
}


*Probably some Java Developers would rather like to create a Class for each state and dedicated listener objects for moving the door. ;-)

View comment
The Official Scripting Ask Thread
Scripting

Hello,
i do programming a lot of years, but more for MCUs, Raspberry Pi, console programms for PC etc. in C. I have also made some programs in C++. Also german language is no problem because i am from germany :-) I have found videos from new play list, but if it is only for block scripting, it does not help yet, perhaps later. Is it possible to get the package for animated objects without steam? i have no steam account and have never informed how to use it. My linux ubuntu PC hs for internet only and NoLimits2 is running on a Windows PC without internet connection (it was connected only ca. 1 minute for enabling NoLimits after installing it). Is there a doku hot to install and use it?

Best solution will be one working example, then i can change it for my special case. Is there a park project that uses animated objects triggered by trains passing a selected point of track where it is possible to read the script code of the object? The only example i have found in help for scripts was an animated object rotating constantly without triggering by a train. So i was able to use it for my own objects, also to use other periodical moves.

If it is necessary to learn java, i think it is not a big problem for me, it is just another programming language, programming itself is nothing new for me. E.G. i have written a console programm for PC to calculate track elements (e.g. clothoid curves, drops, camelbacks for airtime etc.) as CSV files that can be imported with the professional version of NoLimits.

Best regards

View comment
Raptoralex's defunct coasters
NoLimits Coaster

The transition from (simple terms to explain) half cork to half loop in reverse (so the first inversion) has too much of a lat/flat turn feel at the very crest of it. I just checked with the POVs and it didn't seem to be shaped that way.

Comparo:

^Very flat-turned looking


^Harder to tell without watching, but actually smooth-rolled throughout

Otherwise, looks great. Supports look awesome.

View comment
Delay's Construction Thread
NoLimits Coaster

I have a new PC capable of running NL2 smoothly. I could work Diamond Heights and get it into a somewhat working order now.

However there'd be one thing that would keep me from releasing it either way.


Fear

I don't think this "project" is great. I think it's terrible, a disgrace even, both to RCT and this community, and I don't want to release, yet I do want to do so. I'm in a dilemma right now: Either I release this project as is and (from my perspective) risk disgracing basically everyone and/or everything or I don't release this, in that case the entire work I did on this would've been for nothing. Neither one of these sounds pleasant or desirable to me.

I'm really not sure as to what I'm supposed to do in this situation. I have conflicting interests and frankly I'm stuck with nowhere left to go.

View comment
The "What Did You Just Do In NoLimits" Thread
NoLimits Coaster

^^ I definitely am not totally married to the current layout. I mostly just wanted to demonstrate the original thought process that went into it, as well as the fact that there was one. Also, thanks for the compliment on the early part of the ride; that's what I was most proud of.

^ Absolutely. I want people to see where I'm coming from, but I consider all perspectives and criticisms.

Also, I'd like to hear what you all think of the revisions:

I kept the original early parts of the ride, even though it wasn't everyone's favorite.

View comment
Womp's thread of stuff
NoLimits Coaster

Hey people.. Seems it's been a few months since i put something in here. So with that being said, here's something.
Who remembers this? Given the limited screens i've previously posted both here and on NLE..

Yeah, neither do i.

I joke.. It would be a bit weird if i didn't remember my own ride.
But i just wanted to let you all know that things are happening. So, if you feel the urge to watch this space, go right ahead.

View comment
13601 to 13620 of 19729