info.lua question
#1
Hi I got a question about info.lua.

Do I just have to register the commands in the info.lua or do I need to register the commands using the BindCommand function and the info.lua is just a info table?

Another question releated to info.lua, the Alias var in commands, can it be an array or is it only a string?
Reply
Thanks given by:
#2
Note that Info.lua needs to have a capital I, otherwise it won't work on case-sensitive filesystems, such as on most Linuxes.

You either use the Info.lua file or the BindCommand function; usually not both at the same time.

Note that Info.lua is really just a descriptor table, in order to register the commands, you need to do this:
	-- Load the InfoReg shared library:
	dofile(cPluginManager:GetPluginsPath() .. "/InfoReg.lua")
	
	-- Bind all the commands:
	RegisterPluginInfoCommands();
	
	-- Bind all the console commands:
	RegisterPluginInfoConsoleCommands();
This will load an aux library that provides the actual guts to Info.lua command handling, and can register the commands and console commands for you.

The Alias can be either a single string, or an array-table of strings.
Reply
Thanks given by:
#3
Can we get the server to do this automatically?
Reply
Thanks given by:
#4
We could, theoretically, when it finds out that the plugin has the Info.lua file, it could process it this way. But when should the server do that? Before calling Initialize()? Or after?
Reply
Thanks given by:
#5
Hmm... after checking the Article on the Info.lua I got two questions,
1) When/where is AdditionalInformation displayed? is it only for external services, like if you want to use it on a website or can you actually see the text in a command or something?

2) Can you have multiple lines in AdditionalInformation Table? like if you add a \n will that make it a new line?

Maybe add Author property too?
Reply
Thanks given by:
#6
Reply
Thanks given by:
#7
Reply
Thanks given by: tryy3 , Seadragon91
#8
Ah thanks Smile
And hmm... Maybe I'll add a Contributors property in my lua files instead, I prefer to keep everything in 1 place, but yeah you are right about the Author stuff.
Thanks for the help Smile
I might do some PR on that article, found a few things that a newbie like me might want to know.
Reply
Thanks given by:




Users browsing this thread: 2 Guest(s)