Sends command to Hammer, if Hammer is running with the current map loaded.
All commands are in the format "command var1 var2 etc"<br><br> All commands that pick an entity with x y z , must use the exact position including decimals. i.e. -354.4523 123.4 -1224.325452 <br><br>
<h2>List of commands</h2> "session_begin mapName mapVersion" - Starts a hammer edit, locking the editor. mapName is the current map without path or suffix, mapVersion is the current version in the .vmf file<br><br> "session_end" - Ends a hammer edit, unlocking the editor.<br><br> "map_check_version mapName mapVersion" - This only works after session_begin, so you'd know the right version already and this only returns ok, this function is apparently useless<br><br> "entity_create entityClass x y z" - Creates an entity of entityClass at position x y z <br><br> "entity_delete entityClass x y z" - Deletes an entity of entityClass at position x y z <br><br> "entity_set_keyvalue entityClass x y z "key" "value"" - Set's the KeyValue pair of an entity of entityClass at x y z. The Key name and Value String must be in quotes.<br><br> "entity_rotate_incremental entityClass x y z incX incY incZ" - Rotates an entity of entityClass at x y z by incX incY incZ<br><br> "node_create nodeClass nodeID x y z" - Creates an AI node of nodeClass with nodeID at x y z you should keep nodeID unique or you will have issues<br><br> "node_delete nodeID" - Deletes node(s) with nodeID, this will delete multiple nodes if they have the same nodeID<br><br> "nodelink_create startNodeID endNodeID" - Creates a link between AI nodes startNodeID and endNodeID<br><br> "nodelink_delete startNodeID endNodeID" - Removes a link between AI nodes startNodeID and endNodeID<br><br>
All changes only happen in hammer, there is NO in game representation/feedback
A hammer function library I wrote while testing all these functions.
Please feel free to use this library as-is or with modification.