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

[idea] Arguments for plugins in plugins.ini


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Shadows In Rain
Senior Member
Join Date: Apr 2010
Location: Russia::Siberia
Old 09-18-2011 , 18:24   [idea] Arguments for plugins in plugins.ini
Reply With Quote #1

I have my own simple plugin host (not related to AMXX and CStrike). Actually I'm not using config file to specify which plugins to load, because I'm using simple easy-to-parse scripts. Look at example.
Code:
plugins::load safe
	plugin1
		param1
		param2 = blah-blah
	plugin2
	folder1/plugin3
	plugin4
	// etc
As you can see, I have freedom to pass any arguments to my plugins, so i don't need to use thousands of variables and config files.

What we have with AMXX in year* 2011? AMXX uses plain .ini files.
Code:
plugin1.amxx
plugin2.amxx debug
plugin3.amxx
As I know, AMXX allows modules to load plugins manually. So i'm planning to create improved plugin loader, that allows to pass arguments to plugins, like this:
Code:
always
	plugin1.amxx
	plugin2.amxx
		debug
	plugin3.amxx
		server myserver.com
		port 13666

map zm_*
	zombieplague.amxx
	myextraitem.amxx
		cost = 15

map kz_*
	kreedz.amxx

map de_dust2
	dedust2_bugfix.amxx
But before I even tried to write first line of code, I want to discuss and to hear opinions, if possible. May be I will see suggestions how to make it even better.

* I can play Portal 2 or Minecraft, but I still love cstrike and AMXX.
__________________
I'm using Google translator, yarrr. |.◕‿‿◕.|

Last edited by Shadows In Rain; 09-19-2011 at 15:19.
Shadows In Rain is offline
Send a message via ICQ to Shadows In Rain
Fedcomp
Member
Join Date: Feb 2009
Location: Russia
Old 09-18-2011 , 19:11   Re: [idea] Arguments for plugins in plugins.ini
Reply With Quote #2

http://pastebin.com/ydfbyv1r
Sourcemod style better.
I hate tabs for many reasons.
__________________

Last edited by Fedcomp; 09-18-2011 at 19:30.
Fedcomp is offline
Send a message via ICQ to Fedcomp
Shadows In Rain
Senior Member
Join Date: Apr 2010
Location: Russia::Siberia
Old 09-18-2011 , 20:08   Re: [idea] Arguments for plugins in plugins.ini
Reply With Quote #3

I wont plan to pass key-value pair, I need to pass only lines of text, plugin will parse it as it needs. Also I dont want to type these annoying braces and quotes. Plugin args is something like program args — short and simple. Anything complicated must still be stored within dedicated config files.
__________________
I'm using Google translator, yarrr. |.◕‿‿◕.|

Last edited by Shadows In Rain; 09-19-2011 at 15:20.
Shadows In Rain is offline
Send a message via ICQ to Shadows In Rain
xPaw
Retired AMX Mod X Moderator
Join Date: Jul 2008
Old 09-19-2011 , 00:20   Re: [idea] Arguments for plugins in plugins.ini
Reply With Quote #4

Quote:
Originally Posted by Fedcomp View Post
http://pastebin.com/ydfbyv1r
Sourcemod style better.
I hate tabs for many reasons.
Sourcemod loads plugins from plugins/ folder without parsing any files.
__________________
xPaw is offline
bibu
Veteran Member
Join Date: Sep 2010
Old 09-19-2011 , 12:15   Re: [idea] Arguments for plugins in plugins.ini
Reply With Quote #5

http://wiki.amxmodx.org/Configuring_...ecific_Plugins
http://forums.alliedmods.net/showthread.php?p=440397
__________________
Selling tons of my own private works.
Accepting paid work for clans and communities.
Don't hesitate to contact me.
bibu is offline
Shadows In Rain
Senior Member
Join Date: Apr 2010
Location: Russia::Siberia
Old 09-19-2011 , 14:33   Re: [idea] Arguments for plugins in plugins.ini
Reply With Quote #6

And...?
How to pass args?
__________________
I'm using Google translator, yarrr. |.◕‿‿◕.|
Shadows In Rain is offline
Send a message via ICQ to Shadows In Rain
bibu
Veteran Member
Join Date: Sep 2010
Old 09-19-2011 , 16:17   Re: [idea] Arguments for plugins in plugins.ini
Reply With Quote #7

I just give a start, if you didn't know this plugin/configuration.
__________________
Selling tons of my own private works.
Accepting paid work for clans and communities.
Don't hesitate to contact me.
bibu is offline
Shadows In Rain
Senior Member
Join Date: Apr 2010
Location: Russia::Siberia
Old 09-19-2011 , 18:48   Re: [idea] Arguments for plugins in plugins.ini
Reply With Quote #8

TY. I know. :)
__________________
I'm using Google translator, yarrr. |.◕‿‿◕.|
Shadows In Rain is offline
Send a message via ICQ to Shadows In Rain
Fedcomp
Member
Join Date: Feb 2009
Location: Russia
Old 09-30-2011 , 23:59   Re: [idea] Arguments for plugins in plugins.ini
Reply With Quote #9

Quote:
Originally Posted by xPaw View Post
Sourcemod loads plugins from plugins/ folder without parsing any files.
Configs too?

facepalm
__________________
Fedcomp is offline
Send a message via ICQ to Fedcomp
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 20:00.


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