NathanKell
...
First: I have NOT tested this yet, just found it; so it may be it needs something turned on in a DLL and won't work for us. But I'm an optimist.
Pieter pointed out that the US version lacked a file called CheckDlgLoad.c
I looked in it and beheld the Holy Grail of POTC modding (well, POTC _scripting__): Directory reads, and loading all files within a directory.
What does this mean? It means each modder can have his or her own item, ship, model, whatever, init file--and the script _does not have to know their names_.
I.e. you can finally do:
#include "Directory*.*"
Which means that _any_ modder who adds a new item need not modify a core file (nor have it overwritten on update!).
Code:
<!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1-->object objChkDlg;
objChkDlg.dir = "DIR_TO_CHECK";
objChkDlg.mask = "*.h"; // or other wildcard based mask, I presume.
CreateEntity(&objChkDlg,"FINDFILESINTODIRECTORY");
DeleteClass(&objChkDlg);
//then:
objChkDlg.filelist.* // one attribute per file, with the attr. value the filename.
//so then if you want to do all:
aref arList, arCur;
makearef(arList,objChkDlg.filelist);
for(int i = 0; i < GetAttributesNum(arList); i++)
{
arCur = GetAttributeN(arList,i);
if(LoadSegment(GetAttributeValue(arCur)))
{
Execute_function(); // or whatever function is in the file
UnloadSegment(GetAttributeValue(arCur));
}
}<!--c2--></div><!--ec2-->
Pieter pointed out that the US version lacked a file called CheckDlgLoad.c
I looked in it and beheld the Holy Grail of POTC modding (well, POTC _scripting__): Directory reads, and loading all files within a directory.
What does this mean? It means each modder can have his or her own item, ship, model, whatever, init file--and the script _does not have to know their names_.
I.e. you can finally do:
#include "Directory*.*"
Which means that _any_ modder who adds a new item need not modify a core file (nor have it overwritten on update!).
Code:
<!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1-->object objChkDlg;
objChkDlg.dir = "DIR_TO_CHECK";
objChkDlg.mask = "*.h"; // or other wildcard based mask, I presume.
CreateEntity(&objChkDlg,"FINDFILESINTODIRECTORY");
DeleteClass(&objChkDlg);
//then:
objChkDlg.filelist.* // one attribute per file, with the attr. value the filename.
//so then if you want to do all:
aref arList, arCur;
makearef(arList,objChkDlg.filelist);
for(int i = 0; i < GetAttributesNum(arList); i++)
{
arCur = GetAttributeN(arList,i);
if(LoadSegment(GetAttributeValue(arCur)))
{
Execute_function(); // or whatever function is in the file
UnloadSegment(GetAttributeValue(arCur));
}
}<!--c2--></div><!--ec2-->