Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Entity SetTrigger/StartTouch/EndTouch/Touch #340

Open
awilliamson opened this issue Aug 28, 2015 · 2 comments
Open

Entity SetTrigger/StartTouch/EndTouch/Touch #340

awilliamson opened this issue Aug 28, 2015 · 2 comments

Comments

@awilliamson
Copy link
Member

See: http://wiki.garrysmod.com/page/Entity/SetTrigger

Problem is GM-code would look for those functions on the GM(underlying) entity. We can't pre-modify 'all' entities with those functions. We would have to have some method for creating those functions on entities adhoc, which bind to the SF-layer. SF has GM as underlying, so we've have to go backwards, make SF code generate GM code on-the-fly and still be sandboxed and safe.

I have a rough idea of how to achieve this. All the work would be in the library function for setting up these 'trigger' GM callbacks, but the user-provided callback would be vetted and checked. The interface functions under those 'trigger' GM callbacks would 'force' SF to parse the user-provided callback in SF-space.

Am I making any sense? Any suggestions/Ideas? I think these functions would be damn cool for users, as they'd able to hook into the physics system on entities ( including holograms! ), perhaps even able to get velocity and physics information for simulations?

@Xandaros, @Jazzelhawk, @EpicG Thoughts?

@davidsonbr
Copy link

I had to deal with this in my panel library that I have yet to finish.
Gimme a sec to find it.

@davidsonbr
Copy link

Here is what I did.

We could modify the __newindex to make it so that if the user changes "startTouch", "touch" or "endTouch" keys the actual functions will set the instance, run the function and reset the instance.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants