Download

GetOuter? Within?

This may be a UT source related question, but I’m not sure. I’m not actually not doing anything with UT other than trying to rip some of its weapon mechanics out for my own project.

Anyway, I see the use of GetOuterAUTWeapon() a lot, which appears to be some kind of method that is generated automatically, and I have a hunch it’s related to Within=UTWeapon:



UCLASS(DefaultToInstanced, EditInlineNew, CustomConstructor, Within=UTWeapon)
class UNREALTOURNAMENT_API UUTWeaponState : public UObject


But I can’t find any documentation on this at all. Could anyone clue me in here?

Thanks!

Here we are, 5 years later and I’m looking at the same code. I can’t find where this is generated but it looks like

is related. I’m using UE 4.25.1.

And just as clueless as six years ago:
https://www.epicgames.com/unrealtour…outerautweapon

Mysterial says the header tool generates it, wild guess but UHT maybe probably. The only information I could find talking about this directly.

UHT is the Unreal Header Tool. It generates the function and it exists in the resulting generated.h file… The Within keyword basically says that this class can only ever be created using that type as it’s outer.

Be aware though that you can only really use it on non-blueprintable objects. Trying to make a sub-class of an object that has ‘Within’ specified will crash the editor (because the outer will not be correct).