I know I must be the most stupid person on Earth, but I'm trying to add a follower to my party by using the wiki script bellow:
#include "events_h"
void main()
{
if(IsPlayer(oCreature))
{
object oFollower = GetObjectByTag("myfollower");
UT_HireFollower(oCreature, oFollower);
}
}
It returns an error message for line if(IsPlayer(oCreature)) - No right bracket on expression.
I'd be glad if someone helps me find what's wrong with it, because I think all {} and () are correctly placet at the script.
Adding a follower to the player's party
Débuté par
JR_ANGELO_BR
, sept. 05 2010 04:30
#1
Posté 05 septembre 2010 - 04:30
#2
Posté 05 septembre 2010 - 06:34
I don't think there's a function called IsPlayer - I'm using IsPartyMember for this purpose. I'll put a comment in the wiki about this.
#3
Posté 05 septembre 2010 - 04:05
I guess wiki script has a generic instrunction, but I needed specific help with the code.
I was successful by merging hire functions with my area script. Now it loads an initial cutscene, controls the quest update, hires the follower and runs the area core script after all.
Here is the complet script:
#include "events_h"
#include "plt_orplot01"
#include "wrappers_h"
#include "log_h"
#include "utility_h"
#include "events_h"
const string LLVT_FOLLOWER = "my_creature_tag";
void main()
{
int nEventHandled = FALSE;
event ev = GetCurrentEvent();
int nEventType = GetEventType(ev);
Log_Events("", ev);
switch(nEventType)
{
case EVENT_TYPE_TEAM_DESTROYED:
{
if(GetEventInteger(ev,0) == 1)
{
WR_SetPlotFlag(PLT_ORPLOT01, MONSTERS_SLAIN, TRUE);
}
object oPC = GetHero();
object oFollower = UT_GetNearestCreatureByTag(oPC, LLVT_FOLLOWER);
UT_HireFollower(oFollower);
break;
}
{
// play intro cutscene
case EVENT_TYPE_AREALOAD_SPECIAL:
{
object oHero = GetHero();
DisplayFloatyMessage(oHero, "TEXT MESSAGE", FLOATY_MESSAGE, 16777215, 2.f);
CS_LoadCutscene(R"my_cutscene.cut");
PlayCutscene();
break;
}
}
}
HandleEvent(ev, RESOURCE_SCRIPT_AREA_CORE);
}
I was successful by merging hire functions with my area script. Now it loads an initial cutscene, controls the quest update, hires the follower and runs the area core script after all.
Here is the complet script:
#include "events_h"
#include "plt_orplot01"
#include "wrappers_h"
#include "log_h"
#include "utility_h"
#include "events_h"
const string LLVT_FOLLOWER = "my_creature_tag";
void main()
{
int nEventHandled = FALSE;
event ev = GetCurrentEvent();
int nEventType = GetEventType(ev);
Log_Events("", ev);
switch(nEventType)
{
case EVENT_TYPE_TEAM_DESTROYED:
{
if(GetEventInteger(ev,0) == 1)
{
WR_SetPlotFlag(PLT_ORPLOT01, MONSTERS_SLAIN, TRUE);
}
object oPC = GetHero();
object oFollower = UT_GetNearestCreatureByTag(oPC, LLVT_FOLLOWER);
UT_HireFollower(oFollower);
break;
}
{
// play intro cutscene
case EVENT_TYPE_AREALOAD_SPECIAL:
{
object oHero = GetHero();
DisplayFloatyMessage(oHero, "TEXT MESSAGE", FLOATY_MESSAGE, 16777215, 2.f);
CS_LoadCutscene(R"my_cutscene.cut");
PlayCutscene();
break;
}
}
}
HandleEvent(ev, RESOURCE_SCRIPT_AREA_CORE);
}
#4
Posté 06 septembre 2010 - 03:07
There shouldn't be any opening bracket before the // play intro cutscene line and there should only be one closing bracket after the break in the EVENT_TYPE_AREALOAD_SPECIAL case.
#5
Posté 07 septembre 2010 - 05:57
Thanks for the tip. As I said before, I have no big skills dealing with scripts. Everything i've got comes from other foruns and sometimes I have to make things up by myself. But you know what is good about it? It gets the job done.
#6
Posté 10 septembre 2010 - 08:20
Hi, guys! Thanks to the help received things are much better now. So, I'm here for some extra help. Does anybody know how to customize de follower portrait? I always get a grey portrait and all my followers have the same expression. It would be nice to make them different form each other.
#7
Posté 11 septembre 2010 - 12:49
I was also wondering this, would love to know the answer!
#8
Posté 12 septembre 2010 - 02:15
When we use Excell spreadsheet to buid 2 GDA files used to hire followers, one of them has the column PORTRAIT. But the wiki guide I found fills this column wiht a default string "INVALID COLUMN". I'm almost sure if I discover how to set this parameter here, things will work fine.





Retour en haut






