Hi there, As a retirement project I've embarked on a project to create an Irish route and Irish locomotive. I have created a GM class 141 loco, and successfully set up a cab and throttles. Much work remains to be done, but one issue is that the keyboard map doesn't work. I note that some locos seem to use the default and don't specify any mapper in the blueprint, and some use their own input mappers. Whatever I try, nothing works. I could still drive using the hud or controls, but still.. I've used Tony Nicholls excellent tutorial videos btw, does he contribute here? Much thanks to him for helping me get as far as I have.
Input mapper blueprint must be exported manually (right click->Export in Blueprint Editor), and it must be located in a folder named "InputMappers" In the engine blueprint, add the name of the input mapper just like it appears in the first field inside the input mapper. Don't use the path or name of the input mapper file. Restart game after editing the input mapper. Also, make sure that you have a working engine script with at least the following code; Code: ------------------------------------------------------------ -- OnControlValueChange ------------------------------------------------------------ -- Called when a cab control is modified ------------------------------------------------------------ -- Parameters: -- name = Name of the control -- index = Index of the control -- value = Modified control value ------------------------------------------------------------ function OnControlValueChange ( name, index, value ) if Call( "*:ControlExists", name, index ) then Call( "*:SetControlValue", name, index, value ); end end I hope this helps!
I also used his tutorials to get started making content. I wish he was still making videos. Sadly there is not much out there on this topic. What info that is out there is not thorough enough, or it's just simply outdated.
Thanks guys. I really didn't expect such a quick response. I'll keep you posted on progress, as help for anyone else trying this.
Ten million thanks, the .lua file was blank. If I'd looked at the sample .lua I'd have seen the script. THanks Oystein...and it's great to see this forum is not dead!
OK here's another question. I'm animating the dials in the cab. The speedometer is the obvious one. Provided the needle is in a plane such that only one angle of rotation is required everything is fine. But to animate the needle in a plane (ie on the cab sloping dashboard) seems to require the needle to be the child of an empty. With the empty aligned corectly the needle will rotate in the plane. But it will not display in the cab in-game. Including the needle animation in the blueprint causes the needle to disappear. I'm pretty sure I'm on the right track because I seee the needles in Tony's cab are aligned and are children of empties. Just missing a bit of information.
If you are using Blender, you can set the transform of the mesh to "Quaternion", then you can animate with the local orientation of the mesh.
Thanks!! I was looking at quaternions but shied away from it. Having done some reading I figured it out. The advantage is that one only needs to specify the first, middle and final location and the animation figures out the rest. The disadvantage is that it's a bit fiddly to set up the locations, you need to rotate using the mouse, you can't edit individual values of xyz and w becasue they're all interrelated. I still think there must be a way using normals, but this is fine for the moment. Again, thanks to Oystein for the lead. Fun fact: quaternions were first described by Irish mathematician William Hamilton in 1843, and there is a plaque celebrating this fact on Broom Bridge in Dublin, crossing the Dublin-Sligo railway line.