• Lua and map interaction
    4 replies, posted
In a map with a trigger for when players go through a door, you can make hammer respond by playing a sound ( or trigger some other event ). But is lua able to read that trigger as well? Running its own code with the maps trigger as a 'Hook'? Only other way I can think of is an entity made with lua and a custom model to do OnTouch and those kind of events. But it's more time consuming.
Garry added some entity called lua_script or something like that for hammer
If you mean the lua_run entity yeah, but you'd have to be able to edit the map to make that work. You can't add an output to a non-scripted entity outside hammer.
Oh good idea, that sounds like it could work for many scenarios. I assume you would just put what you want in the property name, and then the code in the value? Followed by some logic trigger of course.
[code] @PointClass base(Targetname, Origin) = lua_run : "Runs Lua Code" [ Code(string) : "Code" : "" : "Lua code to run when triggered" input RunCode(void) : "Run Code that was defined in the entity" input RunPassedCode(string) : "Run code that was passed as a variable" ] [/code] [url]https://github.com/garrynewman/garrysmod/blob/master/garrysmod/garrysmod.fgd[/url]
Sorry, you need to Log In to post a reply to this thread.