One for Andis - Help on another new Signal ??? Updated....

Re: One for Andis - Help on another new Signal ??? Updated....

Postby VictoryWorks » Wed Jul 17, 2019 8:59 am

The ActivateNode call doesn't work in the Initialise function, you need to create a run once section of code at the start of the Update function.
User avatar
VictoryWorks
Driver
 
Posts: 333
Joined: Mon Apr 07, 2014 1:22 pm
Has thanked: 41 times
Been thanked: 224 times

Re: One for Andis - Help on another new Signal ??? Updated....

Postby Widewanderer » Wed Jul 17, 2019 12:19 pm

G'Day Steve,

I've not seen those lines of code added anywhere else in an AndiS signalling scheme, so I concur with VictoryWorks :mrgreen: However...

Have you thought about using a basic ground signal, and have an external indicator, rather than one with the indicator built-in? That's the way I've done it with my GPLS setups, and it seems to work. Here is the code I use for the main signal:

Code: Select all
require "Assets/AndiS/FPSignals/scripts/FP CLS Stop Signal.out"

function Initialise ()
   
   DefaultInitialise()

   gLightTable[1][LIGHT_RED]             = "CallOn_Red"
   gLightTable[1][LIGHT_GREEN]           = "CallOn_White"
   gLightTable[1][HEAD_MAIN]             = "2 Aspect GPLS"

end


The signal head itself is here implemented as a child object called 2 Aspect GLPS, and the nodes for turning on and off are CallOn_Red and CallOn_White, determined by inspecting the GeoPcDx file for the head model in RW_Tools. In the blueprint, refer to the GeoPcDx of the signal's post for the geometry, or leave this reference blank if you want to place the signal head on a post implemented as a separate scenery item.

As for the external indicator, its blueprint refers directly to the script FP External Text-based Indicator.out, which is found in AndiS>FP Signals>Scripts within his original package. The link0 of the indicator is placed immediately after the link0 for the signal. Configure the indicator in the Editor by placing in the SignalID field two characters (or for however many routes you have), which refer to the textures to be displayed by the indicator for your routes, Route 1 then Route 2 and so on. Using a "_" character would leave the indicator blank for that route.

Steve, feel free to PM me with your email address, or if you wish, I can PM you with mine, and then we can exchange files back and forth to get your model working. I have a solution in mind for you using the external indicator route already, and can send you the files for this so that you can decide if the approach is right for you.

AndiS scripts are powerful and realistic, and it is a shame that more folks are not using them fully. With you now on board, I think we are up to about four, plus AP who used the AndiS system on Wherry Lines...! Andi spent a lot of time and effort into creating these scripts; I am now involved with producing signalling schemes for various freeware "preserved" routes - so far, South Devon Railway and Swanage Railway (published on SSS) are powered by AndiS scripts, and a start has been made on a rendering of the Llangollen Railway.

Best wishes, and looking forward to getting your signals working :D
Rob :-D

Saul Junction, Glos.
User avatar
Widewanderer
Fit for Firing Duties
 
Posts: 43
Images: 32
Joined: Sun Nov 02, 2014 5:09 pm
Location: Saul Junction, Glos.
Has thanked: 20 times
Been thanked: 11 times

Re: One for Andis - Help on another new Signal ??? Updated....

Postby SteveP_trains » Thu Jul 18, 2019 8:59 am

Hi
Pete - I sort of came to the same conclusion with regard to the ActivateNode within Initialise but thanks for confirming that.

Apologies but I seem to have complicated this post by adding a second issue to the original request - the ActivateNode is related to the semaphore signals that Andy helped out with earlier.

Rob, thanks for your reply and suggestions for the platform signal.
Yesterday (Weds) provided a Eureka moment and I have ended up with a signal with working call-on aspect function together with a working Indicator! :D (Sadly, before I checked the post again and found your replies)

My solution was a bit "out of the box" because when I considered that the "call-on with clear" signal, worked as I wanted on a semaphore type, why not make the light signal work as a semaphore!! The animation requirement was covered by moving the white lights forward & back to hide the red since the sim doesn't care whether the animation is up & down or front to back.
Anyway, it works and gives me a "clear aspect" on the lights when making a call-on request!!!

The working Indicator came from Andy's second option of making the indicator head a child object - so again simply blueprinting the indicator as a "signal" with a dummy animation (just leaving out animation paths seems to stop everything working) and using the ActivateNode function to switch P & Y on/off according to route, again worked ok.
So feeling a little pleased with myself this morning :lol: No doubt there may well be a better way to get what I want via CLS scripting but...........!!

So my last problem is the "Glow effects" on my semaphore signals. The effect seems to be working even on the basic standard KUJU semaphore signals but for me, I get a mixed red/green glow which looks orange in game, until the signal gets the startOpening / startClosing script functions after which everything looks perfect. Hence my thinking to try and initialise glows to red as default.

Anyway, Rob - I'll PM you after this post and perhaps bounce some ideas? This signalling project is part of my Ffestiniog re-vamp and the Ffestiniog has a mixed bag of CLS and CLs/Semaphore signals as part of the Heritage look & feel.

Thanks again

Steve
SteveP_trains
Full Time Fireman
 
Posts: 56
Images: 1
Joined: Mon Oct 05, 2015 6:16 pm
Has thanked: 2 times
Been thanked: 10 times

Re: One for Andis - Help on another new Signal ??? Updated....

Postby AndiS » Tue Jul 23, 2019 8:37 pm

Cool to come back from a little holiday and find the forum full of helpful people.

I can only confirm that you can do very little in Initialise, the signal proper is loaded only after this function is called.

I have no experience with glows. I would make a single object in the 3D editor so you can switch on and off a single light which happens to use two shaders, one for the glow (I assume) and another for the conventional disk. Or you must have the glow on a quad and the centre is solid enough to represent the illuminated lamp?

At any rate, I cannot remember some way of turning off arbitrary stuff on start-up (on a semaphore).

I would have assumed that semaphores do a closing animation on start-up in which case startClosing and finishClosing should be called. I could be wrong though.
AndiS
Top Link Driver!
 
Posts: 736
Joined: Wed Apr 09, 2014 5:48 pm
Has thanked: 268 times
Been thanked: 308 times

Re: One for Andis - Help on another new Signal ??? Updated....

Postby SteveP_trains » Tue Jul 23, 2019 9:42 pm

Hi Andy
Hope you had a good holiday :)
I seem to be tackling the glows in the way you have suggested so glad I haven’t missed something obvious.

Once the signals have been triggered by a route/points change and the opening/ closing functions work, then the glows are correct. There is something missing in my build that stops the signal initialising across the whole route.
I’ll keep thinking and testing but I have a workaround in place anyway.
Cheers

Steve
SteveP_trains
Full Time Fireman
 
Posts: 56
Images: 1
Joined: Mon Oct 05, 2015 6:16 pm
Has thanked: 2 times
Been thanked: 10 times

Re: One for Andis - Help on another new Signal ??? Updated....

Postby AndiS » Wed Jul 24, 2019 9:56 am

Glad it works for you.

I guess the history of initialisation solution was this: I certainly had all the signals do one closing animation on start-up. But most likely there were complications from things happening during that first second so I made signals start closed, which cut out the startFinishing function.

Now if a train is somewhere near a signal, it will try to clear. And during my tests, that was always the case, since I never laid more track than necessary. But in a real route, there will be signals that do not see a train for quite some time.

So the best way is the one you take now, integrating the glow with the light.

(The above is from memory, I have not looked at the code for a while.)
AndiS
Top Link Driver!
 
Posts: 736
Joined: Wed Apr 09, 2014 5:48 pm
Has thanked: 268 times
Been thanked: 308 times

Previous

Return to Route Creation

Who is online

Users browsing this forum: No registered users and 4 guests