Help & Guidance for a New Signal

Help & Guidance for a New Signal

Postby SteveP_trains » Fri Jan 18, 2019 5:32 pm

Hi
I am looking for some advice and guidance on the best way to build this particular signal that I need for the Narrow Gauge Ffestiniog Railway route.
I am not aware of a similar type being used elsewhere.
I am looking to use AndiS' Signal Scripts to control this signal and have read through the Dev Guides so am comfortable to be able to produce the 3D model but not sure whether there is a need to make changes in the Signal LUA scripts.
The signal is fairly simple in that it has 3 Home signals to control access to three main routes and a small shunt signal for the yard.
I have found 2 post signal that I can get to work after a fashion but would like to use this 3-4 post signal to be accurate.
Is it just enough to modify the FP HH script (from Andy's Freeware Pack) or are there are more subtle changes needed to the Common Scripts pack??

Any help appreciated here as I have not tried any form of signal modifications before :D

Thanks
Steve

4511
SteveP_trains
Fit for Firing Duties
 
Posts: 28
Images: 1
Joined: Mon Oct 05, 2015 6:16 pm
Has thanked: 2 times
Been thanked: 9 times

Re: Help & Guidance for a New Signal

Postby AndiS » Fri Jan 18, 2019 9:29 pm

The scripting is the easy bit here. :)

Starting from a copy of FP HH.lua, first thing is to duplicate the group of lines for the second arm and change the index from 2 to 3. I would call the stop arms Home1, Home2, Home3 in the blueprint, then it is dead simple that SEM_CHILD_NAME Home3 is the child which corresponds to the [3] entries and link 3.

In my view, you fare best with one stop arm and thus one pair of animation files used for all three stop arms. Then the animation names are the same for all of them.

If the call-on arm only works for one link, then it is simply as in the manual. You name the child Call On and your group of lines could look like this:

Code: Select all
gArmTable[1][ARM_CALLON][SEM_CHILD_NAME]   = "Call On"
gArmTable[1][ARM_CALLON][SEM_PROCEED_ANIM]   = "Clear01"
gArmTable[1][ARM_CALLON][SEM_BLOCKED_ANIM]   = "Stop01"

(Or Stop instead of Stop01, as always.)

Now if you want to clear the Call-on for other routes, too, you can boldly duplicate that line group and have a copy for index 2, i.e., link 2, using exactly the same SEM_CHILD_NAME. This only works because the script does nothing with all the arms most of the time. That is, [1][ARM_CALLON] will not move when [2][ARM_CALLON] is cleared. Only after [2][ARM_CALLON] is reset to closed, there is a chance of [1][ARM_CALLON] getting cleared.

Same for route 3, if you like.

For the lights, I don't know what your plans are. If you can pull off the shader/material tricks to have the green/blue light actually shine through the red glass and appear red and bright enough in game, the following is irrelevant.

If you want to take a bit of a shortcut as a modeller, you can switch on and off lights, i.e., nodes as if it were a CLS.

To do this, you are free to add any of the following functions (compare section 8.6.1 in the manual): startOpening, finishOpening, startClosing and finishClosing.

Each looks like this:
Code: Select all
function startOpening(routeIndex, armIndex)
...
end


At ... you insert any of the following:
Code: Select all
Call("Home1:ActivateNode", "red", 0)

to turn off a node named red that is part of the arm shape.
Code: Select all
Call("ActivateNode", "green", 1)

to turn on a node named green that is part of the main post shape.

Node means a part of the 3D model (named object or whatever in your modelling program) that gets exported together with the main post. I.e., each .igs file can consist of several parts = nodes and each of them can be shown and hidden using 1 and 0 in these ActivateNode calls. Of course, having extra parts for no reason is discouraged for performance reasons but for CLS, this is how it is done.

Just when you do the switching is your choice, I don't have a trigger halfway through the animation. I would go for startOpening for red-to-green and finishClosing for green-to-red.
AndiS
Top Link Driver!
 
Posts: 628
Joined: Wed Apr 09, 2014 5:48 pm
Has thanked: 257 times
Been thanked: 297 times

Re: Help & Guidance for a New Signal

Postby SteveP_trains » Sat Jan 19, 2019 9:47 am

Brilliant, Andy :D
Thanks for your usual prompt and informative reply.
I will give this a go over the next couple of weeks and let you know how things go.
Cheers

Steve
SteveP_trains
Fit for Firing Duties
 
Posts: 28
Images: 1
Joined: Mon Oct 05, 2015 6:16 pm
Has thanked: 2 times
Been thanked: 9 times

Re: Help & Guidance for a New Signal

Postby SteveP_trains » Mon Jan 21, 2019 11:47 am

Hi Andy
Well, after a weekend of trial & error, I have managed to get the three main signals to work successfully!! :shock:
The arm animation proved a headache but after I started with a simple 1 arm + 1T signal proved the animation to work so then it was down to a few silly mistakes in blueprint naming but finally got the 3 Trident signal to work this morning. Now I have to work out how best to do the lamp lights and the small "Call-On" signal which I am not sure what that controls at the moment.

Many thanks for the assistance.

Just one other question, if I use the FP K External Indicator to indicate the path selected, where should I place the link for that?? I assume after the trident signal but before the point work.
Does it matter just where it goes?

Cheers

Steve
SteveP_trains
Fit for Firing Duties
 
Posts: 28
Images: 1
Joined: Mon Oct 05, 2015 6:16 pm
Has thanked: 2 times
Been thanked: 9 times

Re: Help & Guidance for a New Signal

Postby AndiS » Mon Jan 21, 2019 3:44 pm

It goes between link 0 of the signal and link 0 of the switch wrapper, or the first switch.
Just be warned that they are not meant to be debugging devices. The main signal may change the arms it clears, clearing the highest-numbered arm no matter what when the indicator is active. And I cannot remember whether I ever tested it in a situation where the indicator is redundant, i.e., 3 arms and still an indicator for these same 3 links.
AndiS
Top Link Driver!
 
Posts: 628
Joined: Wed Apr 09, 2014 5:48 pm
Has thanked: 257 times
Been thanked: 297 times

Re: Help & Guidance for a New Signal

Postby SteveP_trains » Fri Feb 01, 2019 3:59 pm

Hi Andy
Have now managed to get the Red/Green lights working with the signals which look quite good to me :)
I used the ActivateNode technique as you suggested.

In use, I have found that the command for the arm return to the ON position, is activated when the train is well past the signal and certainly further than if a CLS signal is used. Is this easily configurable in any way in the scripts?

Secondly, is there any of your scripts that would be suitable to add to a Banner-Repeater signal that I need?

Thanks for your help

Steve
FRSignal2.jpg


BannerRepeater.JPG
BannerRepeater.JPG (13.66 KiB) Viewed 200 times
SteveP_trains
Fit for Firing Duties
 
Posts: 28
Images: 1
Joined: Mon Oct 05, 2015 6:16 pm
Has thanked: 2 times
Been thanked: 9 times

Re: Help & Guidance for a New Signal

Postby AndiS » Fri Feb 01, 2019 5:54 pm

Link 0 is meant to be placed 10 m in approach to the signal post, to make AI stop there. It always looks stupid for diesels do stop right under the arms where the driver would never see them. However, this is not a strict rule.

But assuming you have 10 m from the link to the post, I would expect a single-link signal to start the resetting animation when the train end clears the post.

However, for junctions, I guess resetting is done when the numbered link is cleared. This may be an overshooting reaction to the much to early resetting of the default signals. The theory is that the signaller makes sure that the signal is not reset in the face of the guard on the brake van.

I did not find a way to configure this. Maybe there was even some intrinsic benefit from resetting so late at a junction. You will not that the distant resets than the stop signal, but not when link 0 is cleared (I believe). Overall, it should tie in well with the course of signalling by humans in the signal box.


The banner repeater somehow hounds me. I always maintained that it is just an inner distant, but people keep pointing out drawbacks that I keep forgetting. There must be some script somewhere silently rotting because testing and weeding out the last bug is frustrating. Therefore I am glad for every banner repeater that does its job as inner distant.
AndiS
Top Link Driver!
 
Posts: 628
Joined: Wed Apr 09, 2014 5:48 pm
Has thanked: 257 times
Been thanked: 297 times

Re: Help & Guidance for a New Signal

Postby SteveP_trains » Fri Feb 01, 2019 7:19 pm

Thanks for reply Andy.
I was thinking myself that a Banner Repeater was just a "Distant" signal in another form.

Sorry but I have another question :?
I used the startOpening(routeIndex, armIndex) to switch the Light Nodes on/off and must have struck lucky because now that I have introduced the CallOn arm, I can't get the Home to show RED light and CallOn to show Green.
This is what I used for the Home signals (+ the extra line for CallOn) which worked after a fashion ...............
Code: Select all
function startOpening(routeIndex, armIndex)
   if routeIndex == 1 then
      Call ("Home01:ActivateNode", "Red", 0)
      Call ("Home01:ActivateNode", "Green", 1)
   elseif    routeIndex == 2 then
      Call ("Home02:ActivateNode", "Red", 0)
      Call ("Home02:ActivateNode", "Green", 1)   
   elseif    routeIndex == 3 then
      Call ("Home03:ActivateNode", "Red", 0)
      Call ("Home03:ActivateNode", "Green", 1)
   elseif    routeIndex == 1 then
      Call ("CallOn01:ActivateNode", "Red", 0)
      Call ("CallOn01:ActivateNode", "Green", 1)   
   end      
end

But this now shows Home01 as green when I want the CallOn only to show Green.
I think I need to use the armIndex as a criteria as well but not sure what values are returned by the function call?

The arms are working so the basics are right, it is just this bit of custom LUA code that I struggle with :(

Appreciate your assistance again

Steve
SteveP_trains
Fit for Firing Duties
 
Posts: 28
Images: 1
Joined: Mon Oct 05, 2015 6:16 pm
Has thanked: 2 times
Been thanked: 9 times

Re: Help & Guidance for a New Signal

Postby AndiS » Fri Feb 01, 2019 10:35 pm

I believe the solution could look like this:

if routeIndex == 1 then
if armIndex == ARM_HOME then
-- the stop arm is concerned
else
-- the call-on arm is concerned
end
elseif routeIndex == 2 then
...

armIndex must correspond to all these ARM_... values. Just a quick guess.
AndiS
Top Link Driver!
 
Posts: 628
Joined: Wed Apr 09, 2014 5:48 pm
Has thanked: 257 times
Been thanked: 297 times

Re: Help & Guidance for a New Signal

Postby SteveP_trains » Sat Feb 02, 2019 1:46 pm

Thanks Andy
That LUA sequence worked fine.
Hopefully, I won't need to bother you any more! ;)

Steve
SteveP_trains
Fit for Firing Duties
 
Posts: 28
Images: 1
Joined: Mon Oct 05, 2015 6:16 pm
Has thanked: 2 times
Been thanked: 9 times

Next

Return to Route Creation

Who is online

Users browsing this forum: No registered users and 3 guests

cron