- Install StarfallEx from https://github.com/thegrb93/StarfallEx
- Put this repo into your addons folder
- Open Hammer and compile your map that you wish to edit in-game
- Open your map in Garry's Mod
- Begin a session using hammer.startSession()
- Note: You MUST be running the same version of the map in Hammer and Garry's Mod.
- Use whatever functions you wish to place entities in Hammer
- End the editing session using hammer.endSession()
- Your changes should appear in Hammer!
hammer.sendCommand(cmd) - Sends a command to Hammer. Arguments:
cmd- String - The command to send
hammer.startSession() - Begins an editing session.
hammer.endSession() - Ends an editing session.
hammer.createEntity(class, pos) - Creates an entity. Arguments:
class- String - Class of the entitypos- Vector - Position of the entity
hammer.removeEntity(class, pos) - Removes an entity. Arguments:
class- String - Class of the entitypos- Vector - Position of the entity
hammer.setKeyValue(class, pos, key, value) - Sets an entity's KeyValue pair. Arguments:
class- String - Class of the entitypos- Vector - Position of the entitykey- String - Key to setvalue- String - Value to set
hammer.rotateIncremental(class, pos, ang) - Incrementally rotates an entity. Arguments:
class- String - Class of the entitypos- Vector - Position of the entityang- Angle - Angle to rotate the entity by
hammer.createNode(class, id, pos) - Creates an AI node. Arguments:
class- String - Class of the nodeid- Number - ID of the nodepos- Vector - Position of the node
hammer.removeNode(id) - Removes an AI node. Arguments:
id- Number - ID of the node
hammer.createNodeLink(startID, endID) - Creates a link between two AI nodes. Arguments:
startID- Number - First node IDendID- Number - Second node ID
hammer.removeNodeLink(startID, endID) - Removes a link between two AI nodes. Arguments:
startID- Number - First node IDendID- Number - Second node ID
hammer.createProp(type, model, pos, ang) - Creates a prop. Arguments:
type- String - Type of prop ("physics", "dynamic", "dynamic_override", or "static")model- String - Model of the proppos- Vector - Position of the propang- Angle - Angle of the prop
I made a chip to make use of these functions! Check out my vegetation placer!