Aller au contenu

Photo

Creating Haks


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

#1
Jenna WSI

Jenna WSI
  • Members
  • 1 078 messages
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.

#2
Lightfoot8

Lightfoot8
  • Members
  • 2 535 messages

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 .


#3
Jenna WSI

Jenna WSI
  • Members
  • 1 078 messages
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 .


#4
Lightfoot8

Lightfoot8
  • Members
  • 2 535 messages

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 .


#5
Failed.Bard

Failed.Bard
  • Members
  • 774 messages
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.

#6
Lightfoot8

Lightfoot8
  • Members
  • 2 535 messages
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.

#7
Just a ghost

Just a ghost
  • Members
  • 146 messages
@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.

#8
Lightfoot8

Lightfoot8
  • Members
  • 2 535 messages

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 .

#9
Just a ghost

Just a ghost
  • Members
  • 146 messages
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.

#10
Lightfoot8

Lightfoot8
  • Members
  • 2 535 messages

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.  

#11
Just a ghost

Just a ghost
  • Members
  • 146 messages
Ahhh... that's clever!

#12
Jenna WSI

Jenna WSI
  • Members
  • 1 078 messages
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 .


#13
Jenna WSI

Jenna WSI
  • Members
  • 1 078 messages
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 .


#14
The Amethyst Dragon

The Amethyst Dragon
  • Members
  • 1 880 messages
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).

#15
Jenna WSI

Jenna WSI
  • Members
  • 1 078 messages
I'm guessing it's a pallet thing? Because we removed over 1000 resources and adding one crafting system made it break again.

#16
Jenna WSI

Jenna WSI
  • Members
  • 1 078 messages
Also... would removing dialogue files and putting them into a hak be causing game crashes for players, somehow?

#17
Just a ghost

Just a ghost
  • Members
  • 146 messages
Another trick: put all the crafting items in a container and place that in a locked area. You can use that to copy/place stuff if that's what you need to do (you can also make a builder hak for that, of course). Then you look in the script for the place where the crafting system generates new items (if that's the case). Instead of using CreateObject you now look in the container for the item that you need and copy it.

#18
Just a ghost

Just a ghost
  • Members
  • 146 messages
O, and then you obviously trash everything that's on the palette.

#19
Jenna WSI

Jenna WSI
  • Members
  • 1 078 messages
Ah, smart idea for container items.

I am just baffled at this point though.... removed a lot of stuff and the dm client login works. However, it seems that if I add 1 script or 100.... it goes back to crashing again. I swear nwn trolls me. At this point I'm at a loss for why.

Modifié par Jenna WSI, 19 septembre 2012 - 05:27 .


#20
Just a ghost

Just a ghost
  • Members
  • 146 messages
Open the mod, look in Temp0 and post the file count?

#21
Jenna WSI

Jenna WSI
  • Members
  • 1 078 messages
This is the working module... after we removed convo files and moved them into a cep hak for storage. Just not sure why adding one dialogue file messes it up again. Even after adding what we needed and removing MORE files it still crashes the dm client.

12,233

Edited version that doesn't work - 12,239

Post edit: Okay a bare bones module with nothing but areas, with scripts added to a hak does allow dms to login. After going back to the old mod, removing all the scripts except core scripts, dialogue files also gone, only monsters and some items still in the module... it's crashing again. FML.

Modifié par Jenna WSI, 20 septembre 2012 - 09:17 .


#22
Just a ghost

Just a ghost
  • Members
  • 146 messages
Did you also try areas + script + dialogues in the module, but without anything on the palette? And then the same, but with every item, creature etc in a hak?

Mind that each hak also has a 16K limit.

Modifié par Just a ghost, 21 septembre 2012 - 06:16 .


#23
Jenna WSI

Jenna WSI
  • Members
  • 1 078 messages
Not yet. PRC and CEP has monsters placed into the mod for use... not sure if I can move them to a hak and have everything still functional?

Modifié par Jenna WSI, 21 septembre 2012 - 04:05 .


#24
Just a ghost

Just a ghost
  • Members
  • 146 messages
Me neither, I never touched PRC and CEP because I want my stuff lean and mean.

#25
Jenna WSI

Jenna WSI
  • Members
  • 1 078 messages
Dunno if anyone has new ideas, this has pretty much killed my interest in working with nwn for half a year now. Every time I look at it the problem defies normal logic. Take a module that works. Add 12 scripts to it. Remove 15 areas to give more space, nope.... dm client crash. Remove all scripts, nope... dm client crash. The module I'm trying to use is very much smaller than the old one that works. This time I even replaced the plc pallet with a blank one, removing all the placeables references there and it still crashes on dm login. I'm just stumped.

Modifié par Jenna WSI, 24 octobre 2012 - 04:35 .