Author Topic: Q: How to introduce new palette categories......  (Read 939 times)

Legacy_TheStoryteller01

  • Newbie
  • *
  • Posts: 30
  • Karma: +0/-0
Q: How to introduce new palette categories......
« Reply #15 on: September 21, 2013, 11:12:41 pm »


               That means I have to make a new module in the toolset, add all the necessary haks, re-create every single of 150+ placables with the wizard, add them manually as a blueprint to the palette and add this module to my own hak?
               
               

               
            

Legacy_The Amethyst Dragon

  • Hero Member
  • *****
  • Posts: 2981
  • Karma: +0/-0
Q: How to introduce new palette categories......
« Reply #16 on: September 22, 2013, 01:17:26 am »


               If you have existing placeable blueprints in the palette for a module you're already working on, and you just want to change/move those to a new palette category...

Add you new palette via the hak method as described above.  Build you module so that the new palette category get's recognized by the toolset. Then right-click > Edit each existing placeable blueprint to change the category to the new one (just click on the little "..." button next to the existing category). Tedious, but that's the way to do it.

You blueprints will remain a part of your module, rather than a hak.  You need the hak for the new palette category, but not for the blueprints themselves.

If you don't yet have blueprints made for new placeable models, you do have to use the toolset to make them. 

As far as I know, there just isn't a way to create new placeable blueprints outside of the toolset.  You might be able to find software that can edit specific parts of an existing blueprint, but I've not heard of anything that can create new ones and add them to a module without them first being created in the toolset itself by someone.

------------

Once all of the new blueprints are created and added to your module in the category you want, and any of your existing ones you want modified to use the category you want, you can make it so that the blueprints can be taken from your existing module and added to another.

If you just want them to import the blueprints into their module and it you're NOT using a hak to add a new palette category:

Go to File > Export...  
Pick Add Resources...
Change the Resources of Type: box to "Blueprints for Placeables"
Highlight every placeable blueprint you want others to be able to use.
Click Export
Click OK and pick a file name (16 characters or less, all lowercase recommended).
Include your new .erf file with your haks so that people can import the blueprints into their own modules.

If you want everyone using your haks to have to use the blueprints (if you are using a new palette category via hak, for instance), you might consider adding all of the blueprints to the same hak file:

With your module still open in the toolset, go to your NWN/modules/temp0 folder.
Sort the files by file type.
Find the files ending in .utp (these are your placeable blueprints)
Highlight and copy all of the desired blueprint files to another folder.
I would personally then remove all of said blueprints from my module since they'll be in a hak anyway, so...
 - delete all of those files you just copied from temp0 (not your copies, the originals)
 - in the toolset, go to the palette category with all of the blueprints
 - - right-click on the palette category header and pick "Refresh Palette"
 - - - when done, you should find that all those blueprints are gone. Save the module and close it and the toolset.
Open whatever hak file you will be including the blueprints in with NWHak.exe
Drag/drop all of those blueprint (.utp) files from the "copy" folder to the hak editor.
Save the hak and close it.
Start the toolset and open your module in it.  If the hak that includes the blueprints is not already associated with your module, add it (Edit > Module Resources > Custom Content).
Save your module.  Close it.  Close the toolset.
Open the toolset.  Open your module.
The blueprints should all be visible in the palette.

Blueprints in haks are really easy to use, and cut down on resources used for the module that would apply to the 16k module resource limit.  However, if you ever want to change anything about one of those blueprints, you need to go through a process, otherwise the change won't "stick" (the game and toolset will use the hak version over the module's version).

The process:
1. edit the blueprint in the toolset
2. repeat the entire process you used for getting the blueprint into the hak in the first place, but instead of picking all of the .utp files in the NWN/modules/temp0 folder, you'll just copy the one you just modified (it should be the most recent file if you sort by date).
               
               

               


                     Modifié par The Amethyst Dragon, 22 septembre 2013 - 12:41 .
                     
                  


            

Legacy_FunkySwerve

  • Hero Member
  • *****
  • Posts: 2325
  • Karma: +0/-0
Q: How to introduce new palette categories......
« Reply #17 on: September 22, 2013, 02:18:31 am »


               

As far as I know, there just isn't a way to create new placeable blueprints outside of the toolset.  You might be able to find software that can edit specific parts of an existing blueprint, but I've not heard of anything that can create new ones and add them to a module without them first being created in the toolset itself by someone.

Actually, letoscript via Moneo CAN do this - I just don't have the code handy. You can take a place, copy it, rename the copy, alter the appearance and/or the palette id, and save. I'll see if I can work out how, since this is one of the things missing from my tutorial in the scripting forum.

Funky
               
               

               
            

Legacy_TheStoryteller01

  • Newbie
  • *
  • Posts: 30
  • Karma: +0/-0
Q: How to introduce new palette categories......
« Reply #18 on: September 22, 2013, 01:59:31 pm »


               Thanks for the extensive how-to @Amethyst Dragon, this will be very helpful!

Looks like I really have to create every single BP in the toolset for a useful hak (*sigh). Ok, I've done it a thousand times (no exagerration) for my NWN2 creatures but I don't have as much time as I had back then.

Lets see how far I get.....
               
               

               


                     Modifié par TheStoryteller01, 22 septembre 2013 - 01:00 .
                     
                  


            

Legacy_FunkySwerve

  • Hero Member
  • *****
  • Posts: 2325
  • Karma: +0/-0
Q: How to introduce new palette categories......
« Reply #19 on: September 22, 2013, 04:24:14 pm »


               I spent about half an hour working to get it to copy files, but could only rename. I think acaos used perl to make new dummy utps when he created all the CEP 2.3 places. I don't do perl, but a C script would do just as well. From there, it's a simple moneo edit. Let me know if you're still interested.

Funky
               
               

               
            

Legacy_henesua

  • Hero Member
  • *****
  • Posts: 6519
  • Karma: +0/-0
Q: How to introduce new palette categories......
« Reply #20 on: September 23, 2013, 02:29:27 pm »


               Funky, can that set up be used to make blueprints? I am thinking of generating a static for each
appearance in the 2da.
               
               

               
            

Legacy_FunkySwerve

  • Hero Member
  • *****
  • Posts: 2325
  • Karma: +0/-0
Q: How to introduce new palette categories......
« Reply #21 on: September 23, 2013, 07:52:59 pm »


               Yup. I hacked away at it with leto for a bit, but was only able to inadvertently copy files - that is, by them failing an edit, which seems a silly way to approach things. If leto has a FileCopy function, I don't know its syntax, unfortunately - I lifted the rename my approach relies on from dragonsongs Chimera Street.

That said, I DO know how to code a simple C function to copy files (I think, anyway, copying a single file isn't so hard, and I'm no stranger to ), with an input for number, incrementing based on a base name. Once you have the files, letoscripting them to different appearances and palette ids is simple.

I'm in a time crunch this week, but I'll code it up when I have time - could really save a lot of time if someone needs a thousand new palette items.

Funky
               
               

               
            

Legacy_3RavensMore

  • Hero Member
  • *****
  • Posts: 1153
  • Karma: +0/-0
Q: How to introduce new palette categories......
« Reply #22 on: September 24, 2013, 12:03:20 am »


               Since we're talking about this...  Would someone like to tell me how to make additional <i>creature</i> palette categories?  I've done items and placeables without much trouble from various threads, but the creatures palettes seem to not to work in exactly the same way.  An example of a category including a subcategory would really be helpful.
               
               

               
            

Legacy_henesua

  • Hero Member
  • *****
  • Posts: 6519
  • Karma: +0/-0
Q: How to introduce new palette categories......
« Reply #23 on: September 24, 2013, 08:38:42 am »


               3RavensMore, all the palettes work in exactly the same way. The trick might be getting the ID right as the creature palette has quite a few, but otherwise there is no difference. To make a category that contains subcategories you need to make a LIST. I think the best way to figure this out is to look at how the animals are setup and copy the pattern. The hard part as I said above will be to figure out what IDs arre available.

Funky, that sounds promissing. What I had wanted to do was to read the name in the placeable.2da, and use that for the name of the blueprint, and to key some of the names to go to particular palette IDs.Rather than code it for me, I would appreciate an explanation of the tools and how they work together. Is this laid out in a thread on here?
               
               

               
            

Legacy_3RavensMore

  • Hero Member
  • *****
  • Posts: 1153
  • Karma: +0/-0
Q: How to introduce new palette categories......
« Reply #24 on: September 24, 2013, 03:24:19 pm »


               Ah...okay.  I'm using CEP so the palette IDs are a bit...murky.
               
               

               
            

Legacy_FunkySwerve

  • Hero Member
  • *****
  • Posts: 2325
  • Karma: +0/-0
Q: How to introduce new palette categories......
« Reply #25 on: September 24, 2013, 03:48:51 pm »


               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
               
               

               
            

Legacy_henesua

  • Hero Member
  • *****
  • Posts: 6519
  • Karma: +0/-0
Q: How to introduce new palette categories......
« Reply #26 on: September 24, 2013, 07:12:54 pm »


               i'm going to try to tackle this myself first. I appreciate your help, but this is something I should learn how to do.