Welcome to The Forum

Register now to gain access to all of our features. Once registered and logged in, you will be able to create topics, post replies to existing threads

info Getting Started With Sourcemod


Pyrrhic
 Share

Recommended Posts

First off, this isn't really a guide to coding Sourcemod, but to getting ready to code.

 

Getting Started

 

If you're using git (such as github or gitlab), you'll want to install a suitable git client. GitKraken is highly recommended as it has an easy to use visual interface.

Writing Code

 

Sourcemod can be written using any text editor, but some have special features like syntax highlighting or auto completion.

Some recommendations are:

Sometimes you need a bit of help slapping the proper methods together. For editing code together we like to use Codeshare. HGDC members please be careful not to share links containing private code. For sharing code over a longer term a Secret Github Gist could be used.

 

To compile

 

Download Sourcemod, extract it, and open the folders addons > sourcemod > scripting. In there will be a compiler for your operating system.

Drag and drop your .sp plugin on the compiler (spcomp[.exe]) and if no errors occur a .smx compiler plugin will be created.

If no .smx is created it means there is an error and to compile you should open a command terminal into the folder you are developing in and enter "<compiler file name> <plugin file name>".

Any warnings or errors encountered during compilation will be printed into the terminal.

 

If your plugin doesn't depend on any Extensions (You'd probably know if it did) or depend on any other plugins you may compile online.

 

Most text editors can be configured to have a key combination automatically compile the plugin(s). You should research your specific text editor to see if this is available.

 

Troubleshooting

 

Can't figure out how a method works? If it is from Sourcemod you can search for it in the Sourcemod API which will detail what it returns, what arguments it takes, possible errors, etc.

If you are having a compile error or just don't know how to accomplish something Google it. Results from https://wiki.alliedmods.net or https://forums.alliedmods.net will likely help you as they are dedicated to Sourcemod.

If you are still having trouble and are not using private HG code you could request help on the AlliedModders Forums or ask other HGDC members for help. Please don't skip the 1st 2 resources as many times they will be able to answer your questions.

 

Useful links

  • Like 7
Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
 Share