Aquaterion Posted May 11, 2016 Share Posted May 11, 2016 I'm looking into disabling every action the player can do except maybe Examine(not really that important but wouldnt mind it) I tried inst:ShowActions(false), but it only does half the job, which is just hiding them, the player can still press SPACE to interact with things. Link to comment Share on other sites More sharing options...
rezecib Posted May 11, 2016 Share Posted May 11, 2016 (edited) @Aquaterion I'd refer to Woodie's action changes on his beavermode transformation. So I think this would do the trick: inst.components.playercontroller.actionbuttonoverride = function() end inst.components.playeractionpicker.leftclickoverride = function(inst, target) --Copied and edited from PlayerActionPicker:GetLeftClickActions if inst.components.playercontroller:IsControlPressed(CONTROL_FORCE_INSPECT) and target:HasTag("inspectable") and (inst.CanExamine == nil or inst:CanExamine()) and (inst.sg == nil or inst.sg:HasStateTag("moving") or inst.sg:HasStateTag("idle")) and (inst:HasTag("moving") or inst:HasTag("idle")) then return inst.components.playeractionpicker:SortActionList({ ACTIONS.LOOKAT }, target, nil) end end inst.components.playeractionpicker.rightclickoverride = function() end And if you want to remove examination you could just give the leftclickoverride a function stub like the others. Do you also want to disable attacks, though? I think that would require something more. Edited May 11, 2016 by rezecib Link to comment Share on other sites More sharing options...
Aquaterion Posted May 11, 2016 Author Share Posted May 11, 2016 41 minutes ago, rezecib said: @Aquaterion I'd refer to Woodie's action changes on his beavermode transformation. So I think this would do the trick: inst.components.playercontroller.actionbuttonoverride = function() end inst.components.playercontroller.leftclickoverride = function(inst, target) --Copied and edited from PlayerActionPicker:GetLeftClickActions if inst.components.playercontroller:IsControlPressed(CONTROL_FORCE_INSPECT) and target:HasTag("inspectable") and (inst.CanExamine == nil or inst:CanExamine()) and (inst.sg == nil or inst.sg:HasStateTag("moving") or inst.sg:HasStateTag("idle")) and (inst:HasTag("moving") or inst:HasTag("idle")) then return inst.components.playeractionpicker:SortActionList({ ACTIONS.LOOKAT }, target, nil) end end inst.components.playercontroller.rightclickoverride = function() end And if you want to remove examination you could just give the leftclickoverride a function stub like the others. hmm I see, I got it to work combining with ShowActions, cant examine things but that's fine. Thanks for the help! Link to comment Share on other sites More sharing options...
rezecib Posted May 11, 2016 Share Posted May 11, 2016 @Aquaterion I made a mistake in the first version I posted-- for the leftclick and rightclick overrides, it needs to be the playeractionpicker component. That should enable examination, although ShowActions might be screwing that up if you keep it. Link to comment Share on other sites More sharing options...
Aquaterion Posted May 11, 2016 Author Share Posted May 11, 2016 5 minutes ago, rezecib said: @Aquaterion I made a mistake in the first version I posted-- for the leftclick and rightclick overrides, it needs to be the playeractionpicker component. That should enable examination, although ShowActions might be screwing that up if you keep it. yea showactions hides them, but makes them still usable via space, removing showactions and doing inst.components.playercontroller.actionbuttonoverride = function() end inst.components.playeractionpicker.leftclickoverride = function() end inst.components.playeractionpicker.rightclickoverride = function() end fixes the "usable via space" issue, but covers examine too. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now