• Lua 5.1
    15 replies, posted
How would i import Lua 5.1 to my map/mod?
Pack rat is a good choice for a map.
pack rat? is that a program?
Are you talking about another mod other that gmod? If so then you need to do lots of C++ programming, it's documented on the lua website
Basically, what i want to do is put the bouncy ball from gmod, into a fun test mod i'm creating. Someone told me i would have to import 5.1 lua to do it, and that's it. Not very helpful. =(
It's probably difficult, unless you are a C++ wizard. What it means to import Lua 5.1 is trying to put a programming language into another language. Sounds hard if you've ever touched C++ on Source.
Although this is the LUA forum, it's also in the GMOD section. And as for putting the bouncy ball in, when making a map for GMOD you create any point based entity and open it's properties. switch "info_node" or whatever you used with "sent_ball" in the drop-down menu.
[QUOTE=CazzK]Not very helpful. =([/QUOTE] That's because few people here actually know how its done, and those who do know that it's too long and complex to bother describing at length. If you want to run Lua scripts in your own HL2 mod, you'll need to download the source for the Lua interpreter, and write your own set of Lua bindings so that the scripts can talk to the Source engine. This will be hard, it take a long time, and require you to be very familiar with the workings of the Source engine. If you want your mod to run scripts that look and behave the same way as they do in GMod, then you'll need to write your bindings to mimic that of the GMod bindings. This will be considerably harder - prohibitive for most. Frankly, I wouldn't bother - not unless you really really want it. :)
Stripped down tutorial: [list] [*]Create a new project from the source SDK [*]Download the Lua source [*]Include the source in your new project [*]Hook the functions from the HL2 source to Lua. This is what allows your to use functions. [*]Compile - Errors = Bad, Warnings = Not so bad, hopefully avoidable. [/list] I've done this before for laughs sake. I didn't go for an implementation as advanced as GMOD's, but managed to draw to the HUD using scripts. As for the bouncy ball idea, why not just create a new model, and set the physical properties to bouncy?
Why not just make a gamemode for garry's mod?
It would certainly make things simpler, but it would also limit his fan base to those who own a copy of GM10. It would be simple enough to just implement the GMod bouncy ball in C++.
[QUOTE=PackRat;5335336]That's because few people here actually know how its done, and those who do know that it's too long and complex to bother describing at length. If you want to run Lua scripts in your own HL2 mod, you'll need to download the source for the Lua interpreter, and write your own set of Lua bindings so that the scripts can talk to the Source engine. This will be hard, it take a long time, and require you to be very familiar with the workings of the Source engine. If you want your mod to run scripts that look and behave the same way as they do in GMod, then you'll need to write your bindings to mimic that of the GMod bindings. This will be considerably harder - prohibitive for most. Frankly, I wouldn't bother - not unless you really really want it. :)[/QUOTE] YOU IDIOTS! YOU DONT NEED TO ADD LUA TO SORCE JUSt SWITCH THE APP ID WITH THIS ONE IN YOUR MOD's GameInfo.txt: 4001
Ehm what, that doesn't make any sense at all.
[QUOTE=Overv;18078521]Ehm what, that doesn't make any sense at all.[/QUOTE] I think they want to add Lua to their Source Mod, like GMod uses. @OP: I've no idea how it works, and by the sound of it you don't know much code either. I believe you include Lua into any C++ or whatever by binding it to C++ functions, or something, there's a library somewhere too. Sorry I can't help much more, I've never used C++/C/C# and so on.
It's so incredibly simple. Go follow the tutorials on the Valve Developer Wiki that guide you on how to make a basic entity, then adapt your new found knowledge to converting the Lua code Garry has written for the bouncy ball into C++ using the appropriate functions.
Sorry, you need to Log In to post a reply to this thread.