A vehicle on vehicle collision triggers the DamagedEvent but the damage_results returned are empty for ?game_action_causer. This is despite the fort_vehicle class implementing the game_action_causer interface.
The code below shows me retrieving the damage source from the DamagedEvent
MyDamageResult:= Vehicle.DamagedEvent().Await()
# Vehicle was damaged, find causing vehicle
MaybeCauser:= MyDamageResult.Source
MaybeVehicle:= CheckIfCauserWasVehicle(MaybeCauser)
The code below shows be checking the source of the damage to see whether it is empty before casting it to a fort_vehicle class to see if it is a vehicle
# Check the results of the DamagedEvent called by the vehicle
CheckIfCauserWasVehicle(InCauser:?game_action_causer) : ?fort_vehicle =
var Vehicle : ?fort_vehicle = false
if:
Causer:= InCauser?
then:
Print("Causer Exists")
else:
Print("Causer Empty")
if:
Causer:= InCauser?
MyVehicle:= fort_vehicle[Causer]
then:
Print("Instigator is a vehicle")
set Vehicle = option{MyVehicle}
return Vehicle
The code above outputs “Causer Empty” which indicates that the
?game_action_causer result from the DamagedEvent is empty. I’m pretty sure this is a bug and it’s preventing me from continuing a game mode which is otherwise complete.
If anyone has any suggestions, or has solved this previously let me know