Hello, i’ve encountered some weird behavior with the GAS system, particularly adding a hit result to an effect context, that i am trying to understand.
im trying to spawn a gameplay cue actor with hit data at the location of a projectile impact. here was my logic, summarized:
1.) the firing ability spawns projectile, and feeds it the effect spec handle on spawn.
2.) projectile detects the hit and applies the spec
3.) projectile executes the cue
the cue needs hit data, so we have to add that to the parameters, aka the effect context. so we should be able to take our spec, get the effect context, promote it to a variable, add the hit result to it, and shazzam, we have a context with hit data ready to pass to the cue.
however i quickly found that this was not the case. the context contained no hit data.
the chain was as follows
ability makes spec->spawn projectile and pass it spec->projectile creates context from that spec->promote to variable, addhitresult node.
this didnt work.
but this did:
ability makes spec->ability makes context->spawn projectile and feed it spec and context->addhitresult to the context
im sorry but this makes no sense to me at all. how is
ability spec->ability context->projectile
fundamentally different from
ability spec->projectile->projectile context?
is there some key principle im missing? perhaps a networking issue? if anyone has any idea please let me know, im trying my best to understand this system at its core.
Hello, I also just have the exact same set up as yours and I also have this problem now… I first use make outgoing GE spec node - assign tag set by caller magnitude - get effect context - add hit result - apply GE spec to target and test the GE execution calc. In my case the context is valid but the hit result is false (or null) when I used .gethitresult(). I solved it now by set new variable after the assign tag set by caller node, so I think you might need to set the GE spec handle to a variable then use that variable plug in to GE spec to target
Hey, I was having similar issues with the AddHitResult, never seeming to actually add the result to my context and I found out part of the issue was I was using “make outgoing spec” instead of “make spec handle”, for some reason make outgoing spec was ignoring the “addHitResult” even though the context I was feeding into it did include the hit if I checked it after applying the gameplay effect.
Anyway, here’s what ended up working for me with the logical steps of
-creating the spec handle
-adding the hit result to the context inside the spec handle
-adding magnitude to my effect (for dynamic damage/healing etc)
-applying the gameplay effect
Ok. I’m not that into GAS at the moment. (I used it extensively in the past but haven’t touched it in a few years)
…so forgive me if this too basic but…
When working with structs I always forget that I’m working with a copy of the data, not a reference and (I’m ashamed to admit) often apply my changes to the copy without actually setting the copy back to the object I got it from.
Can you please double check if all the changes in the context are actually applied back to the game effect.
Again sorry if it is too basic and you are already sure you are doing this correctly.