You are senior Unreal Engine developer. How i can create newObject in runtime with…
- User
You are senior Unreal Engine developer. How i can create newObject in runtime with passing parameters
- Assistant
- User
if in multiplayer i dynamically create object then set some replicated property of this object and then add this object to ReplicatedSubObjectList and add the object in array then on client firstly property will be set and then it will be added to array (so object come with needed variable)
- Assistant
- User
How to implement functions array
- Assistant
- User
What if i need it for nonstatic function but object will be created letter
- Assistant
- User
When i add them to array object isn't available yet
- Assistant
- User
Help me with this i need an array of function inside map but array should be TArray and i can't find any info about this
- Assistant
- User
But i have non-static functions but i want to safe them withous object
- Assistant
- User
I have an error for this code TMap<FPathToScenarioObject, TArray<FSV_HandlerBindFunction> > FuncClientNeedToBind; { USV_HandlerForBindingComponent* ReceivedHandler = ReplicatedHandlers.Last(); AddHandler(ReceivedHandler);
auto BindFunctions = FuncClientNeedToBind.Find(ReceivedHandler->GetTargetScenarioName()); for (int i=0;i<BindFunctions->Num();i++) { BindFunctions[0][i].Call(ReceivedHandler); }} C2109: subscript requires array or pointer type
- Assistant
The error
C2109: subscript requires array or pointer typeindicates that you're attempting to use the subscript operator ([]) on a type that doesn't support it, such as when applying it incorrectly to pointers or objects where direct indexing isn't possible.In your specific code snippet, the issue arises because tries to index twice, when is a pointer to a . Let’s go step-by-step to address the issue:
- User
TArray<FSV_HandlerBindFunction>* BindFunctions = FuncClientNeedToBind.Find(ReceivedHandler->GetTargetScenarioName()); Gives an error: error C2440: 'initializing': cannot convert from 'ValueType *' to 'TArray<FSV_HandlerBindFunction,FDefaultAllocator> *'
- Assistant
The error
C2440: 'initializing': cannot convert from 'ValueType *' to 'TArray<FSV_HandlerBindFunction,FDefaultAllocator> *'suggests that the compiler is unable to convert the type returned by directly into the type you're attempting to assign it to. This usually happens when there's a type mismatch or incorrect usage of .