Jump to content

Recommended Posts

i am trying to use an RPC, but i need to also pass a target along with the procedure call.

in the example from http://forums.kleientertainment.com/topic/47353-guide-getting-started-with-modding-dst-and-some-general-tips-for-ds-as-well/#EngineDifferences the remote procedure just gets the player as parameter, without having it passed along.

there seem to be an dataparameter in HandleModRPC, but i didnt manage to get anything working.

is there a way to pass additional data along an RPC?

Edited by Seiai
Link to comment
https://forums.kleientertainment.com/forums/topic/53711-parameters-for-rpc/
Share on other sites

AddModRPCHandler(modname, "withtarget", function(player, target)    if target then        print("Player = ", player.prefab, "Target = ", target.prefab)    endend)AddPlayerPostInit(function(inst)    inst:DoPeriodicTask(5, function()        local dummy = GLOBAL.SpawnPrefab("glommer")        SendModRPCToServer(MOD_RPC[modname]["withtarget"], dummy)    end)end)

Player always gets passed.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
  • Create New...