BP_VolumeGas not properly removing all gas pillars
I am trying to improve ExampleLevel by making the gas pillars have visible gas clouds. I've implemented the editor-only functions in
AFGGasPillarCloud
that set up the links between gas pillars and gas cloud, and I can see the clouds getting spawned at all 5 pillar locations. However, only 2 out of 5 pillars have their gas clouds removed when destroying them. How can I figure out what is going on? (attachments in follow-up because :CertifiedDiscordMoment:)Solution:Jump to solution
Works! So the key is that the effect height offset needs to be accounted for in my reimplementation of editor-only functionality. It's just a matter of changing one line. Attached the entire file just in case.
...
8 Replies
This is what I see in ContentInspector for the
BP_VolumeGas
actor in ExampleLevel after blowing up the 5 pillars. The most relevant parts are: mRemainingRelevantWorldLocations
, mProximityPillarWorldLocations
and mRemovedWorldLocations
This is what I changed in
FGGasPillarCloud.cpp
(it's not perfect, but it should be good enough to get the job done)
I just rotated the whole setup 180 degrees and it somehow started working?
That's what happens with one of the non-working pillars. Looks like the location is in the lists but it doesn't get removed for some reason
Ignore the decompiler pooping nonsense for SSE stuff... Should I save the position in the gas cloud with mEffectHeightOffset
pre-added?
The two gas pillars that work properly are the ones with the smallest absolute value for
mEffectHeightOffset
. IIRC it's -150
. Since the code checks whether the distance squared is less than 40000
, this would explain why only these two work: the other three pillars' values are greater than 200
(sqrt(40000)
). Time to test my theory!Though I'll need to edit the header for
AFGGasPillar
since I can't access mEffectHeightOffset
from AFGGasPillarCloud
Oh, I'm stupid, I missed the getter
For reference. All pillars are at Z=0, so Z is
mEffectHeightOffset
Solution
Works! So the key is that the effect height offset needs to be accounted for in my reimplementation of editor-only functionality. It's just a matter of changing one line. Attached the entire file just in case.
Just noticed a slight issue:
NotifyGasPillarRemovedFromInfluence
needs + FVector(0, 0, gasPillar->GetEffectHeightOffset())
as well. Didn't catch this because it doesn't get called when there's only one gas cloud in the level (which is true for ExampleLevel)
I'm going to PR this anywaythanks for working on this and showing the process you went through here, educational stuff