Aller au contenu

Photo

help please, got bugs in my recruitment scripts


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

#1
LukaCrosszeria

LukaCrosszeria
  • Members
  • 1 304 messages
 Hi everyone,

I could use some help. I've got two bugs in my recruitment script of a new follower for the main campaign. After a conversation with him, the first line being a cutscene, you can recruit him, in the Lothering chantry. I've spawned the follower dynamically, since I didn't want to mess around with the lothering chantry .are file.

1) Only the first line of the initial dialog with him was mean to be a cutscene, but I've had to turn the entire dialogue into cutscenes because the stage kep jumping all over the chantry after the first cutscene was done and the dialog took over, before finally settling somewhere outside the chantry in pitch black darkness.

2) The recruitment happens in the Lothering chantry. When the script fires at the end of the dialogue, the party picker appears and I can select him, but not all three followers are removed from my selection screen. Alistair always remains selected as a party member. I can deselect and reselect Alistair though. After that the recruimtent works fine.

Then, after leaving Lothering for the first time and the dragon cutscene plays and you end up in the party camp for the first time, my new follower takes up his position fine near the campfire, but Alistair still remains in my party. Also I can't talk to my npc in the party camp, there's no dialog that fires.

2)  I created a quest for him, but the quest arrow that is supposed to appear over him before you talk to him, doesn't appear. The quest is then added after he joins, but then a very small arrow indicating a quest appears on the ground and follows him around. Then when you arrive in the party camp, the quest arrow appears over his head, but that's basically when the quest is already accepted, so there's no point to it anymore.

Here are some screen shots of my plot files and links to my scripts.

www.starlitsea.net/DA/plots.png

-> The plot files I use

www.starlitsea.net/DA/hirecustomfollower_h.txt

-> the custom include file for my hire script

www.starlitsea.net/DA/sng_hire_maethan.txt

-> the hire script that fires during his dialogue

www.starlitsea.net/DA/sng_maethan_quest.txt

-> the script that fires through PRCSCR when entering the Lothering Chantry

www.starlitsea.net/DA/sng_module_core.txt

-> my addin module's core script

www.starlitsea.net/DA/sng_party_camp.txt

-> the script that fires through PRCSCR when entering any of the party camps

Tnanks for any assistance, I'm out of ideas here.

Modifié par LukaCrosszeria, 08 février 2011 - 06:54 .


#2
Proleric

Proleric
  • Members
  • 2 346 messages
Regarding the stage, did you assign a default camera to every place, and check "At Current Location" in the Cinematics tab of the conversation root?

Regarding the follower scripts, have you considered the FAQ in the Follower Tutorial on how to handle more than 3 followers, and/or the Alternate Approach? Do you really need the complexity of the Advanced scripts?

I don't know why Alistair is behaving differently, but unless you have a dramatic reason for clearing out the party, it's unnecessary.

The conversation failure in camp is likely to be a conversation logic error. Is the node that's supposed to fire in camp unconditional?

Can't help with the quest arrow, I'm afraid. We don't use them in our custom campaign. Maybe it's not designed to be used with a follower? Or maybe followers are only supposed to give quests in camp? Don't know.

#3
LukaCrosszeria

LukaCrosszeria
  • Members
  • 1 304 messages
Thanks for the reply, Proleric. I'll first get to work on trying to use the stage again. I'll check the default cameras and "At Current Location".

As far as the followers are concerned, all I really wanted was a follower who could level like the others do, including romance and approval options. I'd rather keep things simple actually, but when looking at the wiki tutorial, it seemed like the advanced tutorial was the way to go.

As for the conversation bug in the camp, the lines should be unconditional. I've now also noticed a bug with the conditions in my dialog, since the initial dialogue before recruiting him, which should become unavailable after he joins, becomes available again after Lothering, :P

I'll just try to get rid of the quest arrow alltogether. Better than than have it float over his head for no good reason.

Modifié par LukaCrosszeria, 09 février 2011 - 10:17 .


#4
Karma

Karma
  • Members
  • 391 messages
I had some unexplainable things happen when I first started making my mod because I got hit by the plot GUID bug. You didn't duplicate any plots, did you? I almost remember that causing the OC followers to follow me around camp, but it was so long ago, I can't be sure.



Also the function Camp_PlaceFollowersInCamp() from the camp_functions_h script sends the OC companions to their normal positions. You could add that to your camp script, though it shouldn't be necessary.


#5
LukaCrosszeria

LukaCrosszeria
  • Members
  • 1 304 messages
Aah, I had duplicated them, and I saw your post somewhere that the plot GUID bugs so I made new plots. As far as I can tell, all the GUID's are unique.

Modifié par LukaCrosszeria, 10 février 2011 - 08:25 .


#6
LukaCrosszeria

LukaCrosszeria
  • Members
  • 1 304 messages
Edit: The stage for the Lothering chantry conversation works, finally. I've used the dynamic stage, it stays put this time and the quest arrow appears over his head. *cries tears of joy*.

Now to solve the other two problems. I copied the scripts exactly from the follower wiki, I don't know why Alistair is acting differently.

Edit: okay the quest arrow is gone again. I think it has something to do with the dynamic spawn. Maybe I should try to set teh flag in another script that fires after a short delay

Modifié par LukaCrosszeria, 11 février 2011 - 09:15 .


#7
LukaCrosszeria

LukaCrosszeria
  • Members
  • 1 304 messages
Well, I finally got Alistair to stop following me around in camp, now it's my follower following me around. I don't see what I'm doing wrong I followed this tutorial:

http://social.biowar..._game_resources

This is my module's script:

//core includes here
#include "utility_h"
#include "wrappers_h"
#include "plot_h"
#include "party_h"
#include "events_h"
#include "core_h"
#include "global_objects_h"
#include "sys_autolevelup_h"
#include "sys_chargen_h"
#include "sys_rewards_h"
#include "approval_h"
#include "sys_ambient_h"

//core plot includes
#include "plt_epipt_main"
#include "plt_clipt_main"
#include "plt_cir000pt_main"
#include "plt_denpt_captured"
#include "plt_cir300pt_fade"

//maethan function, plots etc, includes

#include "plt_maethan_hire"
#include "plt_maethan_fade_nightmare"

//constant definitions here

(left this bit out of the post)

//function definitions here
void check_plot_changed(object oMaethan);
void maethan_banter();
void Handle_Maethan_In_Camp(object curArea);
void maethan_approval();
void give_maethan_skill(object oMaethan,int level);
void handle_maethan_gift(object oFollower,object oItem,int nApprovalChange);
resource get_gift_resource(string sGiftTag);
resource get_maethan_gift_resource(string sGiftTag);

// (all this part 1)

void main()
{
object oPC = GetHero(),me=OBJECT_SELF,ohire;
event ev = GetCurrentEvent();
int nEventType = GetEventType(ev);
//function calls here, other important checks (part 2)
object oMaethan=UT_GetNearestObjectByTag(oPC,"gen00fl_maethan");
check_plot_changed(oMaethan);

object curArea=GetArea(oPC);
object oArea = GetObjectByTag("cam100ar_camp_plains");
//Maethan in camp
if (GetTag(curArea)!="cam100ar_camp_plains" && GetTag(curArea)!="den211ar_arl_eamon_estate_1" && GetTag(curArea)!="cli300ar_redcliffe_castle" && GetTag(curArea)!="epi300ar_post_coronation" && WR_GetPlotFlag(PLT_MAETHAN_HIRE, PARTY_MAETHAN_JOINED))
WR_SetPlotFlag(PLT_MAETHAN_HIRE, MAETHAN_CHECK_RUNIT,TRUE);
int runit=WR_GetPlotFlag(PLT_MAETHAN_HIRE, MAETHAN_CHECK_RUNIT);
if (runit && (GetTag(curArea)=="cam100ar_camp_plains" || GetTag(curArea)=="den211ar_arl_eamon_estate_1" || GetTag(curArea)=="cli300ar_redcliffe_castle" || GetTag(curArea)=="epi300ar_post_coronation") && WR_GetPlotFlag(PLT_MAETHAN_HIRE, PARTY_MAETHAN_JOINED))
Handle_Maethan_In_Camp(curArea);

if (WR_GetPlotFlag(PLT_MAETHAN_HIRE, PARTY_MAETHAN_IN_PARTY))
maethan_banter();

//capture events
switch(nEventType)
{
// .....(part 3)
//world map was closed and Maethan was either chosen or not from the partypicker, he has to be taken care of since we're still in camp or we moved to another area.

case EVENT_TYPE_WORLD_MAP_CLOSED:
{
int nCloseType = GetEventInteger(ev, 0);
object oMaethan=UT_GetNearestObjectByTag(oPC,"gen00fl_maethan");
WR_SetPlotFlag(PLT_MAETHAN_HIRE, MAETHAN_CHECK_RUNIT,TRUE);
if (GetTag(curArea)==GetTag(oArea) && WR_GetPlotFlag(PLT_MAETHAN_HIRE, PARTY_MAETHAN_JOINED) && WR_GetPlotFlag(PLT_MAETHAN_HIRE, PARTY_MAETHAN_IN_PARTY))
{
if (!nCloseType)//0 canceled, 1 means selected a pin
{
SetFollowerState(oMaethan, FOLLOWER_STATE_AVAILABLE);
WR_SetPlotFlag(PLT_MAETHAN_HIRE, PARTY_MAETHAN_IN_PARTY, FALSE);
WR_SetPlotFlag(PLT_MAETHAN_HIRE, MAETHAN_CHECK_RUNIT,TRUE);
}
else
{
//don't run the camp script for Maethan now, set runit=0;

SetLocalInt(oMaethan, CREATURE_REWARD_FLAGS, 0); //Allows the follower to gain XP
SetLocalInt(oMaethan, AMBIENT_SYSTEM_STATE, 0);
SetFollowerState(oMaethan, FOLLOWER_STATE_ACTIVE); //Adds follower to the active party
AddCommand(oMaethan, CommandJumpToLocation(GetLocation(GetHero()))); //Ensures follower appears at PC's location.
WR_SetPlotFlag(PLT_MAETHAN_HIRE, MAETHAN_CHECK_RUNIT,FALSE);
}
}
break;
}

//Maethan was chosen from the partypicker

case EVENT_TYPE_PARTYMEMBER_ADDED:
{
object oFollower = GetEventObject(ev, 0);
if (GetTag(oFollower) == "gen00fl_maethan")
{
SetImmortal(oFollower,0);
SetLocalInt(oFollower, CREATURE_REWARD_FLAGS, 0); //Allows the follower to gain XP
SetLocalInt(oFollower, AMBIENT_SYSTEM_STATE, 0);
SetFollowerState(oFollower, FOLLOWER_STATE_ACTIVE); //Adds follower to the active party
SetObjectActive(oFollower,1);
AddCommand(oFollower, CommandJumpToLocation(GetLocation(GetHero()))); //Ensures follower appears at PC's location.
WR_SetPlotFlag(PLT_MAETHAN_HIRE, PARTY_MAETHAN_IN_PARTY, TRUE);
}

break;
}

//here we have dropped Maethan from the party, using the partypicker

case EVENT_TYPE_PARTYMEMBER_DROPPED:
{
object oFollower = GetEventObject(ev, 0);

if (GetTag(oFollower) == "gen00fl_maethan")
{
SetImmortal(oFollower,1);
SetFollowerState(oFollower, FOLLOWER_STATE_AVAILABLE); //Adds follower to the active party

WR_SetPlotFlag(PLT_MAETHAN_HIRE, PARTY_MAETHAN_IN_PARTY, FALSE);
}
break;

}

//here we change the partypicker to sng_char_stage

case EVENT_TYPE_MODULE_GETCHARSTAGE:
{
SetPartyPickerStage("sng_char_stage", "partypicker");
break;
}

case EVENT_TYPE_BEGIN_TRAVEL://EVENT_TYPE_WORLD_MAP_USED:
{
string sSource = GetEventString(ev, 0); // the area tag the player is travelling from
string sTarget = GetEventString(ev, 1); // the area tag the player is travelling to
string sWPOverride = GetEventString(ev, 2);
//we pick to sent the PC clicking to the right nightmare area here
if(sWPOverride=="1" && sTarget=="Fade_Follower" && WR_GetPlotFlag(PLT_MAETHAN_HIRE,MAETHAN_HAS_NIGHTMARE_A))
DoAreaTransition("maethan_fade_nightmare","start");
if(sWPOverride=="2" && sTarget=="Fade_Follower" && WR_GetPlotFlag(PLT_MAETHAN_HIRE,MAETHAN_HAS_NIGHTMARE_B))
DoAreaTransition("maethan_fade_nightmare","start");
if(sWPOverride=="3" && sTarget=="Fade_Follower" && WR_GetPlotFlag(PLT_MAETHAN_HIRE,MAETHAN_HAS_NIGHTMARE_C))
DoAreaTransition("maethan_fade_nightmare","start");
break;
}

case EVENT_TYPE_MODULE_HANDLE_GIFT:
{
(left this bit out of the post)
}

case EVENT_TYPE_MODULE_LOAD:
{
(left this bit out of the post)
}
}

//functions here (part 4)

void check_plot_changed(object oMaethan)
{
object oPC=GetHero(); //if Maethan has not joined return
//leave some room here for the slideshow script addition
//it has to go above this check, otherwise if you don't pick him up
//the script won't fire and the appropriate slides won't be shown

//Maethan in the epilogue
(left this bit out of the post)
if (!WR_GetPlotFlag(PLT_MAETHAN_HIRE, PARTY_MAETHAN_JOINED))
return;

if (!WR_GetPlotFlag(PLT_MAETHAN_HIRE, PARTY_MAETHAN_JOINED))
return;
//every other addition to this function should be made below this check
//here depending on which core flag changed, act appropriately

//Maethan at the gates
(left this bit out of the post)
//fighting wynne
(left this bit out of the post)
//fighting wynne
(left this bit out of the post)
//pc captured by cauthrien
(left this bit out of the post)
//enter the fade, remove Maethan from party
if (WR_GetPlotFlag(PLT_CIR300PT_FADE,ENTER_FADE) && !WR_GetPlotFlag(PLT_MAETHAN_HIRE,MAETHAN_ENTER_FADE))
{
WR_SetPlotFlag(PLT_MAETHAN_HIRE,MAETHAN_ENTER_FADE,TRUE);
//if he was in the party when the demon put you to sleep, he needs
//to have a nightmare area for him
if(WR_GetPlotFlag(PLT_MAETHAN_HIRE, PARTY_MAETHAN_IN_PARTY))
{
SetFollowerState(oMaethan, FOLLOWER_STATE_AVAILABLE); //Adds follower to the active party
//this flag is important, it tells us Maethan has indeed a nightmare
//and will be used in his dialogs(see below)
WR_SetPlotFlag(PLT_MAETHAN_FADE_NIGHTMARE,MAETHAN_SLEEP,TRUE);
//which area to put Maethan in.
int fol1=GetLocalInt(GetModule(),CIR_FADE_FOLLOWER_1);
int fol2=GetLocalInt(GetModule(),CIR_FADE_FOLLOWER_2);
int fol3=GetLocalInt(GetModule(),CIR_FADE_FOLLOWER_3);
if(fol1<1)
WR_SetPlotFlag(PLT_MAETHAN_HIRE,MAETHAN_HAS_NIGHTMARE_A,TRUE);
else if(fol2<1)
WR_SetPlotFlag(PLT_MAETHAN_HIRE,MAETHAN_HAS_NIGHTMARE_B,TRUE);
else if(fol3<1)
WR_SetPlotFlag(PLT_MAETHAN_HIRE,MAETHAN_HAS_NIGHTMARE_C,TRUE);
}
WR_SetPlotFlag(PLT_MAETHAN_HIRE, PARTY_MAETHAN_IN_PARTY, FALSE);//not in party anymore anyways
}
//fighting the demon in the fade
if (WR_GetPlotFlag(PLT_CIR300PT_FADE,SLOTH_DEMON_ATTACKS) && !WR_GetPlotFlag(PLT_MAETHAN_HIRE,MAETHAN_SLOTH_DEMON_ATTACKS) && WR_GetPlotFlag(PLT_MAETHAN_FADE_NIGHTMARE, MAETHAN_TALKED_TO_IN_FADE))
{
WR_SetFollowerState(oMaethan, FOLLOWER_STATE_ACTIVE);
SetImmortal(oMaethan,0);
WR_SetPlotFlag(PLT_MAETHAN_HIRE,MAETHAN_SLOTH_DEMON_ATTACKS,TRUE);
WR_SetPlotFlag(PLT_MAETHAN_HIRE, PARTY_MAETHAN_IN_PARTY,TRUE);
SetLocalInt(oMaethan, CREATURE_REWARD_FLAGS, 0); //Allows the follower to gain XP
SetLocalInt(oMaethan, AMBIENT_SYSTEM_STATE, 0);
SetObjectActive(oMaethan,1);
AddCommand(oMaethan, CommandJumpToLocation(GetLocation(GetHero()))); //Ensures follower appears at PC's location.
}
//demon in the fade defeated, this is captured here
if (WR_GetPlotFlag(PLT_CIR300PT_FADE,SLOTH_DEMON_DEFEATED) && !WR_GetPlotFlag(PLT_MAETHAN_HIRE,MAETHAN_SLOTH_DEMON_DEFEATED) && WR_GetPlotFlag(PLT_MAETHAN_HIRE,MAETHAN_SLEEP))
{
WR_SetFollowerState(oMaethan, FOLLOWER_STATE_ACTIVE);
WR_SetPlotFlag(PLT_MAETHAN_HIRE, PARTY_MAETHAN_IN_PARTY,TRUE);
WR_SetPlotFlag(PLT_MAETHAN_HIRE,MAETHAN_SLOTH_DEMON_DEFEATED,TRUE);
SetLocalInt(oMaethan, CREATURE_REWARD_FLAGS, 0); //Allows the follower to gain XP
SetLocalInt(oMaethan, AMBIENT_SYSTEM_STATE, 0);
SetObjectActive(oMaethan,1);
AddCommand(oMaethan, CommandJumpToLocation(GetLocation(GetHero()))); //Ensures follower appears at PC's location.
}

}

void maethan_banter()
{
(left this bit out of the post)
}

void Handle_Maethan_In_Camp(object curArea)
{
object oPC=GetHero();

//spawn Maethan in camp if he's joined
object oMaethan=UT_GetNearestObjectByTag(oPC,"gen00fl_maethan");
location MaethanLoc;

if(GetTag(curArea)=="cam100ar_camp_plains")
MaethanLoc=Location(curArea, Vector(135.85, 123.18, -0.08), -71.33);

if(GetTag(curArea)=="den211ar_arl_eamon_estate_1")
MaethanLoc=Location(curArea, Vector(28.1, 4.75, 0.0), 176.33);

if(GetTag(curArea)=="cli300ar_redcliffe_castle")
MaethanLoc=Location(curArea, Vector(2.56,-14.84, 0.0), -130.38);

if(GetTag(curArea)=="epi300ar_post_coronation")
MaethanLoc=Location(curArea, Vector(15.73,4.3, 0.0), 13.16);

if(!IsObjectValid(oMaethan))
{
oMaethan=CreateObject(OBJECT_TYPE_CREATURE, R"gen00fl_maethan.utc", MaethanLoc);
}
else
{
SetObjectActive(oMaethan,1);
AddCommand(oMaethan, CommandJumpToLocation(MaethanLoc));
}
SetFollowerState(oMaethan, FOLLOWER_STATE_AVAILABLE);
if(GetTag(curArea)=="cam100ar_camp_plains")
Ambient_Start(oMaethan, AMBIENT_SYSTEM_ENABLED, AMBIENT_MOVE_NONE, AMBIENT_MOVE_PREFIX_NONE, 70, AMBIENT_ANIM_FREQ_ORDERED);
if(GetTag(curArea)=="den211ar_arl_eamon_estate_1" ||GetTag(curArea)=="cli300ar_redcliffe_castle" || GetTag(curArea)=="epi300ar_post_coronation")
Ambient_Start(oMaethan, AMBIENT_SYSTEM_ENABLED, AMBIENT_MOVE_NONE, AMBIENT_MOVE_PREFIX_NONE, 56, AMBIENT_ANIM_FREQ_ORDERED);
WR_SetPlotFlag(PLT_MAETHAN_HIRE, PARTY_MAETHAN_IN_PARTY,FALSE);
WR_SetPlotFlag(PLT_MAETHAN_HIRE, MAETHAN_CHECK_RUNIT,FALSE);
}

resource get_maethan_gift_resource(string sGiftTag)
{
(left this bit out of the post)
}

resource get_gift_resource(string sGiftTag)
{
(left this bit out of the post)
(left this bit out of the post)
}

void maethan_approval()
{
(left this bit out of the post)
}

void give_maethan_skill(object oMaethan,int level)
{
(left this bit out of the post)
}

void handle_maethan_gift(object oFollower,object oItem,int nApprovalChange)
{
(left this bit out of the post)
}

Modifié par LukaCrosszeria, 27 février 2011 - 08:31 .


#8
LukaCrosszeria

LukaCrosszeria
  • Members
  • 1 304 messages
And this is the script I use to recruit him:

#include "utility_h"
#include "hirecustomfollower_h"
#include "wrappers_h"
#include "plot_h"
#include "party_h"
#include "events_h"
#include "core_h"
#include "global_objects_h"
#include "sys_autolevelup_h"
#include "sys_chargen_h"
#include "sys_rewards_h"
#include "approval_h"
#include "plt_maethan_hire"

void main()
{

object oPC=GetHero(), oMaethan=OBJECT_SELF;
WR_SetPlotFlag(PLT_MAETHAN_HIRE, PARTY_MAETHAN_JOINED, TRUE);

// equip Maethan's staff
object oMain = GetItemInEquipSlot(INVENTORY_SLOT_MAIN,oMaethan);

if(!IsObjectValid(oMain))
{
resource rMain = R"gen_im_wep_mag_sta_enc.uti";
object oNewMain = CreateItemOnObject(rMain,oMaethan);
if(IsObjectValid(oNewMain))
{
EquipItem(oMaethan,oNewMain,INVENTORY_SLOT_MAIN);
}
}
// apply attributes, abilities and stats for the core class and
// specialization, tactics, level and scale Maethan's items appropriately
int nALTable = 77143;
int nLevel = GetLevel(oPC);
ScaleEquippedItems(oMaethan, nLevel);
Chargen_InitializeCharacter(oMaethan, FALSE);
Chargen_SelectCoreclass(oMaethan, class_WIZARD);
Chargen_ApplyclassAttributeModifiers(oMaethan, class_WIZARD);
Chargen_ApplyclassAbilities(oMaethan, class_WIZARD);
AL_DoAutoLevelUp(oMaethan, TRUE, FALSE);
AddAbility(oMaethan, 4012);
AL_SpendAttributePoints(oMaethan, nALTable, FALSE);
AL_SpendSpecializationPoints(oMaethan, nALTable);
AL_SpendSkillPoints(oMaethan, nALTable, FALSE);
AL_SpendTalentSpellPoints(oMaethan, nALTable, FALSE);
Chargen_SetNumTactics(oMaethan);
SetFollowerApprovalEnabled(oMaethan, TRUE);
SetFollowerApprovalDescription(oMaethan, 371487);
SetPlotGiver(oMaethan, FALSE);

//make available in party picker
SetFollowerState(oMaethan, FOLLOWER_STATE_ACTIVE);
SetFollowerState(oMaethan, FOLLOWER_STATE_AVAILABLE);

//change script to player and send hire event
SetEventScript(oMaethan, RESOURCE_SCRIPT_PLAYER_CORE);
InitHeartbeat(oMaethan, CONFIG_CONSTANT_HEARTBEAT_RATE);
SendPartyMemberHiredEvent(oMaethan, FALSE);
SetFollowerApprovalEnabled(oMaethan, TRUE);
SetFollowerApprovalDescription(oMaethan, 371487);
SetPlotGiver(oMaethan, FALSE);

hireCustomFollower(oMaethan, class_WIZARD, ABILITY_SPELL_HIDDEN_ARCANE_WARRIOR);
SetGroupId(oMaethan, GetGroupId(oPC));
AddCommand(oMaethan, CommandJumpToLocation(GetLocation(GetHero())));

SetPartyPickerGUIStatus(2);
ShowPartyPickerGUI();
}

Any ideas?

#9
Karma

Karma
  • Members
  • 391 messages
Couple suggestions for your own sanity:
1) Put your custom functions in a separate include script, so it's easier to follow your module script.
2) Get rid of the unnecessary includes (some of them are already included in your includes)
3) Your recruiting script is probably duplicating a lot of what your "hirecustomfollower_h" script is doing, so get rid of one or the other

As for your follower following you around camp issue, you probably just need to call your custom "in camp" function in a PRCSCR script that fires when you enter camp.

#10
daywalker03

daywalker03
  • Members
  • 357 messages
My opinion: putting functions that are only used in one place (the module script) in an include file isn't needed; it might look neater, but that's about all it accomplishes. The follower following you in the first camp can be fixed by using a PRCSCR, as satans_karma suggested; you could either copy the location code for the camp function from the module script or write one that does the same thing. As for the hiring script, since you're using idomneas tutorial for the other stuff, why not use his hiring script too?

#11
Karma

Karma
  • Members
  • 391 messages
@daywalker
Agreed on the gift mechanics as that's only used in the module script, but there are some functions (like the approval and camp) that I assume he'll be using elsewhere. Also if he plans on more than one companion, the hiring script should be cleaned up and made into a custom function listed in an include, so he doesn't have to repeat the code.

@luka
I assume this is an addin instead of a new campaign? If so, the hirecustomfollower script found in the follower tutorial is probably unnecessary for your purposes as it just recreates what already happens in the player_core. Setting the creature script to player_core and then using UT_HireFollower (or anything else that sends the event to player_core) should do what you want without the extra code.

If you plan to multiclass your follower, then follow the idomneas tutorial. If not, you can probably rely on the player_core (and a select few other functions you've already listed) to take care of you. A lot of what you've coded for is done in player_core.

I haven't tested it , but, as long as you've got your AL and AIP tables set up in creature properties, you probably only need:

SetEventScript(oFollower, RESOURCE_SCRIPT_PLAYER_CORE);
UT_HireFollower(oFollower, FALSE);
SetLocalInt(oFollower, CREATURE_REWARD_FLAGS, 0);
ScaleEquippedItems(oFollower, GetLevel(GetHero()));
SetFollowerApprovalEnabled(oFollower, TRUE);
SetFollowerApprovalDescription(oFollower, 371487);  //<---- sets approval to neutral, but you can change it to whatever
AddCommand(oFollower, CommandJumpToLocation(GetLocation(GetHero())));
WR_SetFollowerState(oFollower, FOLLOWER_STATE_ACTIVE);     //<---or AVAILABLE or whatever
SetPartyPickerGUIStatus(2);
ShowPartyPickerGUI();

Whatever you decide, you should take a look at the player_core script in the toolset. Particularly noting the "PARTY_MEMBER_HIRED" event. EDIT: You should look at sys_autolevelup_h as well.

Modifié par satans_karma, 01 mars 2011 - 04:14 .


#12
LukaCrosszeria

LukaCrosszeria
  • Members
  • 1 304 messages
Hi guys, thanks for your replies. I've managed to solve the follower bug in the camp, but it seems my scripts are pretty messy/too long? I've planned 4 companions and yes, it's an addin for the main campaign. I'm just afraid to start tinkering with them now that I finally got them to work. I'm not versed enough in scripting yet to clean up the mess if I get it wrong. I'll need a bit of time to look at all this and I'll get back to you guys :)