In my level i have placed 24 actors(highlighted with selection) of the blueprint class tracks(which are basically splines).
What i want to do is to create trains which have their default routes set on these tracks depending on their inital location and destination.(Shown in the image)
There are a total of 16 possibilities(4 entry points, 4 exit points).
My idea was to duplicate the train blueprint 16 times and assign default values(The tracks they need to run on-stored in an array of (class tracks)) to each of them.But unfortunately i’m not allowed to assign default values to these trains because, the assigned actor may not be present in the run time and this is the basis of the object oriented programming.(when i try to assign default values in the blueprint of the actor, after selecting the track value it again becomes none.)
So, instead of setting default values in the actor blue print i will have to set default values in the level blueprint(that is, assign default values to them in the run time)
Now to do this,i again planned to duplicate my train 16 times and reference the blueprint to each of these duplicates(not the instance of the blueprint), in my level blueprint and use the “for each” loop to assign the default value in run time. Now what i want to know is how to get a reference to the of the duplicates of blueprint train(basically,get a reference to the actor blueprint classes) in my level blueprint, so that i can assign default values to them.
My goal is that, once i assign default values to these 16 trains of mine, i will then assign keys to these 16 train from my keyboard and in the run time when ever i press these keys, the train will spawn and follow the allocated tracks.