PivityGmodStore

๐Ÿ˜ Adding new emoji

Creating paths


Garry's mod uses a shared pool of materials so one addon can access the materials of another. This will allow us to place emoji without affecting the main addon.

Let's start by creating a base path:


  1. Go to the garrysmod/addons folder of your server
  2. Create a new folder with any name (f.e. AnyNameHere)
  3. Create a "materials" folder inside the "AnyNameHere" folder
  4. Create an "echat" folder inside the "materials" folder
  5. Create an "emoji" folder inside the "echat" folder


The final path must be like this: "garrysmod/addons/AnyNameHere/materials/echat/emoji"




Creating emoji


The emoji themselves are PNG files with a size of 36x36 (It can be higher, but the quality in the game may degrade due to the rendering of materials). The name of the file is the name of the emoji in the game. For example cool.png in the game will be represented as :cool:. Please note that it is desirable to give file names in lower case and without spaces.


Good example: AnyNameHere/materials/echat/emoji/hello_world.png

Bad example: AnyNameHere/materials/echat/emoji/Hello World.png

Next, you simply populate the emoji folder with your pictures.




Uploading to workshop


In order for your clients to receive emoji, you need to upload your emojis to Workshop.

I suggest you use gmpublisher (clickable) as it provides a user-friendly interface for this.

Also, here's a link to the official guide for this : https://wiki.facepunch.com/gmod/Workshop_Addon_Creation


After you post the addon, don't forget to open it for all users (Visibility - for all)

Copy the link to your addon. It should be a link like https://steamcommunity.com/sharedfiles/filedetails/?id=YourAddonIDHere

You need an ID from it. It comes right after ?id=

Then you can upload this addon to the server collection, as well as add to the server download. To do this, go to addons/echat/lua/autorun/echat_loader.lua. Find the code responsible for resources. Its approximate view:

if ( SERVER ) then
--content (materials)
resource.AddWorkshop( "3152189815" ) -- https://steamcommunity.com/sharedfiles/filedetails/?id=3152189815
end

Add a new line immediately after resource.AddWorkshop("3152189815" )

resource.AddWorkshop("YourAddonIDHere" )

View after changes:ย 

if ( SERVER ) then
--content (materials)
resource.AddWorkshop( "3152189815" ) -- https://steamcommunity.com/sharedfiles/filedetails/?id=3152189815
resource.AddWorkshop( "YourAddonIDHere" )
end


Emoji should now be available in your game.

Can't find what you're looking for?

Contact support