• Is it possible to virtually create a building ingame without using props and only use coding?
    11 replies, posted
Is it possible to create a building using only lua code without props. Essentially the player would have a tool that showed an overview of the area and it would allow them to build walls in certain areas. I feel it is possible but I honestly have no clue on where to start. If it is possible can someone point in the right direction?
Mesh Library pls
[QUOTE=BFG9000;44416816]Mesh Library pls[/QUOTE] Do you know how much of a resource hog this is on players computers? Will you have better performance if you built something with this vs building with props? Do these automatically generate their own physics or do they need to have them generated for them?
I've never used them but I'm pretty sure they automatically get physics Physics by collisions and such, right?
Meshes are just visual. There are two physics based methods that I know of. [url]http://samuelmaddock.github.io/glua-docs/#Entity.PhysicsInitMultiConvex[/url] [url]http://samuelmaddock.github.io/glua-docs/#Entity.PhysicsFromMesh[/url] I don't have any experience with physics meshes so I can't tell you which is best or how to use them.
use PhysicsInitMultiConvex iirc PhysicsFromMesh is prone to crashes
[QUOTE=bran92don;44416774]Is it possible to create a building using only lua code without props[/QUOTE] Create a building? How about [url=https://facepunch.com/showthread.php?t=1270943]entire maps[/url]?
Wait your ported maps are made with the mesh library what the fuck :O
[QUOTE=rejax;44417541]use PhysicsInitMultiConvex iirc PhysicsFromMesh is prone to crashes[/QUOTE] Do you have any more information on it? There is very little documentation on it, and I am a little confused as to how I need to input the vectors into the table it is looking for. like do I do something like this: [lua] local table = [] table[1]=Vector(0,0,0) table[2]=Vector(1,1,1) [/lua] Sorry for the questions I just am trying to learn something new here. I have a idea I want to do but I need to better understand how to create meshes efficiently without crashing players.
[QUOTE=bran92don;44423327]Do you have any more information on it? There is very little documentation on it, and I am a little confused as to how I need to input the vectors into the table it is looking for. like do I do something like this: [lua] local table = [] table[1]=Vector(0,0,0) table[2]=Vector(1,1,1) [/lua] Sorry for the questions I just am trying to learn something new here. I have a idea I want to do but I need to better understand how to create meshes efficiently without crashing players.[/QUOTE] You might want to actually learn basic Lua syntax before you start taking on such a daunting task like this. [editline]1st April 2014[/editline] By the way; reading the documentation would have answered your question.
[QUOTE=EvacX;44423430]You might want to actually learn basic Lua syntax before you start taking on such a daunting task like this. [editline]1st April 2014[/editline] By the way; reading the documentation would have answered your question.[/QUOTE] No offense but I will not learn anything if I do not tackle new things. This is why I am asking questions regarding this to help me get a full understanding of how it works. I did go here: [url]http://wiki.garrysmod.com/page/Entity/PhysicsInitMultiConvex[/url] I read where it said: [b]A table consisting of tables containing Vectors.[/b] I am confused on how you would make a wall with that information. Do I need to go to one location and get the vector from there and then go to a different area and get the vector at that position to make it draw a wall to that location.
[QUOTE=bran92don;44423560]No offense but I will not learn anything if I do not tackle new things. This is why I am asking questions regarding this to help me get a full understanding of how it works. I did go here: [url]http://wiki.garrysmod.com/page/Entity/PhysicsInitMultiConvex[/url] I read where it said: [b]A table consisting of tables containing Vectors.[/b] I am confused on how you would make a wall with that information. Do I need to go to one location and get the vector from there and then go to a different area and get the vector at that position to make it draw a wall to that location.[/QUOTE] You use the Vectors to specify the vertices of a 3D convex shape. You can write this in Lua like so: [code] convexes = { { Vector(0, 0, 0), Vector(50, 0, 0), Vector(50, 0, 50), Vector(0, 0, 50), Vector(25, 25, 25), }, { Vector(0, 0, 0), Vector(-50, 0, 0), Vector(-50, 0, 50), Vector(0, 0, 50), Vector(-25, 25, 25), }, } [/code] There are other 'gotchas' you have to work around. Refer to working code to see how they can be worked around.
Sorry, you need to Log In to post a reply to this thread.