You are here

Companion trouble

5 posts / 0 new
Last post
Grog
Companion trouble

So I'm having a bit of a weird issue with my mod - I've tried everything I can think of over the last few updates, including scrapping the objects and creating them again fresh, so if anyone has any ideas, it'd be much appreciated!

Problem 1: I have one companion who refuses to gain experience correctly (the XP appears in numbers, but doesn't seem to be added to the progress bar). He has the same roster_add_object / roster_party_add / roster_selectable / reset_level scripts as everyone else when he joins. Designer XP Mod is set to 1. XP is set to be shared equally amongst companions in the Campaign plugin.

Problem 2: I have another companion who likes to invariably plunge into melee combat, despite being a sorcerer. She has a full set of spells, her feats and stats are all fine, she's using the companion behaviour scripts, and if I take direct control, the spells all work fine...she just doesn't like to cast them herself.

Any ideas?

  • up
    50%
  • down
    50%
andysks

For the first problem, it sounds weird since as you say you followed all required steps to add the companion properly to the roster. Have you tried giving him enough XP to gain a level? Perhaps since the number shows up he does indeed gain the XP and the problem lies by the GUI and progress bar.

 

For the second problem... it might sound stupid and simple but have you set the companion behavior, in game, to never cast spells?

  • up
    50%
  • down
    50%
Grog

Hmm, that's definitely not it on the second point, unfortunately - I checked the in-game behaviours and they were all set to default (meanwhile the druid companion is cheerfully Entangling away!).

Thanks, Andy - I'll keep messing about and see if I can solve it.

  • up
    50%
  • down
    50%
andysks
Try this and see how it goes. It doesn't do anything special, just summs up the scripts you use into one function. Perhaps for some weird reason it works better? Who knows :D . I mean, I know it works because it's the one I use. I don't know what difference it would make in your case though. Can't harm trying though. 
 
#include "ginc_companion"
#include "ginc_misc"
 
void AddCompanionToParty(string sCompanionTag)
{
  /////////////////////////////////////////////////////
  // Make the companion visible on the Roster GUI
  /////////////////////////////////////////////////////
  SetIsRosterMemberCampaignNPC(sCompanionTag, 0);
  /////////////////////////////////////////////////////
  // Make the companion selectable on the Roster GUI
  // FROM: ga_roster_selectable
  /////////////////////////////////////////////////////
  SetIsRosterMemberSelectable(sCompanionTag, 1);
  /////////////////////////////////////////////////////
  // Add the companion to the party
  //FROM: ga_roster_party_add
  /////////////////////////////////////////////////////
  object oPC = GetFirstPC();
  AddRosterMemberToParty(sCompanionTag, oPC);
  /////////////////////////////////////////////////////
  /////////////////////////////////////////////////////
  // Set the companion's XP equal to that of the PC
  /////////////////////////////////////////////////////
  object oCompanion = GetObjectByTag(sCompanionTag);
  int nXP = GetPCAverageXP();
  SetXP(oCompanion, nXP);
  ForceRest(oCompanion);
}
 
Edit, some things are only for my campaign relevant so I updated the script.
  • up
    100%
  • down
    0%
Grog

Oh, wow - thanks a lot, Andy, that's really kind. I'll give it a go later today and see if it makes a difference, fingers crossed...

  • up
    50%
  • down
    50%