Author Topic: Lazarus IDE adopted for soldat scripting  (Read 6542 times)

0 Members and 1 Guest are viewing this topic.

Offline VirtualTT

  • Veteran
  • *****
  • Posts: 1026
Lazarus IDE adopted for soldat scripting
« on: November 07, 2009, 10:31:15 am »
I recently again got interested in soldat scripting, so i searched for some nice environment to code in. Only thing i found here was that retarded ManSoft|Warlord's Soldat.IDE project. Then i switched to pascal standard IDE - Delphi, and checked how's alternative IDE project - Lazarus is doing. And it turned out that it's pretty nice, the only missing thing is definitions for Soldat Script Core functions which are not part of pascal. So i wrote scriptcore header file to use with it to get everything working. It also contains almost complete manual (without examples), so Lazarus displays description/parameters info for all the sciptcore functions (whole morning of copy-paste from devs wiki...).

Lazarus IDE is a free, cross-platform, open-source IDE for [object]pascal development. It provides all necessary tools and means to comfortably write pascal code such as:
  • Syntax highlight
  • Syntax checking
  • Autocompletion
  • Project management
  • Code explorer
  • Code aftoformatting
  • Tool tips with variables/functions info

^click to enlarge^

Download:
Lazarus: Lazarus project
Scriptcore v2 header: attachedmirror

So where is the catch?
  • Soldat scripts currently don't support unit unit_name; | uses ...; | implementation | interface keywords so to run script on server you need to comment them, and uncomment back when editing in Lazarus, otherwise autocompletion, tool-tips and thorough syntax check (on Build) will not work.
  • Lazarus usually complains about variant type being used without proper typecast...

But this is definately much better than using Np++...

I hope that EnEsCe will add missing keywords support in the new scriptcore v3 and workaround variant type will be found somehow so using Lazarus will become more comfortable.

How to use: Go to Main Menu->Project->New Project. Select Custom program item and click OK. Remove all required packages (there should be only one of them in Project  Inspector window). Save your project somewhere. Put soldat_scriptcore_v2.pas to your project folder and add it to your lazarus project. Script files can be anywhere else, just add them to the project too. So Project  Inspector window will contain your_project.lpr, soldat_scriptcore_v2.pas, your_script_1.pas, your_script_2.pas...

Script structure example:

Code: (pascal) [Select]
unit my_script; // comment this when running script on server!

interface // comment this when running script on server!

uses soldat_scriptcore_v2; // comment this when running script on server!

const
...

type
...

var
...

implementation // comment this when running script on server!

procedure MyProcedure();
begin
    ...
end;

...

procedure AppOnIdle(Ticks: integer);
begin
    ...
end;

...

begin
// no code here!
end. // end with DOT!!!
« Last Edit: November 08, 2009, 07:12:51 am by VirtualTT »

Offline jrgp

  • Administrator
  • Flamebow Warrior
  • *****
  • Posts: 5037
Re: adopting Lazarus IDE for soldat scripting
« Reply #1 on: November 07, 2009, 12:47:07 pm »
That's interesting. Reminds me a bit of Aptana (when used for php/js). Good find
There are other worlds than these

Offline L[0ne]R

  • Soldat Beta Team
  • Rainbow Warrior
  • ******
  • Posts: 2079
  • need a life. looking for donors.
Re: Lazarus IDE adopted for soldat scripting
« Reply #2 on: November 07, 2009, 02:03:40 pm »
Notepad++ is also a nice program. In a few words - it's a very advanced version of good ol' notepad. Has syntax highlighting for a ton of languages, a lot of customization, plugins, auto-closure of tags and brackets, etc. I used it to code the site template for oS.



I'm not sure if it has things like "code explorer" and "project manager" like those I see on your screenie, but it's still a very good (and free) program. More info and downloads here: http://notepad-plus.sourceforge.net/uk/site.htm

Offline jrgp

  • Administrator
  • Flamebow Warrior
  • *****
  • Posts: 5037
Re: Lazarus IDE adopted for soldat scripting
« Reply #3 on: November 07, 2009, 02:06:06 pm »
Notepad++ is also a nice program. In a few words - it's a very advanced version of good ol' notepad. Has syntax highlighting for a ton of languages, a lot of customization, plugins, auto-closure of tags and brackets, etc. I used it to code the site template for oS.

[pic]

I'm not sure if it has things like "code explorer" and "project manager" like those I see on your screenie, but it's still a very good (and free) program. More info and downloads here: http://notepad-plus.sourceforge.net/uk/site.htm


The main thing is that it doesn't offer pascal specific features, like code completion and syntax checking.
There are other worlds than these

Offline L[0ne]R

  • Soldat Beta Team
  • Rainbow Warrior
  • ******
  • Posts: 2079
  • need a life. looking for donors.
Re: Lazarus IDE adopted for soldat scripting
« Reply #4 on: November 07, 2009, 02:09:20 pm »
Notepad++ is also a nice program. In a few words - it's a very advanced version of good ol' notepad. Has syntax highlighting for a ton of languages, a lot of customization, plugins, auto-closure of tags and brackets, etc. I used it to code the site template for oS.

[pic]

I'm not sure if it has things like "code explorer" and "project manager" like those I see on your screenie, but it's still a very good (and free) program. More info and downloads here: http://notepad-plus.sourceforge.net/uk/site.htm


The main thing is that it doesn't offer pascal specific features, like code completion and syntax checking.
Who knows. It might. ;D I didn't get too deep into many of its features, so I can't tell. But I guess a program made specifically for Pascal probably is better with it, than something oriented for coding in general.

Offline jrgp

  • Administrator
  • Flamebow Warrior
  • *****
  • Posts: 5037
Re: Lazarus IDE adopted for soldat scripting
« Reply #5 on: November 07, 2009, 02:11:47 pm »
Notepad++ is also a nice program. In a few words - it's a very advanced version of good ol' notepad. Has syntax highlighting for a ton of languages, a lot of customization, plugins, auto-closure of tags and brackets, etc. I used it to code the site template for oS.

[pic]

I'm not sure if it has things like "code explorer" and "project manager" like those I see on your screenie, but it's still a very good (and free) program. More info and downloads here: http://notepad-plus.sourceforge.net/uk/site.htm


The main thing is that it doesn't offer pascal specific features, like code completion and syntax checking.
Who knows. It might. ;D I didn't get too deep into many of its features, so I can't tell. But I guess a program made specifically for Pascal probably is better with it, than something oriented for coding in general.

It offers syntax highlighting, so if you do something like misplace a quote, you can obviously tell there's an issue since everything changes color. But I doubt it has anything other than that.

This thing vtt mentioned is more in line with Eclipse and its set of features.
There are other worlds than these

Offline VirtualTT

  • Veteran
  • *****
  • Posts: 1026
Re: Lazarus IDE adopted for soldat scripting
« Reply #6 on: November 07, 2009, 03:26:27 pm »
The main difference between various notepad clones with syntax highlight and the true IDE for codding is that notapads don't recognize the meaning of the text typed. They simply don't have a linker and compiler to do this. While Lazarus offers full-scale language audit capabilities. Using it will exclude situations when server complains about type mismatch or unknown function/parameters on script compile (not speaking about basic syntax mistakes). So you may change focus on script functionality and code efficiency.
« Last Edit: November 07, 2009, 03:30:40 pm by VirtualTT »

Offline danmer

  • Camper
  • ***
  • Posts: 466
  • crabhead
Re: Lazarus IDE adopted for soldat scripting
« Reply #7 on: November 08, 2009, 06:24:50 am »
god dam, VTT! This thing is so awesome! Just gotta get used to it a bit. How long did it take you to put the header file together?

Offline VirtualTT

  • Veteran
  • *****
  • Posts: 1026
Re: Lazarus IDE adopted for soldat scripting
« Reply #8 on: November 08, 2009, 07:24:56 am »
I've added quick startup guide to the first post.

How long did it take you to put the header file together?
Quote
(whole morning of copy-paste from devs wiki...).
But it's not like it is just a plain copy of scripting guide, i spent quite some time to refract it...

Also maybe it would be better if i've made this topic in the Scripting Discussions and Help board...
« Last Edit: November 08, 2009, 07:27:21 am by VirtualTT »

Offline LORD KILLA

  • Camper
  • ***
  • Posts: 254
  • Happie
Re: Lazarus IDE adopted for soldat scripting
« Reply #9 on: May 15, 2010, 10:32:18 am »
What about being able to use some real language and a good IDE (like MS's Express editors)?
Make a tiny script that sends events via TcpAminPM('127.0.0.1', <event args data here>); to a local application. The app would recive it and hold all data structures and do it their own stable way, and only send the server back what to do ?

Offline dnmr

  • Camper
  • ***
  • Posts: 315
  • emotionally handicapped
Re: Lazarus IDE adopted for soldat scripting
« Reply #10 on: May 21, 2010, 09:07:08 am »
ultraedit has autocompletion (at least the 16th version), and you dont need to mess with extra code and adding the template file to your project etc

Offline VirtualTT

  • Veteran
  • *****
  • Posts: 1026
Re: Lazarus IDE adopted for soldat scripting
« Reply #11 on: May 22, 2010, 08:27:02 am »
ultraedit has autocompletion (at least the 16th version), and you dont need to mess with extra code and adding the template file to your project etc
Suggesting 60$ shareware crap is so lame... None of the text editors can tell you if you are using undefined variable or a type mismatch occured...

header for scriptcore v3 is almost ready and will be released when 1.5.1 beta becomes official stable version.
« Last Edit: May 22, 2010, 08:28:35 am by VirtualTT »