Aller au contenu

Photo

Q: How to introduce new palette categories......


  • Veuillez vous connecter pour répondre
26 réponses à ce sujet

#26
FunkySwerve

FunkySwerve
  • Members
  • 1 308 messages
The C part of the coding isn't posted on these forums; I was planning to simply adapt a C function like this one to loop as many times as needed, adding 1 to the 001 at each loop, to produce copies labled 001 through 00X, or 0XX, or XXX, where X is the number input:
Link
Though, that's probably a common need, so you could probably find a 'copy file multiple times' thread somewhere if you look long enough.

The rest is covered in my tutorial in the sticky in the Scripting forum on how to datamine and mass edit your module. You can loop files outside of a module with Moneo just as easily as you can loop them inside. See, for example, this script, taken from the example scripts linked in that tutorial, which loops a palette:

%pal = '../gff/placeablepal.itp.gff';

for (/MAIN) {
  $pre1 = /~/DELETE_ME;
  for (/~/LIST) {
    if (/~/ID < 100) { print " "; }
    if (/~/ID < 10)  { print " "; }

    print /~/ID, " ", $pre1, " | ", /~/DELETE_ME, " (", /~/STRREF, ")\\n";
    $pre2 = /~/DELETE_ME;
    for (/~/LIST) {
      if (/~/ID < 100) { print " "; }
      if (/~/ID < 10)  { print " "; }
      print /~/ID, " ", $pre1, " | ", $pre2, " | ", /~/DELETE_ME, " (", /~/STRREF, ")\\n";
      $pre3 = /~/DELETE_ME;
      for (/~/LIST) {
        if (/~/ID < 100) { print " "; }
        if (/~/ID < 10)  { print " "; }
        print /~/ID, " ", $pre1, " | ", $pre2, " | ", $pre3, " | ", /~/DELETE_ME, " (", /~/STRREF, ")\\n";
      }
    }
  }
}

Likewise, here's one looping a hak file:
%hak = '../hak/cep2_add_sb_v1.hak';

for (%hak['*.utp']) {
  /PaletteID = 59;
  print /TemplateResRef, " ", /PaletteID, "\\n";
}

%hak = '>';
close(%hak);

Lastly, here's one shuffling palette ids (without altering the palette itself, just organizing resources) within the module:

%mod = '..\\Path of Ascension CEP Legends.mod';

for (%mod['uaq*.uti']) {
  replace('PaletteID', '23', '228');
}

for (%mod['es_*.uti']) {
  replace('PaletteID', '2', '241');
}

for (%mod['qc_*.uti']) {
  replace('PaletteID', '2', '242');
}

for (%mod['*.uti']) {
  replace('PaletteID', '0', '185');
  replace('PaletteID', '2', '233');
  replace('PaletteID', '3', '186');
  replace('PaletteID', '24', '238');
}

for (%mod['it_mpot*.uti']) {
  replace('PaletteID', '238', '24');
}


for (%mod['rand00*.uti']) { replace('PaletteID', '1', '196'); }
for (%mod['rand01*.uti']) { replace('PaletteID', '1', '190'); }
for (%mod['rand02*.uti']) { replace('PaletteID', '1', '192'); }
for (%mod['rand03*.uti']) { replace('PaletteID', '1', '193'); }
for (%mod['randck*.uti']) { replace('PaletteID', '1', '194'); }
for (%mod['randam*.uti']) { replace('PaletteID', '1', '189'); }
for (%mod['randrg*.uti']) { replace('PaletteID', '1', '198'); }
for (%mod['randsh*.uti']) { replace('PaletteID', '1', '199'); }
for (%mod['randbl*.uti']) { replace('PaletteID', '1', '191'); }
for (%mod['randwp*.uti']) { replace('PaletteID', '1', '200'); }
for (%mod['randtr*.uti']) { replace('PaletteID', '1', '197'); }
for (%mod['rand*.uti']) { replace('PaletteID', '1', '188'); }


%mod = '>';
close %mod;

The last shows how you can move stuff around after you've created new PaletteID entries.

I took a new job yesterday, so my time is suddenly quite constrained, and it's great if you want to try to tackle this yourself first. If not, say so, and I'll get to it asap.

Funky

#27
henesua

henesua
  • Members
  • 3 878 messages
i'm going to try to tackle this myself first. I appreciate your help, but this is something I should learn how to do.