AP - Made in Alpinetrainz :)

The last model is made with love. :love:(y)

index.php
 
Unfortunately, I have to announce that I have to change the last project, it was supposed to have two more blocks, but something damaged my entire last work, not only this one, but also the AŽD of lights, which I had created, but I have saved the files in another file, which is not intended for clear editing, it's a big problem. So I will have to create other models and start from scratch. Fortunately, all the models that are on the forum and are completed are already ready for Trainz. 😟
 
So I have good news, the problem was not in my corrupted files (fortunately there are none). The problem is in the Secret Windows Update (VS2026), which corrupted the calculations. Error is:
  • This issue is caused by vcomp140.dll version 14.50.35710.0 from the latest Microsoft VS2026 update.
To resolve this issue, download the latest Microsoft Visual C++ Redistributable (version 14.50.35719) and install.

Now everything works again... ugh! 🥴
 
I need help with the non-functional "corona" texture is overwritten, but the corona effect is not applied, where is the error? 😟

C#:
mesh-table
{
  mesh
  {
    auto-create                         1
    mesh                                "lod.lm"
    
    effects
    {
      elektrosvit_albedo
      {
        kind                            "texture-replacement"
        texture                         "elektrosvit_albedo.texture"
      }
      
      elektrosvit_parameters
      {
        kind                            "texture-replacement"
        texture                         "elektrosvit_parameters.texture"
      }
      
      light-1
      {
        kind                            "corona"
        att                             "a.light0"
        texture-kuid                    <kuid:383363:101651>
        directional                     0
        object-size                     0.1
        max-distance                    7000
      }
      
      light-2
      {
        kind                            "corona"
        att                             "a.light0"
        texture-kuid                    <kuid:383363:101654>
        directional                     0
        object-size                     0.22
        max-distance                    50
      }
      
      light-3
      {
        kind                            "corona"
        att                             "a.light0"
        texture-kuid                    <kuid:383363:101652>
        directional                     0
        object-size                     4
        max-distance                    500
      }
    }
  }
...
kuid-table
{
  a                                     <kuid:383363:101651>
  b                                     <kuid:383363:101654>
  c                                     <kuid:383363:101652>
}
}


C++:
include "asset.gs"
include "buildable.gs"
include "gs.gs"

class Engine isclass Buildable
{
    thread void CheckTime();

    int isDay;
    int lastSet = -1;


    void Init(Asset asset)
    {
        // call the parent
        inherited(asset);
        CheckTime();
    }



                  Asset GetCorona(string mesh, string effect) {
                  Soup meshtable = GetAsset().GetConfigSoup().GetNamedSoup("mesh-table");
                  Soup effects = meshtable.GetNamedSoup(mesh).GetNamedSoup("effects");
                  KUID kuid = effects.GetNamedSoup(effect).GetNamedTagAsKUID("texture-kuid");
                  return World.FindAsset(kuid);
                  }


    thread void CheckTime()
    {
        while (true)
        {
            if(World.GetGameTime() * 24 > 6 and World.GetGameTime() * 24 < 18)
            {
                isDay = 0;
            }
            else
            {
                isDay = 1;
            }
            
            if(lastSet != isDay)
            {
                if(isDay == 1)
                {
                    Interface.Log("NOW UNLIT");
                    SetFXTextureReplacementTexture("elektrosvit_albedo", "elektrosvit_albedo.texture");
                    SetFXTextureReplacementTexture("elektrosvit_parameters", "elektrosvit_parameters.texture");

                    SetFXCoronaTexture("light-1",null);
                    SetFXCoronaTexture("light-2",null);
                    SetFXCoronaTexture("light-3",null);

                    lastSet = 1;
                }
                if(isDay == 0)
                {
                    Interface.Log("NOW LIT");
                    SetFXTextureReplacementTexture("elektrosvit_albedo", "elektrosvit_n_albedo.texture");
                    SetFXTextureReplacementTexture("elektrosvit_parameters", "elektrosvit_n_parameters.texture");

                    // Activate Lights 1 ; 2 ; 3

                    SetFXCoronaTexture("light-1",GetCorona("light-1","a"));
                    SetFXCoronaTexture("light-2",GetCorona("light-2","b"));
                    SetFXCoronaTexture("light-3",GetCorona("light-3","c"));

                    lastSet = 0;
                }
            }
            
            Sleep(10);
        }
    }

};
 
Back
Top