I really wanted to use CEP and PRC in my module, but put off incorperating PRC until now. Seems like the best way for me to get it into my module is to recreate the module from the base merge anf go from there. I would like to export areas from the old module into the new but I’m running into the toolset crashes upon importing areas.
So far I’ve found this is because I don’t have a specific custom content hak selected that is in the old module. This is intended, as I’m trying to cut out a lot of stuff I really don’t need, to get rid of the bloat.
My question, is there a way to see what hak resources are used in a area? I can delete all placeables, and it allows me to then export/import without issue. I just don’t want to delete one at a time to find out what it is when I have a lot of placeables in the area.
Looks like Edit > Find Instance is what I’m looking for. Go me!
I guess it doesn’t really tell me what resource it’s coming from, so I’m still digging.
What you want to do can be done via Moneo-Letoscript - How to Mass Edit and Data Mine your Module
With that you can replace all placeables with certain model (line) to different model (line) en mass. Amongst others.
Here a script I made for this taks myself:
#CHANGE THIS TO NAME OF YOUR MODULE
%mod = 'arkh_current.mod' or die $!;
for ('*.git' in %mod)
{
for (/{'Placeable List'})
{
if(/~/Appearance == 1124)
{
/~/Appearance = 15037;
}
elsif(/~/Appearance == 203)
{
/~/Appearance = 2466;
}
elsif(/~/Appearance == 205)
{
/~/Appearance = 2468;
}
elsif(/~/Appearance == 1125)
{
/~/Appearance = 15114;
}
elsif(/~/Appearance == 915)
{
/~/Appearance = 2329;
}
elsif(/~/Appearance == 916)
{
/~/Appearance = 2330;
}
elsif(/~/Appearance == 917)
{
/~/Appearance = 2331;
}
elsif(/~/Appearance == 918)
{
/~/Appearance = 2332;
}
elsif(/~/Appearance == 965)
{
/~/Appearance = 1823;
}
elsif(/~/Appearance == 966)
{
/~/Appearance = 1824;
}
elsif(/~/Appearance == 4076)
{
/~/Appearance = 3080;
}
elsif(/~/Appearance == 4077)
{
/~/Appearance = 3081;
}
elsif(/~/Appearance == 4078)
{
/~/Appearance = 3082;
}
elsif(/~/Appearance > 869 && /~/Appearance < 902)
{
/~/Appearance = /~/Appearance + 1515;
}
elsif(/~/Appearance > 931 && /~/Appearance < 965)
{
/~/Appearance = /~/Appearance + 568;
}
elsif(/~/Appearance > 901 && /~/Appearance < 911)
{
/~/Appearance = /~/Appearance + 1414;
}
elsif(/~/Appearance > 919 && /~/Appearance < 928)
{
/~/Appearance = /~/Appearance + 1414;
}
elsif(/~/Appearance > 927 && /~/Appearance < 932)
{
/~/Appearance = /~/Appearance + 1369;
}
elsif(/~/Appearance == 4084)
{
/~/Appearance = 3088;
}
elsif(/~/Appearance == 4013)
{
/~/Appearance = 2665;
}
elsif(/~/Appearance == 4032)
{
/~/Appearance = 2684;
}
elsif(/~/Appearance == 4041)
{
/~/Appearance = 2644;
}
elsif(/~/Appearance == 4042)
{
/~/Appearance = 2645;
}
elsif(/~/Appearance == 4080)
{
/~/Appearance = 3084;
}
elsif(/~/Appearance == 4040)
{
/~/Appearance = 2692;
}
elsif(/~/Appearance == 4121)
{
/~/Appearance = 3046;
}
elsif(/~/Appearance == 4047)
{
/~/Appearance = 3051;
}
elsif(/~/Appearance == 4046)
{
/~/Appearance = 3050;
}
}
}
print "\ndone.";
%mod = '>';
close %mod;
If I’ve understood the question correctly, some analysis is required upfront to identify placeables that only exist in the unwanted hak.
A text file compare utility (e.g. WinMerge Compare) could be used to compare the unwanted placeables.2da with the base game to identify the unwanted appearance numbers.
If there are lots of custom haks, this would be a multi-step process, following the same principle.
Spreadsheets are pretty good for extracting lists and generating moneo code - you can even do the comparison that way if you know how.
Then a moneo script like Shadooow’s could be used to change or delete the instances - it needs an extra iteration to fix templates, too, I think.
The latest moneo is here:
https://neverwintervault.org/project/nwn1/script/moneo-v40224
Yes, I deleted the blueprints for the placeables I was changing (they were pre-cep era custom appearances that were later added by CEP so they were actually duplicates) and thus I had no need to alter them as well via script (and it is not that problematic to adjust them manually either - often writing the moneo script takes longer than do it manually).
I’ve got 10 or more custom haks beyond cep/prc. So I think rebuilding the area in my newer module is the more realistic route for me to take. I wouldn’t even know where to begin with the placeable IDs above.
It’s not so much that I know what I want to replace. If there was a way to generate a list of placeables in the area and have it state what HAK it belongs too, that would tell me what placeables I should delete prior to exporting so I can import it to the new module that doesn’t use that HAK.
I’m bookmarking this post though. May give it more thought in the future. Thanks for sharing it.
I don’t think there’s much alternative to the method I outlined (assuming there’s a lot of data). The relationships in the data are [placeable instance : 2da line], [2da line : 2da file] and [2da file : hak] so to get [placeable instance : hak] you have to join the data up somehow.
Working with 2da files is an almost essential skill when building with custom content - worth exploring.
Moneo is admittedly a learning curve, but boy does it save a lot of time.
1 Like