No way to obtain `fort_vehicle` from a `vehicle_spawner_device` at a later point of time

Summary

Currently vehicle_spawner_device does not provide a way to grab a fort_vehicle reference for the spawned vehicle. It’s mandatory for us to manually keep track of that state after a vehicle has been spawned. After it’s spawned it’s not possible to obtain the same reference to the active vehicle. Alternatively one could try and fetch the vehicle from an associated fort_character, but that does not provide any concrete association with a specific vehicle spawner. Please provide a failable method to fetch the currently spawned vehicle.

For example:

vehicle_spawner_device<public> := class<abstract><epic_internal>(creative_device_base):
  GetVehicle<public>()<transacts><decides>: fort_vehicle = external {}

Please select what you are reporting on:

Verse

What Type of Bug are you experiencing?

Verse

Steps to Reproduce

N/A

Expected Result

API that returns the vehicle spawned by the current vehicle_spawner_device or fails if no vehicle is currently spawned.

Observed Result

No such API.

Platform(s)

PC

You are supposed to subscribe to each spawner and keep track of the vehicles yourself, for example using closures Pass Extra Data to Event Handlers Using Closures | Community tutorial

Put vehicle_details (containing id device and any other data) in an array and then you can get any the vehicle device at any time.

I haven’t asked how to do it. I did outline the current status quo in the issue report. However this is not ideal, hence the feature request report.

You said in the title there is no way to obtain at a later time and it is very much possible to do in your code.

It seems to me it might be dev job and not the spawners’. It is important that basic devices only do their job well, it is less buggy then.

The title is still correct as is. It’s not up for interpretations. There’s no way to obtain the fort_vehicle from a vehicle_spawner_device post spawn if you missed the event or did not track it yourself. Going the route via fort_character has no association with a concrete spawner. If you have a ton of spawners it can become tricky.

If that was the case then we can close further evolution of UEFN, everything is done and published. I’m not up for such discussions. Thank you for your understanding.

There’s nothing wrong with extending the capabilities of devices. In fact every vehicle_spawner_device has a hidden GetDriver()<transacts><decides>: agent method.

Epic can easily publish GetVehicle method like so:

GetVehicle()<transacts><decides>: fort_vehicle = {
  GetDriver[].GetFortCharacter[].GetVehicle[] # wouldn't be correct!
}

However this would only work if the vehicle is occupied by the player. In my case I would like to get just the reference to the vehicle without any player association.

Ahaha no I would rather a few working devices remain intact and not be broken in the next update and the team works on new exciting features like scene graph. Collision needs some attention I heard.

Creators learning how to work with spawners might find my comment useful since it is pretty standard way of working with many devices including vehicle spawners.

While I don’t disagree with this, creators might not realize that the current approach is potentially error prone. If you subscribe or listen too late for the spawn event, you will miss it. Not that it ever happened to me, because I spawn the vehicles on command instead of relying on auto spawning behavior.