Developer Notes

They should guard against performing cosmetic operations on the server. These errors are helpful to catch scenarios like this, where you're doing extra (wasted) operations on the server.

Description

If a component class returns 'false' for NeedsLoadForServer(), then variables will not be included in the class in a cooked/packaged dedicated server build, and thus any variable references in script will result in 'Access None' warnings at runtime.

Perhaps as a fix we just suppress the log spam when NeedsLoadForServer() is 'false' for the component class?

I'm guessing the same might hold true when NeedsLoadForClient() returns 'false' in a packaged client build.

Suggested workaround I gave on UDN for now is to add:

[Kismet]
bCanSuppressAccessViolation=true

to the DefaultEngine.ini, and then cook/package with that in place.

Steps to Reproduce
  1. Create a new ThirdPersonBP project.
  2. In the editor, create a new BP class and add a TextRenderComponent.
  3. Drag the TextRender component variable into the event graph and create a 'Get' node.
  4. Add a 'SetTextColor' node and link it to the BeginPlay event node along with the 'Get' node as its target input.
  5. Compile and save the BP class.
  6. Drag an instance of the BP class into the ThirdPersonExampleMap scene and save.
  7. Choose "Launch->Project Launcher" and cook/package a dedicated server build (WindowsServer).
  8. Navigate to the Saved/StagedBuilds directory in the project folder and open a CMD prompt at WindowsServer\<ProjectName>
  9. Type <ProjectName>.exe ThirdPersonExampleMap -log to launch the packaged dedicated server build. Note in the log that script warnings result due to the missing 'TextRender' variable.

Have Comments or More Details?

There's no existing public thread on this issue, so head over to Questions & Answers just mention UE-30540 in the post.

0
Login to Vote

By Design
CreatedMay 10, 2016
ResolvedMay 10, 2016
UpdatedJul 14, 2021