Jump to content

Recommended Posts

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!

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.

@pickleplayer

You 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 by Blueberrys

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