Author Topic: Creating Haks  (Read 510 times)

Legacy_Jenna WSI

  • Hero Member
  • *****
  • Posts: 1837
  • Karma: +0/-0
Creating Haks
« on: September 16, 2012, 08:34:05 pm »


               I'm looking at moving loot items and such into a hak in order to preserve module space, but still having the scripts access them in the pallet with it pointing to the items stored in the hak instead of inside the module. How is the hak created for this to work correctly? I know with CEP if you try to edit certain items that are stored in the hak while in the module it tells you that it won't work. I understand why, but not how to do that myself for our server's haks. Thankee.
               
               

               
            

Legacy_Lightfoot8

  • Hero Member
  • *****
  • Posts: 4797
  • Karma: +0/-0
Creating Haks
« Reply #1 on: September 16, 2012, 08:45:41 pm »


               

Jenna WSI wrote...

I'm looking at moving loot items and such into a hak in order to preserve module space, but still having the scripts access them in the pallet with it pointing to the items stored in the hak instead of inside the module. How is the hak created for this to work correctly? I know with CEP if you try to edit certain items that are stored in the hak while in the module it tells you that it won't work. I understand why, but not how to do that myself for our server's haks. Thankee.


Simple answer:

Just load them into the hak and remove them from the module so fee up you space in the module.  That all there is to it.


Extemded answer:

Within the NWN engine there is a critter called the Resource Manager  It is the job of the resource manager to keep track of all of the Content that the Game has access to.  It does this by making a list of the files and where they are  located.  

The way the list is built is what determins what file is used when there are two files of the same name and type.  The manager first builds the list from all of the fils located is the Key/Bif files (The base content for the game) 

Once the Key/Bif files are loaded It then adds the content from the override folder.  If any of the files where of the same name and type, They are simply overritten with the new information.  

The Files in the module  are then added to the list.  Once again overriting any that already exsisted with there new location to load from.  

Then the files in the Haks are loaded into the list. They are loaded in order from the Bottom of the list to the Top. 

The reason the toolset gives you the warning about the file being in a hak, is because the version that is saves into the module will have  its  file location information  overritten, in the resource manager when the hak resources are added to the Resource List.
               
               

               


                     Modifié par Lightfoot8, 16 septembre 2012 - 08:02 .
                     
                  


            

Legacy_Jenna WSI

  • Hero Member
  • *****
  • Posts: 1837
  • Karma: +0/-0
Creating Haks
« Reply #2 on: September 16, 2012, 08:54:29 pm »


               Simple... in nwn? >.<

And it is true that moving items into a hak will free the resource cap for a module, just to double check through you guys? (as per the dm crash bug)
               
               

               


                     Modifié par Jenna WSI, 16 septembre 2012 - 07:54 .
                     
                  


            

Legacy_Lightfoot8

  • Hero Member
  • *****
  • Posts: 4797
  • Karma: +0/-0
Creating Haks
« Reply #3 on: September 16, 2012, 09:12:11 pm »


               

Jenna WSI wrote...

Simple... in nwn? >.<

And it is true that moving items into a hak will free the resource cap for a module, just to double check through you guys?


Yep, Just that simple.  

(as per the dm crash bug)


Well, Umm,  No!!

This is not a problem with resources in the module, Per the resource Manger.  It a a Problem with how many resources are listed in the palettes.  Reguardless of where you move the resources to thy will still be included in the palette.    I think the simplest solution there is to find the offending Palette and edit it by removing items unused by the DM and placing the edited copy into the top hak. 

I am sure that others have other opinions on that one.
               
               

               


                     Modifié par Lightfoot8, 16 septembre 2012 - 08:12 .
                     
                  


            

Legacy_Failed.Bard

  • Hero Member
  • *****
  • Posts: 1409
  • Karma: +0/-0
Creating Haks
« Reply #4 on: September 16, 2012, 10:09:47 pm »


               The only way I know of to get around the DM client crash once that limit gets broached, is to move resources out of the module itself, accessing them only through use of nwnx_resman.
 It's actually pretty simple to do with anything spawned only via script, and allows for those resources to be altered while the module is up and running.

 If you aren't using nwnx, as Lightfoot8 said, you have to remove unneeded resources to push the count down.
               
               

               
            

Legacy_Lightfoot8

  • Hero Member
  • *****
  • Posts: 4797
  • Karma: +0/-0
Creating Haks
« Reply #5 on: September 16, 2012, 10:20:36 pm »


               note;  I have not tested it.  But I do not think the resources have to be removed.   They just have to be removed from the palette.  The .itp file.   The resources will still be able to be spawned by script.  They just will no longer show up on the DM/Toolset palettes.
               
               

               
            

Legacy_Just a ghost

  • Full Member
  • ***
  • Posts: 244
  • Karma: +0/-0
Creating Haks
« Reply #6 on: September 17, 2012, 07:27:52 am »


               @Lightfoot8 : Mind that hitting "build palettes" once will put you back to zero if you try that approach. Pretty dangerous, I'd say.

I did two things to counter this issue:
- I put PLC palette stuff that DM's don't really need in a builder hak (why would a DM need 100 different trees?). You hook that up to a module to build areas. This has another bonus: you don't have to mess with erfs just to start building stuff. It also makes the palette less bewildering in game.
- I took a good look at the item palette, and trashed tons of old stuff that wasn't used. Then I took a good look again, and used scripts to generate random loot, crafting items (these can number in the hundreds, and are generally all the same except for portrait, tag and name).

A third approach, which is cool for techheads: store stuff in a mysql db. Many of you already do this for shops and whatever, but you can put a few hundred items on the floor, let a script put 'm in the db, and use their resrefs as a key for respawning them when needed. I did so with rings for all the deities (FR should have been monotheistic, much easier), which were infused in the loot system. Mind that this setup makes changing the items after they are in the db a lot harder.
               
               

               
            

Legacy_Lightfoot8

  • Hero Member
  • *****
  • Posts: 4797
  • Karma: +0/-0
Creating Haks
« Reply #7 on: September 17, 2012, 07:30:17 am »


               

Just a ghost wrote...

@Lightfoot8 : Mind that hitting "build palettes" once will put you back to zero if you try that approach. Pretty dangerous, I'd say.


Does not matter if you hit it or not.  The version in the Hak will override the version on the module no matter what .
               
               

               
            

Legacy_Just a ghost

  • Full Member
  • ***
  • Posts: 244
  • Karma: +0/-0
Creating Haks
« Reply #8 on: September 17, 2012, 07:35:30 am »


               O, sorry. I misinterpreted you. I though you wanted to keep the resources in the module/hak, just not on the palette (as in: add hak, don't build palette). Not sure if that's even possible, but that was my interpretation of your post.
               
               

               
            

Legacy_Lightfoot8

  • Hero Member
  • *****
  • Posts: 4797
  • Karma: +0/-0
Creating Haks
« Reply #9 on: September 17, 2012, 07:48:04 am »


               

Just a ghost wrote...

O, sorry. I misinterpreted you. I though you wanted to keep the resources in the module/hak, just not on the palette (as in: add hak, don't build palette). Not sure if that's even possible, but that was my interpretation of your post.


Yes, That is pretty much what I said.   The game itself does not need the use of the palette to run.   The Palette is only used  for Human interface.   DM/Builder being able to select things.   If you take and edit the Palette (.itp) File and place them in a Hak. You freeze them in that State.   At that point rebulding the palette is just like trying to edit a blueprint that is in a hak.  

Just keep in Mind that the Game does not use the Palette to Find resources.  
               
               

               
            

Legacy_Just a ghost

  • Full Member
  • ***
  • Posts: 244
  • Karma: +0/-0
Creating Haks
« Reply #10 on: September 17, 2012, 08:59:44 am »


               Ahhh... that's clever!
               
               

               
            

Legacy_Jenna WSI

  • Hero Member
  • *****
  • Posts: 1837
  • Karma: +0/-0
Creating Haks
« Reply #11 on: September 17, 2012, 07:00:40 pm »


               Okay, removing a ton of stuff fixed it but now we have the issue that the items aren't in the pallet and dm's can't create the monsters or items anymore. If anyone can tell me how to fix this and give me a 'dummy's guide' that would be great. I'm pretty sure it's going to involve adding a pallet file to our top hak but I've never worked with those kinds of files before.
               
               

               


                     Modifié par Jenna WSI, 17 septembre 2012 - 06:08 .
                     
                  


            

Legacy_Jenna WSI

  • Hero Member
  • *****
  • Posts: 1837
  • Karma: +0/-0
Creating Haks
« Reply #12 on: September 18, 2012, 03:31:00 am »


               Hm.. thought that by putting items into a hak that it wouldn't be counted as resources by the game, but that doesn't appear to be true... only dialogue and script files work that way? Items and creatures were going in a new hak, scripts and dialogues into the cep custom hak.
               
               

               


                     Modifié par Jenna WSI, 18 septembre 2012 - 02:31 .
                     
                  


            

Legacy_The Amethyst Dragon

  • Hero Member
  • *****
  • Posts: 2981
  • Karma: +0/-0
Creating Haks
« Reply #13 on: September 18, 2012, 08:17:21 am »


               Blueprints (for items, creatures, placeables, etc.) and scripts and conversations placed in hak files do not count toward the ~16k total resource limit as far as the module is concerned.

However, such blueprints will normally still appear in the game palettes and can be spawned by a DM.  There is an additional ~16k limit to these blueprints in the palettes, and the ones in haks DO count toward this limit.  Passing this limit can cause the DM client to crash when a DM tries to log into the server.

Blueprints, conversations, and scripts are all server-side only, so they can all be moved to cep2_custom.hak if you wish (as long as you don't plan on having to edit the one's you're moving).  You can even store certain types of 2da files in there (ones that are accessed only by the server and never the player client).
               
               

               
            

Legacy_Jenna WSI

  • Hero Member
  • *****
  • Posts: 1837
  • Karma: +0/-0
Creating Haks
« Reply #14 on: September 18, 2012, 05:07:03 pm »


               I'm guessing it's a pallet thing? Because we removed over 1000 resources and adding one crafting system made it break again.