[Request] Wrapper & Legacy Functions

Hello there.

I was wondering if the Epic devs would consider adding wrapper functions to UObject to make the transition from unrealscript to C++ a little less steep. It sort of meshes with the added problem of there being long drawn-out gobs of typing just to do the exact same thing as before, and the fact that (as of right now, anyway) UE4’s architecture is significantly more more decentralized than its predecessor.

What also prompted me to finally ask this was that I keep seeing threads that ask for similar or equivalent functions to what people are normally accustomed to using. Basic things like VSize/2D, RInterpTo, Trace, etc. But it seems kind of annoying to have to hunt all this stuff down in scattered classes and hope that there’s a similar workaround for it somewhere.

So I’m asking if the team would add a lot of the most commonly used wrapper functions into Object.h. That way, instead of typing Vector::VSize(InsertVectorHere), you could just type in a nice simple VSize(), RInterpTo(), Vect(X,Y,Z), Rot(P,Y,R) or QuatToRotator() in every derived class and not have to give it second thought.

The other major concern with this might be for the devs in keeping the architecture lightweight. If this is the case, then perhaps the devs could add an extra means such as macros for full legacy support #define UnrealScript_Legacy ON/OFF or piecemeal support: #define UnrealScript_Rotator ON/OFF, #define UnrealScript_Vector ON/OFF, etc).

Just some way to make the coding pipeline a bit less rough and long-winded, regardless of how it would be implemented.

I think this is a really interesting discussion to have - thankyou for your feedback.

Some things are now in a different order, but shouldn’t be more typing. So:

Dist = VSize(Dir);
Rot = QuatToRotator(Quat);

Becomes

Dist = Dir.Size();
Rot = Quat.Rotator();

In general type in the variable you have, type ‘.’, and auto-complete in VS should show you what you can do!

There are several things about C++ that should mean less typing than UnrealScript. One is being able to assign and declare on the same line, and not requiring to learn ‘vect’ and ‘rot’:

local vector Dir;
Dir = vect(1,0,0);

Becomes:

FVector Dir(1,0,0);

You can also construct things and pass them on the same line:

SetRelativeTranslation(FVector(100, 0, ZOffset));