NoLimits 2 Roller Coaster Simulation

NoLimits 2 Roller Coaster Simulation

Not enough ratings
Refactored Customizable Dynamic Brakes V 1.1
   
Award
Favorite
Favorited
Unfavorite
File Size
Posted
Updated
6.173 MB
2 Mar @ 5:12am
14 Mar @ 6:08am
4 Change Notes ( view )

Subscribe to download
Refactored Customizable Dynamic Brakes V 1.1

Description
Update to Version 1.1 (14th March 2025):
Changes:
  • Changed that the brake only snaps to track pieces which belong to the coaster which was chosen in the settings.

  • Removed a bug which lead to wrong offsets when using the auto-snap offsets.

  • Added a longitudinal offset to the auto-snap function.

  • Added an option that the two track-triggers are triggered if the train leaves the triggers instead of the train enters it.

  • Added an option to add "speed limit" and a "hysteresis" value to the trigger settings. Then the brake copies the exact behaviour of a trim-brake with the same settings while the train is between the two track triggers.

  • Added an option if information messages should be printed in the console or not. Errors are always printed!

Description:
I refactored the dynamic magnetic brake by TheCodeMaster. You can customise the brake's auto-snap position and its complete behaviour and sounds via the scene object instance properties window. No scripting needed. All possible customisations are shown in the demonstration park and described below.

The 3D models are from TheCodeMaster's first New Gen Intamin trains and the three hiss sounds are from TheCodeMaster's first New Gen Intamin trains and his launch kit (https://nolimitscentral.com/account/thecodemaster).

The idea/request came from CCA_Games (https://nolimitscentral.com/account/cca-games).

You are free to change the source code and/or use it for other brake models as you like. An explanation how you can use different brake models is given below.

Customisation Options:
  • Choose if you want to auto-snap the brake to the closest track of the chosen coaster. Add horizontal, vertical and longitudinal offsets if wanted. (E.g. see BLUE track at the demonstration coaster)

  • Choose if the fins should always be raised if the emergency-stop is triggered.

  • Choose a block-section brake from which the current brake state should be copied. (E.g. see RED track at the demonstration coaster)

  • OR choose two track-triggers for rasing and lowering the fins. The fins are raised if the train enters the "raise trigger" and lowered if the train enters the "lower trigger". (E.g. see BLUE track at the demonstration coaster)

  • You can check an option that the two track-triggers are triggered if the train leaves the triggers instead of entering them. (E.g. see BLUE track at the demonstration coaster)

  • If the track triggers are used one can (optionally) add a "speed limit" and a "hysteresis" value. Then the brake copies the exact behaviour of a trim-brake with the same settings while the train is between the two track triggers. This option is ignored if the values are negative. (E.g. see GREE track at the demonstration coaster)

  • Choose a special track the brake should follow (No tiltrack support).

  • Choose the sound which should be played while the fin is moving up and down and set its gain and pitch. The up and down movement duration of the fin is defined by the length of this sound. The sound length is given by: "length of sound file" * 1.0/"pitch". (See the next options for more details.) (E.g. see PURPLE track at the demonstration coaster).

  • Optionally apply and choose a random pitch variation factor for the brake sound so that not all brakes move perfectly identical (different pitch means different sound length, means different moving speed). The final pitch for the brake sound is then chosen randomly as: "randomPitch" = "pitch" +- "pitch" * "variation factor" * "random(0, 1)" . (E.g. see GREEN track at the demonstration coaster).

  • Choose a fin "movement duration factor". The time the fin needs to move up and down is determined by the length of the sound and this factor. The final movement duration for one up or down movement is given by: "length of sound file" * 1.0/"randomPitch" * "movement duration factor". A smaller factor means a faster movement. A value of 1 means that the fin's movement needs exactly the same time as the sound length given by: "length of sound file" * 1.0/"randomPitch". Values over 1 can lead to multiply sound plays during one movement!

  • Decide if information messages should be printed in the console. Errors are always printed!

How to use:
Extract this park and copy the folder "CustomizableDynamicBrake" in your park folder. Then place "CustomizableDynamicBrake.nl2sco" in your park and use it.

How to use it with a different brake model:
The script can be used with other brake models. You need a 3D-object model which can be loaded by NoLimits. It also works when the new brake model has more then one fin and the moving direction of the fins can be chosen freely.
  1. Open the 3D-model of the brake you want to use in a 3D graphics software such as "Blender". Look what name(s) the object-element(s) has/have which should be moving while the brake is closed/opened. Look in which direction the object-element(s) has/have to move (along which axis of the coordinate system). Also check or estimate how far the object-element should be moved in this direction in total. Write this information down. (E.g.: There are two object-elements which should be moved. The object-element's names are "Fin1" and "Fin2". They have to move along the y-axis to open/close. The moving range is 0.3 meters.)

  2. In the NoLimits editor go to "Scenery" -> "NL2SCO Editor.." -> "General". Click on "Open" and open the "CustomizableDynamicBrake.nl2sco" file.

  3. Click on "Save as..." and save it under a new name to not overwrite "CustomizableDynamicBrake.nl2sco".

  4. In the field "3D model" load your new 3D-model form step 1.

  5. Optionally got to "NL2SCO Editor.." -> "Materials" and set the materials and colours as you like.

  6. "Save" it again and place the scenery object in your park normally via the "Choose..." button.

  7. Outside of NoLimits open the file "\CustomizableDynamicBrake\CustomizableDynamicBrake.nlvm" with a text editor like notepad++ or visual studio code. (Maybe you want to save a backup of the original file so that you can use it for comparison if the new file gets broken somehow).

  8. Go to line 15 and enter the names of all object-elements which should be moving (see step 1) as strings inside the curly brackets, separated by a comma. (Following the example from step 1, line 15 should look like: private static final String[] NAME_FINS_SOE = {"Fin1", "Fin2"}; )

  9. Go to line 16 and enter the moving directions (see step 1) for each object-element as a 3D vector inside the curly brackets, separated by a comma. (Following the example from step 1, line 16 should look like: private static final Vector3f[] DIRECTION_OF_MOVEMENT_FINS = {new Vector3f(0.0f, 1.0f, 0.0f), new Vector3f(0.0f, 1.0f, 0.0f)};). It can be that the axis or axis-directions are differently in NoLimits than in the 3D graphics software. So you can just play around and test different axis or change the direction of movement by inputting negative values. E.g.: Enter "new Vector3f(0.0f, -1.0f, 0.0f)" to move in the opposite direction as "new Vector3f(0.0f, 1.0f, 0.0f)".

  10. Go to line 17 and enter the fins maximum moving range in meters. (Following the example from step 1, line 17 should look like: private static final float FIN_MOVING_RANGE = 0.30f;). If you were not able to get the value in step 1 just play around with this value here until it looks nice in the simulation.

  11. Save the file "\CustomizableDynamicBrake\CustomizableDynamicBrake.nlvm" after you edit it. Reload your park and enjoy your new brake!
If the console throws errors, read them and look about what or about which line of code it is complaining. Then look in "\CustomizableDynamicBrake\CustomizableDynamicBrake.nlvm" again and see what you entered wrongly. It can help to compare it to the original file to see what went wrong. Cheers,
Systron