Skip to content

Commit 403cffa

Browse files
committed
Add info about loading GameplayTag .ini files from plugins
Resolves tranek#125
1 parent eac5c24 commit 403cffa

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

README.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ The best documentation will always be the plugin source code.
2121
>       4.1.2 [Setup and Initialization](#concepts-asc-setup)
2222
> 4.2 [Gameplay Tags](#concepts-gt)
2323
>       4.2.1 [Responding to Changes in Gameplay Tags](#concepts-gt-change)
24+
>       4.2.2 [Loading Gameplay Tags from Plugin .ini Files](#concepts-gt-loadfromplugin)
2425
> 4.3 [Attributes](#concepts-a)
2526
>       4.3.1 [Attribute Definition](#concepts-a-definition)
2627
>       4.3.2 [BaseValue vs CurrentValue](#concepts-a-value)
@@ -469,6 +470,28 @@ virtual void StunTagChanged(const FGameplayTag CallbackTag, int32 NewCount);
469470
470471
**[⬆ Back to Top](#table-of-contents)**
471472
473+
<a name="concepts-gt-loadfromplugin"></a>
474+
### 4.2.2 Loading Gameplay Tags from Plugin .ini Files
475+
If you create a plugin with its own .ini files with `GameplayTags`, you can load that plugin's `GameplayTag` .ini directory in your plugin's `StartupModule()` function.
476+
477+
For example, this is how the CommonConversation plugin that comes with Unreal Engine does it:
478+
479+
```c++
480+
void FCommonConversationRuntimeModule::StartupModule()
481+
{
482+
TSharedPtr<IPlugin> ThisPlugin = IPluginManager::Get().FindPlugin(TEXT("CommonConversation"));
483+
check(ThisPlugin.IsValid());
484+
485+
UGameplayTagsManager::Get().AddTagIniSearchPath(ThisPlugin->GetBaseDir() / TEXT("Config") / TEXT("Tags"));
486+
487+
//...
488+
}
489+
```
490+
491+
This would look for the directory `Plugins\CommonConversation\Config\Tags` and load any .ini files with `GameplayTags` in them into your project when the Engine starts up if the plugin is enabled.
492+
493+
**[⬆ Back to Top](#table-of-contents)**
494+
472495
<a name="concepts-a"></a>
473496
### 4.3 Attributes
474497

0 commit comments

Comments
 (0)