Aller au contenu

Photo

Adding a follower to the player's party


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

#1
JR_ANGELO_BR

JR_ANGELO_BR
  • Members
  • 35 messages
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.

#2
Proleric

Proleric
  • Members
  • 2 352 messages
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
JR_ANGELO_BR

JR_ANGELO_BR
  • Members
  • 35 messages
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);

}

#4
TimelordDC

TimelordDC
  • Members
  • 923 messages
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
JR_ANGELO_BR

JR_ANGELO_BR
  • Members
  • 35 messages
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
JR_ANGELO_BR

JR_ANGELO_BR
  • Members
  • 35 messages
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
madsabroo

madsabroo
  • Members
  • 259 messages
I was also wondering this, would love to know the answer!

#8
JR_ANGELO_BR

JR_ANGELO_BR
  • Members
  • 35 messages
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.