Raised This Month: $32 Target: $400
 8% 

core.cfg not a valid KeyValues file?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
OSWO
Senior Member
Join Date: Jul 2015
Location: United Kingdom, London
Old 08-22-2017 , 04:32   core.cfg not a valid KeyValues file?
Reply With Quote #1

I'm looking to import from the file configs/core.cfg. The structure looks exactly like a KeyValue with comments. The issue is I cannot load it, here is the code + error. If anyone knows a way to fix it, or yield the variables from memory already would be appriciated, thanks.

EDIT: When I removed the Comments inside the KV file, it started to work.

PHP Code:
char cPath[512];
BuildPath(Path_SMcPathsizeof(cPath), "configs/core.cfg");

KeyValues kValues = new KeyValues("");
kValues.SetEscapeSequences(true);
kValues.ImportFromFile(cPath); 

__________________
SourceTimer | WeaponSkins++ | BasePlugins++ https://github.com/OSCAR-WOS

Last edited by OSWO; 08-22-2017 at 04:36.
OSWO is offline
psychonic

BAFFLED
Join Date: May 2008
Old 08-22-2017 , 08:23   Re: core.cfg not a valid KeyValues file?
Reply With Quote #2

It's an SMC file. You are correct that the format is similar to KeyValues, but they are not the same. As you saw, one of those differences is that KeyValues files don't support multiline comments.
psychonic is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 12:38.


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