Jump to content

Recommended Posts

I added a component action that, when I was testing locally, was available, but when I uploaded it to the server and try to do it on a client, was not. Has anyone experienced this before? The specific action in question is trying to make wortox souls give-able to revive corpses:

AddComponentAction("USEITEM", "inventoryitem", function(inst, doer, target, actions, right)
	if inst:HasTag"reviver" and target and target:HasTag"player" and target:HasTag"corpse" then -- wortox soul would have the reviver tag
		table.insert(actions, inst.replica.stackable and inst.replica.stackable:IsStack() and GLOBAL.ACTIONS.GIVEALLTOPLAYER or GLOBAL.ACTIONS.GIVETOPLAYER)
	end 
end)

Locally, when I hover a soul as an active item over a corpse, the "give" option appears. But as a client, when I hover it over a corpse, no actions are suggested.

I've been having two similar problems that are like the one I just posted - one is trying to make booster shots usable by Wanda (since in our custom game mode everybody takes health penalty); and the other one is trying to make watering can fillable by ocean water. In all three cases, when I was testing locally, it was fine, but when I am playing as a client connected to the server, it wasn't. The "use" option doesn't appear over a boosters shot when you're Wanda. And as for the watering can, it's a bit different. My character enters the dolongaction state, but at the end of it, the watering can is not filled, but my character would not say the speech for a failed action...

Please excuse me. I checked and rechecked when you asked and discovered that inside an if-statement I had "if not GLOBAL.TheNet:GetIsMasterSimulation() then return end". Now this explains why the actions weren't being added on the client.

But do you have any ideas about  the watering can problem... where the watering can is ocean-fillable locally, but when as a client, the action does not seem to be registered on the server. I am clicking the "fill" action when hovering watering can above the ocean, and as I am walking towards the shore, I paused and had ThePlayer:GetBufferedAction(), and sure enough it returned nil. I'm really confused by this.

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...