[Freeciv-Dev] Re: commandline syntax and semantics (was: Server/ruleset
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
On Sun, 4 Nov 2001, [iso-8859-1] Daniel Sjölie wrote:
> On 2001-10-29 00:35:33, Reinier Post wrote:
> > On Sat, Oct 27, 2001 at 11:39:08PM +0200, Daniel Sjölie wrote:
> >
> > [...]
> >
> > > > Renaming would really be handy, for example, if you end up playing
> > > > as Hitler by accident. I've seen this happen. I agree it can be
> > > > confusing.
> > >
> > > I imagine this to be done as:
> > >
> > > > show players
> > > 1: Napoleon
> > > 2: Hitler
> > > 3: Cleopatra
> > > > show players[2].name
> > > Hitler
> > > > set players[2].name = Churchill
> > > > show players[2].name
> > > Churchill
> > > > show players
> > > 1: Napoleon
> > > 2: Churchill
> > > 3: Cleopatra
> > >
> > > I think this is sufficiently clearer that the bother of having to use a
> > > number instead of the more easily seen name is outweighed...
> >
> > This would be an option, but I still think referring by name is convenient.
> > Do you really want to forbid
> >
> > /ai Napoleon
> >
> > and allow only
> >
> > /ai players[5]
> >
> > ?
>
> Well, I don't think it should be supported directly in the
> "ruleset-language"... I think it's really too specific...
>
> Actually, now that I think about it... How hard would it be to actually
> use a subset of (or very heavily inspired by) sql syntax? That would solve
> our problems nicely I think... I've kind of written that of earlier because
> it might be overly complex but maybe it really wouldn't be that hard...
> It certainly would have a lot of advantages, right?
>
> The convenient syntax above should be specific for the command line
> server (no need for this in a gui-server) and _implemented_ _using_ the
> "ruleset-language"... So that /ai Napoleon could become:
>
> update players set ai=not ai where name="Napoleon"
>
> Server commands should not be part of the language but there should be a
> server command that would take a "ruleset-language" statement as
> argument and execute it...
>
> This would give the best of all worlds, wouldn't it?
> Do you think it's too much?
>
> Some people had allready begun coding, right? How much has been done
> really?
>
I've started coding (though it's been a while since I did anything). At
present, I'm using a java-ish (javish?) syntax with some SQL-like features
(or, I think they're SQL-like -- I haven't used SQL). So, at present, /ai
Napolean would be:
set players.Napolean.a1 1
or something similar. With the implementation I've written, each
datapoint has a freeform (string) key distinct from any of its members, so
something like
rename players.Hitler Bismark
would be easy enough to add. Where the tags and the names displayed
should/shouldn't be the same is an issue I've avoided so far.
Something like the where construct you described would be possible (I sort
of designed with it in mind). I pictured a syntax like
with units {wherever {equals vision 2} {set vision 7}}
Some sort of defining-commands-in-command-language would be a nice thing
to have. I might picture something like
set ai {lambda {x} {...}}
but then, I've been using lisp recently ;).
--Daniel Speyer
"May the /src be with you, always"
> /Daniel
>
> --
> Now take a deep breath, smile and don't take life so seriously... :)
>
>
- [Freeciv-Dev] Re: commandline syntax and semantics (was: Server/ruleset unification), Daniel Sjölie, 2001/11/03
- [Freeciv-Dev] Re: commandline syntax and semantics (was: Server/ruleset unification),
Daniel L Speyer <=
- [Freeciv-Dev] Re: commandline syntax and semantics (was: Server/ruleset unification), Reinier Post, 2001/11/04
- [Freeciv-Dev] Re: commandline syntax and semantics (was: Server/ruleset unification), Daniel Sjölie, 2001/11/04
- [Freeciv-Dev] Re: commandline syntax and semantics (was: Server/ruleset unification), Reinier Post, 2001/11/05
- [Freeciv-Dev] Re: commandline syntax and semantics (was: Server/ruleset unification), Daniel Sjölie, 2001/11/05
- [Freeciv-Dev] Re: commandline syntax and semantics (was: Server/ruleset unification), Daniel L Speyer, 2001/11/05
- [Freeciv-Dev] Re: commandline syntax and semantics (was: Server/ruleset unification), Daniel Sjölie, 2001/11/05
- [Freeciv-Dev] Re: commandline syntax and semantics (was: Server/ruleset unification), Reinier Post, 2001/11/05
- [Freeciv-Dev] Re: commandline syntax and semantics (was: Server/ruleset unification), Daniel L Speyer, 2001/11/05
|
|