Please select what you are reporting on:
Verse
What Type of Bug are you experiencing?
Verse
Summary
When creating a damage_args to use with a damageable.Damage() call, if the Instigator is set to false, it also does not pass along the Source. this is a problem because instigator is a game_action_instigator, an internal epic class that we cant inherit from…but we can inherit from game_action_causer. If this bug didnt exist i could pass along any custom class that inherits from game_action_causer as a source and be able to figure out where the damage came from (the class isnt an agent).
Steps to Reproduce
objective_test := class(creative_device, game_action_causer):
@editable
ObjectiveDevice:objective_device=objective_device{}
@editable
DamageButton:button_device = button_device{}
OnBegin<override>()<suspends>:void=
DamageButton.InteractedWithEvent.Subscribe(ButtonDamageEvent)
ObjectiveDevice.DamagedEvent().Subscribe(OnDamageResult)
ButtonDamageEvent(Agent:agent):void=
#THIS DOESNT WORK (never reaches "Has Source")
ObjectiveDevice.Damage(damage_args{Source:=option{Self}, Instigator:=false, Amount:=50.0})
#THIS WORKS
ObjectiveDevice.Damage(damage_args{Source:=option{Self}, Instigator:=option{Agent.GetInstigator()}, Amount:=50.0})
OnDamageResult(Result:damage_result):void=
Print("Objective damaged for {Result.Amount}")
if(Source:=Result.Source?):
Print("Has Source")
if(IsMe:=objective_test[Source]):
Print("Its me!")
Expected Result
Source should still be passed in the damage_result even if Instigator is false
Observed Result
the damage_result Source is false even though it was passed through
Platform(s)
uefn pc