1. This forum is ARCHIVED! Visit the new Cloud Sixteen forums, codename Eden, at https://eden.cloudsixteen.com. These forums will remain archived for a few months before being closed down, so try to encourage plugin developers to begin moving their content across to the new forums.
Dismiss Notice
Hi Guest, you need a Steam account to register and post on these forums. Login with Steam at the top of the forums to get started!
Dismiss Notice
Hi Guest, do you want to buy HL2RP or another Clockwork schema? Visit the Cloud Sixteen Store to get started!

Other How to Create Entities?

Discussion in 'Development' started by NoahtheBoah36™, Jan 4, 2018.

  1. NoahtheBoah36™

    NoahtheBoah36™ Clockwork Retard Clockwork Customer

    Sorry to make something so basic, but how exactly does one create entities? I tried looking at the code for the vending machine and I can't make heads or tails of it. Is there a tutorial out there or a simple explanation? If not that's fine but I'm hoping I can glean some information.
     
    • Like Like x 1
    • Winner Winner x 1
  2. Mixed

    Mixed removed Clockwork Customer

    Make some research on the web, make an entity on gmod is pretty simple.

     
  3. RJ

    RJ no pay Legend Clockwork Customer

    Entities consist of 3 files: cl_init.lua, init.lua, and shared.lua. See here for ('outdated?', albeit useful) documentation: https://maurits.tv/data/garrysmod/wiki/wiki.garrysmod.com/indexf251.html

    • cl_init.lua: This file is for defining how the client (i.e. player) sees the entity, if at all. Think of how a combine lock will have a light on it, same for the vending machine. Also think of how those entities show up as models that you, the player, can see.
    • init.lua: This file defines how the entity behaves and how the player can interact with it. Think of how the Combine can lock/unlock the combine lock, or how a citizen can buy a can of soda from the vending machine.
    • shared.lua: This file pretty much defines metadata (i.e. data describing data) of the entity, e.g. name of the entity, its author, what type of entity it is, what kind of functionality it inherits, etc. This is boilerplate kind of stuff, it's not too important in terms of making your first entity unless you need a specific kind of functionality. Don't worry about this file too much unless your entity isn't behaving the way you want it to, but that could be for other reasons other than what's defined in this file.
     
    • Informative Informative x 1
    • Good Coder Good Coder x 1
  4. NoahtheBoah36™

    NoahtheBoah36™ Clockwork Retard Clockwork Customer

    Alright, thanks RJ. That context actually helps a lot. I might actually give it a shot now. XD
     
    • Like Like x 1

Previous Readers (Total: 0)