Raised This Month: $7 Target: $400
 1% 

[INCLUDE] AutoExecConfig: Read and append to auto configs


Post New Thread Reply   
 
Thread Tools Display Modes
Psyk0tik
Veteran Member
Join Date: May 2012
Location: Homeless
Old 04-13-2018 , 05:47   Re: [INCLUDE] AutoExecConfig: Read and append to auto configs
Reply With Quote #51

Is it possible to use multiple AutoExecConfig_SetFile() to create multiple autoconfig files?

I'm asking because AutoExecConfig() doesn't allow multiple callbacks if autocreate is set to true for all the callbacks.

Example:

AutoExecConfig(true, "blah");
AutoExecConfig(true, "blarg");

Would only create blah.cfg but not blarg.cfg

Just wanna know if your include is also limited by that.
__________________

Last edited by Psyk0tik; 04-13-2018 at 05:49.
Psyk0tik is offline
Impact123
Veteran Member
Join Date: Oct 2011
Location: Germany
Old 04-13-2018 , 06:10   Re: [INCLUDE] AutoExecConfig: Read and append to auto configs
Reply With Quote #52

Yes that's possible. I'm not sure what you mean with callbacks.
__________________

Last edited by Impact123; 04-13-2018 at 06:47.
Impact123 is offline
Psyk0tik
Veteran Member
Join Date: May 2012
Location: Homeless
Old 04-13-2018 , 06:39   Re: [INCLUDE] AutoExecConfig: Read and append to auto configs
Reply With Quote #53

Quote:
Originally Posted by Impact123 View Post
Yes, that's possible. I'm not sure what you mean with callbacks.
Oh, my bad. I meant just calling AutoExecConfig() multiple times, not callbacks.

Thanks btw!
__________________

Last edited by Psyk0tik; 04-13-2018 at 06:39.
Psyk0tik is offline
Impact123
Veteran Member
Join Date: Oct 2011
Location: Germany
Old 04-13-2018 , 06:48   Re: [INCLUDE] AutoExecConfig: Read and append to auto configs
Reply With Quote #54

Here's an example which would create 2 config files
PHP Code:
AutoExecConfig_SetCreateFile(true);

AutoExecConfig_SetFile("test1");
AutoExecConfig_CreateConVar("test1""1""Test1");
AutoExecConfig_ExecuteFile();

AutoExecConfig_SetFile("test2");
AutoExecConfig_CreateConVar("test2""1""Test2");
AutoExecConfig_ExecuteFile(); 
The important part which i forgot to mention is using

PHP Code:
AutoExecConfig_SetCreateFile(true); 
__________________
Impact123 is offline
Psyk0tik
Veteran Member
Join Date: May 2012
Location: Homeless
Old 04-13-2018 , 17:18   Re: [INCLUDE] AutoExecConfig: Read and append to auto configs
Reply With Quote #55

Would this work as well?

PHP Code:
AutoExecConfig_SetCreateFile(true);
AutoExecConfig_SetFile("test1");
AutoExecConfig_SetFile("test2");
AutoExecConfig_CreateConVar("sm_test1""1""test1");
AutoExecConfig_CreateConVar("sm_test2""2""test2");
AutoExecConfig_ExecuteFile(); 
__________________

Last edited by Psyk0tik; 04-13-2018 at 17:51.
Psyk0tik is offline
Impact123
Veteran Member
Join Date: Oct 2011
Location: Germany
Old 04-13-2018 , 23:02   Re: [INCLUDE] AutoExecConfig: Read and append to auto configs
Reply With Quote #56

No. If you use
PHP Code:
AutoExecConfig_SetFile 
you're just setting a few global variables that will be used by the other functions to read, create, append, etc. If you use it like that you would immediately overwrite test1 with test2.
__________________

Last edited by Impact123; 04-13-2018 at 23:06.
Impact123 is offline
Psyk0tik
Veteran Member
Join Date: May 2012
Location: Homeless
Old 04-13-2018 , 23:34   Re: [INCLUDE] AutoExecConfig: Read and append to auto configs
Reply With Quote #57

Quote:
Originally Posted by Impact123 View Post
No. If you use
PHP Code:
AutoExecConfig_SetFile 
you're just setting a few global variables that will be used by the other functions to read, create, append, etc. If you use it like that you would immediately overwrite test1 with test2.
Alright, that makes sense. Thanks!
__________________
Psyk0tik is offline
eyal282
Veteran Member
Join Date: Aug 2011
Old 12-18-2018 , 15:53   Re: [INCLUDE] AutoExecConfig: Read and append to auto configs
Reply With Quote #58

Where's the file?
__________________
I am available to make plugins for pay.

Discord: Eyal282#1334
eyal282 is offline
Impact123
Veteran Member
Join Date: Oct 2011
Location: Germany
Old 12-18-2018 , 16:54   Re: [INCLUDE] AutoExecConfig: Read and append to auto configs
Reply With Quote #59

That depends on what you pass to AutoExecConfig_SetFile. By default it's created inside the cfg/sourcemod folder.
__________________

Last edited by Impact123; 12-18-2018 at 16:56.
Impact123 is offline
eyal282
Veteran Member
Join Date: Aug 2011
Old 12-20-2018 , 11:59   Re: [INCLUDE] AutoExecConfig: Read and append to auto configs
Reply With Quote #60

Quick question, if you give us coders the ability to add cvars into a queue and after adding all cvars, force the queue to execute, won't it be more efficient, as it is required to check the file less?

Edit: Can you also perhaps add a default auto exec global config file that auto sorts itself? I don't like the way AutoExecConfig separates cvars with whole different files, messy and in Linux once caused me crashes.
__________________
I am available to make plugins for pay.

Discord: Eyal282#1334

Last edited by eyal282; 12-20-2018 at 12:05.
eyal282 is offline
Reply


Thread Tools
Display Modes

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 01:33.


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