I am currently renovating the old Pine Forest Flying Mouse. Adding new custom track. 
All Comments
10281 to 10300 of 19729Filter comments
No
Sorry
Bob Run @ Heimwehfluh
No Sorry, just 2 more guesses and i will add a use full Hint
Natur-Bobbahn @ Kienbergpark
No
Sorry
Hint #2 added
Dawson Duel @ Bellewaerde
Both No
Sorry.
My progress on more steep stairs. 
Pipeline Express @ Putt N' Pond Speed Park
Pipeline Express @ Boardwalk Fun Park
If you can find decent plans, anything better than what I've managed to track down, I'd be very interested in providing you with track and supports for Mystic Timbers, since I've become quite familiar with GCI supporting following a custom modelled structure for Wicker Man.
So it would be wrong of me to assume that sounds are placed relative to their object
sound.setPosition(sco.getTranslation());
Thanks for your help anway :)
ngreenberg2019 posted on July 2nd, 2019
Dude! This is amazing! I congratulate you on the progress so far and I am hype for the completion of this project. Keep up the good work!
Thank you, dude. Of course, completion will take a while. I just hope KI won't demolish more coaster right after I finished recreating it...
Some progress mainly on The Beast:
Some new details added and cars color updated


The storage shed and wood platform are completed. The catwalk passing over the track will be added at the same time as the station

Some detailed work support on the second main drop


Wide supports and steel cables are currently being built on the helix



The Beast viewed from Wind Seeker. I will be using several flat rides made by RIDE and M34. Some of those flat rides are incredibly well crafted!

The train track basic layout is done. There will be a lot of landscaping to do. That large surface area surrounded by the train track will be occupied by Mystic Timber in phase 2

More updates in a few days!
Maybe try to make it static as well. And / or also try to create some empty onNextFrame method that does "something" (like just set some variable to some value or so). In my case (it's the sound setup helper script) I also returned false from onInit in some cases and with the static collector it kept alive. But maybe it just worked since the VM is still running, I have no idea if NL2 stops it when nothing is running or not.
If the error persists and cannot be resolved, contact the NL2 support, Ole agreed when I contacted them as I noticed some behavior like this even further before in another case, that it indeed might be the GC that kills it, but since I was the only person (back then) and found a workaround no measures have been taken on the NLVM engine side.
Maybe also try to add some onNextFrame code and just do something cheap like
if(sound != null){
}
there.
No
Hint #1 added.
Still getting the same result
import com.nolimitscoaster.SceneObject;
import com.nolimitscoaster.StaticSound;
import nlvm.math3d.Vector3f;
import nlvm.util.Vector;
public class SoundSphere extends com.nolimitscoaster.Script
{
protected StaticSound sound;
private final Vector preventGarbageCollecting = new Vector();
private static float getRangeFromScoScale(SceneObject sco)
{
Vector3f scale = new Vector3f(0, 0, 0);
sco.getScale(scale);
return scale.x * 10.0f;
}
public final bool onInit()
{
// Get the object
int parentID = getParentEntityId();
SceneObject sco = sim.getSceneObjectForEntityId(parentID);
// Load the sound file
int flags = StaticSound.FLAG_SHARED;
sound = StaticSound.loadFromResourceId("sound", flags);
if(sound == null)
{
System.err.println("Could not load sound!");
System.throwRuntimeException("Resource not found");
}
// Set additional parameters
sound.setDistanceParameters(getRangeFromScoScale(sco), 10.0f);
sound.setEnvironmentMode(StaticSound.E_ENVMODE_GLOBAL);
sound.setGain(1.0f);
preventGarbageCollecting.addElement(sound);
// Loop the sound
sound.playLoop();
return true;
}
}
I have had some strange sound behavior in the past like this and I guess NLVM's garbage collector might be too aggressive with the sound objects sometimes that aren't used anymore further in the code and therefore seems to kill them although they play some sound (I have heard sounds playing and all of a sudden stop in some cases).
This is for example a case where I (successfully) tried to use a vector as a workaround to keep an instance alive that the GC does not kill:

You probably messed up some file path somewhere, if it used to work.
Edit: You are returning false at the end of onInit. Return true instead. If you return false it will "stop the initialization and abort execution" (according to the official NL2 Scripting Docs). Not sure if that fixes it but it might be the reason why it doesn't do anything and also doesn't throw an error.
Having a little trouble with playing a sound attached to an object. This object+script worked in a brand new park, but when copying all the files over to a number of my other projects, the sound cannot be heard. There is no error produced. Any ideas?
[Code moved below]