Aller au contenu

Photo

wishing to destroy the monster when they enter the trigger


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

#1
GrandaddyBonegrinder

GrandaddyBonegrinder
  • Members
  • 8 messages
Greetings Ye who hold the knowlwdge!

I am wishing to destroy the monster when they enter the trigger... but only some get destroyed... the rest walk through as if no trigger there... the tags are correct...  plez tell me what I am missing :blush:

////////////////////////////////////////////////////////////////////////////////
//Script: dz_s_desyhates
//goes on OnEnter
//
// Created By: GB
// Created On: 4/3/12
////////////////////////////////////////////////////////////////////////////////
void main()
{


        object oTarget = GetEnteringObject();
        if (oTarget == GetObjectByTag("dz_c_bloodrip"))
                    {

            ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_IMP_DIVINE_STRIKE_FIRE,FALSE), oTarget);
            DelayCommand(1.0, DestroyObject(oTarget));
                     }

        if (oTarget == GetObjectByTag("dz_c_hatemonger"))
                {
            ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_IMP_DIVINE_STRIKE_FIRE,FALSE), oTarget);
            DelayCommand(1.0, DestroyObject(oTarget));
                 }

         if (oTarget == GetObjectByTag("dz_c_hatewings"))
                {
            ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_IMP_DIVINE_STRIKE_FIRE,FALSE), oTarget);
            DelayCommand(1.0, DestroyObject(oTarget));
                }



}


thanks...



at your service,
:D

Modifié par GrandaddyBonegrinder, 17 mai 2012 - 03:08 .


#2
The Amethyst Dragon

The Amethyst Dragon
  • Members
  • 1 883 messages
Instead of GetObjectByTag, you'll want to just use GetTag.

void main()
{
object oEnteree = GetEnteringObject();
string sTag = GetTag(oEnteree);

if (sTag == "dz_c_bloodrip" || sTag == "dz_c_hatemonger" || sTag == "dz_c_hatewings")
   {
   ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_IMP_DIVINE_STRIKE_FIRE), oEnteree);
   DelayCommand(1.0, DestroyObject(oEnteree));
   }
}



#3
Krevett

Krevett
  • Members
  • 104 messages
Perhaps your if statement should look like if (GetTag(oTarget) == ''dz_c_bloodrip'') etc....
To avoid the script getting the tag for each 'if' statement you can add a line string sTag = GetTag(oTarget);

Edit: owned by the great dragon 
:happy:

Modifié par Krevett, 17 mai 2012 - 03:20 .


#4
GrandaddyBonegrinder

GrandaddyBonegrinder
  • Members
  • 8 messages
thanks... I'll give it a go '' )

#5
GrandaddyBonegrinder

GrandaddyBonegrinder
  • Members
  • 8 messages
works perfectly!! tks!

BTW - I love your transparent GUI and Colorized icons AD :)

really helps during PvP