Aquaterion Posted February 26, 2016 Share Posted February 26, 2016 (edited) I thought this was gonna be easy but apparently the current Right Click Use only works on equipped items, is there a way to use an item without equipping it, or change the text of the rightclick? as I think making a new action would require editing base files? Edited February 29, 2016 by Aquaterion Link to comment https://forums.kleientertainment.com/forums/topic/64801-help-right-click-use/ Share on other sites More sharing options...
Aquaterion Posted February 29, 2016 Author Share Posted February 29, 2016 Since I decided to edit a thread I did before that I didn't need rather than make a new thread, I have to bump it back up so yea. Link to comment https://forums.kleientertainment.com/forums/topic/64801-help-right-click-use/#findComment-728502 Share on other sites More sharing options...
Muche Posted February 29, 2016 Share Posted February 29, 2016 Using an item (i.e. item with useableitem component) currently does indeed require the item to be equipped, see componentactions:L835). However, other components usually don't require that. Changing the display text can be accomplished by setting the the action's strfn field + STRINGS.ACTIONS texts. Link to comment https://forums.kleientertainment.com/forums/topic/64801-help-right-click-use/#findComment-728543 Share on other sites More sharing options...
Aquaterion Posted March 1, 2016 Author Share Posted March 1, 2016 48 minutes ago, Muche said: Using an item (i.e. item with useableitem component) currently does indeed require the item to be equipped, see componentactions:L835). However, other components usually don't require that. Changing the display text can be accomplished by setting the the action's strfn field + STRINGS.ACTIONS texts. If you have time, mind providing an example of the action strfn, because I have to go right now, but If can do that, I can easily just put it on another component like sleeping or such.. Thank you for your help again. Link to comment https://forums.kleientertainment.com/forums/topic/64801-help-right-click-use/#findComment-728555 Share on other sites More sharing options...
Muche Posted March 1, 2016 Share Posted March 1, 2016 Examples from actions.lua: ACTIONS.RUMMAGE.strfn = function(act) local targ = act.target or act.invobject return targ ~= nil and targ.replica.container ~= nil and targ.replica.container:IsOpenedBy(act.doer) and "CLOSE" or nil end ACTIONS.DROP.strfn = function(act) if act.invobject ~= nil and not act.invobject:HasActionComponent("deployable") then return (act.invobject:HasTag("trap") and "SETTRAP") or (act.invobject:HasTag("mine") and "SETMINE") or (act.invobject.prefab == "pumpkin_lantern" and "PLACELANTERN") or nil end end ACTIONS.DEPLOY.strfn = function(act) return act.invobject ~= nil and ( (act.invobject:HasTag("groundtile") and "GROUNDTILE") or (act.invobject:HasTag("wallbuilder") and "WALL") or (act.invobject:HasTag("eyeturret") and "TURRET") ) or nil end ACTIONS.REEL.strfn = function(act) local fishingrod = act.invobject.replica.fishingrod if fishingrod ~= nil and fishingrod:GetTarget() == act.target then if fishingrod:HasHookedFish() then return "REEL" elseif act.doer:HasTag("nibble") then return "HOOK" else return "CANCEL" end end end ACTIONS.STORE.strfn = function(act) if act.target ~= nil then return (act.target.prefab == "cookpot" and "COOK") or (act.target.prefab == "birdcage" and "IMPRISON") or nil end end ACTIONS.HARVEST.strfn = function(act) if act.target ~= nil and act.target.prefab == "birdcage" then return "FREE" end if act.target ~= nil and act.target.components.crop and act.target:HasTag("withered") then return "WITHERED" end end ACTIONS.TURNOFF.strfn = function(act) local tar = act.target return tar ~= nil and tar:HasTag("hasemergencymode") and "EMERGENCY" or nil end ACTIONS.TAKEITEM.strfn = function(act) return act.target.prefab == "birdcage" and "BIRDCAGE" or "GENERIC" end Link to comment https://forums.kleientertainment.com/forums/topic/64801-help-right-click-use/#findComment-728556 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