Aller au contenu

Photo

[Request] Check Partymember and decrease approval


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

#1
DeepImpact

DeepImpact
  • Members
  • 520 messages
Hi,

I need a script to:

if (Alister in current Party) {
decrease approval (Alister) by 1
}

The best would be a function like

DECREASE_WHEN_PARTYMEMBER(Alister,1);

Modifié par DeepImpact, 21 décembre 2009 - 03:20 .


#2
Lord Thing

Lord Thing
  • Members
  • 257 messages
#include "plt_gen00pt_party"
#include "party_h"
#include "approval_h"

 If(WR_GetPlotFlag(PLT_GEN00PT_PARTY, GEN_ALISTAIR_IN_PARTY)
{
object oAlistair = Party_GetFollowerByTag(GEN_FL_ALISTAIR);        
AdjustFollowerApproval(oAlistair, -1);
}

Assuming of course by sympathy you meant approval

Modifié par Lord Thing, 21 décembre 2009 - 03:15 .


#3
DeepImpact

DeepImpact
  • Members
  • 520 messages
Yes it was :)

As far as I see "AdjustFollowerApproval(oAlistair, 1)"
is PLUS 1 Approval to Alistair, right?

I found something

void AdjustFollowerApproval(
object oFollower,
int nAmount,
int bNotify = FALSE
);


Does that mean, that I need AdjustFollowerApproval(oAlistair, 1, TRUE), so that the player sees a notification?

#4
Lord Thing

Lord Thing
  • Members
  • 257 messages
Yeah, if you want the "Alistair Approves +1" you'll need to add TRUE to the end of the function parameters. I'm not sure how it handles decreasing, but I would assume that if you put a negative number in there (ie AdjustFollowerApproval(oAlistair, -1, TRUE)), it probably says "Alistair Disapproves -1"

Modifié par Lord Thing, 22 décembre 2009 - 03:56 .


#5
DeepImpact

DeepImpact
  • Members
  • 520 messages
I´ll try, and then report.

#6
DeepImpact

DeepImpact
  • Members
  • 520 messages
Did not function:



// moral-code

#include "plt_gen00pt_party"

#include "party_h"

#include "approval_h"

#include "plt_gen00pt_party"



// MORALCODE ALISTAIR

object oHero = GetHero();



if (WR_GetPlotFlag(PLT_GEN00PT_PARTY, GEN_ALISTAIR_IN_PARTY))

{

object oAlistair = Party_GetFollowerByTag(GEN_FL_ALISTAIR);

AdjustFollowerApproval(oAlistair, -1);

DisplayFloatyMessage(oHero, "ALISTAIR FOUND", FLOATY_MESSAGE, 16777215, 20.0);

}

else

{

DisplayFloatyMessage (oHero, "ALISTAIR NOT FOUND", FLOATY_MESSAGE, 16777215, 20.0);

}




Will allways get the "ALISTAIR NOT FOUND" - Message. Did I do something wrong?

#7
Lord Thing

Lord Thing
  • Members
  • 257 messages
It works fine for me, note the GEN_ALISTAIR_IN_PARTY checks that Alistair is in your current active group, not whether you have recruited him, to check if he has been recruited you use GEN_ALISTAIR_RECRUITED.

There is also a GEN_ALISTAIR_IN_CAMP if you need to check whether he is in camp

#8
DeepImpact

DeepImpact
  • Members
  • 520 messages
He is surely in my current party.



Is it possible to "echo" the content of the plot-array?

#9
Phaenan

Phaenan
  • Members
  • 315 messages
Hmm... Doesn't this plot depends on the addon hierarchy, and its relation with the SP campaign ? Just a wild idea why it may not work.



Either way, me, to check if Alistir is nearby, I'd simply throw a :

object oAlistair = UT_GetNearestCreatureByTag(GetHero(), GEN_FL_ALISTAIR);
if(oAlistair != OBJECT_INVALID) {
     // Blablabla
}


#10
DeepImpact

DeepImpact
  • Members
  • 520 messages
Works great! Thanks.



(What is the definition of "near"?)

#11
Phaenan

Phaenan
  • Members
  • 315 messages
The closest distance between the two locations vectors, I reckon. (between the party member currently controlled, and the queried object)