Raised This Month: $12 Target: $400
 3% 

[INCLUDE] AutoExecConfig: Read and append to auto configs


Post New Thread Reply   
 
Thread Tools Display Modes
ImACow
AlliedModders Donor
Join Date: Feb 2015
Old 07-02-2017 , 11:57   Re: [INCLUDE] AutoExecConfig: Read and append to auto configs
Reply With Quote #41

Thanks for this.
__________________
ImACow is offline
Impact123
Veteran Member
Join Date: Oct 2011
Location: Germany
Old 11-02-2017 , 21:57   Re: [INCLUDE] AutoExecConfig: Read and append to auto configs
Reply With Quote #42

A few small changes you might be interested in to know about if you use the include file

The include now has versions. If you use
PHP Code:
AutoExecConfig_SetCreateFile 
The config will now add a version number and a link to this forum post at the top of configs like this
Code:
// This file was auto-generated by AutoExecConfig v0.1.2 (https://forums.alliedmods.net/showthread.php?t=204254)
You could always set a custom folder when you used
PHP Code:
AutoExecConfig_SetCreateFile("somefile""somefolder"
but it was never created when it didn't exist.

To retain backwards compatibility i added a new function which allows you to enable the directory creation
PHP Code:
AutoExecConfig_SetCreateDirectory 
The second parameter allows you to tell it which permissions to create the folder with but i would recommend to leave them as is.
__________________

Last edited by Impact123; 11-02-2017 at 22:04.
Impact123 is offline
shanapu
Veteran Member
Join Date: Apr 2015
Location: .de
Old 11-02-2017 , 22:04   Re: [INCLUDE] AutoExecConfig: Read and append to auto configs
Reply With Quote #43

nice update for this great include!

As asherkin said 5 years ago:
Quote:
Originally Posted by asherkin View Post
This is a really cool contribution, but it really should be a part of Core alongside AutoExecConfig.

Btw. I just found out that config files named with 3 or less letters, will not be generated.
__________________
coding & free software

Last edited by shanapu; 11-02-2017 at 22:05.
shanapu is offline
Impact123
Veteran Member
Join Date: Oct 2011
Location: Germany
Old 11-02-2017 , 22:27   Re: [INCLUDE] AutoExecConfig: Read and append to auto configs
Reply With Quote #44

Guess i need a better test suite because that wasn't intended but it's fixed now. Thanks!
__________________

Last edited by Impact123; 11-02-2017 at 23:11.
Impact123 is offline
Peace-Maker
SourceMod Plugin Approver
Join Date: Aug 2008
Location: Germany
Old 01-29-2018 , 09:17   Re: [INCLUDE] AutoExecConfig: Read and append to auto configs
Reply With Quote #45

Quote:
Originally Posted by Impact123 View Post
You could always set a custom folder when you used
PHP Code:
AutoExecConfig_SetCreateFile("somefile""somefolder"
but it was never created when it didn't exist.

To retain backwards compatibility i added a new function which allows you to enable the directory creation
PHP Code:
AutoExecConfig_SetCreateDirectory 
The second parameter allows you to tell it which permissions to create the folder with but i would recommend to leave them as is.
That change broke the case where you were creating that directory on your own before. Since you don't allow nested directories anymore, this fails and creates the files in the game's root folder instead of any subfolder at all. More details here.

I'd like to either revert that commit or try to create the whole subdirectory path if it doesn't exist.
__________________
Peace-Maker is offline
Impact123
Veteran Member
Join Date: Oct 2011
Location: Germany
Old 01-29-2018 , 17:29   Re: [INCLUDE] AutoExecConfig: Read and append to auto configs
Reply With Quote #46

Sorry about that, I've reverted the commit. Thanks for letting me know.
__________________

Last edited by Impact123; 01-29-2018 at 17:29.
Impact123 is offline
stickz
Senior Member
Join Date: Oct 2012
Location: Ontario, Canada
Old 04-03-2018 , 19:08   Re: [INCLUDE] AutoExecConfig: Read and append to auto configs
Reply With Quote #47

Could an optional function be added to remove convars, that are no longer relevant to a particular cfg file?

Here's an example as to how i'm currently using this wrapper with multiple cfg files.
stickz is offline
Impact123
Veteran Member
Join Date: Oct 2011
Location: Germany
Old 04-04-2018 , 03:19   Re: [INCLUDE] AutoExecConfig: Read and append to auto configs
Reply With Quote #48

I answered to a similar question here. Back then i did not succeed to implement it, nowadays might be different. I'm sure it's possible, if not for me then for a better programmer, but at the moment i don't have plans to put too much time into this, sorry.
__________________

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

I didn't read anything that seemed to answer my question:

What if I were to release an update that removed a convar? Would the include erase any unused convars from a pre-existing autoconfig file?

Edit:

Would I be able to use AutoExecConfig_SetFile() to create multiple autoconfig files in different directories? I'm asking because AutoExecConfig() doesn't have that capability.
__________________

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

No, it can only create and/or append. My last post has some background about why.
__________________

Last edited by Impact123; 04-13-2018 at 05:13.
Impact123 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 05:26.


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