AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Snippets and Tutorials (https://forums.alliedmods.net/forumdisplay.php?f=112)
-   -   Keyvalues #base <sourcefile> (https://forums.alliedmods.net/showthread.php?t=279853)

Bacardi 03-02-2016 19:01

Keyvalues #base <sourcefile>
 
Hey, I found this keyname "#base" from Insurgency game, haven't seen before. (name "#include" exist also, works same way ?)

It can merge source file(s) in your current kv structure.
It not update/overwrite your current values, but create new ones.

Quick example:
By creating three file in game root folder

Main File.txt

First File.txt

Second File.txt


And in your sourcemod plugin, you import Main File.txt in your KeyValue structure and thats it.
PHP Code:

    Handle kv CreateKeyValues("MyFile");
    
FileToKeyValues(kv"Main File.txt");
    
KeyValuesToFile(kv"MyFile.txt");
    
CloseHandle(kv); 

Output will be this:
Code:

"Main File"
{
        "Main File section"
        {
                "Main File key"                "value"
                "First File key"                "666"
        }
        "Second File section"
        {
                "Second File key"                "value"
        }
}


headline 03-02-2016 22:51

Re: Keyvalues #base <sourcefile>
 
Cool! Nice find


All times are GMT -4. The time now is 18:30.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.