Aller au contenu

Photo

Hak pak creation


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

#1
captain venus

captain venus
  • Members
  • 11 messages

Hello,

 

I am wanting to group various custom scripts together so that I can access them in any modules that I play or make, and the simplest way to do that would seem to be to make them all into a hak pak.

 

However, I cannot find any kind of Hak Pak creator software; I am assuming there must be something like this to collate all the relevant information together.

 

I appologise if I am asking an obvious question, but I have been looking around and cannot find any links to hak pak creation stuff.

 

I would be grateful if someone could point me in the right direction. Thanks :)



#2
Shadooow

Shadooow
  • Members
  • 4 471 messages

hak pack is usually the worst place for scripts because then they cannot be modified in toolset (though for situation like this I dont think there is any better place - usually advicing to just put them into erf and import but your situation is different)

 

so to make a hak, open NWN/utils/nwhak.exe

add any files and press File-Save As, then put hak into NWN/hak/

and in module go to the module properties, Custom Content tab and select the hak in menu

press add butoon and then press OK



#3
Proleric

Proleric
  • Members
  • 2 361 messages
Exactly.

It's a good technique, for appropriate situations - you keep the master scripts in a separate module, compile them there, then reload the hak from the temp0 folder using nwhak.

The advantages over the erf method are [1] confidence that all modules are using the same source [2] changes only have to be done once [3] scripts in a hak don't impact toolset performance

For the latter reason, I sometimes put stable scripts in a hak, even if they're only required in one module.

#4
captain venus

captain venus
  • Members
  • 11 messages

Hi Shadooow and proleric,

 

Thanks for the rapid response.

 

I just knew that hak pak making would be somewhere obvious, didn't even consider to think it might be in the game folders themselves!

 

Sorry I have another question now. How would I add scripts to the hak pak exactly? The scripts are tied up in a simple module I have made, but how do I separate the scripts so that I can add them to the hak pak?

 

Hak.exe gives the option to *add rescources* but obviously I cannot navigate to the scripts like that?

 

Do I need to export the scripts from the module or something like that? or do I just copy the scripts to a .txt file and add them to the hak pak as .txt files?



#5
Pstemarie

Pstemarie
  • Members
  • 2 745 messages

Open the module in the toolset then open the /temp0 folder in your NWN /modules folder (which is created when the module is opened). Navigate to the /temp0 folder in the "Add Resources" window in nwhak.exe and add the .nss and .ncs files for the scripts you want to import into the hak file.


  • captain venus aime ceci

#6
captain venus

captain venus
  • Members
  • 11 messages

Thanks Pstemarie.

 

There's so much to learn about how to do all this.



#7
Pstemarie

Pstemarie
  • Members
  • 2 745 messages

The hard part of learning is that there are so many ways to do things.


  • Verilazic aime ceci

#8
Verilazic

Verilazic
  • Members
  • 162 messages

You're in good company. I'm a relative newcomer too, and my only regret is not coming here earlier.



#9
kalbaern

kalbaern
  • Members
  • 824 messages

Another way to do it, if only scripts are used in your hak is to open your toolset and load the module they are found in. Then export them them all into an erf that you have named as your desired hak name. When done, simply transfer the erf into your hak folder, then open the erf's properties. Change the extension from .erf to .hak and then add the hak to the modules you play. If its only scripts (or even creatures, items, encounters, triggers, waypoints, and doors) and not any 2da files, then exporting as an erf and changing the extension works just fine and you don't need to use the NWN Hak Utility at all.



#10
Shadooow

Shadooow
  • Members
  • 4 471 messages

btw i recommend to assign *.erf, and *.mod files in windows to the nwhak.exe so you can open these files directly without need to rename them to hak, its normally possible to save them as well


  • Verilazic aime ceci

#11
captain venus

captain venus
  • Members
  • 11 messages

Thank you all for your very helpful answers. I am really getting somewhere with what I wanted to do now. Using Hakpaks to transfer scripts is working out great. :)

 

Another query if anyone can answer for me. The X2 tag based scripting works very reliably, but seems as if the tag based scripting switch Has to be enabled in the module properties; is there any way round this? Could I enable tag based scripts/set the tag based scripting switch via a hakpak? (From my knowledge, the answer would seem to be no, since it would seem the ONLY way of doing it is to enable it in the module properties, but I'm just asking just in case there is a way of doing it).

 

Thanks again for all the helpful answers.



#12
Proleric

Proleric
  • Members
  • 2 361 messages
The default OnModuleLoad script has a line which can be enabled like this:

SetModuleSwitch (MODULE_SWITCH_ENABLE_TAGBASED_SCRIPTS, TRUE);
A script in the hakpak which has the same name as the OnModuleLoad script in the module properties will over-ride it, without changing the module properties. Alternatively, you can turn that switch on in any hakpak script, as long as you're sure that script will definitely run before any event that might need tag based scripting.