Author Topic: [Request] script combiner  (Read 2171 times)

0 Members and 3 Guests are viewing this topic.

Offline zyxstand

  • Veteran
  • *****
  • Posts: 1106
  • Mother of all Bombs
[Request] script combiner
« on: July 25, 2007, 11:02:25 am »
A program that would be needed by many would be a script combiner:
you indicated which folders with scripts you want to use and it opens their Include.txt and combines all the included files into one .pas file.  The individual .pas files that have multiple 2soldat-defined procedures (ie:  AppOnIdle, OnJoinTeam, etc.) will have their code within combined.
So if script1.pas has somewhere in the code:
Code: [Select]
OnCommand(ID: byte; Text: string)
var script1Variable: string;
begin
if Text = '/hello' then SayToPlayer(ID, 'hello there!');
end;
and script2.pas (in another scripts folder) has somewhere in the code:
Code: [Select]
OnCommand(ID: byte; Text: string)
var script2Number: integer;
begin
if Text = '/goodbye' then SayToPlayer(ID, 'See ya...');
end;

then the script combiner would create a combined script file with the code:
Code: [Select]
OnCommand(ID: byte; Text: string)
var script1Variable_1: string;
script2Number_2: integer;
begin
if Text = '/hello' then SayToPlayer(ID, 'hello there!');
if Text = '/goodbye' then SayToPlayer(ID, 'See ya...');
end;

This examples also shows how non-soldat-defined variables (meaning script1Variable but not ID) get a _1 or _2 added at the end of the name to prevent double-used variables from occuring.  So all (non-soldat) variables from the first scripts folder get a _1 added to the end and so on.
That way people can just release whole scripts folders and people can download them and use them together to get features of each.

Hopefully I explained it well...
Can't think of anything original to put here...

Offline FliesLikeABrick

  • Administrator
  • Flamebow Warrior
  • *****
  • Posts: 6144
    • Ultimate 13 Soldat
Re: [Request] script combiner
« Reply #1 on: July 25, 2007, 11:23:10 am »
I know someone was working on one of these, I'm not sure what the status is.  I know him as bmekim, I think his username on the forums is mikembm

edit: found it: http://scriptcombiner.awardspace.com/

Not sure how well it works, if you try it out please let us know!
« Last Edit: July 25, 2007, 11:25:51 am by FliesLikeABrick »

Offline mikembm

  • Soldier
  • **
  • Posts: 210
Re: [Request] script combiner
« Reply #2 on: July 25, 2007, 11:34:22 am »
Yeah basically mine allows you to paste in your current script and or use a blank template and then combine your new script into it.
The only problem with it now is you cant have more than one script to add - in other words in the new script section you can't have more than 1 of the same procedure. But that really isn't that big of a problem.
As for development of it I have pretty much stopped - it works and I'm happy with the result.

As for everything you mentioned I'm sure I could do it but I really don't have the motivation to - But I would like to see one get made.
« Last Edit: July 25, 2007, 11:36:52 am by mikembm »

Offline bja888

  • Flagrunner
  • ****
  • Posts: 745
  • Working
    • Bja888.com
Re: [Request] script combiner
« Reply #3 on: July 25, 2007, 05:21:39 pm »
Enesce and I agreed a while back that it needed to be done however nether of us had the time.

The one I was plotting was fool proof but time consuming. Its on the old to do list. Better hope I get bored.

Offline EnEsCe

  • Retired Soldat Developer
  • Flamebow Warrior
  • ******
  • Posts: 3101
  • http://enesce.com/
    • [eC] Official Website
Re: [Request] script combiner
« Reply #4 on: July 31, 2007, 07:46:24 am »
Well just a heads up, script combiners will not be needed when I release ScriptCore v2.

Offline mikembm

  • Soldier
  • **
  • Posts: 210
Re: [Request] script combiner
« Reply #5 on: July 31, 2007, 09:28:18 am »
Well just a heads up, script combiners will not be needed when I release ScriptCore v2.

Cool!