Garry's Mod

Garry's Mod

276 ratings
Custom Animated Flags
2
3
   
Award
Favorite
Favorited
Unfavorite
Content Type: Addon
Addon Type: Tool
Addon Tags: Roleplay, Realism
File Size
Posted
Updated
28.838 MB
15 Dec, 2021 @ 10:38am
21 Feb @ 5:02am
10 Change Notes ( view )

Subscribe to download
Custom Animated Flags

In 1 collection by niumikus
Nucondrian Addons
9 items
Description
Welcome to Custom Animated Flags!

This Addon allows you to spawn flags, and apply your own images to them!

Applying Images
To apply an image
1.Select the Flag loader tool.
2.Select an image.
3.Click on the pole of a Flag.


How to add custom images

1.Navigate to your GarrysMod folder.
2.go to GarrysMod>garrysmod>materials>caf_flags
If the last folder (caf_flags) does not exist, just create it.
3.Put your images in here! (Jpg and png supported)

Images may not contain ".", whitespaces or any special characters in their names!

Note:
-To refresh the file explorer ingame, click on the main folder again.
-The Addon supports sub-folders, but they will not update upon refreshing.
-Subfolders required to be configurated in GarrysMod>garrysmod>data>caf>subfolders.json
-DO NOT remove "world/" from the subfolder config! but you can remove "example/"!

Multiplayer

For this to work in multiplayer, all players require the image file.
The image does not have to have the same name, but the image has to be exactly the same.
Subfolders do not have to match either.

If a player does not have the image, the flag will default for him. (Currently Germany)

Flag Collection Addons
You can also publish an addon with a collection of flags.
Please put them in <your addon name>/materials/caf_flags/<some subfolder>/
<some subfolder> being either the name of your addon, or whatever represent the flags within.

Requires one lua file:
In which you

hook.Add("CAFAddSubfolder","<Unique_identifier>",function ()
AddCAFFolder("folder/")
end)

Put this file in lua/autorun/client
If you're having problems, contact me.

Everything is saveable!

Some side notes:

When sharing images for multiplayer;
If you're using discord to share the images, send them in ZIPs. Otherwise discord might compress them and the image might not be exactly the same. (And therefore not get recognised)

Margain
There's a 1% margain on all sides of the picture.

Cannot see flags on Server i just joined
Either you do not have the required images, or try running the console command caf_refesh.

Configuration of subfolders
GarrysMod>garrysmod>data>caf>subfolders.json
["world/","example/"]
always add a ,"<subfolder>/" if you want a new subfolder.
Should support subfolders of subfolders, in this case do "<subfoldera>/<subfolderb>/".

CONVARS
CAF_ALLOW_UPDATE 1
0 to disallow CAF Material updates.
1 to allow CAF Material updates.
When disabled only cached flags will load
If you're not actively adding images, i recommend to set this to 0! And caching the folder! (world/ is automatically cached)

Console Commands
caf_createcache <folder>/
Create a Cache for this folder, assumes content will no longer change.
Use caching if CAF_ALLOW_UPDATE is set to 0
Only cache folders you do not intend to change anymore.
Do not cache "/"

caf_destroycache
Deletes the cache.

caf_stats
Shows stats.

caf_reloadcache
Purges the loaded cache, and reloads everything from the cache file.
May cause issues if a Flag Collection Addon is mounted
There is actually no reason for you to use this

caf_forceload_all
Forces caf to consider loading all images. Already cached Images are exempt.

Tip!
When in doubt, destroy the cache!

Help for multiplayer debugging from: Kerolos and Vulkyrie
Popular Discussions View All (7)
8
25 Jul @ 4:25pm
PINNED: Issues 2024
niumikus
5
19 Jun @ 12:49pm
couldn't find the flag folder
AyamJantanBertelur
4
10 Feb @ 4:26pm
My map crashes after i enable this addon.
Stepan Bandera
110 Comments
Monolithsss 26 Jul @ 11:04am 
Iv made so many cursed images go on my flag so far, it's genuinely amazing. :AmokSoldier: 10/10.
Mozambik 25 Jul @ 12:28pm 
i cant find the caf_folder please help:steamsad:
AliBabaHajjHasan 3 Jul @ 8:31am 
How can I permaprop a flag and the flag material I choose?
ICDX 19 Jun @ 11:14am 
this is the best flag addon for gmod :steamthumbsup:
Combine 8 Jun @ 7:46pm 
i want great britain
niumikus  [author] 15 Apr @ 12:50pm 
Did you click the root folder in the sTOOL UI?
The tree only lists the folders, the files are listed right next to it after clicking the Folder.
The1freeman1 15 Apr @ 12:40pm 
I estarted many a time and still nothing there.
niumikus  [author] 15 Apr @ 12:37pm 
GarrysMod>garrysmod>materials>caf_flags.
Are you sure its exactly here?
Subfolders must be configured manually. (desc)
If this folder didnt exist beforehand the game will require a restart first.
Folders are not updated after the addon is loaded, only images
The1freeman1 15 Apr @ 8:29am 
I made the caf_flag folder/document and put all my flags in there, no where to be found..
hunter1944 26 Mar @ 8:54am 
This is amazing, thank you for this.