Author Topic: More scripting woes  (Read 1251 times)

0 Members and 1 Guest are viewing this topic.

Offline yexxle

  • Major(1)
  • Posts: 22
More scripting woes
« on: June 19, 2007, 04:38:02 am »
As an addition to my post regarding arrays, here are other bugs I have come across that EnEsCe blatantly ignores in IRC.

The newer socket stuff bombs if a connection cannot be obtained. The manual states that ConnectSocket will set its third parameter to something less than 1 if the tcp connection fails. It does indeed set the variable, but the failed socket creation creates a run-time error that breaks the funciton ConnectSocket was called in, preventing any further code from being executed. The following code will reach the WriteLn if connection is successful, but execution of ActivateServer will terminate if the connection fails. Also, OnException receives no notice of this error (actually, it seems to me that OnException never gets called for anything).

Code: [Select]
var
    ip: string;
    port: word;
    sock_id: integer;

procedure ActivateServer();
    begin
        ip := '127.0.0.1';
        port := 1020;
        ConnectSocket(ip, port, sock_id);

        WriteLn('Result of connect: ' + inttostr(sock_id));
    end;

Another issue is with the 'with' statement of Pascal. The following code runs fine with the comment left as-is, which is expected. However, uncommenting the code results in internal errors, even though the code is perfectly valid Pascal.

Code: [Select]
type
    Player = record
        username: string;
        score: integer;
    end;

var
    first: Player;

procedure ActivateServer();
    begin;
        with first do begin
            {
             username := 'that guy';
             score := 0;
            }
        end;
    end;

You can tell me that "the 'with' statement isn't supported in Soldat scripting", but that's just lazy programmer cop-out. Stop breaking the language! There's a point where a person gets sick of hearing "that's been disabled" and "we don't support that feature of Pascal". Especially when it has to do with core language elements like arrays and 'with'. Yes I'm on a programming rampage, but I think I'm done now.

Offline chrisgbk

  • Moderator
  • Veteran
  • *****
  • Posts: 1739
Re: More scripting woes
« Reply #1 on: June 19, 2007, 06:23:25 am »
The script support isn't written by EnEsCe, it's a third party kit. If a feature doesn't work, it's never going to work.

Offline yexxle

  • Major(1)
  • Posts: 22
Re: More scripting woes
« Reply #2 on: June 19, 2007, 06:31:25 am »
Third party? Geez. How can anybody be expected to produce good work if everything is built on top of a butchered framework to begin with? :(

Offline chrisgbk

  • Moderator
  • Veteran
  • *****
  • Posts: 1739
Re: More scripting woes
« Reply #3 on: June 19, 2007, 06:42:08 am »
Alright, try writing your own pascal compiler and integrating it with something so it works as a script engine; get back to me when it's done.

It's a non-trivial task to do something like this, and if it was written from scratch, it wouldn't exist now, period.

Offline yexxle

  • Major(1)
  • Posts: 22
Re: More scripting woes
« Reply #4 on: June 19, 2007, 06:54:12 am »
Haha I know it's not an easy task, it's just annoying when one project includes other projects that contain bugs or inadequacies. I don't know what you'd call them, but "cascading bugs" maybe? One C library contains a single bug. Someone else uses codes a wrapper around this buggy library and in addition they introduce a second bug in their wrapper code. By the time 5 more people have added 5 more layers on top of this wrapper, there are 10 bugs in 7 different layers. Of course, you can't fix any of the last 9 bugs introduced without first going back to that original C library. And that just doesn't happen in today's code world. We're supposed to just "deal" with it. :(

Offline EnEsCe

  • Retired Soldat Developer
  • Flamebow Warrior
  • ******
  • Posts: 3101
  • http://enesce.com/
    • [eC] Official Website
Re: More scripting woes
« Reply #5 on: June 19, 2007, 06:55:56 am »
that EnEsCe blatantly ignores in IRC.
Man, stop whining. Learn how IRC works. You didn't highlight me, hence I will not alt+tab into IRC.

Offline yexxle

  • Major(1)
  • Posts: 22
Re: More scripting woes
« Reply #6 on: June 19, 2007, 07:09:42 am »
Highlight, as in having your name selected in the users list, or by including your irc nick in the text of the chat, or by pm-ing? If the first, not something I knew about IRC. Sorry, it's just hard to sit there and watch you talking to someone else in public chat and happening to just "not see" anyone else interjecting comments to you in the middle of what you are obviously reading.

ie: how can you not notice user2 in this:

user1: hey enesce.. blah blah
enesce: blah blah blah
user1: blah blah
user2-talking-to-enesce: blah blah blah
enesce: (speaking to user1)
user1: blah blah
user2-still-trying-to-catch-enesce's-attention: blah blah
enesce: still talking to user1
user1: blah blah

Offline EnEsCe

  • Retired Soldat Developer
  • Flamebow Warrior
  • ******
  • Posts: 3101
  • http://enesce.com/
    • [eC] Official Website
Re: More scripting woes
« Reply #7 on: June 19, 2007, 08:29:06 am »
Looking through the chat logs, such situation did not occur. Interrupting is rude anyway ;)

Offline Ahmed Muhammad

  • Major(1)
  • Posts: 6
Re: More scripting woes
« Reply #8 on: June 21, 2007, 07:42:49 am »
Ooo I can go on IRC and talk to the big man himself!
Im soo there :P