C:/Users/jlatta/Documents/Unreal Projects/medieval/Source/Medieval/MedievalCharacter.h(56) : Function return type: Missing variable type
I’ve tried adding a variable to pass in, setting it to virtual functions, but no matter what that error pops up. If I take out WithValidation, it actually tells me that WithValidation is required for every Server RPC. I’ve tried adding in the base AttackServer function, same thing. We really need some documentation on this, the official docs are very dated.
Okay well I copied some code from shooter game over to here and it just started magically working. Works for me I guess? I didn’t include the _Implementation and _Validate in the header, there is some very confusing info on the net haha. I guess in 4.7 they took that functionality out, then put it back in with 4.8?
SetSomeBool() is a local function, but ServerSetSomeBool() is an RPC. All he has defined is ServerSetSomeBool_Validate() and ServerSetSomeBool_Implementation()
Close but not quite, it actually depends on the GENERATED_ class type you’re using.
If you’re using GENERATED_UCLASS_BODY() - then you don’t define the functions, but if you’re using GENERATED_CLASS() then you do have to. Also, I think they need to be virtual functions but that might not be a requirement. In 4.7 and above, any new classes you create through the wizard will use GENERATED_BODY() by default, but any classes brought forward from previous versions of the engine will still have GENERATED_UCLASS_BODY()
So so long as OP is using GENERATED_BODY(), the code is correct. Try declaring the latter-two functions as virtual instead, just in case.