Aller au contenu

Photo

Why are all followers that join via UT_HireFollower defaulting to warrior class? How can I prevent this?


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

#1
DarkJin83

DarkJin83
  • Members
  • 37 messages
 I've created creatures with a base class of Rogue or Wizard, but when I hire them via UT_HireFollower() function, in game when they join my party they are ALWAYS a warrior.  How can I fix this issue?

#2
Magic

Magic
  • Members
  • 187 messages
I fear we need another approach here because the function itself is working correctly, probably also used in the OC. By "base class" you mean the "class" field in the creature's "General" properties, yes?

#3
DarkJin83

DarkJin83
  • Members
  • 37 messages
Yeah, the "class" field in the creature's General properties. Is there some other way of going about manipulating the code that deals with a creature joining the party and becoming a playable character? I looked at the UT_HireFollower() function there's nothing in there but a bunch of plot/compatibility checks and a SetGroupID() function to sync it with the PC's group. Where is the code that dictates how the CharGen variables for the follower are set when the follower joins?

#4
Magic

Magic
  • Members
  • 187 messages
EVENT_TYPE_PARTY_MEMBER_HIRED in player_core.nss



There the character also is generally completely recreated from scratch, including resetting the class. Did you modify 2DAs perchance?

#5
DarkJin83

DarkJin83
  • Members
  • 37 messages
Ok well, I just added a conditional into my hiring script setting the core class variable via chargen. Had to include "sys_chargen_h". I've refined my follower code quite a lot, if anyone is interested I can post it up.

The only .2da's i've modified as of now are party picker related ones.  I don't think it's necessary here, as you can just run the chargen functions on the creature after it joins the party.

Modifié par DarkJin83, 15 décembre 2009 - 10:58 .


#6
Magic

Magic
  • Members
  • 187 messages
I see. Well, were you already successful then? You just modified Chargen_SelectCoreclass() in sys_chargen_h.nss, if I understood correctly?

#7
DarkJin83

DarkJin83
  • Members
  • 37 messages
Didn't have to modify anything, you can just run the chargen functions after the UT_HireFollower, and they just override anything else, here's my code:



#include "events_h"

#include "utility_h"

#include "global_objects_h"

#include "sys_chargen_h"



void main()

{

string[] PartyMembers;

PartyMembers[0] = "dyj_shanti";

object oFollower = GetObjectByTag(PartyMembers[0]);

UT_HireFollower(oFollower);



object oPC = GetHero();

object oShanti = UT_GetNearestCreatureByTag(oPC, "dyj_shanti");

Chargen_SelectCoreclass(oShanti, class_ROGUE);

SetFollowerState(oShanti, FOLLOWER_STATE_LOCKEDACTIVE);

SetLocalInt(oShanti, CREATURE_REWARD_FLAGS, 0);



SetPartyPickerGUIStatus(2);

ShowPartyPickerGUI();

}

#8
Magic

Magic
  • Members
  • 187 messages
Ah oops, okay. Strange then that it didn't work in the first place.

#9
georage

georage
  • Members
  • 247 messages
That seems a lot easier than AddHenchman(oPC, oHench);