General > Developers Corner

Lua brush

<< < (2/2)

Tophat Man:
Ok I'm basically making a game mode. I figure its the easiest way for me at least to understand lua. It's going to be like the sassilization lounge server but more based on mini-games than like making money to play sassilization. So far I have the spawn and lounge parts of the map and I'm using this lua brush for the game room.

JamminR:

--- Quote from: MrPresident on June 20, 2008, 08:24:20 AM ---Why didn't you just ask me? =(
<clip>

--- End quote ---
Because you scare him. You military men can be so intimidating.


--- Quote from: MrPresident on June 20, 2008, 08:24:20 AM ---<clip>
Create a new entity folder called like "garrysmod/lua/entities/mynewbrush"
Inside this folder create an init.lua file and include the following in the file.
<clip>
Put this in a lua file that is run at startup. Either in your init.lua file, if you are making a gamemode.. or in a lua file in garrysmod/lua/autorun/server/
<clip>

--- End quote ---

Though I'm not sure the entities folder would act like any other addon, I strongly recommend using addon format.
gmod/addons/<myaddonname>/lua/entities blah blah
Just place an info.txt file in <myaddonname>.

President has a tendency to like editing straight gmod directories/code at times...but, one day, this will (if not already) bite him in the butt because he'll forget where a change is located that he needs to fix/put back (if overwritten by update).

:P :D

The addons folder is your friend. I recommend using it for any addition.
I've even gone so far as to convert some maps that had extra materials/sounds into addon format, so I wouldn't have to worry/remember where/what stuff came with the map.

Tophat Man:
Yeah when I have stuff that uses things like sounds or materials I use the addons folder. I already was using it for this, I have some custom textures and stuff.

Navigation

[0] Message Index

[*] Previous page

Go to full version