thank you so much for this there is 2 warnings but i think i know what they are, and it finally works when i left click the light turns on which is almost what i want
import nlvm.math3d.*;
import nlvm.lang.Math;
doesn't need to be there for now
thank you so much for this there is 2 warnings but i think i know what they are, and it finally works when i left click the light turns on which is almost what i want
import nlvm.math3d.*;
import nlvm.lang.Math;
doesn't need to be there for now
We know how the game works
Yes correct, someone has 3 days to place a new guess.
I am just wanting to get into scripting scenery, specifically doors that open and close on command. Does anyone have a good place for me to start? Thanks for the help!
It's Mayan Adventure https://rcdb.com/1231.htm#p=11607
Someone else can go
Not correct
Raptor - Fantasilandia
Not correct
Flight Deck at Canada’s Wonderland
You're missing the closing } after
light.setEnabled(Button.isPressed(Button.ACTION) && sim.getCurSunElevation() < 0.05f);
public void onNextFrame(float tick)
{
light.setEnabled(Button.isPressed(Button.ACTION) && sim.getCurSunElevation() < 0.05f);
}
Also :
turn is never set (the variable does not exist before assignation). Possible fix : rename turn to light
a light is not a scene object, you may want to replace obj.getElementForName with obj.getLightForName
light should also be replaced with a SceneObjectLight instead of a SceneObjectElement.
light is never set and does not exist before assignation. Light =/= light. Possible fix : rename Light to light in : private SceneObjectElement Light; (also missing a semicolon)
Vector3f dis is never used : No need to fix, but to remove a warning, delete this line. Same for DEG.
onInit() is missing a return statement.
Wrong name used in getElement(/Light)ForName
This should look like this (Not tested):
import com.nolimitscoaster.*;
import nlvm.math3d.*;
import nlvm.lang.Math;
public class LightEnabled extends Script
{
// Removed unused DEG & dis
protected String SCRIPT_NAME = "Light";
protected String LIGHT_NAME = "Light";
private SceneObject obj;
// Changed type, name, missing ';'
private SceneObjectLight light;
public bool onInit() {
obj = sim.getSceneObjectForEntityId(getParentEntityId());
if(obj == null) {
System.err.println(SCRIPT_NAME + ": Object not found");
return false;
}
// Renamed from turn to light, changed to getLightForName, corrected parameter
light = obj.getLightForName(LIGHT_NAME);
if(light == null) {
System.err.println(SCRIPT_NAME + ": Element " + LIGHT_NAME + " not found");
return false;
}
// Added missing return statement
return true;
}
// Added missing }
public void onNextFrame(float tick) {
light.setEnabled(Button.isPressed(Button.ACTION) && sim.getCurSunElevation() < 0.05f);
}
}
TLDR: Missing semicolon line 12
Can u provide us with the script with line numbers and an image with the error line, is much easier to work with.
Not correct
Great nor-Easter?
Gyazo Master Race.
update i just found one issue, there wasn't a parentheses before " public bool onInit(){ " now it says that line 14 or " } " is a sytax error
I keep getting an error on " public bool onInit(){ " it says that there is an error but i cant see any issues with this line, i know that the script is probably all wrong but im just confused about that one error
import com.nolimitscoaster.*;
import nlvm.math3d.*;
import nlvm.lang.Math;
public class LightEnabled extends Script
{
protected static final float DEG = (float)Math.PI/180.f;
protected String SCRIPT_NAME = "Light";
protected String LIGHT_NAME = "Light";
private Vector3f dis = new Vector3f();
private SceneObject obj;
private SceneObjectElement Light
public bool onInit(){
obj = sim.getSceneObjectForEntityId(getParentEntityId());
if(obj==null){
System.err.println(SCRIPT_NAME + ": Object not found");
return false;
}
turn = obj.getElementForName(LIGHT_NAME + ": Object not found");
if(turn==null){
System.err.println(SCRIPT_NAME + ": Element " + LIGHT_NAME + " not found");
return false;
}
}
public void onNextFrame(float tick)
{
light.setEnabled(Button.isPressed(Button.ACTION) && sim.getCurSunElevation() < 0.05f);
}
When I remember correctly I mentioned it already where I mentioned that it is possible, but if not, you have to enable the import / export Addon for LightWave Objects:

