Aller au contenu

Photo

Ghost Effects For Party Members Too: Equality for All!


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

#1
MokahTGS

MokahTGS
  • Members
  • 946 messages
 I have a custom OnEnter script that makes the player ghostish, but it does not effect the party members or companions.  Can someone give me a hand adjusting this script so that it applys the VFX to everyone in the players party, even animal companions?

I also have an OnExit script that removes the VFX when they leave.  It of course will have to be adjusted as well.

OnEnter:

//Put this OnEntervoid main(){
object oPC = GetEnteringObject();
if (!GetIsPC(oPC)) return;
ApplyEffectToObject( DURATION_TYPE_PERMANENT, EffectVisualEffect(VFX_DUR_INVISIBILITY), oPC);
}


OnExit:

//Put this OnExitvoid main(){
    object oPC = GetExitingObject();    effect ePC = GetFirstEffect(oPC);    while( GetIsEffectValid( ePC))
    {    RemoveEffect( oPC, ePC);    ePC = GetNextEffect( oPC);    }}



#2
diophant

diophant
  • Members
  • 116 messages
I haven't tested it, but you could try to replace

if (!GetIsPC(oPC)) return;

by

if (!GetIsPC(oPC) && !GetIsPC(GetMaster(oPC))) return;

#3
Orion7486

Orion7486
  • Members
  • 161 messages
You might have to cycle through the PC's party. You could use GetFirstFactionMember and GetNextFactionMember

#4
Dann-J

Dann-J
  • Members
  • 3 161 messages
I once created a script that checked the entering object's deity and applied effects to them if it matched that of the trigger (around a shrine to that god). Although it worked on any party members that entered (indeed, any creature at all), it only seemed to apply the visual effects to a party member if the PC was controlling them at the time. The ability modifiers of the spell that was cast on them were still applied, but the visual effects (and icons) wouldn't appear unless you were in control when they entered the trigger.

In your case, where the effect is entirely visual, you might not get anything at all. You can try applying an effect that alters an ability score as a test, and comment out the PC check (so it works on any creature that enters), then see if your party members get the ability modifier without manifesting any visual effects.

Also; your OnExit script posted above will strip all effects from the players, and not just the ghost effect. So don't bother drinking any potions or using any buff spells before entering!

Modifié par DannJ, 08 décembre 2010 - 12:57 .


#5
JasonNH

JasonNH
  • Members
  • 237 messages
Based off something similar I needed for a cutscene before, and compiled but not tested:

void main()
{
    object oPC = GetEnteringObject();
    object oMember, oAssociate;
   
    if (!GetIsPC(oPC)) return;

    oMember = GetFirstFactionMember(oPC, FALSE);
    while(oMember != OBJECT_INVALID)
    {
       
        if( (oAssociate = GetAssociate(ASSOCIATE_TYPE_ANIMALCOMPANION, oMember)) != OBJECT_INVALID)
        {
            ApplyEffectToObject( DURATION_TYPE_PERMANENT, EffectVisualEffect(VFX_DUR_INVISIBILITY), oAssociate);
        }
       
        if( (oAssociate = GetAssociate(ASSOCIATE_TYPE_FAMILIAR, oMember)) != OBJECT_INVALID)
        {
            ApplyEffectToObject( DURATION_TYPE_PERMANENT, EffectVisualEffect(VFX_DUR_INVISIBILITY), oAssociate);
        }

        if( (oAssociate = GetAssociate(ASSOCIATE_TYPE_SUMMONED, oMember)) != OBJECT_INVALID)
        {
            ApplyEffectToObject( DURATION_TYPE_PERMANENT, EffectVisualEffect(VFX_DUR_INVISIBILITY), oAssociate);
        }

        ApplyEffectToObject( DURATION_TYPE_PERMANENT, EffectVisualEffect(VFX_DUR_INVISIBILITY), oMember);
   
        oMember = GetNextFactionMember(oPC, FALSE);
    }
}

Modifié par JasonNH, 08 décembre 2010 - 01:36 .


#6
MokahTGS

MokahTGS
  • Members
  • 946 messages
 Tested and working as it should!  Thanks JasonNH!!  Glad you're back...