Creating Headboards for Locos

Creating Headboards for Locos

Postby SteveP_trains » Tue Nov 23, 2021 3:25 pm

Hi
Looking for some guidance as to how to make loco headboards that can be changed via keys in the Sim.
I have most of this process sussed but think I am stuck on the construction of the IGS file for the headboards.

So, I have .......
(1) created the Headboard itself as a Scenery Blueprint
(2) added this to the Loco blueprint as a Child Object
(3) added a Control Object (interior lever) in the Loco's Blueprint under Control Values
(4) added two key functions in my custom InputMapper file

All is ok and headboard visible in game but won't change using the key

So my guess is that I have not constructed headboard models correctly to output as a IGS. Are they all single nodes or a hierarchy under one node? How does the "no headboard" option show?

Any advice as to how to construct the 3D headboard model would be useful and appreciated!! (I use 3DCrafter but guess the principle will be the same whatever)

Thanks

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: Creating Headboards for Locos

Postby JamesLit » Wed Dec 15, 2021 6:31 pm

Steve, you need something to talk between the child object and the control: the loco script.

Just as with particle effects and so on that change depending on cylinder cocks being open or shut, a loco being stationary or moving, etc, you need the state of the headboard to be changed via script. It's pretty straightforward though! You just need to set whether or not the node is active based on the value of the control you're using to operate it.

They all need to be single nodes, and to have no headboard show up at all, you simply have an extra control setting and use that to disable all nodes on the child object in the script.

e.g. if you have 3 headboards

Your Headboard control therefore has 4 positions
0 = Off
1 = Headboard 1
2 = Headboard 2
3 = Headboard 3

So for example

If Headboard = 1 then activate Headboard1; deactivate Headboard2; deactivate Headboard 3, then you'd use an elseIf for the other 2 headboards, then once you've done that you end with just else (as in not elseIf) deactivate all headboard nodes.
The Forge Simulation | Like us on Facebook!
Owner & Director | Content built with care, not compromises.
User avatar
JamesLit
Driver
 
Posts: 370
Images: 26
Joined: Mon Apr 07, 2014 3:26 pm
Location: Kent
Has thanked: 433 times
Been thanked: 141 times

Re: Creating Headboards for Locos

Postby SteveP_trains » Fri Dec 17, 2021 12:14 pm

Hi
Thanks for the reply.
I think your steps are the ones that I have basically followed since writing the initial topic.

I have the Control elements in place now and the Script referring to the Child objects.

My only thought is to where they should be referred to in the script.
I have them under the "OnControlValueChange" section and not the Update section??

I've added shots of the two bits that I've used.

Any further help appreciated

Cheers
Steve
Attachments
Headboard Script.JPG
LUA Script
Headboard Control.JPG
Blueprint Control Section
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: Creating Headboards for Locos

Postby JamesLit » Sat Dec 18, 2021 11:35 pm

Hi Steve,

Actually not too sure on that one.

Personally I would have the 'fallback' option (as in the last thing) to be to disable all headboards rather than to show one of them.

You would also benefit from having a call to disable all headboard nodes in the Initialise function.

I'm not sure whether Update would be the better function for the showing/hiding to be in... worth a try though. Unfortunately I'm away from home so can't try it out myself for you.

I note your control has 3 notches but the maximum value for the control itself is 1, so that won't help matters - it's easiest to use the same numbers here, so if you have the two headboards for now, keep 3 notches but have the maximum value as 2 rather than 1, so that you have 0-2 to work with. Therefore you have 1 whole number per option (none, 1 or 2).

Also, you have the control set up as a push button, which may not be ideal for this sort of thing - try it as a lever of some sort. Push buttons tend to be a 0 or 1 affair without notches, e.g. for stuff like extra whistles for example. I'm not sure whether the movement sensitivity may be a bit high to allow smooth changes between options without skipping through them too fast? But when they work I suppose you will find out!

The last thing I can think to check is the input mapper - just do your basic checks to ensure you've not made any errors and you do actually have it set up as you intend: I'm not sure whether you wanted to do it along the lines of headlights where you start at the lowest value and then have a button to cycle back from high to low values when you reach the end, or have it setup as a loop, which would involve an extra line of scripting in the LUA and a couple of small changes but would be very easy. Cycling high to low will want 4 entries in the input mapper as you have 2 key presses and releases to worry about, rather than just 1 press and release for a looping system.

I know it sounds silly telling you to 'check your work' but to be honest I am speaking from experience - I often find myself scratching my head saying "I've done this completely right but it doesn't work!" only to find I missed one tiny thing...! TS as we all know is a fickle and harsh mistress.....
The Forge Simulation | Like us on Facebook!
Owner & Director | Content built with care, not compromises.
User avatar
JamesLit
Driver
 
Posts: 370
Images: 26
Joined: Mon Apr 07, 2014 3:26 pm
Location: Kent
Has thanked: 433 times
Been thanked: 141 times

Re: Creating Headboards for Locos

Postby SteveP_trains » Sun Dec 19, 2021 10:07 am

Hi
Thanks. I found some "sillies" when I worked on this again after I posted and have made some progress.
I can now hide all the headboards !!!!
So the Initialisation bit now seems to work so just a matter of getting the control bit to work as well.

Help is much appreciated and yes, I too, recognise that effect of " I done it all correct but it doesn't work" many times and then spot the stupid mistake!
So don't worry about the advice to check it again. :D

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: Creating Headboards for Locos

Postby SteveP_trains » Sun Dec 19, 2021 6:25 pm

Hi
Just to let you know I have the Headboards working now.
It wasn't anything major I was doing wrong but more a series of small, silly mistakes across the board which I've worked through.
A breakthrough came when I tied the Headboard Input Mapper to the Headlights (H) and saw that they worked (after a fashion) there so it was a case of working back.
Just a matter of finding a free Key and substituting

I've worked it along lines of the Headlight control so 4 entries in the Mapper and an Increase/Decrease key setting.

Thanks for the input and advice, though. It all helped to dis-entangle the mess I was in.

Regards

Steve (SPRailways)
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: Creating Headboards for Locos

Postby JamesLit » Tue Dec 21, 2021 2:54 am

Well done Steve - I was going to say sorry for not replying sooner but you have of course worked it all out yourself! Well done mate, bet you are 'chuffed' with them now. :D
The Forge Simulation | Like us on Facebook!
Owner & Director | Content built with care, not compromises.
User avatar
JamesLit
Driver
 
Posts: 370
Images: 26
Joined: Mon Apr 07, 2014 3:26 pm
Location: Kent
Has thanked: 433 times
Been thanked: 141 times

Re: Creating Headboards for Locos

Postby SteveP_trains » Fri Dec 24, 2021 3:38 pm

:D
Indeed I am

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


Return to Rolling Stock General

Who is online

Users browsing this forum: No registered users and 8 guests

cron