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?
Why are all followers that join via UT_HireFollower defaulting to warrior class? How can I prevent this?
Débuté par
DarkJin83
, déc. 15 2009 10:34
#1
Posté 15 décembre 2009 - 10:34
#2
Posté 15 décembre 2009 - 10:41
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
Posté 15 décembre 2009 - 10:49
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
Posté 15 décembre 2009 - 10:53
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?
There the character also is generally completely recreated from scratch, including resetting the class. Did you modify 2DAs perchance?
#5
Posté 15 décembre 2009 - 10:57
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.
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
Posté 15 décembre 2009 - 11:00
I see. Well, were you already successful then? You just modified Chargen_SelectCoreclass() in sys_chargen_h.nss, if I understood correctly?
#7
Posté 15 décembre 2009 - 11:08
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();
}
#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
Posté 15 décembre 2009 - 11:13
Ah oops, okay. Strange then that it didn't work in the first place.
#9
Posté 16 décembre 2009 - 12:13
That seems a lot easier than AddHenchman(oPC, oHench);





Retour en haut






