Author Topic: Animal companion  (Read 732 times)

Legacy_tobtor

  • Jr. Member
  • **
  • Posts: 69
  • Karma: +0/-0
Animal companion
« on: December 29, 2014, 10:23:32 am »


               

Hi


 


I am trying to make my first module, and I want animal companions and familiars work different than in vanilla NWN.


 


I want to do two things:


1. Making them more interactive. Basically I want them to be less of a class feature and more of a companion. I want the player to be able to have more elaborate conversations with them (like with henchmen). Is this possible and is there any known problems? For example can an animal companions/familiars "remember" conversations from time to time, or do they loose them when dead/unsummoned? I imagine that area triggers might not work well (?), seeing how they might not be summoned at the time of moving into the trigger.


 


Does anyone know of modules that do something like what I describe above or has worked with this?


 


2. Having the player acquire the companion. Do to the module background (the character is prisoner/slave) I do not want the player to have the companion/familiar from the start, but that it is acquired through quest/conversation later. The player should meet the companion/familiar and form a bond with it.


Can this be done? And how to deal with the player choice of companion? Can I limit the choices to a few types that fit the story (like animals that fit the environment)? This would making the changing of companion type more immersion breaking than normal, therefore can it be enforced that when first one type (like dire wolf) is chosen then it remain that type thrughout? the game regardless of levelling.


I considered it might be possible to move the lvl which the companion/familiar is gained (can this be done?) and then having the player meet the creature and force give lvl-up in the conversation, but maybe someone has a better idea.


 


If the above two is not possible is it then possible to remove the companion/familiar completely (is that possible?), and then add a henchman tied to an item that can resummon the henchman once a day.


 


I think I have seen that in a module, how is it done?.



               
               

               
            

Legacy_henesua

  • Hero Member
  • *****
  • Posts: 6519
  • Karma: +0/-0
Animal companion
« Reply #1 on: December 29, 2014, 04:39:27 pm »


               

You can do what you want. but you'll need custom scripting and conversations. The scripting will be a little tricky but not impossible. The main trick here is to track the state of the familiar/companion somewhere other than the companion. If this is a single player module I suggest storing the state as local variables on the PC/Master. If it was for a quest in a multiplayer server environment, I'd recommend looking at the server's DB or if that is lacking using the PC Skin to store the variables.


 


Some key pieces of info:


nw_s2_familiar - is the script which executes when the PC uses the summon familiar ability.


You will edit this script to prevent a summon from happening.


 


SummonFamiliar(); - this is the function call which actually summons the familiar. In order to prevent the familiar from summoning, you need to prevent this function call from executing. You could have a variable which you require to be set on the PC before allowing this function call to proceed.


 


example:


if(GetLocalInt(oPC,"COMPAION_FAMILIAR_FOUND"))


     SummonFamiliar();


 


 


nw_g_fam - is the conversation file for all familiars. There may actually be another one too, but i forget which one it is. If you edited this file, all familiars would have their conversation changed. Keep in mind that all familiar types use this one so if you want different conversations for different types you'll probably want to create branches for each at the very top to keep things well organized for your self.


 


As a guide to what you can do with your conversation, you should look at the XP2 (hordes of the underdark) henchman conversations. Conveniently they also provided an example template for other builders to use xp2_hen_template


 


 


This is probably all you need to know for familiars. You can hunt down the animal companion versions of the script and conversation above easily enough.



               
               

               
            

Legacy_tobtor

  • Jr. Member
  • **
  • Posts: 69
  • Karma: +0/-0
Animal companion
« Reply #2 on: January 03, 2015, 06:21:36 pm »


               

Thank you (sorry for the late reply, but holidays).


 


It is for a single player module.


 


I will try your suggested approach (when I get the time...), it will probably take some times since I have never scripted before.