Board index Roller Coaster Games NoLimits Coaster 2 lights don't work

lights don't work

All discussion relation to NoLimits Coaster 2 should be posted here. Purchase NoLimits Coaster from this page: nolimits-coaster-2-purchase-and-upgrade-links-t32524.html

Post April 30th, 2016, 3:54 pm

Posts: 102
Points on hand: 1,124.00 Points
Location: the netherlands

hi i have made a light in the editor and it work when i start the simulation the light don't work who can help me? what is the problem?
Attachments
ScreenShot_20160430234627.png
in the editor
screenshot-2016-04-30-23-44-21.png
in the simulation

Post April 30th, 2016, 4:21 pm

Posts: 136
Points on hand: 2,091.00 Points
Location: Somewhere in Ohio


Post May 1st, 2016, 2:09 am
herman116 User avatar
Premium Member
Premium Member

Posts: 636
Points on hand: 7,471.00 Points
Location: The Netherlands
If I remember it correctly, the standard lights have a script which tells the lights when to turn on the lights. Normally the script does this when it's dark outside.

If you want to let the lights burn day and night, you'll have to edit the script. If you use the standard light script you'll find this chunk of code in it:

public void onNextFrame(float tick)
{
    bool bEnable = sim.getCurSunElevation() <= m_fElevationLimit;

    if (bEnable != m_bEnabled)
    {
      if (bEnable)
      {
        // switching on
        m_fCurBrightness = c_fStartBrightness;
        m_fNewBrightness = 1.0f;
        m_bEnabled = true;
      }
      else
      {
        // switching off
        m_fNewBrightness = 0.0f;
        m_bEnabled = false;
      }
    }
   
    if (m_fCurBrightness < m_fNewBrightness)
    {
      // switching on
      m_fCurBrightness += tick / c_fSwitchOnTime;
      if (m_fCurBrightness > m_fNewBrightness)
      {
        m_fCurBrightness = m_fNewBrightness;
      }
    }
    else if (m_fCurBrightness > m_fNewBrightness)
    {
      // switching off
      m_fCurBrightness -= tick / c_fSwitchOffTime;
      if (m_fCurBrightness < m_fNewBrightness)
      {
        m_fCurBrightness = m_fNewBrightness;
      }
    }
     
    bEnable = m_fCurBrightness > 0;
   
    m_aLight.setEnabled(bEnable);
   
    if (bEnable)
    {
      m_aLight.setColor(m_fCurBrightness * m_aOrgColor.x, m_fCurBrightness * m_aOrgColor.y, m_fCurBrightness * m_aOrgColor.z);
    }
   
    // This controls the fading between normal object color and completely white, using a special material (fade_to_white)
    m_aEntCol.w = m_fCurBrightness;
    m_aSCO.setEntityColor(m_aEntCol);
}


When you replace it with this code, it should burn constantly:

public void onNextFrame(float tick)
{
    m_aLight.setEnabled(true);
}


I haven't tested this code so maybe you should still edit something but I think this should work.

Post May 1st, 2016, 4:18 am

Posts: 48
Points on hand: 1,683.00 Points
You can also make a ligth in the NL2SCO editor. the light will be a permanent part of the object and will always stay on day and night
Attachments
screenshot-2016-05-01-12-06-54.png

Post May 1st, 2016, 7:32 am

Posts: 102
Points on hand: 1,124.00 Points
Location: the netherlands

herman116 wrote:
If I remember it correctly, the standard lights have a script which tells the lights when to turn on the lights. Normally the script does this when it's dark outside.

If you want to let the lights burn day and night, you'll have to edit the script. If you use the standard light script you'll find this chunk of code in it:



public void onNextFrame(float tick)
{
    bool bEnable = sim.getCurSunElevation() <= m_fElevationLimit;

    if (bEnable != m_bEnabled)
    {
      if (bEnable)
      {
        // switching on
        m_fCurBrightness = c_fStartBrightness;
        m_fNewBrightness = 1.0f;
        m_bEnabled = true;
      }
      else
      {
        // switching off
        m_fNewBrightness = 0.0f;
        m_bEnabled = false;
      }
    }
   
    if (m_fCurBrightness < m_fNewBrightness)
    {
      // switching on
      m_fCurBrightness += tick / c_fSwitchOnTime;
      if (m_fCurBrightness > m_fNewBrightness)
      {
        m_fCurBrightness = m_fNewBrightness;
      }
    }
    else if (m_fCurBrightness > m_fNewBrightness)
    {
      // switching off
      m_fCurBrightness -= tick / c_fSwitchOffTime;
      if (m_fCurBrightness < m_fNewBrightness)
      {
        m_fCurBrightness = m_fNewBrightness;
      }
    }
     
    bEnable = m_fCurBrightness > 0;
   
    m_aLight.setEnabled(bEnable);
   
    if (bEnable)
    {
      m_aLight.setColor(m_fCurBrightness * m_aOrgColor.x, m_fCurBrightness * m_aOrgColor.y, m_fCurBrightness * m_aOrgColor.z);
    }
   
    // This controls the fading between normal object color and completely white, using a special material (fade_to_white)
    m_aEntCol.w = m_fCurBrightness;
    m_aSCO.setEntityColor(m_aEntCol);
}


When you replace it with this code, it should burn constantly:

public void onNextFrame(float tick)
{
    m_aLight.setEnabled(true);
}


I haven't tested this code so maybe you should still edit something but I think this should work.


Thank you ??? it works

Post May 1st, 2016, 7:32 am

Posts: 102
Points on hand: 1,124.00 Points
Location: the netherlands

Emperors productions wrote:
You can also make a ligth in the NL2SCO editor. the light will be a permanent part of the object and will always stay on day and night


Thanks for the tip ???

Post May 1st, 2016, 5:37 pm

Posts: 8144
Points on hand: 13,491.00 Points
@herman116: Great job! :)
-- I was happy to be with NL1 - [:')] --

Post May 3rd, 2016, 4:21 pm

Posts: 102
Points on hand: 1,124.00 Points
Location: the netherlands

herman116 wrote:
If I remember it correctly, the standard lights have a script which tells the lights when to turn on the lights. Normally the script does this when it's dark outside.

If you want to let the lights burn day and night, you'll have to edit the script. If you use the standard light script you'll find this chunk of code in it:

public void onNextFrame(float tick)
{
    bool bEnable = sim.getCurSunElevation() <= m_fElevationLimit;

    if (bEnable != m_bEnabled)
    {
      if (bEnable)
      {
        // switching on
        m_fCurBrightness = c_fStartBrightness;
        m_fNewBrightness = 1.0f;
        m_bEnabled = true;
      }
      else
      {
        // switching off
        m_fNewBrightness = 0.0f;
        m_bEnabled = false;
      }
    }
   
    if (m_fCurBrightness < m_fNewBrightness)
    {
      // switching on
      m_fCurBrightness += tick / c_fSwitchOnTime;
      if (m_fCurBrightness > m_fNewBrightness)
      {
        m_fCurBrightness = m_fNewBrightness;
      }
    }
    else if (m_fCurBrightness > m_fNewBrightness)
    {
      // switching off
      m_fCurBrightness -= tick / c_fSwitchOffTime;
      if (m_fCurBrightness < m_fNewBrightness)
      {
        m_fCurBrightness = m_fNewBrightness;
      }
    }
     
    bEnable = m_fCurBrightness > 0;
   
    m_aLight.setEnabled(bEnable);
   
    if (bEnable)
    {
      m_aLight.setColor(m_fCurBrightness * m_aOrgColor.x, m_fCurBrightness * m_aOrgColor.y, m_fCurBrightness * m_aOrgColor.z);
    }
   
    // This controls the fading between normal object color and completely white, using a special material (fade_to_white)
    m_aEntCol.w = m_fCurBrightness;
    m_aSCO.setEntityColor(m_aEntCol);
}


When you replace it with this code, it should burn constantly:

public void onNextFrame(float tick)
{
    m_aLight.setEnabled(true);
}


I haven't tested this code so maybe you should still edit something but I think this should work.


Hallo even in het nederlands aangezien je dat ook bent ??? even een vraagje hoe kom ik bij het script van de lamp? De spotlight

Post May 4th, 2016, 1:43 pm
herman116 User avatar
Premium Member
Premium Member

Posts: 636
Points on hand: 7,471.00 Points
Location: The Netherlands
Als je de spotlight gebruikt die al standaard bij NoLimits zit moet je deze eerst van de interne library naar je eigen project kopi??ren zodat je hem aan kan passen zonder dat er dingen in andere parken mis gaan.

De lampen kun je vinden in C:\Program Files\NoLimits 2\scene objects\Lights. De map Lights kun je dan kopi??ren naar je eigen NoLimits project (als je je project zo klein mogelijk wil houden kun je alleen de dingen mee kopi??ren die je echt nodig hebt).

Het script is voor de meeste lampen gewoon de LightScript.nlvm in de Lights map. Het script dat aan de lamp vast zit kun je ook gemakkelijk opzoeken door in NoLimits naar de tab Scenery te gaan en daar op de NL2SCO Editor te klikken. Vervolgens de lamp openen waarvan je het script wil weten en op het tablad Script klikken. Als je dan dubbelklikt op het script wat op deze pagina te zien is, kun je zien waar hij staat op je computer.

For everyone who would also want to know and can't read Dutch here's a small summary: ;)

Normally you should always copy the lights from C:\Program Files\NoLimits 2\scene objects\Lights to you own project folder before editing it. For most lights, the script that is used is LightScript.nlvm which is located in the Lights folder. You can also see the script that is used by opening the light (or other object) in the NL2SCO editor in NoLimits and double click on the script in the script tab.


Return to NoLimits Coaster 2

 


  • Related topics
    Replies
    Views
    Last post