Tu le mets en Autopplant puis dans les paramètres du terrain tu mets ton objet dans l'extra du layer sur lequel tu aimerais de l'herbe. Tu veux de l'herbe ? pô bien !
import com.nolimitscoaster.*;
import nlvm.math3d.*;
/* **************************************************************************
This is a generic object attachment script.
Directions to use this script.
1) Copy and paste attach_object.nlvm to the same directory as your .nl2sco file.
2) Open the NL2SCO Editor and go to the Scripts tab.
3) Select attach_object.nlvm from the Script Class dialog.
4) Save the file and Refresh the scene object.
View the in-game Help for creating .nl2sco files for your 3D models.
It is unlikely that your object will be positioned exactly where you want it at first.
You can modify the positional offset off the 3D model by adding or subtracting
from xOffset, yOffset, zOffset below.
*************************************************************************** */
public class attach_object extends Script
{
// ====== CUSTOMIZABLE VARIABLES =======
// Note: Decimal point "float" values must be followed by an 'f' (e.g. 0.5f, -9.205f). Whole values do not need the 'f'.
private static final float xOffset = 0; // left/right
private static final float yOffset = 0.0f; //up/down
ExternalRideView pov;
float xOffset_cam1 = 0.0000000001f;
float yOffset_cam1 = -0.5f;
float zOffset_cam1 = 0.0f;
private static final float zOffset = 0; //back/forth
private static final float range = 5; // The first train within this range of the scene object will receive the attachment. (range is in meters)
private static final int carToAttach = 32; // Defines the car on the train that will receive the attachment. (0 = lead car or zero car)
// ======================================
private SceneObject sco; // Scenery object handle.
private Train train; // Train handle.
private Vector3f posOut = new Vector3f(0,0,0); // Will store the scenery object's position based on the car's position.
private Vector3f pitchHeadBankOut = new Vector3f(0,0,0); // Will store the scenery object's orientation based on the car's orientation.
private Matrix4x4f carMatrix = new Matrix4x4f(); // Will store the car's orientation.
//**************************************************************************************
// onInit is called when the scene object is loaded. Use this for initialization.
// onInit should return true if initialization succeeds, else false.
// If onInit returns false then the script will be disabled automatically and onNextFrame will never be called.
//**************************************************************************************
public bool onInit()
{
// ********************************************
// Get the scene object handle.
// ********************************************
sco = sim.getSceneObjectForEntityId(getParentEntityId());
if (sco == null)
{
System.err.println("attach_object.nlvm: This script must be assigned to a scene object.");
return false;
}
// ********************************************
// Determine if there is a track within range of the scenery object.
// ********************************************
TrackPos trackPos = sim.findNearestCoasterTrack(sco.getTranslation(), range);
if (trackPos == null)
{
System.err.println("attach_object.nlvm: No track found within range of " + range + " meters.");
return false;
}
// ********************************************
// Determine if there is a train within range of the scenery object.
// ********************************************
Coaster coaster = trackPos.getCoaster();
train = coaster.findNearestTrain(sco.getTranslation(), range);
if (train == null)
{
System.err.println("attach_object.nlvm: No train found within range of " + range + " meters.");
return false;
}
pov = sim.createExternalRideView();
pov.setEnterWarpPointEnabled(true);
pov.setLabel("Magnus Nose Cam");
return true;
}
public void onNextFrame(float tick)
{
// ********************************************
// Obtain the orientation matrix of the last car
// ********************************************
train.getCarMatrix(carToAttach, carMatrix);
// ********************************************
// Convert the matrix obtained from getCarMatrix()
// to the Euler angle vector used in setRotation()
// ********************************************
Tools.matrixToPitchHeadBankPos(carMatrix, pitchHeadBankOut, posOut);
// ********************************************
// Calculate XYZ offset
// ********************************************
Matrix4x4f matrix = new Matrix4x4f();
matrix.initTrans(xOffset, yOffset, zOffset);
carMatrix.multRight(matrix);
Matrix4x4f matrixCamera = new Matrix4x4f();
// ********************************************
// Update the scene object's rotation and
// position for this frame.
// ********************************************
Tools.matrixToPitchHeadBankPos(carMatrix, pitchHeadBankOut, posOut);
sco.setRotation(pitchHeadBankOut);
sco.setTranslation(posOut);
matrixCamera.initTrans(xOffset_cam1, yOffset_cam1, zOffset_cam1);
pov.setEnterWarpPoint(posOut,(float)10);
carMatrix.multRight(matrixCamera);
pov.setCameraMatrix(carMatrix);
}
}
import com.nolimitscoaster.*;
import nlvm.math3d.*;
/* **************************************************************************
This is a generic object attachment script.
Directions to use this script.
1) Copy and paste attach_object.nlvm to the same directory as your .nl2sco file.
2) Open the NL2SCO Editor and go to the Scripts tab.
3) Select attach_object.nlvm from the Script Class dialog.
4) Save the file and Refresh the scene object.
View the in-game Help for creating .nl2sco files for your 3D models.
It is unlikely that your object will be positioned exactly where you want it at first.
You can modify the positional offset off the 3D model by adding or subtracting
from xOffset, yOffset, zOffset below.
*************************************************************************** */
public class crossties extends Script implements TrackTriggerListener
{
// ====== CUSTOMIZABLE VARIABLES =======
// Note: Decimal point "float" values must be followed by an 'f' (e.g. 0.5f, -9.205f). Whole values do not need the 'f'.
private static final float xOffset = 0; // left/right
private static final float yOffset = 0.0f; //up/down
private static final float zOffset = 0; //back/forth
//restraints
private static final float range = 5; // The first train within this range of the scene object will receive the attachment. (range is in meters)
private static final int carToAttach = 1; // Defines the car on the train that will receive the attachment. (0 = lead car or zero car)
// ======================================
private SceneObject sco; // Scenery object handle.
private Train train; // Train handle.
private Vector3f posOut = new Vector3f(0,0,0);
// Will store the scenery object's position based on the car's position.
private Vector3f pitchHeadBankOut = new Vector3f(0,0,0); // Will store the scenery object's orientation based on the car's orientation.
private Matrix4x4f carMatrix = new Matrix4x4f(); // Will store the car's orientation.
private SceneObjectElement[] lb1 = new SceneObjectElement[32];
//**************************************************************************************
// onInit is called when the scene object is loaded. Use this for initialization.
// onInit should return true if initialization succeeds, else false.
// If onInit returns false then the script will be disabled automatically and onNextFrame will never be called.
//**************************************************************************************
public bool onInit()
{
// ********************************************
// Get the scene object handle.
// ********************************************
sco = sim.getSceneObjectForEntityId(getParentEntityId());
if (sco == null)
{
System.err.println("attach_object.nlvm: This script must be assigned to a scene object.");
return false;
}
// ********************************************
// Determine if there is a track within range of the scenery object.
// ********************************************
//TrackPos trackPos = sim.findNearestCoasterTrack(sco.getTranslation(), range);
//if (trackPos == null)
//{
// System.err.println("attach_object.nlvm: No track found within range of " + range + " meters.");
// return false;
//}
// ********************************************
// Determine if there is a train within range of the scenery object.
// ********************************************
coaster = sim.getCoaster("crossties");
train = coaster.getTrainAt(0);
if (train == null)
{
System.err.println("attach_object.nlvm: No train found within range of " + range + " meters.");
return false;
}
for(int i = 0; i < lb1.length; i++){
System.out.print(i);
lb1[i] = sco.getElementForName(i + "");
train.getCarMatrix(i, carMatrix);
Tools.matrixToPitchHeadBankPos(carMatrix, pitchHeadBankOut, posOut);
//Matrix4x4f matrix = new Matrix4x4f();
//matrix.initTrans(xOffset, yOffset, zOffset);
//carMatrix.multRight(matrix);
Tools.matrixToPitchHeadBankPos(carMatrix, pitchHeadBankOut, posOut);
lb1[i].setRotation(pitchHeadBankOut);
lb1[i].setTranslation(posOut);
}
return true;
}
Coaster coaster = null;
public void onNextFrame(float tick)
{
}
public void onTrainLeaving(TrackTrigger trigger, Train train){
}
public void onTrainEntering(TrackTrigger trigger, Train train){
}
}
Tu mets un trigger et tu définies l'action.cedric77 a dit:bonjour a tous,je voudrait savoir comment faire sur les spinning coaster (maurer,zamperla etc..) pour bloquer la rotation des nacelle dans les zone de frein par exemple.
cordialement
bonne journée a tous
Thx !Arofly a dit:Oui, car ce n'est pas un Closed (Puisqu'il passe plusieurs fois en station), et ce n'est pas un Shuttle (Car le circuit est une boucle).
cedric77 a dit:bonjour a tous,je voulais savoir si les fichier no limit 1 sont compatible avec no limit 2,en gros si on peut rider les track de nolimit 1 sur le 2
cedric77 a dit:bonjour a tous,je voulais savoir si les fichier no limit 1 sont compatible avec no limit 2,en gros si on peut rider les track de nolimit 1 sur le 2
ttfun13 a dit:Et bien malheureusement , non .
Enfin avec moi , ça marche pas ...
KingRCT3 a dit:Si, y'a moyen, seulement il faut que tu créer un nouveau park, puis que tu importes ton coaster à partir de là.