Page MenuHomeFeedback Tracker

Rpc() doesn't work within user scripts
Closed, ResolvedPublic

Description

Rpc will not work when directly called from within a user script

Details

Severity
Minor
Resolution
Open
Reproducibility
Always
Operating System
Windows 10
Category
General
Steps To Reproduce
  1. Create some entity
  2. Add a user script to that entity
  3. Within the user script, add a method that should be Rpc-ed and add an Rpc call somewhere. For example, I wrote this user script for a trigger entity.
  4. Add an RplComponent to the trigger entity.
  5. Play (with PeerTool) and it will result in this error: RpcError: Calling a RPC from an unregistered item! itemType='script::Game::SCR_BaseTriggerEntity', rpc=''

If you copy the very same script and save it as a completely new entity, it will work just fine, the issue specifically occurs when using Rpc inside of user scripts.

Additional Information


Here is a test prefab with the sphere trigger user script, be sure to rename it so the script runs.

Event Timeline

TilW created this task.Mar 28 2023, 5:59 PM
Geez changed the task status from New to Assigned.Apr 4 2023, 11:51 AM
Geez closed this task as Resolved.Apr 5 2023, 3:10 PM
Geez claimed this task.
Geez added a subscriber: Geez.

Hello TilW.
This is currently not supported and we do not plan to support this in the near future.
Regards,
Geez