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_

)
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 .