I am doing a Multiplayer RPG game.
We have skill actors scripted in Blueprints. And all the functionality is in the BeginPlay. So… I need to separate the functionality because the BeginPlay is called by Client and Server (replicated actor).
To help designers, I need to separate the BeginPlay in “3” BlueprintImplementableEvent Functions. Buuuut after many tests I did:
____ReplicatedCaster = Caster; // Replicated
__BeginPlay_Multiplayer(); //No RPC
____BeginPlay_Server(); //No RPC (BlueprintImplementableEvent)
______OnlyCaster = true; //No replicated
________OnlyCaster = true; //No replicated
__BeginPlay_Client(); //No RPC (BlueprintImplementableEvent)
(( Inside BeginPlay_Client() I use the variable OnlyCaster with a branch to separate functionality because there are functions only called by the CASTER of the skill (1client is the correct one) ))
I have many questions: WHY THIS WORKS?
- Where there is a variable with name OnlyCaster I used BeginPlay_Caster() (BlueprintImplementableEvent) BUT Unreal never call the scripted part (I mean, the code is correct, but the Blueprint part was never called!!!). WHY?
- Where you can see the variable ReplicatedCaster in BeginPlay, I used to have it in BeginPlay_Multiplayer() BUT the variable didnt initialize good. WHY works ONLY inside the BeginPlay()??
- Where you can see the function BeginPlay_Multiplayer(), I used to have it in BeginPlay() BUT it didnt work. WHY?