Whole Tomato Software Forums
Whole Tomato Software Forums
Main Site | Profile | Register | Active Topics | Members | Search | FAQ
 All Forums
 Visual Assist
 Feature Requests
 UE4/5 _Validate RPC

You must be registered to post a reply.
Click here to register.

Screensize:
UserName:
Password:
Format: BoldItalicizeUnderlineStrikethrough Align leftCenterAlign right Insert horizontal ruleUpload and insert imageInsert hyperlinkInsert email addressInsert codeInsert quoted textInsert listInsert Emoji
   
Message:

Forum code is on.
Html is off.

 
Check to subscribe to this topic.
   

T O P I C    R E V I E W
trdwll Posted - Aug 16 2021 : 09:29:59 AM
Can you fix the _Validate method to default return true?

This isn't a big deal, but I figured I'd see if you could add this in the next update as it's something small.

Thanks
5   L A T E S T    R E P L I E S    (Newest First)
feline Posted - Aug 17 2021 : 1:09:42 PM
This is actually reasonable. I have put in a feature request for a separate VA refactoring Snippet to control the generated code for the _Validate version of the function when you use Create Implementation:

case=146109

if / when this is done, you would then be able to set the snippet so that the function defaults to return true, and perhaps throws a piece of logging, or an assert, to remind you to actually check this is what you intend.
trdwll Posted - Aug 17 2021 : 11:14:05 AM
Preferably all. Not sure if this would be an ideal feature for VAX. Mainly I thought about this, because when you override a method via Implement Virtual Methods it will add a Super call.
In my experience with _Validate methods we just return true, but still, do some verification in our _Validate in certain circumstances. Really this is just me being lazy and not wanting to write return true for my _Validate methods.

Even if you don't want to have this added is there currently a way to do this when I generate the implementation?
feline Posted - Aug 17 2021 : 08:43:54 AM
Are you looking for all _Validate functions to return true by default, or are you after a change that is limited to just a few _Validate functions?
trdwll Posted - Aug 17 2021 : 04:19:41 AM
When you make an RPC like below and run create implementation it only generates the method like below.

UFUNCTION(Server, Reliable, WithValidation)
void ServerRPC();

void AClass::ServerRPC_Implementation()
{

}

bool AClass::ServerRPC_Validate()
{

}

What I'm asking is to add return true to the _Validate method by default when the method is created.
feline Posted - Aug 16 2021 : 1:35:26 PM
I really don't understand what you are asking for here. VA tries to help you write your code, and navigate it, but we don't have a say in the default behaviour of Unreal Engine its self. Is that what you are asking about here?

Doing a search for symbols containing both RPC and Validate brings me to the file "UnrealNetwork.h" and the macro:

RPC_VALIDATE( expression )

which is defined to return false. If you want this to return true you can just edit this file and recompile Unreal Engine.

© 2023 Whole Tomato Software, LLC Go To Top Of Page
Snitz Forums 2000