Results 1 to 6 of 6

Thread: Custom Signals Light Probelm

  1. #1

    Default Custom Signals Light Probelm

    Hello!

    So I am trying something new for the first time by creating a custom signal for my route. To make things easier for me, I am using the "JP3Light" signal type script in the sigcfg.dat as a template and I am also using MSTS North American Traffic Lights (Specifically the VLSA12AB_YYC_RGY_FR.s) as my signal head. The good news, I was able to get it into the game without errors and it does function as a signal (as shown in the track monitor.)

    The problem is that none of the lights are showing, which I am having trouble with. One of the things I did tried was copying from jpsignal9.s at lines 1693-1696 (along with line 1676 and the last bracket. See image below if you need a better understanding) and but it at the bottom of the new shape file (I removed the animation of the flashing light). Although the signal still works, no luck showing the lights. Any suggestions?

    OTHER INFO:
    • The new signal uses the "ltex" as the LightTex along with the default SigLight.ace. (Other signals in my route (the ones which I did not make) work and show the light)

      I did tried changing the Radius and changed the Y position of the lights, no luck either.


    OTHER SCREENHOTS

    The SignalType Data for the new signal.


    The SignalShape data for the new signal


    The bottom of the uncompressed shape data for the new signal. Note that the animation was deleted (no problems occurred when it happened)
    tgriebel; also known as "Stickmanstudoes"
    Creator of New York State Railroads

    Railroads give off less CO2 than trucks and cars. They should be saved.

  2. #2
    Join Date
    Jun 2009
    Location
    Post Falls, ID
    Posts
    1,054

    Default

    Signals can be very finicky, and sometimes MSTS will let errors in the Signal Config or the Signal Script files go by unnoticed, sometimes it will give effects like you are experiencing, and sometimes it will give actual error messages. As a first test, I see that in your signal config file you have three Aspects defined, but you have written "SignalAspects ( 4". Trying changing that 4 to a 3 and see if it helps.

    There also appears to be a missing closing parenthesis that should be on the line directly above SignalAspects. It should be lined up vertically with the first letter of the SignalAspects line. Let me know if you need assistance with that.

    Also, when you try opening the route in the route editor, I assume you do not receive any error messages?
    Last edited by PerryPlatypus; 07-06-2016 at 01:32 PM.
    ~Sean Kelly~

    MRL Mullan Pass for ORTS
    https://www.trainsimulations.net/Pro...LLAN_ORTS.HTML

  3. #3

    Default

    When I open the route editor (before the small edit you suggested), I get no error, even when placing the object. So I did your suggestions in order. I changed the 4 to a 3, but I got an error at line 1168 (the line where I made the change. Interestingly, the Japan 3 Head Signals also use "SignalAspects ( 4"... ). Reverted the change and added the parenthesis above the first letter of "SignalAspects" Same error as last time (the line number was the same, but it was located at the added parenthesis. I also noticed the Japan 3 Head signals also don't have the added parenthesis that you suggested and they work fine.) This is part of the code for the SignalTypes. I included the JP3Light part too, pretty much that is where I got the code for my new signal. My custom signal is the last SignalType listed.
    Code:
        SignalType ( "JP3Light"
    
            SignalFnType ( NORMAL )
            SignalLightTex ( "ltex" )
    
    
            SignalLights ( 3
                SignalLight ( 0 "Red Light"
                    Position ( 0 0.1899 0 )
                    Radius ( 0.10 )
                )
                SignalLight ( 1 "Amber Light"
                    Position ( 0 0.4416 0 )
                    Radius ( 0.10 )
                )
                SignalLight ( 2 "Green Light"
                    Position ( 0 0.6979 0 )
                    Radius ( 0.10 )
                )
            )
            SignalDrawStates ( 3
                SignalDrawState ( 0
                    "Red"
                    DrawLights ( 1
                        DrawLight ( 0 )
                    )
                )
                SignalDrawState ( 1
                    "Yellow"
                    DrawLights ( 1
                        DrawLight ( 1 )
                    )
                )
                SignalDrawState ( 2
                    "Green"
                    DrawLights ( 1
                        DrawLight ( 2 )
                    )
                )
            )
        SignalAspects ( 4
                SignalAspect ( STOP                    "Red"                SpeedMPH ( 0 ) )
                SignalAspect ( APPROACH_3                "Yellow"                       )
                SignalAspect ( CLEAR_2                    "Green"                          )
            )
            SignalNumClearAhead ( 2 )
            )
        SignalType ( "TrafficLight"
    
    
            SignalFnType ( NORMAL )
            SignalLightTex ( "ltex" )
    
    
            SignalLights ( 3
                SignalLight ( 0 "Red Light"
                    Position ( 0 0.1899 0 )
                    Radius ( 0.10 )
                )
                SignalLight ( 1 "Amber Light"
                    Position ( 0 0.533 0 )
                    Radius ( 0.10 )
                )
                SignalLight ( 2 "Green Light"
                    Position ( 0 5.244 0 )
                    Radius ( 0.10 )
                )
            )
            SignalDrawStates ( 3
                SignalDrawState ( 0
                    "Red"
                    DrawLights ( 1
                        DrawLight ( 0 )
                    )
                )
                SignalDrawState ( 1
                    "Yellow"
                    DrawLights ( 1
                        DrawLight ( 1 )
                    )
                )
                SignalDrawState ( 2
                    "Green"
                    DrawLights ( 1
                        DrawLight ( 2 )
                    )
                )
            )
        SignalAspects ( 4
                SignalAspect ( STOP                    "Red"                SpeedMPH ( 0 ) )
                SignalAspect ( APPROACH_3                "Yellow"                       )
                SignalAspect ( CLEAR_2                    "Green"                          )
            )
            SignalNumClearAhead ( 2 )
            )
    )
    
    
    SignalShapes ( 41
    And here is the SignalShape code for only the new Signal (it is also the last SignalShape listed in the file.)
    Code:
        SignalShape (        
            "VLSA12AB_YYC_RGY_FR.s"
            "Traffic Light Signal"
            SignalSubObjs ( 1
                SignalSubObj ( 0
                    "HEAD1"
                    "Signal Head 1"
                    SigSubType ( SIGNAL_HEAD )
                    SigSubSType ( "TrafficLight" )
                )
            )
        )

    EDIT: I may try deleting the SignalType and then copying and pasting the code for the "JP3Light", and then make a few adjustments so that it is used for the new signal.

    UPDATE 2: OK, so I did some "experiments" with the file, and interesting stuff happened. So the copying and pasting method lead to having same results, but I changed the SignalAspects for the Japan Signals to three, restarted the editor, and it opened without any trouble. Even when I placed it, no errors. So I tried this with the new signals, no errors either, but still, no lights are showing. I also doubled checked the parenthesis using ConText, and they all seem to close at appropriate places. So I am guessing (and I may not be correct) that it might have something to do with the Shape file instead of the signal file.
    Last edited by tgriebel; 07-06-2016 at 05:20 PM. Reason: Did some experiments, unexpected results happened (but in a somewhat good way)
    tgriebel; also known as "Stickmanstudoes"
    Creator of New York State Railroads

    Railroads give off less CO2 than trucks and cars. They should be saved.

  4. #4

    Default

    OK, so I've been continuing to try to fix the issue of the lights not showing. While working with the shape file, I noticed in the shape file called "matrices." I've been studying all three Japan 3 head light files and I noticed that they are all in different locations, and are slightly different from each other. In Signals 8 and 9 (the right and left sided signals,) they both have "matrix SIGNAL (1 0 0 0 1 0 0 0 1 0 0 0 )" along with on the next line: "matrix HEAD1 ( 1 0 0 1 0 0 0 1 0.345405 4.11335 -0.0341561 )" They are both in diffrent locations too (Signal 8 near the middle and Signal 9 at the very bottom.) However, Signal 10 (the one with just a head, no pole,) it just has "matrix HEAD1 ( 1 0 0 1 0 0 0 1 0 0 0 )" and it's located in the middle. I think that is the problem, but there is already other matrices in the new signal shape file, and when I add it in to the file, the game crashes along with an error message "failed to read shape file.) Here is my shape file
    --->http://www.mediafire.com/download/k4...B_YYC_RGY_FR.s

    Suggestions? Thank you!

    Update: Oh yea, for those who are testing, you have to remove the comment (the skip(**..**) thing) located in the middle of the file. If you don't, its gonna crash the game once you place it. If you also want the .ace and .sd files (ONLY FOR THIS SHAPE ONLY), you can either let me know or download the whole signal set on trainsim.com.
    Last edited by tgriebel; 07-07-2016 at 05:43 PM.
    tgriebel; also known as "Stickmanstudoes"
    Creator of New York State Railroads

    Railroads give off less CO2 than trucks and cars. They should be saved.

  5. #5
    Join Date
    Jun 2013
    Location
    Minnesota
    Posts
    1,389

    Default

    Try making the lights very large (radius of 1m or more) and see if you can find the light then, as it may be there, but be facing up rather than forward. When I first started making signal shapes, I ran into this problem, and had to re-engineer the shapes to fix it. Seeing as this shape is supposed was never intended to be a signal, this seems to me a likely possibility

  6. #6

    Default

    Update (I know it has been a while) I finally got the signal to work (I didn't work on it this entire time.) I made a few adjustments to the matrices in the shape file from NPELCO R3 to SIGNAL and HEAD1 (in that order), and it surprisingly worked!
    tgriebel; also known as "Stickmanstudoes"
    Creator of New York State Railroads

    Railroads give off less CO2 than trucks and cars. They should be saved.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •