[QUOTE=nullsquared;17157477]I wasn't talking about the naming. I'm talking about the whole console idea. Why must everything be console-based?
"I want to move left."
"Tell the console that."
What? Why don't you skip the console and do something more direct and useful? You guys are following Source's example Just Because. I'm not saying it's completely bad, but I'm not saying there's anything amazing about it.[/QUOTE]
Everyone has their own methods. Some people find being able to bind fun. I know when I try to bind and it doesn't work i'm slightly disappointed.
[QUOTE=Blynx6;17163411]Everyone has their [b]own[/b] methods. Some people find being able to bind fun. I know when I try to bind and it doesn't work i'm slightly disappointed.[/QUOTE]
If they base it off source it's not their own method.
[QUOTE=efeX;17163554]If they base it off source it's not their own method.[/QUOTE]
How the fuck is having binds Source. Games have done that for a while.
[QUOTE=efeX;17163554]If they base it off source it's not their own method.[/QUOTE]
It's not even Source's method (or goldsrc's), so why does it matter?
[QUOTE=Catdaemon;17163342]Because I'm used to it and it works for me. How else do you want me to do it? XML?[/quote]
Sure, why not? It shouldn't really matter if you use a graphical key binder that simply stores the data in whatever format it wants.
[quote]
I don't use the console for movement. Bind is a command, +forward isn't. When you bind a key, it does this:
[/quote]
That's what I don't like about it, it's very ambiguous. I thought bind binds commands, not ... identifiers or whatever.
[QUOTE=nullsquared;17164226]Sure, why not? It shouldn't really matter if you use a graphical key binder that simply stores the data in whatever format it wants.
That's what I don't like about it, it's very ambiguous. I thought bind binds commands, not ... identifiers or whatever.[/QUOTE]
The reason why not is that XML is needlessly complicated. To the average end user, the format I currently have makes far more sense. You can't for example break it by forgetting to close or open a tag. I can have all the settings in one file in an easy to read and easy to write format. Writing a parser for this file involves simply running the commands one by one through my console system. You can also bind keys in game through the console using the same system, which means the methods used are very consistent to the user. I really don't see any down sides at all.
Bind does bind commands, I just chose not to implement those particular keywords as commands in the same way for speed. Nobody will notice.
[img]http://imageflock.com/img/1252271872.png[/img]
Took a break with the hard stuff and lowered the level by messing around with Java GUI. It's fucking epic.
[QUOTE=Catdaemon;17164374]The reason why not is that XML is needlessly complicated. To the average end user, the format I currently have makes far more sense. You can't for example break it by forgetting to close or open a tag. I can have all the settings in one file in an easy to read and easy to write format. Writing a parser for this file involves simply running the commands one by one through my console system. You can also bind keys in game through the console using the same system, which means the methods used are very consistent to the user. I really don't see any down sides at all.
Bind does bind commands, I just chose not to implement those particular keywords as commands in the same way for speed. Nobody will notice.[/QUOTE]
Don't worry about it, just continue how you do it. It's only ProFags who think because you have the same idea or theres already code that works fine, you shouldn't use it.
Doing something different for the sake of being different is terrible. There is simply no easier way than this.
Config/autorun.cfg
[code]
*// ===================================================
// Autorun file.
// Use this to execute console commands on game load.
// ===================================================
// Mouse bindings
// bind <Binding enumeration> <Key or MouseButton enumeration>
bind W Up
bind S Down
bind A Left
bind D Right
bind Space Jump
bind E Use
bind Enter Enter
bind Escape ESC
bind M_Left Attack1
bind M_Right Attack2
bind OEMTilde Console
[/code]
On application initialise.
[code]
Console.Instance.ParseFile( "Config/autorun.cfg" );
[/code]
It also promotes lots of code reuse in the console class, since all we're doing is calling the parse method.
[code]
/// <summary>
/// Reads a file line by line and executes each line
/// </summary>
/// <param name="filename">The file to parse</param>
public void ParseFile( string filename )
{
WriteWarning( "Parsing file: " + filename );
try
{
StreamReader fileStream = new StreamReader( filename );
string line = fileStream.ReadLine();
while( line != null )
{
// "//" indicates a comment. Do not parse these lines.
if( !line.StartsWith( "//" ) )
ParseString( line );
line = fileStream.ReadLine();
}
fileStream.Close();
}
catch( Exception e )
{
WriteError( "Error parsing file: " + e.Message );
}
WriteWarning( "File parsed.\n\n" );
}
[/code]
But I'd like to see your XML version for comparison. I'm sure it would be equally robust, widely understood and simple.
Wait, what? I did not say "YES USE XML". I said "sure, why not" and then I proceeded with "it shouldn't really matter [b]if you use a graphical key binder that simply stores the data in whatever format it wants[/b]". The user shouldn't mess with random configuration files that have no established naming convention for the keys. For example, what the hell is OEMTilde? Then why OEMTilde and not OEMSpace? An automated system will avoid this and it can save to whatever format it wants.
Also - if those particular keywords aren't commands, then how does your bind command work? It doesn't make sense, if bind can bind commands as well as "identifier", how do those identifiers know what key you passed to bind?
[QUOTE=nullsquared;17165206]Wait, what? I did not say "YES USE XML". I said "sure, why not" and then I proceeded with "it shouldn't really matter [b]if you use a graphical key binder that simply stores the data in whatever format it wants[/b]". The user shouldn't mess with random configuration files that have no established naming convention for the keys. For example, what the hell is OEMTilde? Then why OEMTilde and not OEMSpace? An automated system will avoid this and it can save to whatever format it wants.
Also - if those particular keywords aren't commands, then how does your bind command work? It doesn't make sense, if bind can bind commands as well as "identifier", how do those identifiers know what key you passed to bind?[/QUOTE]
They're members of an enumeration, or to be specific, a set of enumerations. They are parsed using the Parse method of .NET's enumeration class. It is an automated system.
[B]Edit:[/B]
In fact it's using exactly the same system that an XML parser would use. Just it's simpler, and more flexible.
[QUOTE='-[ Fizzadar ]-;17163035']Awesome SupahVee :)
Working on my PHP forum [url]http://justdevs.com/[/url][/QUOTE]
You shouldn't use the '«' and '»' characters because they are symbols for quotes in French.
The French will torture you with snails...
[QUOTE=The Inzuki;17164579][img]http://imageflock.com/img/1252271872.png[/img]
Took a break with the hard stuff and lowered the level by messing around with Java GUI. It's fucking epic.[/QUOTE]
What hard stuff? Do you need help with it?
[QUOTE=blankthemuffin;17165440]
In fact it's using exactly the same system that an XML parser would use. Just it's simpler, and more flexible.[/QUOTE]
Drop the stupid XML argument, [b]I did not say "use XML"[/b] anyway. How would the user know what keys are represented by what enumeration?
Documentation, of course. If a user doesn't know, they can just use the GUI for it. Flexible for power users and easy to use for non-power users.
More to the point, why does it matter?
For something that's going to be used by developers mostly and for debugging purposes with anything User-orientated hidden behind a GUI(possibly?) there sure is a lot of pointless argumentationisms.
Such idiosyncrasies shouldn't matter if they are documented.
[QUOTE=nullsquared;17166198]"use XML"[/QUOTE]
Well that's just weird :v:
(Just Kidding Around)
[QUOTE=Robber;17165944]What hard stuff? Do you need help with it?[/QUOTE]
Meh, just the more important part of Java - actually building the application. But even Java GUI is kind of hard, I don't know the full library yet.
[QUOTE=nullsquared;17166198]How would the user know what keys are represented by what enumeration?[/QUOTE]
1) Documentation
2) Auto-complete
3) Existing use
This is more powerful too, instead of designing a separate system for everything you might want to have a setting for, it's simple to amalgamate them all into a single, extensible system. As opposed to, for example, having a separate XML schema for each and every system you might want to serialise.
I'm mentioning XML again, since it's the only other method you have mentioned. You seem to be good at calling a system crap, yet explaining why seems harder, and suggesting how to improve it ( or replace it ) seems to be harder again.
Kinda off-topic, but does anyone know of a small C# compiler? (Not VS Express C# kthx)
VC# Express is an IDE...
Wasn't C# made by Microsoft for the .NET Framework?
Anyway I found you can use something called the "Mono CSharp Compiler" heres a [url=http://www.mono-project.com/CSharp_Compiler]link[/url]
[QUOTE=FerrisWheel;17174670]Wasn't C# made by Microsoft for the .NET Framework?[/QUOTE]
Yes.
[QUOTE=Plastical;17174683]Yes.[/QUOTE]
So therefore any other compiler would be like WINE is to Windows?
[QUOTE=FerrisWheel;17174749]So therefore any other compiler would be like WINE is to Windows?[/QUOTE]
Not at all, .NET is an open specification. And mono is just a free implementation of that.
as eFeX said, Visual Studio is just an IDE. You can use the compiler included in VS C# Express from the command line if you want to. There's also Mono (and its IDE, MonoDevelop) if you don't want the Microsoft compiler.
[QUOTE=jA_cOp;17174820]as eFeX said, Visual Studio is just an IDE. You can use the compiler included in VS C# Express from the command line if you want to. There's also Mono (and its IDE, MonoDevelop) if you don't want the Microsoft compiler.[/QUOTE]
Thanks. Also, with not VB C# express I meant a compiler without the need to install VB C#.
I'll check out Mono.
Attempting to setup PVP to use my current non-PVP battle system.
[QUOTE=Marlamin;17174932]Thanks. Also, with not VB C# express I meant a compiler without the need to install VB C#.
I'll check out Mono.[/QUOTE]
Check [url=http://stackoverflow.com/questions/330149/are-there-any-web-based-standalone-no-install-or-no-admin-installer-compilers/330156#330156]this out[/url].
[img]http://imgkk.com/i/4XoIqx.png[/img]
Starting work on another website.
Sorry, you need to Log In to post a reply to this thread.