[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4921: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3896)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4923: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3896)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4924: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3896)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4925: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3896)
TrainSimDev.com • View topic - One for Andis - Help on another new Signal ??? Updated....

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: 331
Joined: Mon Apr 07, 2014 1:22 pm
Has thanked: 37 times
Been thanked: 223 times

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

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

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
Fit for Firing Duties
 
Posts: 37
Images: 1
Joined: Mon Oct 05, 2015 6:16 pm
Has thanked: 2 times
Been thanked: 9 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: 636
Joined: Wed Apr 09, 2014 5:48 pm
Has thanked: 261 times
Been thanked: 302 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
Fit for Firing Duties
 
Posts: 37
Images: 1
Joined: Mon Oct 05, 2015 6:16 pm
Has thanked: 2 times
Been thanked: 9 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: 636
Joined: Wed Apr 09, 2014 5:48 pm
Has thanked: 261 times
Been thanked: 302 times

Previous

Return to Route Creation

Who is online

Users browsing this forum: No registered users and 4 guests