[Solved] Folder structure in moneo variable possible?

Hello out there,

I use module directories with the toolset and I tried to use moneo with this folder structure.

I want to get the data from all of the area files in my folder. So I wrote the following script snippet, but it throws ‘the specified file could not found’.

%mod = 'moneo/*.are' or die$! ; for (%mod) { print /Tag, "\n"; } close %mod;

Had someone luck to use this or its it not possible?

Thx and greets,
dunahan

My guess is that it isn’t possible, because moneo seems to expect the files to be contained within an erf of some sort.

If it were possible, I imagine the syntax would be

# Report areas in temp0

%mod = 'c:\NeverwinterNights\nwn\modules\temp0' or die;
  {
    for (%mod['*.are'])   
      {	
  	    print /Tag, "    ", /Name, "\n";
      }        
  }  

using the temp0 folder as an example.

This code dies when opening the folder.

The alternative

for %mod = 'c:\NeverwinterNights\nwn\modules\temp0\*.are' or die;

results in a syntax error at ‘for’ so I guess opening multiple files in folder is not supported.

Obviously, you could pack your files into an erf, use moneo, then unbundle, but that’s kinda lame.

Perhaps others know better, though, as the documentation of Letoscript is far from comprehensive.

1 Like

Yes, creating a erf and then working on that would be kinda lame, but until now, it seems to be a working solution…

I wrote a little batch script that copies my areas from my working folder to a temp folder, packs that with niv’s nwn_erf tool to an erf-file and then runs the moneo script.

Yet I am trying to get nwn_erf to extract the data from the modified erf file to a separate folder. That would do the trick.

I’ll share the script here later, yet I am not at my PC.

1 Like

Here is the batch script:

set tempf=C:\tmp\mod\
set moneo=C:\tmp\
set nivto=C:\util\nwn_nim64\
set files="C:\Users\dunahan\Documents\Neverwinter Nights\modules\moneo\"
set script=msp

REM copy area files
copy /Y %files%*.are %tempf%
copy /Y %files%*.git %tempf%
copy /Y %files%*.gic %tempf%

REM create erf
%nivto%nwn_erf -c %tempf% -f %moneo%mod.erf

REM run moneo script
%moneo%moneo %script%.ls > %script%.txt

REM goto folder to/and unpack changed erf-file
cd %moneo%chg\
%nivto%nwn_erf -f %moneo%\mod.erf -x

This is the example moneo script named msp.ls, but every script will work. If another moneo script is used, the batch-script must be adjusted:

%mod = 'mod.erf' or die$!;

for ('*.are' in %mod) {
$are = substr($_, 0, -4);
print $are, "|", /Tag, "|", /Name, "|", /ResRef, "|\n";
}

close %mod;
1 Like

Added extraction of the changed erf/gff files to a specific folder in my pist with the scripts.
Also project is on github too: https://github.com/dunahan/moneo_scripts

In case someone is interested, the purpose was to mass delete only one specific placeable, not found in every area.

The code for that moneo script can be found here