pickleplayer Posted August 14, 2015 Share Posted August 14, 2015 It's probably a simple solution, but I just can't seem to find it. I want to call a function when a character examines a touch stone, but I can't figure out how.I would just use an even listener, but there doesn't seem to be any events related to inspecting items. I'm guessing it's just a common command I don't know about yet. Man, I wish there were lists of events or other useful things like that available somewhere. Thanks in advance for any help! Link to comment https://forums.kleientertainment.com/forums/topic/57071-another-dumb-question-about-examining-items/ Share on other sites More sharing options...
Mobbstar Posted August 15, 2015 Share Posted August 15, 2015 There's a mod called "Examine Traps First", but I'm not sure how well it works. Link to comment https://forums.kleientertainment.com/forums/topic/57071-another-dumb-question-about-examining-items/#findComment-663511 Share on other sites More sharing options...
pickleplayer Posted August 15, 2015 Author Share Posted August 15, 2015 There's a mod called "Examine Traps First", but I'm not sure how well it works. Ah, thanks! I looked at their code and I did manage to make it work for me. It turns out you have to do some weird stuff with GLOBAL.TheInput:GetAllEntitiesUnderMouse() It's strange that there isn't a simpler way to do that. Oh well. Link to comment https://forums.kleientertainment.com/forums/topic/57071-another-dumb-question-about-examining-items/#findComment-663591 Share on other sites More sharing options...
Blueberrys Posted August 17, 2015 Share Posted August 17, 2015 (edited) @pickleplayerYou could try this.ACTIONS = GLOBAL.ACTIONSoldLookAtFn = ACTIONS.LOOKAT.fnACTIONS.LOOKAT.fn = function(act) local targ = act.target or act.invobject if targ and targ.components.inspectable and targ.prefab=="resurrectionstone" then -- Do something end return oldLookAtFn(act)end Edit: See the "Tables as Objects" portion of this guide. Edited August 19, 2015 by Blueberrys Link to comment https://forums.kleientertainment.com/forums/topic/57071-another-dumb-question-about-examining-items/#findComment-663927 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